§
    ÑÁ³gs.  ã                  óX  — d dl mZ d dlZd dlZd dlZd dlZd dlZd dlmZ d dl	m
Z
 ddlmZ ddlmZmZmZ ddlmZmZmZ ej        rd d	lmZ g d
¢Z G d„ d¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ dej        ¦  «        ZdS )é    )ÚannotationsN)Ú	b64encode)Úparse_http_listé   )ÚProtocolError)ÚCookiesÚRequestÚResponse)Úto_bytesÚto_strÚunquote)Ú_Hash)ÚAuthÚ	BasicAuthÚ
DigestAuthÚ	NetRCAuthc                  ó2   — e Zd ZdZdZdZdd„Zdd„Zdd
„ZdS )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.
    FÚrequestr	   Úreturnú)typing.Generator[Request, Response, None]c              #  ó   K  — |V — dS )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© ©Úselfr   s     úI/var/www/html/mpstechhub/venv/lib/python3.11/site-packages/httpx/_auth.pyÚ	auth_flowzAuth.auth_flow&   s   è è € ð, ˆˆˆˆˆó    c              #  ó  K  — | j         r|                     ¦   «          |                      |¦  «        }t          |¦  «        }	 |V —}| j        r|                     ¦   «          	 |                     |¦  «        }n# t          $ r Y dS w xY wŒH)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.
        TN)Úrequires_request_bodyÚreadr   ÚnextÚrequires_response_bodyÚsendÚStopIteration©r   r   ÚflowÚresponses       r   Úsync_auth_flowzAuth.sync_auth_flow>   s¡   è è € ð Ô%ð 	Ø�LŠL‰NŒNˆNà�~Š~˜gÑ&Ô&ˆÝ�t‘*”*ˆð	Ø$�}�}ˆHØÔ*ð  Ø—’‘”�ðØŸ)š) HÑ-Ô-��øÝ ð ð ð Ø��ðøøøð	s   Á#A9 Á9
BÂBú(typing.AsyncGenerator[Request, Response]c               ó0  K  — | j         r|                     ¦   «         ƒ d{V —† |                      |¦  «        }t          |¦  «        }	 |W V —}| j        r|                     ¦   «         ƒ d{V —† 	 |                     |¦  «        }n# t          $ r Y dS w xY wŒO)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_flowzAuth.async_auth_flowW   sË   è è € ð Ô%ð 	"Ø—-’-‘/”/Ð!Ð!Ð!Ð!Ð!Ð!Ð!à�~Š~˜gÑ&Ô&ˆÝ�t‘*”*ˆð	Ø$�}�}�}ˆHØÔ*ð 'Ø—n’nÑ&Ô&Ð&Ð&Ð&Ð&Ð&Ð&Ð&ðØŸ)š) HÑ-Ô-��øÝ ð ð ð Ø��ðøøøð	s   Á0B Â
BÂBN©r   r	   r   r   )r   r	   r   r)   )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r"   r   r(   r,   r   r   r   r   r      sh   € € € € € ð
ð 
ð "ÐØ"Ððð ð ð ð0ð ð ð ð2ð ð ð ð ð r   r   c                  ó"   — e Zd ZdZdd„Zdd
„ZdS )ÚFunctionAuthz‘
    Allows the 'auth' argument to be passed as a simple callable function,
    that takes the request, and returns a new, modified request.
    Úfuncú#typing.Callable[[Request], Request]r   ÚNonec                ó   — || _         d S ©N©Ú_func)r   r4   s     r   Ú__init__zFunctionAuth.__init__w   s   € ØˆŒ
ˆ
ˆ
r   r   r	   r   c              #  ó8   K  — |                       |¦  «        V — d S r8   r9   r   s     r   r   zFunctionAuth.auth_flowz   s$   è è € Ø�jŠj˜Ñ!Ô!Ð!Ð!Ð!Ð!Ð!r   N)r4   r5   r   r6   r-   )r.   r/   r0   r1   r;   r   r   r   r   r3   r3   q   sF   € € € € € ðð ð
ð ð ð ð"ð "ð "ð "ð "ð "r   r3   c                  ó*   — e Zd ZdZdd„Zdd„Zdd„ZdS )r   zy
    Allows the 'auth' argument to be passed as a (username, password) pair,
    and uses HTTP Basic authentication.
    Úusernameústr | bytesÚpasswordr   r6   c                ó<   — |                       ||¦  «        | _        d S r8   )Ú_build_auth_headerÚ_auth_header©r   r>   r@   s      r   r;   zBasicAuth.__init__„   s    € Ø ×3Ò3°H¸hÑGÔGˆÔÐÐr   r   r	   r   c              #  ó0   K  — | j         |j        d<   |V — d S )NÚAuthorization)rC   Úheadersr   s     r   r   zBasicAuth.auth_flow‡   s"   è è € Ø+/Ô+<ˆŒ˜Ñ(Øˆˆˆˆˆr   Ústrc                ó°   — d                      t          |¦  «        t          |¦  «        f¦  «        }t          |¦  «                             ¦   «         }d|› �S ©Nó   :zBasic ©Újoinr   r   Údecode©r   r>   r@   ÚuserpassÚtokens        r   rB   zBasicAuth._build_auth_header‹   óO   € Ø—9’9�h xÑ0Ô0µ(¸8Ñ2DÔ2DÐEÑFÔFˆÝ˜(Ñ#Ô#×*Ò*Ñ,Ô,ˆØ˜ÐÐÐr   N©r>   r?   r@   r?   r   r6   r-   ©r>   r?   r@   r?   r   rH   ©r.   r/   r0   r1   r;   r   rB   r   r   r   r   r   ~   s^   € € € € € ðð ð
Hð Hð Hð Hðð ð ð ð ð  ð  ð  ð  ð  r   r   c                  ó,   — e Zd ZdZddd„Zdd„Zdd„ZdS )r   zT
    Use a 'netrc' file to lookup basic auth credentials based on the url host.
    NÚfileú
str | Noner   r6   c                óB   — dd l }|                      |¦  «        | _        d S )Nr   )ÚnetrcÚ_netrc_info)r   rW   rZ   s      r   r;   zNetRCAuth.__init__–   s'   € ð 	ˆˆˆà Ÿ;š; tÑ,Ô,ˆÔÐÐr   r   r	   r   c              #  óÐ   K  — | j                              |j        j        ¦  «        }|�|d         s|V — d S |                      |d         |d         ¬¦  «        |j        d<   |V — d S )Né   r   )r>   r@   rF   )r[   ÚauthenticatorsÚurlÚhostrB   rG   )r   r   Ú	auth_infos      r   r   zNetRCAuth.auth_flow�   s}   è è € ØÔ$×3Ò3°G´KÔ4DÑEÔEˆ	ØÐ I¨a¤LÐàˆMˆMˆMˆMˆMð 04×/FÒ/FØ" 1œ°	¸!´ð 0Gñ 0ô 0ˆGŒO˜OÑ,ð ˆMˆMˆMˆMˆMr   r>   r?   r@   rH   c                ó°   — d                      t          |¦  «        t          |¦  «        f¦  «        }t          |¦  «                             ¦   «         }d|› �S rJ   rL   rO   s        r   rB   zNetRCAuth._build_auth_header©   rR   r   r8   )rW   rX   r   r6   r-   rT   rU   r   r   r   r   r   ‘   s_   € € € € € ðð ð-ð -ð -ð -ð -ð
ð 
ð 
ð 
ð ð  ð  ð  ð  ð  r   r   c            	      ó¸   — e Zd ZU ej        ej        ej        ej        ej        ej        ej        ej        dœZde	d<   d"d	„Z
d#d„Zd$d„Zd%d„Zd&d„Zd'd„Zd(d „Zd!S ))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_FUNCTIONr>   r?   r@   r   r6   c                ór   — t          |¦  «        | _        t          |¦  «        | _        d | _        d| _        d S )Nr   )r   Ú	_usernameÚ	_passwordÚ_last_challengeÚ_nonce_countrD   s      r   r;   zDigestAuth.__init__»   s6   € Ý! (Ñ+Ô+ˆŒÝ! (Ñ+Ô+ˆŒØ<@ˆÔØˆÔÐÐr   r   r	   r   c              #  ó  K  — | j         r#|                      || j         ¦  «        |j        d<   |V —}|j        dk    s	d|j        vrd S |j                             d¦  «        D ]+}|                     ¦   «                              d¦  «        r nŒ,d S |                      |||¦  «        | _         d| _        |                      || j         ¦  «        |j        d<   |j	        r(t          |j	        ¦  «                             |¬¦  «         |V — d S )NrF   i‘  zwww-authenticatezdigest r   ©r   )rj   rB   rG   Ústatus_codeÚget_listÚlowerÚ
startswithÚ_parse_challengerk   Úcookiesr   Úset_cookie_header)r   r   r'   Úauth_headers       r   r   zDigestAuth.auth_flowÁ   s:  è è € ØÔð 	Ø/3×/FÒ/FØ˜Ô-ñ0ô 0ˆGŒO˜OÑ,ð !�=�=ˆàÔ 3Ò&Ð&Ð*<ÀHÔDTÐ*TÐ*Tð ˆFà#Ô+×4Ò4Ð5GÑHÔHð 	ð 	ˆKØ× Ò Ñ"Ô"×-Ò-¨iÑ8Ô8ð Ø�ðð
 ˆFà#×4Ò4°W¸hÈÑTÔTˆÔØˆÔà+/×+BÒ+BØ�TÔ)ñ,
ô ,
ˆŒ˜Ñ(ð Ôð 	IÝ�HÔ$Ñ%Ô%×7Ò7ÀÐ7ÑHÔHÐHØˆˆˆˆˆr   r'   r
   ru   rH   Ú_DigestAuthChallengec                ó”  — |                      d¦  «        \  }}}|                     ¦   «         dk    sJ ‚i }t          |¦  «        D ]?}|                     ¦   «                              dd¦  «        \  }	}
t          |
¦  «        ||	<   Œ@	 |d                              ¦   «         }|d                              ¦   «         }|                     dd¦  «        }d	|v r|d	                              ¦   «         nd
}d|v r|d                              ¦   «         nd
}t          |||||¬¦  «        S # t          $ r}d}t          ||¬¦  «        |‚d
}~ww xY w)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Ú	algorithmrd   ÚopaqueNÚqop)r{   r|   r}   r~   r   z(Malformed Digest WWW-Authenticate headerrm   )Ú	partitionrp   r   ÚstripÚsplitr   ÚencodeÚgetrv   ÚKeyErrorr   )r   r   r'   ru   ÚschemeÚ_ÚfieldsÚheader_dictÚfieldÚkeyÚvaluer{   r|   r}   r~   r   ÚexcÚmessages                     r   rr   zDigestAuth._parse_challengeà   s{  € ð (×1Ò1°#Ñ6Ô6Ñˆ��6ð �|Š|‰~Œ~ Ò)Ð)Ð)Ð)à&(ˆÝ$ VÑ,Ô,ð 	.ð 	.ˆEØŸš™œ×,Ò,¨S°!Ñ4Ô4‰JˆC�Ý& u™~œ~ˆK˜ÑÐð	CØ Ô(×/Ò/Ñ1Ô1ˆEØ Ô(×/Ò/Ñ1Ô1ˆEØ#Ÿš¨°UÑ;Ô;ˆIØ7?À;Ð7NÐ7N�[ Ô*×1Ò1Ñ3Ô3Ð3ÐTXˆFØ16¸+Ð1EÐ1E�+˜eÔ$×+Ò+Ñ-Ô-Ð-È4ˆCÝ'Ø 5°IÀfÐRUðñ ô ð øõ ð 	Cð 	Cð 	CØ@ˆGÝ °Ð9Ñ9Ô9¸sÐBøøøøð	Cøøøs   ÂBD$ Ä$
EÄ.EÅEÚ	challengec           	     óÔ  ‡— | j         |j                             ¦   «                  Šdˆfd„}d                     | j        |j        | j        f¦  «        }|j        j        }d                     |j	         
                    ¦   «         |f¦  «        } ||¦  «        }d| j        z  }|                      | j        |j        ¦  «        }	| xj        dz  c_         ||¦  «        }
|j                             ¦   «                              d¦  «        r& |d                     |
|j        |	f¦  «        ¦  «        }
|                      |j        |¬	¦  «        }|€|
|j        |g}n|
|j        ||	||g}| j        |j        |j        | |d                     |¦  «        ¦  «        |j         
                    ¦   «         d
œ}|j        r
|j        |d<   |rd|d<   ||d<   |	|d<   d|                      |¦  «        z   S )NÚdataÚbytesr   c                ób   •—  ‰| ¦  «                              ¦   «                              ¦   «         S r8   )Ú	hexdigestrƒ   )r‘   Ú	hash_funcs    €r   ry   z-DigestAuth._build_auth_header.<locals>.digest  s)   ø€ Ø�9˜T‘?”?×,Ò,Ñ.Ô.×5Ò5Ñ7Ô7Ð7r   rK   s   %08xr   z-sessrm   )r>   r{   r|   Úurir'   r}   r~   ó   authr   ÚncÚcnoncezDigest )r‘   r’   r   r’   )rf   r}   ÚupperrM   rh   r{   ri   r_   Úraw_pathÚmethodrƒ   rk   Ú_get_client_noncer|   rp   ÚendswithÚ_resolve_qopr   r~   Ú_get_header_value)r   r   r�   ry   ÚA1ÚpathÚA2ÚHA2Únc_valuer™   ÚHA1r   Údigest_dataÚformat_argsr•   s                 @r   rB   zDigestAuth._build_auth_headerÿ   s  ø€ ð Ô4°YÔ5H×5NÒ5NÑ5PÔ5PÔQˆ	ð	8ð 	8ð 	8ð 	8ð 	8ð 	8ð �YŠY˜œ¨	¬¸¼ÐHÑIÔIˆàŒ{Ô#ˆØ�YŠY˜œ×-Ò-Ñ/Ô/°Ð6Ñ7Ô7ˆàˆf�R‰jŒjˆà˜TÔ.Ñ.ˆØ×'Ò'¨Ô(9¸9¼?ÑKÔKˆØÐÔ˜QÑÐÔàˆf�R‰jŒjˆØÔ×$Ò$Ñ&Ô&×/Ò/°Ñ8Ô8ð 	DØ�&˜Ÿš C¨¬¸&Ð#AÑBÔBÑCÔCˆCà×Ò 	¤°wÐÑ?Ô?ˆØˆ;à 	¤°Ð5ˆKˆKð  	¤°¸6À3ÈÐLˆKð œØ”_Ø”_ØØ˜˜tŸyšy¨Ñ5Ô5Ñ6Ô6Ø"Ô,×3Ò3Ñ5Ô5ð
ð 
ˆð Ôð 	5Ø$-Ô$4ˆK˜Ñ!Øð 	+Ø!(ˆK˜ÑØ (ˆK˜ÑØ$*ˆK˜Ñ!à˜4×1Ò1°+Ñ>Ô>Ñ>Ð>r   Únonce_countÚintr|   r’   c                óL  — t          |¦  «                             ¦   «         }||z  }|t          j        ¦   «                              ¦   «         z  }|t	          j        d¦  «        z  }t          j        |¦  «                             ¦   «         d d…                              ¦   «         S )Né   é   )	rH   rƒ   ÚtimeÚctimeÚosÚurandomÚhashlibÚsha1r”   )r   r©   r|   Úss       r   r�   zDigestAuth._get_client_nonce/  s�   € Ý�ÑÔ×#Ò#Ñ%Ô%ˆØ	ˆU‰
ˆØ	�TŒZ‰\Œ\× Ò Ñ"Ô"Ñ"ˆØ	�RŒZ˜‰]Œ]ÑˆåŒ|˜A‰Œ×(Ò(Ñ*Ô*¨3¨B¨3Ô/×6Ò6Ñ8Ô8Ð8r   Úheader_fieldsúdict[str, bytes]c                óÜ   — d}d}d}d}t          |                     ¦   «         ¦  «        D ]A\  }\  }}|dk    r|dz  }||vr|n|}	||	                     |t          |¦  «        ¦  «        z  }ŒB|S )N)r}   r   r˜   z{}="{}"z{}={}Ú r   z, )Ú	enumerateÚitemsÚformatr   )
r   rµ   ÚNON_QUOTED_FIELDSÚQUOTED_TEMPLATEÚNON_QUOTED_TEMPLATEÚheader_valueÚirŠ   rŒ   Útemplates
             r   r    zDigestAuth._get_header_value7  sž   € Ø6ÐØ#ˆØ%ÐàˆÝ!*¨=×+>Ò+>Ñ+@Ô+@Ñ!AÔ!Að 	Bð 	BÑˆA‰~��uØ�1ŠuˆuØ Ñ$�ð Ð 1Ð1Ð1ð  �à(ð ð
 ˜HŸOšO¨Eµ6¸%±=´=ÑAÔAÑAˆLˆLàÐr   r   úbytes | Nonec                óš   — |€d S t          j        d|¦  «        }d|v rdS |dgk    rt          d¦  «        ‚d|›d�}t          ||¬¦  «        ‚)Ns   , ?r—   s   auth-intz.Digest auth-int support is not yet implementedzUnexpected qop value "z" in digest authrm   )Úrer‚   ÚNotImplementedErrorr   )r   r   r   ÚqopsrŽ   s        r   rŸ   zDigestAuth._resolve_qopI  sj   € Øˆ;Ø�4ÝŒx˜ Ñ$Ô$ˆØ�dˆ?ˆ?Ø�7à�K�=Ò Ð Ý%Ð&VÑWÔWÐWàB¨3ÐBÐBÐBˆÝ˜G¨WÐ5Ñ5Ô5Ð5r   NrS   r-   )r   r	   r'   r
   ru   rH   r   rv   )r   r	   r�   rv   r   rH   )r©   rª   r|   r’   r   r’   )rµ   r¶   r   rH   )r   rÂ   r   r	   r   rÂ   )r.   r/   r0   r²   Úmd5r³   Úsha256Úsha512rf   Ú__annotations__r;   r   rr   rB   r�   r    rŸ   r   r   r   r   r   ¯   sò   € € € € € € àŒ{Ø”KØŒ|Ø”LØ”>ØœØ”>Øœð	Oð 	OÐð 	ð 	ð 	ñ 	ðð ð ð ðð ð ð ð>Cð Cð Cð Cð>.?ð .?ð .?ð .?ð`9ð 9ð 9ð 9ðð ð ð ð$6ð 6ð 6ð 6ð 6ð 6r   r   c                  óB   — e Zd ZU ded<   ded<   ded<   ded<   ded<   d	S )
rv   r’   r{   r|   rH   r}   rÂ   r~   r   N)r.   r/   r0   rÊ   r   r   r   rv   rv   W  sE   € € € € € € Ø€L€L�LØ€L€L�LØ€N€N�NØÐÐÑØÐÐÑÐÐr   rv   )Ú
__future__r   r²   r°   rÄ   r®   ÚtypingÚbase64r   Úurllib.requestr   Ú_exceptionsr   Ú_modelsr   r	   r
   Ú_utilsr   r   r   ÚTYPE_CHECKINGr   Ú__all__r   r3   r   r   r   Ú
NamedTuplerv   r   r   r   ú<module>rÖ      sù  ðØ "Ð "Ð "Ð "Ð "Ð "à €€€Ø 	€	€	€	Ø 	€	€	€	Ø €€€Ø €€€Ø Ð Ð Ð Ð Ð Ø *Ð *Ð *Ð *Ð *Ð *à &Ð &Ð &Ð &Ð &Ð &Ø /Ð /Ð /Ð /Ð /Ð /Ð /Ð /Ð /Ð /Ø -Ð -Ð -Ð -Ð -Ð -Ð -Ð -Ð -Ð -à	Ôð ØÐÐÐÐÐð ;Ð
:Ð
:€ðXð Xð Xð Xð Xñ Xô Xð Xðv
"ð 
"ð 
"ð 
"ð 
"�4ñ 
"ô 
"ð 
"ð ð  ð  ð  ð  �ñ  ô  ð  ð& ð  ð  ð  ð  �ñ  ô  ð  ð<e6ð e6ð e6ð e6ð e6�ñ e6ô e6ð e6ðPð ð ð ð ˜6Ô,ñ ô ð ð ð r   