
    tf_                     j    d Z ddlmZ ddlmZ ddlmZ  ee           G d d                      ZdS )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dS )DigestCredentialFactoryzp
    Wrapper for L{digest.DigestCredentialFactory} that implements the
    L{ICredentialFactory} interface.
    s   digestc                 :    t          j        ||          | _        dS )zN
        Create the digest credential factory that this object wraps.
        N)r   r   digest)self	algorithmauthenticationRealms      W/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/twisted/web/_auth/digest.py__init__z DigestCredentialFactory.__init__   s"     "9*
 
    c                 d    | 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(B(GHHHr   c                 r    | 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/   s6     {!!gng&>&>&@&@&E
 
 	
r   N)__name__
__module____qualname____doc__schemer   r   r    r   r   r   r      sU         
 F
 
 

I 
I 
I	
 	
 	
 	
 	
r   r   N)r   zope.interfacer   twisted.credr   twisted.web.iwebr   r   r   r   r   <module>r"      s   
  ' & & & & & $ $ $ $ $ $ / / / / / /   %
 %
 %
 %
 %
 %
 %
 ! %
 %
 %
r   