Ë
    ±ŒjP  ã                   óp   — d Z ddlmZ ddlmZ ddlmZmZ  G d„ dej                  «      Z	 G d„ d	e	«      Z
y
)z-The module containing the code for GuessAuth.é    )Úauth)Úcookiesé   )Ú_digest_auth_compatÚhttp_proxy_digestc                   ó.   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zy)Ú	GuessAuthz7Guesses the auth type by the WWW-Authentication header.c                 ó<   — || _         || _        d | _        d | _        y ©N)ÚusernameÚpasswordr   Úpos)Úselfr   r   s      úf/var/www/html/Fitness-lenito-AI-main/venv/lib/python3.12/site-packages/requests_toolbelt/auth/guess.pyÚ__init__zGuessAuth.__init__   s   € Ø ˆŒØ ˆŒØˆŒ	Øˆ�ó    c                 óä  — | j                   �/|j                  j                  j                  | j                   «       |j                   |j
                  j                  «        |j                  j                  «       }t        |d«      st        j                  «       |_        t        j                  |j                  |j                  |j
                  «       |j                  |j                  «       t        j                  | j                   | j"                  «      | _        | j                  |«      } |j$                  j&                  |fi |¤Ž}|j(                  j+                  |«       ||_        |S ©NÚ_cookies)r   ÚrequestÚbodyÚseekÚcontentÚrawÚrelease_connÚcopyÚhasattrr   ÚRequestsCookieJarr   Úextract_cookies_to_jarÚprepare_cookiesr   ÚHTTPBasicAuthr   r   Ú
connectionÚsendÚhistoryÚappend©r   ÚrÚkwargsÚprepÚ_rs        r   Ú_handle_basic_auth_401z GuessAuth._handle_basic_auth_401   sû   € Ø�8‰8ÐØ�I‰I�N‰N×Ñ §¡Ô)ð 	
�	Š	Ø	�‰×ÑÔØ�y‰y�~‰~ÓˆÜ�t˜ZÔ(Ü#×5Ñ5Ó7ˆDŒMÜ×&Ñ& t§}¡}°a·i±iÀÇÁÔGØ×Ñ˜TŸ]™]Ô+ä×&Ñ& t§}¡}°d·m±mÓDˆŒ	Ø�y‰y˜‹ˆØˆQ�\‰\×Ñ˜tÑ. vÑ.ˆØ
�
‰
×Ñ˜!ÔØˆŒ
àˆ	r   c                 óh  — t        j                  | j                  | j                  «      | _        	 | j                  j                  «        t        | j                  d«      r'| j                  j                  €d| j                  _         | j                  j                  |fi |¤ŽS # t        $ r Y Œew xY w)NÚnum_401_callsr   )
Úauth_compatÚHTTPDigestAuthr   r   r   Úinit_per_thread_stateÚAttributeErrorr   r-   Ú
handle_401©r   r'   r(   s      r   Ú_handle_digest_auth_401z!GuessAuth._handle_digest_auth_401'   s“   € Ü×.Ñ.¨t¯}©}¸d¿m¹mÓLˆŒ	ð	Ø�I‰I×+Ñ+Ô-ô �D—I‘I˜Ô/Ø—	‘	×'Ñ'Ð/Ø&'ˆD�I‰IÔ#ð $ˆt�y‰y×#Ñ# AÑ0¨Ñ0Ð0øô ò 	ñ ð	ús   ±B% Â%	B1Â0B1c                 ó°   — |j                   j                  dd«      j                  «       }d|v r| j                  ||«      S d|v r| j	                  ||«      S y)z/Resends a request with auth headers, if needed.zwww-authenticateÚ ÚbasicÚdigestN)ÚheadersÚgetÚlowerr+   r4   )r   r'   r(   Úwww_authenticates       r   r2   zGuessAuth.handle_401:   s`   € ð Ÿ9™9Ÿ=™=Ð);¸RÓ@×FÑFÓHÐàÐ&Ñ&Ø×.Ñ.¨q°&Ó9Ð9àÐ'Ñ'Ø×/Ñ/°°6Ó:Ð:ð (r   c                 óÖ   — | j                   �| j                  |«      S 	 |j                  j                  «       | _        |j                  d| j                  «       |S # t        $ r Y Œ)w xY w©NÚresponse)r   r   Útellr   r1   Úregister_hookr2   )r   r   s     r   Ú__call__zGuessAuth.__call__E   sc   € Ø�9‰9Ð Ø—9‘9˜WÓ%Ð%ð	Ø—|‘|×(Ñ(Ó*ˆDŒHð 	×Ñ˜j¨$¯/©/Ô:Øˆøô	 ò 	Ùð	ús   ŸA Á	A(Á'A(N)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r+   r4   r2   rB   © r   r   r	   r	   	   s   „ ÙAòòò,1ò&	;ó
r   r	   c                   óD   ‡ — e Zd ZdZ	 	 dˆ fd„	Zd„ Zd„ Zd„ Zˆ fd„Zˆ xZ	S )ÚGuessProxyAuthzZ
    Guesses the auth type by WWW-Authentication and Proxy-Authentication
    headers
    c                 óX   •— t         t        | �  ||«       || _        || _        d | _        y r   )ÚsuperrI   r   Úproxy_usernameÚproxy_passwordÚ
proxy_auth)r   r   r   rL   rM   Ú	__class__s        €r   r   zGuessProxyAuth.__init__W   s+   ø€ äŒn˜dÑ,¨X°xÔ@Ø,ˆÔØ,ˆÔØˆ�r   c                 óä  — | j                   �/|j                  j                  j                  | j                   «       |j                   |j
                  j                  «        |j                  j                  «       }t        |d«      st        j                  «       |_        t        j                  |j                  |j                  |j
                  «       |j                  |j                  «       t        j                  | j                   | j"                  «      | _        | j%                  |«      } |j&                  j(                  |fi |¤Ž}|j*                  j-                  |«       ||_        |S r   )r   r   r   r   r   r   r   r   r   r   r   r   r   r    r   ÚHTTPProxyAuthrL   rM   rN   r"   r#   r$   r%   r&   s        r   Ú_handle_basic_auth_407z%GuessProxyAuth._handle_basic_auth_407^   s  € Ø�8‰8ÐØ�I‰I�N‰N×Ñ §¡Ô)à	�	Š	Ø	�‰×ÑÔØ�y‰y�~‰~ÓˆÜ�t˜ZÔ(Ü#×5Ñ5Ó7ˆDŒMÜ×&Ñ& t§}¡}°a·i±iÀÇÁÔGØ×Ñ˜TŸ]™]Ô+ä×,Ñ,¨T×-@Ñ-@Ø-1×-@Ñ-@óBˆŒà�‰˜tÓ$ˆØˆQ�\‰\×Ñ˜tÑ. vÑ.ˆØ
�
‰
×Ñ˜!ÔØˆŒ
àˆ	r   c                 óð   — t        j                  | j                  | j                  ¬«      | _        	 | j
                  j                  «         | j                  j                  |fi |¤ŽS # t        $ r Y Œ(w xY w)N)r   r   )	r   ÚHTTPProxyDigestAuthrL   rM   rN   r   r0   r1   Ú
handle_407r3   s      r   Ú_handle_digest_auth_407z&GuessProxyAuth._handle_digest_auth_407s   sm   € Ü+×?Ñ?Ø×(Ñ(Ø×(Ñ(ô*ˆŒð	Ø�I‰I×+Ñ+Ô-ð *ˆt�‰×)Ñ)¨!Ñ6¨vÑ6Ð6øô ò 	Ùð	ús   ²A) Á)	A5Á4A5c                 ó°   — |j                   j                  dd«      j                  «       }d|v r| j                  ||«      S d|v r| j	                  ||«      S y )NzProxy-Authenticater6   r7   r8   )r9   r:   r;   rR   rV   )r   r'   r(   Úproxy_authenticates       r   rU   zGuessProxyAuth.handle_407   s^   € ØŸY™YŸ]™]Ð+?ÀÓD×JÑJÓLÐàÐ(Ñ(Ø×.Ñ.¨q°&Ó9Ð9àÐ)Ñ)Ø×/Ñ/°°6Ó:Ð:ð *r   c                 óú   •— | j                   �| j                  |«      }	 |j                  j                  «       | _        |j                  d| j                  «       t        t        | �'  |«      S # t        $ r Y Œ:w xY wr>   )
rN   r   r@   r   r1   rA   rU   rK   rI   rB   )r   r   rO   s     €r   rB   zGuessProxyAuth.__call__ˆ   sp   ø€ Ø�?‰?Ð&Ø—o‘o gÓ.ˆGð	Ø—|‘|×(Ñ(Ó*ˆDŒHð 	×Ñ˜j¨$¯/©/Ô:Ü”^ TÑ3°GÓ<Ð<øô	 ò 	Ùð	ús    A. Á.	A:Á9A:)NNNN)
rC   rD   rE   rF   r   rR   rV   rU   rB   Ú__classcell__)rO   s   @r   rI   rI   R   s.   ø„ ñð 04Ø59õòò*
7ò;÷
=ð 
=r   rI   N)rF   Úrequestsr   r   r6   r   r.   r   ÚAuthBaser	   rI   rG   r   r   Ú<module>r]      s2   ðá 3Ý Ý ç CôF�—‘ô FôR@=�Yõ @=r   