Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/cherrypy/lib/__pycache__/auth_digest.cpython-39.pyc
Ðазад
a v�h�; � @ s� d Z ddlZddlZddlmZ ddlmZmZ ddlZddl m Z mZ dZdZ dd � Zd ZdZeefZdZd adZdd� Zdd� Zdd� Zdd� Zd*dd�Zdd� Zdd� ZG dd� de�Zdd � Zd!ded"edd� fd#d$�Zd+d&d'�Z d(d)� Z!dS ),a� HTTP Digest Authentication tool. An implementation of the server-side of HTTP Digest Access Authentication, which is described in :rfc:`2617`. Example usage, using the built-in get_ha1_dict_plain function which uses a dict of plaintext passwords as the credentials store:: userpassdict = {'alice' : '4x5istwelve'} get_ha1 = cherrypy.lib.auth_digest.get_ha1_dict_plain(userpassdict) digest_auth = {'tools.auth_digest.on': True, 'tools.auth_digest.realm': 'wonderland', 'tools.auth_digest.get_ha1': get_ha1, 'tools.auth_digest.key': 'a565c27146791cfb', 'tools.auth_digest.accept_charset': 'UTF-8', } app_config = { '/' : digest_auth } � N)�md5)�parse_http_list�parse_keqv_list)�ntob�tonativeZvisteyaz April 2009c C s t t| d���� S )N�utf-8)r r � hexdigest��s� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/cherrypy/lib/auth_digest.py�md5_hex$ s r �auth�auth-int)�MD5�MD5-sessz ISO-8859-1zUTF-8c C s t j| dd� d S )NzTOOLS.AUTH_DIGEST)�context)�cherrypy�log)�msgr r r �TRACE2 s r c s � fdd�}|S )aA Returns a get_ha1 function which obtains a plaintext password from a dictionary of the form: {username : password}. If you want a simple dictionary-based authentication scheme, with plaintext passwords, use get_ha1_dict_plain(my_userpass_dict) as the value for the get_ha1 argument to digest_auth(). c s$ � � |�}|r td|| |f �S d S )N�%s:%s:%s)�getr )�realm�username�password��user_password_dictr r �get_ha1A s z#get_ha1_dict_plain.<locals>.get_ha1r )r r r r r �get_ha1_dict_plain9 s r c s � fdd�}|S )aY Returns a get_ha1 function which obtains a HA1 password hash from a dictionary of the form: {username : HA1}. If you want a dictionary-based authentication scheme, but with pre-computed HA1 hashes instead of plain-text passwords, use get_ha1_dict(my_userha1_dict) as the value for the get_ha1 argument to digest_auth(). c s � � |�S )N)r )r r �� user_ha1_dictr r r S s zget_ha1_dict.<locals>.get_ha1r )r! r r r r �get_ha1_dictJ s r"