Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/cherrypy/lib/__pycache__/auth_basic.cpython-39.pyc
Ðазад
a v�hE � @ sZ d Z ddlZddlZddlZddlZddlmZmZ dZdZ dd� Z dd d�Zdd � ZdS )a� HTTP Basic Authentication tool. This module provides a CherryPy 3.x tool which implements the server-side of HTTP Basic Access Authentication, as described in :rfc:`2617`. Example usage, using the built-in checkpassword_dict function which uses a dict as the credentials store:: userpassdict = {'bird' : 'bebop', 'ornette' : 'wayout'} checkpassword = cherrypy.lib.auth_basic.checkpassword_dict(userpassdict) basic_auth = {'tools.auth_basic.on': True, 'tools.auth_basic.realm': 'earth', 'tools.auth_basic.checkpassword': checkpassword, 'tools.auth_basic.accept_charset': 'UTF-8', } app_config = { '/' : basic_auth } � N)�ntou�tonativeZvisteyaz April 2009c s � fdd�}|S )a. Returns a checkpassword function which checks credentials against a dictionary of the form: {username : password}. If you want a simple dictionary-based authentication scheme, use checkpassword_dict(my_credentials_dict) as the value for the checkpassword argument to basic_auth(). c s � � |�}|r||kpdS )NF)�get)�realm�user�password�p��user_password_dict� ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/cherrypy/lib/auth_basic.py� checkpassword, s z)checkpassword_dict.<locals>.checkpasswordr )r r r r r �checkpassword_dict$ s r F�utf-8c C sL d}d| v rt d��tjj}|j�d�}|du�rd}tj�t tj fd|��� |� dd �\}} |�� d kr�||f} t� | �d��}t|| �}t|�}t�d|�}t|�}|� d d �\}} || || �r�|r�t�dd� ||_W d � dS W d � n1 s�0 Y |�� }||k�r"d| nd}d| |f tjjjd<