ó
    §ZÇhs.  ã                  óP  • S SK Jr  S SKrS SKrS SKrS SKrS SKrS SKJr  S SK	J
r
  SSKJr  SSKJrJrJr  SSKJrJrJr  \R*                  (       a  S S	KJr  / S
Qr " S S5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\R:                  5      rg)é    )ÚannotationsN)Ú	b64encode)Úparse_http_listé   )ÚProtocolError)ÚCookiesÚRequestÚResponse)Úto_bytesÚto_strÚunquote)Ú_Hash)ÚAuthÚ	BasicAuthÚ
DigestAuthÚ	NetRCAuthc                  óN   • \ rS rSrSrSrSrS	S jr    S	S jr    S
S jr	Sr
g)r   é   aÔ  
Base class for all authentication schemes.

To implement a custom authentication scheme, subclass `Auth` and override
the `.auth_flow()` method.

If the authentication scheme does I/O such as disk access or network calls, or uses
synchronization primitives such as locks, you should override `.sync_auth_flow()`
and/or `.async_auth_flow()` instead of `.auth_flow()` to provide specialized
implementations that will be used by `Client` and `AsyncClient` respectively.
Fc              #  ó   #   • Uv •  g7f)a—  
Execute the authentication flow.

To dispatch a request, `yield` it:

```
yield request
```

The client will `.send()` the response back into the flow generator. You can
access it like so:

```
response = yield request
```

A `return` (or reaching the end of the generator) will result in the
client returning the last response obtained from the server.

You can dispatch as many requests as is necessary.
N© ©ÚselfÚrequests     ÚH/home/mande/repo/quber/.venv/lib/python3.13/site-packages/httpx/_auth.pyÚ	auth_flowÚAuth.auth_flow&   s   é € ð, ‹ùs   ‚c              #  ó  #   • U R                   (       a  UR                  5         U R                  U5      n[        U5      n Uv •nU R                  (       a  UR                  5          UR                  U5      nM9  ! [         a     gf = f7f)zÈ
Execute the authentication flow synchronously.

By default, this defers to `.auth_flow()`. You should override this method
when the authentication scheme does I/O and/or uses concurrency primitives.
N)Úrequires_request_bodyÚreadr   ÚnextÚrequires_response_bodyÚsendÚStopIteration©r   r   ÚflowÚresponses       r   Úsync_auth_flowÚAuth.sync_auth_flow>   sw   é € ð ×%×%Ø�L‰LŒNà�~‰~˜gÓ&ˆÜ�t“*ˆàØ$‘}ˆHØ×*×*Ø—‘”ðØŸ)™) HÓ-�ñ øô !ó Ùðüs*   ‚A$B
Á'A: Á8B
Á:
BÂB
ÂBÂB
c               óB  #   • U R                   (       a  UR                  5       I Sh  v•N   U R                  U5      n[        U5      n U7v •nU R                  (       a  UR                  5       I Sh  v•N    UR                  U5      nMB   Nc N! [         a     gf = f7f)zÉ
Execute the authentication flow asynchronously.

By default, this defers to `.auth_flow()`. You should override this method
when the authentication scheme does I/O and/or uses concurrency primitives.
N)r   Úareadr   r    r!   r"   r#   r$   s       r   Úasync_auth_flowÚAuth.async_auth_flowW   sŽ   é € ð ×%×%Ø—-‘-“/×!Ð!à�~‰~˜gÓ&ˆÜ�t“*ˆàØ$’}ˆHØ×*×*Ø—n‘nÓ&×&Ð&ðØŸ)™) HÓ-�ñ ñ "ñ 'øô !ó ÙðüsF   ‚%B§B¨A
BÁ2BÁ3BÁ8B Â	BÂBÂ
BÂBÂBÂBr   N©r   r	   Úreturnz)typing.Generator[Request, Response, None])r   r	   r.   z(typing.AsyncGenerator[Request, Response])Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r!   r   r'   r+   Ú__static_attributes__r   ó    r   r   r      sD   † ñ
ð "ÐØ"Ðôð0Øðà	2ôð2Øðà	1÷r5   r   c                  ó,   • \ rS rSrSrSS jrSS jrSrg)	ÚFunctionAuthéq   z…
Allows the 'auth' argument to be passed as a simple callable function,
that takes the request, and returns a new, modified request.
c                ó   • Xl         g ©N©Ú_func)r   Úfuncs     r   Ú__init__ÚFunctionAuth.__init__w   s   € Ø�
r5   c              #  ó2   #   • U R                  U5      v •  g 7fr:   r;   r   s     r   r   ÚFunctionAuth.auth_flowz   s   é € Ø�j‰j˜Ó!Ó!ùs   ‚r;   N)r=   z#typing.Callable[[Request], Request]r.   ÚNoner-   )r/   r0   r1   r2   r3   r>   r   r4   r   r5   r   r7   r7   q   s   † ñô
÷"r5   r7   c                  ó6   • \ rS rSrSrSS jrS	S jrS
S jrSrg)r   é~   zm
Allows the 'auth' argument to be passed as a (username, password) pair,
and uses HTTP Basic authentication.
c                ó0   • U R                  X5      U l        g r:   )Ú_build_auth_headerÚ_auth_header©r   ÚusernameÚpasswords      r   r>   ÚBasicAuth.__init__„   s   € Ø ×3Ñ3°HÓGˆÕr5   c              #  óF   #   • U R                   UR                  S'   Uv •  g 7f)NÚAuthorization)rG   Úheadersr   s     r   r   ÚBasicAuth.auth_flow‡   s   é € Ø+/×+<Ñ+<ˆ�‰˜Ñ(Ø‹ùs   ‚!c                óˆ   • SR                  [        U5      [        U5      45      n[        U5      R                  5       nSU 3$ ©Nó   :zBasic ©Újoinr   r   Údecode©r   rI   rJ   ÚuserpassÚtokens        r   rF   ÚBasicAuth._build_auth_header‹   ó?   € Ø—9‘9œh xÓ0´(¸8Ó2DÐEÓFˆÜ˜(Ó#×*Ñ*Ó,ˆØ˜�wÐÐr5   )rG   N©rI   ústr | bytesrJ   r\   r.   rB   r-   ©rI   r\   rJ   r\   r.   Ústr©	r/   r0   r1   r2   r3   r>   r   rF   r4   r   r5   r   r   r   ~   s   † ñô
Hô÷ r5   r   c                  ó:   • \ rS rSrSrSS	S jjrS
S jrSS jrSrg)r   é‘   zL
Use a 'netrc' file to lookup basic auth credentials based on the url host.
Nc                ó8   • SS K nUR                  U5      U l        g )Nr   )ÚnetrcÚ_netrc_info)r   Úfilerc   s      r   r>   ÚNetRCAuth.__init__–   s   € ó 	à Ÿ;™; tÓ,ˆÕr5   c              #  óÜ   #   • U R                   R                  UR                  R                  5      nUb
  US   (       d  Uv •  g U R	                  US   US   S9UR
                  S'   Uv •  g 7f)Né   r   )rI   rJ   rM   )rd   ÚauthenticatorsÚurlÚhostrF   rN   )r   r   Ú	auth_infos      r   r   ÚNetRCAuth.auth_flow�   sk   é € Ø×$Ñ$×3Ñ3°G·K±K×4DÑ4DÓEˆ	ØÑ I¨a§Là‹Mð 04×/FÑ/FØ" 1™°	¸!±ð 0Gð 0ˆG�O‰O˜OÑ,ð ‹Mùs   ‚A*A,c                óˆ   • SR                  [        U5      [        U5      45      n[        U5      R                  5       nSU 3$ rQ   rS   rV   s        r   rF   ÚNetRCAuth._build_auth_header©   rZ   r5   )rd   r:   )re   z
str | Noner.   rB   r-   r]   r_   r   r5   r   r   r   ‘   s   † ñö-ô
÷ r5   r   c            	      ó8  • \ rS rSr% \R
                  \R
                  \R                  \R                  \R                  \R                  \R                  \R                  S.r	S\
S'   SS jrSS jr        SS jr      SS jrSS	 jrSS
 jrSS jrSrg)r   é¯   )ÚMD5zMD5-SESSÚSHAzSHA-SESSzSHA-256zSHA-256-SESSzSHA-512zSHA-512-SESSz*dict[str, typing.Callable[[bytes], _Hash]]Ú_ALGORITHM_TO_HASH_FUNCTIONc                ó`   • [        U5      U l        [        U5      U l        S U l        SU l        g )Nr   )r   Ú	_usernameÚ	_passwordÚ_last_challengeÚ_nonce_countrH   s      r   r>   ÚDigestAuth.__init__»   s*   € Ü! (Ó+ˆŒÜ! (Ó+ˆŒØ<@ˆÔØˆÕr5   c              #  óT  #   • U R                   (       a(  U R                  XR                   5      UR                  S'   Uv •nUR                  S:w  d  SUR                  ;  a  g UR                  R	                  S5       H)  nUR                  5       R                  S5      (       d  M)    O   g U R                  XU5      U l         SU l        U R                  XR                   5      UR                  S'   UR                  (       a"  [        UR                  5      R                  US9  Uv •  g 7f)NrM   i‘  zwww-authenticatezdigest r   ©r   )rx   rF   rN   Ústatus_codeÚget_listÚlowerÚ
startswithÚ_parse_challengery   Úcookiesr   Úset_cookie_header)r   r   r&   Úauth_headers       r   r   ÚDigestAuth.auth_flowÁ   s  é € Ø××Ø/3×/FÑ/FØ×-Ñ-ó0ˆG�O‰O˜OÑ,ð !‘=ˆà×Ñ 3Ó&Ð*<ÀH×DTÑDTÓ*Tð à#×+Ñ+×4Ñ4Ð5GÖHˆKØ× Ñ Ó"×-Ñ-¨i×8Ó8Ùñ Ið à#×4Ñ4°WÈÓTˆÔØˆÔà+/×+BÑ+BØ×)Ñ)ó,
ˆ�‰˜Ñ(ð ××Ü�H×$Ñ$Ó%×7Ñ7ÀÐ7ÑHØ‹ùs   ‚BD(Â%BD(c                ó  • UR                  S5      u  pEnUR                  5       S:X  d   e0 n[        U5       H2  nUR                  5       R	                  SS5      u  pš[        U
5      Xy'   M4      US   R                  5       nUS   R                  5       nUR                  SS5      nS	U;   a  US	   R                  5       OS
nSU;   a  US   R                  5       OS
n[        X¼XÞUS9$ ! [         a  nSn[        UUS9UeS
nAff = f)z¡
Returns a challenge from a Digest WWW-Authenticate header.
These take the form of:
`Digest realm="realm@host.com",qop="auth,auth-int",nonce="abc",opaque="xyz"`
Ú ÚdigestÚ=r   ÚrealmÚnonceÚ	algorithmrr   ÚopaqueNÚqop)rŠ   r‹   rŒ   r�   rŽ   z(Malformed Digest WWW-Authenticate headerr|   )Ú	partitionr   r   ÚstripÚsplitr   ÚencodeÚgetÚ_DigestAuthChallengeÚKeyErrorr   )r   r   r&   r„   ÚschemeÚ_ÚfieldsÚheader_dictÚfieldÚkeyÚvaluerŠ   r‹   rŒ   r�   rŽ   ÚexcÚmessages                     r   r�   ÚDigestAuth._parse_challengeà   s  € ð (×1Ñ1°#Ó6Ñˆ�6ð �|‰|‹~ Ó)Ð)Ð)à&(ˆÜ$ VÖ,ˆEØŸ™›×,Ñ,¨S°!Ó4‰JˆCÜ& u›~ˆKÓñ -ð	CØ Ñ(×/Ñ/Ó1ˆEØ Ñ(×/Ñ/Ó1ˆEØ#Ÿ™¨°UÓ;ˆIØ7?À;Ó7N�[ Ñ*×1Ñ1Ô3ÐTXˆFØ16¸+Ó1E�+˜eÑ$×+Ñ+Ô-È4ˆCÜ'Ø°IÐRUñð øô ó 	CØ@ˆGÜ °Ñ9¸sÐBûð	Cús   Á/A8C( Ã(
DÃ2C?Ã?Dc           	     óL  ^• U R                   UR                  R                  5          mSU4S jjnSR                  U R                  UR
                  U R                  45      nUR                  R                  nSR                  UR                  R                  5       U45      nU" U5      nSU R                  -  nU R                  U R                  UR                  5      n	U =R                  S-  sl        U" U5      n
UR                  R                  5       R                  S5      (       a#  U" SR                  X¢R                  U	45      5      n
U R!                  UR"                  US9nUc  X¢R                  U/nOX¢R                  X‰X·/nU R                  UR
                  UR                  UU" SR                  U5      5      UR                  R                  5       S.nUR$                  (       a  UR$                  US'   U(       a  S	US
'   X�S'   X�S'   SU R'                  U5      -   $ )Nc                óL   >• T" U 5      R                  5       R                  5       $ r:   )Ú	hexdigestr’   )ÚdataÚ	hash_funcs    €r   rˆ   Ú-DigestAuth._build_auth_header.<locals>.digest  s   ø€ Ù˜T“?×,Ñ,Ó.×5Ñ5Ó7Ð7r5   rR   s   %08xr   z-sessr|   )rI   rŠ   r‹   Úurir&   rŒ   r�   ó   authrŽ   ÚncÚcnoncezDigest )r£   Úbytesr.   rª   )rt   rŒ   ÚupperrT   rv   rŠ   rw   rj   Úraw_pathÚmethodr’   ry   Ú_get_client_noncer‹   r   ÚendswithÚ_resolve_qoprŽ   r�   Ú_get_header_value)r   r   Ú	challengerˆ   ÚA1ÚpathÚA2ÚHA2Únc_valuer©   ÚHA1rŽ   Údigest_dataÚformat_argsr¤   s                 @r   rF   ÚDigestAuth._build_auth_headerÿ   sÖ  ø€ ð ×4Ñ4°Y×5HÑ5H×5NÑ5NÓ5PÑQˆ	÷	8ð �Y‰Y˜Ÿ™¨	¯©¸¿¹ÐHÓIˆà�{‰{×#Ñ#ˆØ�Y‰Y˜Ÿ™×-Ñ-Ó/°Ð6Ó7ˆá�R‹jˆà˜T×.Ñ.Ñ.ˆØ×'Ñ'¨×(9Ñ(9¸9¿?¹?ÓKˆØ×Ò˜QÑÕá�R‹jˆØ×Ñ×$Ñ$Ó&×/Ñ/°×8Ñ8Ù˜Ÿ™ C¯©¸&Ð#AÓBÓCˆCà×Ñ 	§¡°wÐÐ?ˆØ‰;à§¡°Ð5‰Kð §¡°À3ÐLˆKð Ÿ™Ø—_‘_Ø—_‘_ØÙ˜tŸy™y¨Ó5Ó6Ø"×,Ñ,×3Ñ3Ó5ñ
ˆð ××Ø$-×$4Ñ$4ˆK˜Ñ!ÞØ!(ˆK˜ÑØ (˜ÑØ$*˜Ñ!à˜4×1Ñ1°+Ó>Ñ>Ð>r5   c                ó$  • [        U5      R                  5       nX2-  nU[        R                  " 5       R                  5       -  nU[        R
                  " S5      -  n[        R                  " U5      R                  5       S S R                  5       $ )Né   é   )	r^   r’   ÚtimeÚctimeÚosÚurandomÚhashlibÚsha1r¢   )r   Únonce_countr‹   Úss       r   r®   ÚDigestAuth._get_client_nonce/  sn   € Ü�Ó×#Ñ#Ó%ˆØ	‰
ˆØ	ŒT�ZŠZ‹\× Ñ Ó"Ñ"ˆØ	ŒR�ZŠZ˜‹]Ñˆä�|Š|˜A‹×(Ñ(Ó*¨3¨BÐ/×6Ñ6Ó8Ð8r5   c                óÂ   • SnSnSnSn[        UR                  5       5       H9  u  nu  pxUS:”  a  US-  nXr;  a  UOUn	XYR                  U[        U5      5      -  nM;     U$ )N)rŒ   rŽ   r¨   z{}="{}"z{}={}Ú r   z, )Ú	enumerateÚitemsÚformatr   )
r   Úheader_fieldsÚNON_QUOTED_FIELDSÚQUOTED_TEMPLATEÚNON_QUOTED_TEMPLATEÚheader_valueÚirš   rœ   Útemplates
             r   r±   ÚDigestAuth._get_header_value7  s   € Ø6ÐØ#ˆØ%ÐàˆÜ!*¨=×+>Ñ+>Ó+@Ö!AÑˆA‰~�Ø�1‹uØ Ñ$�ð Ó1ñ  à(ð ð
 ŸO™O¨E´6¸%³=ÓAÑAŠLñ "Bð Ðr5   c                óŠ   • Uc  g [         R                  " SU5      nSU;   a  gUS/:X  a  [        S5      eSU< S3n[        XBS9e)Ns   , ?r§   s   auth-intz.Digest auth-int support is not yet implementedzUnexpected qop value "z" in digest authr|   )Úrer‘   ÚNotImplementedErrorr   )r   rŽ   r   Úqopsrž   s        r   r°   ÚDigestAuth._resolve_qopI  sT   € Ø‰;ØÜ�xŠx˜ Ó$ˆØ�d‹?Øà�K�=Ó Ü%Ð&VÓWÐWà*¨3©'Ð1AÐBˆÜ˜GÑ5Ð5r5   )rx   ry   rw   rv   Nr[   r-   )r   r	   r&   r
   r„   r^   r.   r”   )r   r	   r²   r”   r.   r^   )rÅ   Úintr‹   rª   r.   rª   )rÍ   zdict[str, bytes]r.   r^   )rŽ   úbytes | Noner   r	   r.   rÛ   )r/   r0   r1   r2   rÃ   Úmd5rÄ   Úsha256Úsha512rt   Ú__annotations__r>   r   r�   rF   r®   r±   r°   r4   r   r5   r   r   r   ¯   s¬   ‡ à�{‰{Ø—K‘KØ�|‰|Ø—L‘LØ—>‘>ØŸ™Ø—>‘>ØŸ™ñ	OÐÐ!Kó 	ôôð>CØðCØ*2ðCØADðCà	ôCð>.?Øð.?Ø+?ð.?à	ô.?ô`9ô÷$6r5   r   c                  óH   • \ rS rSr% S\S'   S\S'   S\S'   S\S'   S\S	'   S
rg)r”   iW  rª   rŠ   r‹   r^   rŒ   rÛ   r�   rŽ   r   N)r/   r0   r1   r2   rß   r4   r   r5   r   r”   r”   W  s   ‡ ØƒLØƒLØƒNØÓØ	Ör5   r”   )Ú
__future__r   rÃ   rÁ   rÖ   r¿   ÚtypingÚbase64r   Úurllib.requestr   Ú_exceptionsr   Ú_modelsr   r	   r
   Ú_utilsr   r   r   ÚTYPE_CHECKINGr   Ú__all__r   r7   r   r   r   Ú
NamedTupler”   r   r5   r   Ú<module>rë      s‘   ðÝ "ã Û 	Û 	Û Û Ý Ý *å &ß /Ñ /ß -Ñ -à	××Ýò ;€÷Xñ Xôv
"�4ô 
"ô �ô  ô& �ô  ô<e6�ô e6ôP˜6×,Ñ,õ r5   