§
    Ètºf^  ã                   óv   — d Z ddlZddlmZ ddlmZmZ ddlmZ  ee¦  «         G d„ d¦  «        ¦   «         Z	dS )z¡
HTTP BASIC authentication.

@see: U{http://tools.ietf.org/html/rfc1945}
@see: U{http://tools.ietf.org/html/rfc2616}
@see: U{http://tools.ietf.org/html/rfc2617}
é    N)Úimplementer)ÚcredentialsÚerror)ÚICredentialFactoryc                   ó(   — e Zd ZdZdZd„ Zd„ Zd„ ZdS )ÚBasicCredentialFactoryzÌ
    Credential Factory for HTTP Basic Authentication

    @type authenticationRealm: L{bytes}
    @ivar authenticationRealm: The HTTP authentication realm which will be issued in
        challenges.
    s   basicc                 ó   — || _         d S )N©ÚauthenticationRealm)Úselfr   s     úV/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/twisted/web/_auth/basic.pyÚ__init__zBasicCredentialFactory.__init__"   s   € Ø#6ˆÔ Ð Ð ó    c                 ó   — d| j         iS )zy
        Return a challenge including the HTTP authentication realm with which
        this factory was created.
        Úrealmr
   )r   Úrequests     r   ÚgetChallengez#BasicCredentialFactory.getChallenge%   s   € ð
 ˜Ô1Ð2Ð2r   c                 ó  — 	 t          j        |dz   ¦  «        }n'# t           j        $ r t          j        d¦  «        ‚w xY w|                     dd¦  «        }t          |¦  «        dk    rt          j        |Ž S t          j        d¦  «        ‚)zŠ
        Parse the base64-encoded, colon-separated username and password into a
        L{credentials.UsernamePassword} instance.
        s   ===zInvalid credentialsó   :é   é   )	ÚbinasciiÚ
a2b_base64ÚErrorr   ÚLoginFailedÚsplitÚlenr   ÚUsernamePassword)r   Úresponser   Úcredss       r   ÚdecodezBasicCredentialFactory.decode,   s‘   € ð
	;ÝÔ'¨°6Ñ(9Ñ:Ô:ˆEˆEøÝŒ~ð 	;ð 	;ð 	;ÝÔ#Ð$9Ñ:Ô:Ð:ð	;øøøð —’˜D !Ñ$Ô$ˆÝˆu‰:Œ:˜Š?ˆ?ÝÔ/°Ð7Ð7åÔ#Ð$9Ñ:Ô:Ð:s   ‚ š$>N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úschemer   r   r!   © r   r   r   r      sR   € € € € € ðð ð €Fð7ð 7ð 7ð3ð 3ð 3ð;ð ;ð ;ð ;ð ;r   r   )
r%   r   Úzope.interfacer   Útwisted.credr   r   Útwisted.web.iwebr   r   r'   r   r   ú<module>r+      s    ðð
ð ð €€€à &Ð &Ð &Ð &Ð &Ð &à +Ð +Ð +Ð +Ð +Ð +Ð +Ð +Ø /Ð /Ð /Ð /Ð /Ð /ð €ÐÑ Ô ð#;ð #;ð #;ð #;ð #;ñ #;ô #;ñ !Ô ð#;ð #;ð #;r   