
    Vh_                     V    d Z ddlmZ ddlmZ ddlmZ  ee       G d d             Zy)zg
Implementation of RFC2617: HTTP Digest Authentication

@see: U{http://www.faqs.org/rfcs/rfc2617.html}
    )implementer)credentials)ICredentialFactoryc                   &    e Zd ZdZdZd Zd Zd Zy)DigestCredentialFactoryzp
    Wrapper for L{digest.DigestCredentialFactory} that implements the
    L{ICredentialFactory} interface.
    s   digestc                 :    t        j                  ||      | _        y)zN
        Create the digest credential factory that this object wraps.
        N)r   r   digest)self	algorithmauthenticationRealms      H/home/dcms/DCMS/lib/python3.12/site-packages/twisted/web/_auth/digest.py__init__z DigestCredentialFactory.__init__   s     "99*
    c                 h    | j                   j                  |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
   requests     r   r   z$DigestCredentialFactory.getChallenge#   s(     {{''(@(@(B(G(GHHr   c                     | j                   j                  ||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methodr   r   )r
   responser   s      r   r   zDigestCredentialFactory.decode/   s5     {{!!gnng&>&>&@&E&E
 	
r   N)__name__
__module____qualname____doc__schemer   r   r    r   r   r   r      s    
 F

I	
r   r   N)r   zope.interfacer   twisted.credr   twisted.web.iwebr   r   r   r   r   <module>r"      s4   
 ' $ /  %
 %
 !%
r   