Your IP : 216.73.217.13


Current Path : /lib/python3/dist-packages/twisted/web/_auth/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/twisted/web/_auth/__pycache__/digest.cpython-38.pyc

U


W[��@sTdZddlmZmZddlmZddlmZddlm	Z	ee	�Gdd�de
��ZdS)	zg
Implementation of RFC2617: HTTP Digest Authentication

@see: U{http://www.faqs.org/rfcs/rfc2617.html}
�)�division�absolute_import)�implementer)�credentials)�ICredentialFactoryc@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
�DigestCredentialFactoryzp
    Wrapper for L{digest.DigestCredentialFactory} that implements the
    L{ICredentialFactory} interface.
    sdigestcCst�||�|_dS)zN
        Create the digest credential factory that this object wraps.
        N)rr�digest)�self�	algorithmZauthenticationRealm�r�:/usr/lib/python3/dist-packages/twisted/web/_auth/digest.py�__init__s�z DigestCredentialFactory.__init__cCs|j�|��j�S)aA
        Generate the challenge for use in the WWW-Authenticate header

        @param request: The L{IRequest} to with access was denied and for the
            response to which this challenge is being generated.

        @return: The L{dict} that can be used to generate a WWW-Authenticate
            header.
        )r�getChallenge�getClientAddress�host)r	�requestrrrr"s
z$DigestCredentialFactory.getChallengecCs|j�||j|��j�S)z�
        Create a L{twisted.cred.credentials.DigestedCredentials} object
        from the given response and request.

        @see: L{ICredentialFactory.decode}
        )r�decode�methodrr)r	Zresponserrrrr/s�zDigestCredentialFactory.decodeN)�__name__�
__module__�__qualname__�__doc__Zschemer
rrrrrrrs

rN)rZ
__future__rrZzope.interfacerZtwisted.credrZtwisted.web.iwebr�objectrrrrr�<module>s