+
     h'  c                   s    R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^RI	H
t
 ^RIHtHtHt ^RIHt ^RIHt RtRtR	 t ! R
 R4      t ! R R]4      t ! R R]4      t ! R R]4      tR# )z]
requests.auth
~~~~~~~~~~~~~

This module contains the authentication handlers for Requests.
N)	b64encode)to_native_string)
basestringstrurlparse)extract_cookies_to_jar)parse_dict_headerz!application/x-www-form-urlencodedzmultipart/form-datac           	     sV   \        V \        4      '       g7   \        P                  ! RP	                  V 4      \
        R7       \        V 4      p \        V\        4      '       g@   \        P                  ! RP	                  \        V4      4      \
        R7       \        V4      p\        V \        4      '       d   V P                  R4      p \        V\        4      '       d   VP                  R4      pR\        \        RP                  W34      4      P                  4       4      ,           pV# )zReturns a Basic Auth string.zNon-string usernames will no longer be supported in Requests 3.0.0. Please convert the object you've passed in ({!r}) to a string or bytes object in the near future to avoid problems.)ZcategoryzNon-string passwords will no longer be supported in Requests 3.0.0. Please convert the object you've passed in ({!r}) to a string or bytes object in the near future to avoid problems.Zlatin1zBasic s   :)
isinstancer   warningsZwarnZformatZDeprecationWarningr   Ztypeencoder   r    ZjoinZstrip)usernamepasswordZauthstrs   && 2/usr/lib/python3.14/site-packages/requests/auth.py_basic_auth_strr      s     h
++ x('	
 x=h
++ tH~.'	
 x= (C  ??8,(C  ??8,)$))X01288: G N    c                   s*   a  ] tR t^Et o RtR tRtV tR# )AuthBasez4Base class that all auth implementations derive fromc                s    \        R 4      h)zAuth hooks must be callable.)ZNotImplementedErrorselfr   &&r   __call__ZAuthBase.__call__H   s    !"@AAr    N__name__
__module____qualname____firstlineno____doc__r   __static_attributes____classdictcell__Z__classdict__   @r   r   r   E   s     >B Br   r   c                   s<   a  ] tR t^Lt o RtR tR tR tR tRt	V t
R# )HTTPBasicAuthz?Attaches HTTP Basic Authentication to the given Request object.c                s    Wn         W n        R # N)r
   r   r   r
   r      &&&r   __init__ZHTTPBasicAuth.__init__O   s      r   c           	     |    \        V P                  \        VR R4      8H  V P                  \        VRR4      8H  .4      # r
   Nr   Zallr
   Zgetattrr   r   Zotherr   r   __eq__ZHTTPBasicAuth.__eq__S   >    
D!AA
D!AA
 	
r   c                    W8X  * # r!   r   r(   r   r   __ne__ZHTTPBasicAuth.__ne__[         r   c                `    \        V P                  V P                  4      VP                  R &   V# )Authorizationr   r
   r   headersr   r   r   r   ZHTTPBasicAuth.__call__^   s$    %4T]]DMM%R		/"r   )r   r
   N)r   r   r   r   r   r$   r)   r,   r   r   r   r   r   r   r    r    L   s!     I!
! r   r    c                   s*   a  ] tR t^ct o RtR tRtV tR# )HTTPProxyAuthz=Attaches HTTP Proxy Authentication to a given Request object.c                r.   )zProxy-Authorizationr0   r   r   r   r   ZHTTPProxyAuth.__call__f   s%    +:4==$--+X		'(r   r   Nr   r   r   r   r2   r2   c   s     G r   r2   c                   sT   a  ] tR t^kt o RtR tR tR tR tR t	R t
R tR	 tR
tV tR# )HTTPDigestAuthz@Attaches HTTP Digest Authentication to the given Request object.c                sR    Wn         W n        \        P                  ! 4       V n        R # r!   )r
   r   	threadingZlocal_thread_localr"   r#   r   r$   ZHTTPDigestAuth.__init__n   s      &__.r   c                s   \        V P                  R 4      '       gi   RV P                  n        RV P                  n        ^ V P                  n        / V P                  n        RV P                  n        RV P                  n        R# R# )initT N)Zhasattrr5   r6   
last_noncenonce_countchalposnum_401_calls)r      &r   init_per_thread_stateZ$HTTPDigestAuth.init_per_thread_statet   sn    t))622&*D#,.D)-.D*&(D#%)D"/3D, 3r   c                s,  a V P                   P                  R,          pV P                   P                  R,          pV P                   P                  P                  R4      pV P                   P                  P                  R4      pV P                   P                  P                  R4      pRoVf   RpMVP                  4       pVR8X  g   VR8X  d   R	 p	V	oM&VR
8X  d   R p
V
oMVR8X  d   R pVoMVR8X  d   R pVoV3R lpSf   R# Rp\	        V4      pVP
                  ;'       g    RpVP                  '       d   VRVP                   2,          pV P                   RV RV P                   2pV RV 2pS! V4      pS! V4      pW@P                   P                  8X  d%   V P                   ;P                  ^,          un
        M^V P                   n
        V P                   P                  R p\        V P                   P                  4      P                  R4      pVVP                  R4      ,          pV\        P                  ! 4       P                  R4      ,          pV\        P                   ! ^4      ,          p\"        P$                  ! V4      P'                  4       R,          pVR8X  d   S! V RV RV 24      pV'       g   V! VV RV 24      pM6VR8X  g   RVP)                  R4      9   d   V RV RV RV 2pV! VV4      pMR# W@P                   n	        RV P                   RV RV RV RV R2pV'       d   VR V R2,          pV'       d   VR!V R2,          pV'       d   VR"V R2,          pV'       d   VR#V R$V R2,          pR%V 2# )&z
:rtype: str
realmnonceqop	algorithmopaqueNZMD5zMD5-SESSc                     \        V \        4      '       d   V P                  R 4      p \        P                  ! V 4      P                  4       # utf-8)r   r   r	   hashlibZmd5	hexdigestZxr=   r   md5_utf8Z4HTTPDigestAuth.build_digest_header.<locals>.md5_utf8   s4    a%%)A{{1~//11r   ZSHAc                 rD   rE   )r   r   r	   rG   sha1rH   rI   r=   r   sha_utf8Z4HTTPDigestAuth.build_digest_header.<locals>.sha_utf8   s4    a%%)A||A0022r   zSHA-256c                 rD   rE   )r   r   r	   rG   Zsha256rH   rI   r=   r   sha256_utf8Z7HTTPDigestAuth.build_digest_header.<locals>.sha256_utf8   5    a%%)A~~a(2244r   zSHA-512c                 rD   rE   )r   r   r	   rG   Zsha512rH   rI   r=   r   sha512_utf8Z7HTTPDigestAuth.build_digest_header.<locals>.sha512_utf8   rN   r   c                 s   < S! V  R V 24      # ):r   )sZd	hash_utf8s   &&r   Z<lambda>Z4HTTPDigestAuth.build_digest_header.<locals>.<lambda>   s    )qc1#J/r   Z/Z?rP   Z08xrF   :Ni   NZauthZ,z:auth:z
username="z
", realm="z
", nonce="z", uri="z", response="Z"z
, opaque="z, algorithm="z
, digest="z, qop="auth", nc=z
, cnonce="zDigest )r5   r:   getZupperr   pathZqueryr
   r   r8   r9   r   r	   timeZctimeosZurandomrG   rK   rH   Zsplit)r   methodurlr?   r@   rA   rB   rC   Z
_algorithmrJ   rL   rM   rO   ZKDZentdigZp_parsedrT   ZA1ZA2ZHA1ZHA2ZncvaluerQ   ZcnonceZrespdigZnoncebitZbaserR   s   &&&                        @r   build_digest_headerZ"HTTPDigestAuth.build_digest_header~   s   
 ""''0""''0  %%))%0&&++//<	##((,,X6	J"*J*
":2
 !I5 3
 !I9$5
 $I9$5
 $I/ C=}}##>>>a'((Dawa7xqmm&&111**a/*-.D*''33C8""../66w?	U\\'""	TZZ\  ))	RZZ]a**,S1#se1UG1VH56Cq./GF]f		#6'!F86#?Hh'G (-% z%
5' J6wiq2 	 j**DmI;a00Dj**D'y
6(!DDDr   c                sP    VP                   '       d   ^V P                  n        R# R# )z)Reset num_401_calls counter on redirects.N)Zis_redirectr5   r<   )r   r   kwargss   &&,r   handle_redirectZHTTPDigestAuth.handle_redirect   s    ===/0D, r   c                s   RVP                   u;8:  d   R8  g   M ^V P                  n        V# V P                  P                  e:   VP                  P
                  P                  V P                  P                  4       VP                  P                  RR4      pRVP                  4       9   Ed   V P                  P                  ^8  Ede   V P                  ;P                  ^,          un        \        P                  ! R\        P                  R7      p\        VP                  RV^R7      4      V P                  n        VP                    VP#                  4        VP                  P%                  4       p\'        VP(                  VP                  VP*                  4       VP-                  VP(                  4       V P/                  VP0                  VP2                  4      VP                  R	&   VP4                  P6                  ! V3/ VB pVP8                  P;                  V4       WVn        V# ^V P                  n        V# )
zW
Takes the given response and tries digest-auth, if needed.

:rtype: requests.Response
i  i  zwww-authenticater7   Zdigestzdigest )Zflags)Zcountr/   )Zstatus_coder5   r<   r;   ZrequestbodyZseekr1   rS   ZlowerreZcompileZ
IGNORECASEr   Zsubr:   ZcontentZcloseZcopyr   Z_cookiesZrawZprepare_cookiesrY   rW   rX   Z
connectionZsendZhistoryZappend)r   r   rZ   Zs_authZpatZprepZ_rs   &&,    r   
handle_401ZHTTPDigestAuth.handle_401   s    amm)c)/0D,H!!- IINN 2 2 6 67126v||~%$*<*<*J*JQ*N,,1,**Zr}}=C&7FRS8T&UD# IIGGI99>>#D"4==!))QUUC  /,0,D,DTXX-DLL) ""4262BJJa JI+,(r   c                s   V P                  4        V P                  P                  '       d4   V P                  VP                  VP
                  4      VP                  R &    VP                  P                  4       V P                  n	        VP                  RV P                  4       VP                  RV P                  4       ^V P                  n        V#   \         d    RT P                  n	         Lii ; i)r/   NZresponse)r>   r5   r8   rY   rW   rX   r1   r\   Ztellr;   ZAttributeErrorZregister_hookr^   r[   r<   r   r   r   r   ZHTTPDigestAuth.__call__  s    ""$((()-)A)A!((AEE)RAIIo&	*%&VV[[]D" 	

DOO4	
D$8$89+,(  	*
 &*D"	*s   !)C C43C4c           	     r%   r&   r'   r(   r   r   r)   ZHTTPDigestAuth.__eq__1  r*   r   c                r+   r!   r   r(   r   r   r,   ZHTTPDigestAuth.__ne__9  r-   r   )r5   r   r
   N)r   r   r   r   r   r$   r>   rY   r[   r^   r   r)   r,   r   r   r   r   r   r3   r3   k   s8     J/4l \1
*X(
! !r   r3   )r   rG   rV   r]   r4   rU   r   Zbase64r    Z_internal_utilsr   Zcompatr   r   r   Zcookiesr   Zutilsr   ZCONTENT_TYPE_FORM_URLENCODEDZCONTENT_TYPE_MULTI_PARTr   r   r    r2   r3   r   r   r   <module>r_      st     	 	     - - - + $B / )XB BH .M O!X O!r   