Ë
    r™ãjÎ'  ã                  ó¬   — d dl mZ d dlZd dlZd dlm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 ej                  rd dlZ G d	„ d
«      Z G d„ d«      Zy)é    )ÚannotationsNé   )Údump_header)Úparse_dict_header)Úquote_header_valueé   )ÚCallbackDictc                  ó€   — e Zd ZdZ	 	 d	 	 	 	 	 	 	 dd„Zdd„Zdd„Zddd„Zdd„Zdd„Z	e
dd	„«       Zdd
„Zdd„Zdd„Zy)ÚAuthorizationa»  Represents the parts of an ``Authorization`` request header.

    :attr:`.Request.authorization` returns an instance if the header is set.

    An instance can be used with the test :class:`.Client` request methods' ``auth``
    parameter to send the header in test requests.

    Depending on the auth scheme, either :attr:`parameters` or :attr:`token` will be
    set. The ``Basic`` scheme's token is decoded into the ``username`` and ``password``
    parameters.

    For convenience, ``auth["key"]`` and ``auth.key`` both access the key in the
    :attr:`parameters` dict, along with ``auth.get("key")`` and ``"key" in auth``.

    .. versionchanged:: 2.3
        The ``token`` parameter and attribute was added to support auth schemes that use
        a token instead of parameters, such as ``Bearer``.

    .. versionchanged:: 2.3
        The object is no longer a ``dict``.

    .. versionchanged:: 0.5
        The object is an immutable dict.
    Nc                ó:   — || _         	 |€i }|| _        	 || _        y ©N)ÚtypeÚ
parametersÚtoken)ÚselfÚ	auth_typeÚdatar   s       úg/var/www/html/python-recuperauto-other/env/lib/python3.12/site-packages/werkzeug/datastructures/auth.pyÚ__init__zAuthorization.__init__+   s2   € ð ˆŒ	ØRàˆ<ØˆDàˆŒð	ð ˆŒ
ð	ó    c                ó8   — | j                   j                  |«      S r   ©r   Úget©r   Únames     r   Ú__getattr__zAuthorization.__getattr__C   ó   € Ø�‰×"Ñ" 4Ó(Ð(r   c                ó8   — | j                   j                  |«      S r   r   r   s     r   Ú__getitem__zAuthorization.__getitem__F   r   r   c                ó:   — | j                   j                  ||«      S r   r   ©r   ÚkeyÚdefaults      r   r   zAuthorization.getI   ó   € Ø�‰×"Ñ" 3¨Ó0Ð0r   c                ó   — || j                   v S r   ©r   ©r   r"   s     r   Ú__contains__zAuthorization.__contains__L   ó   € Ø�d—o‘oÐ%Ð%r   c                óÌ   — t        |t        «      st        S |j                  | j                  k(  xr4 |j                  | j                  k(  xr |j
                  | j
                  k(  S r   )Ú
isinstancer   ÚNotImplementedr   r   r   ©r   Úothers     r   Ú__eq__zAuthorization.__eq__O   sU   € Ü˜%¤Ô/Ü!Ð!ð �J‰J˜$Ÿ)™)Ñ#ò 4Ø—‘˜tŸz™zÑ)ò4à× Ñ  D§O¡OÑ3ð	
r   c                ó¦  — |sy|j                  d«      \  }}}|j                  «       }|j                  d«      }|dk(  rE	 t        j                  |d¬«      j                  «       j                  d«      \  }}} | |||dœ«      S d	|j                  d	«      v r | |t        |«      d«      S  | |d|«      S # t        j                  t        f$ r Y yw xY w)
zÄParse an ``Authorization`` header value and return an instance, or ``None``
        if the value is empty.

        :param value: The header value to parse.

        .. versionadded:: 2.3
        Nú ú 	ÚbasicT)Úvalidateú:)ÚusernameÚpasswordú=)Ú	partitionÚlowerÚstripÚbase64Ú	b64decodeÚdecodeÚbinasciiÚErrorÚUnicodeErrorÚrstripr   )ÚclsÚvalueÚschemeÚ_Úrestr6   r7   s          r   Úfrom_headerzAuthorization.from_headerY   sÛ   € ñ ØàŸ/™/¨#Ó.‰ˆ��4Ø—‘“ˆØ�z‰z˜%Ó ˆà�WÒðä×$Ñ$ T°DÔ9×@Ñ@ÓB×LÑLÈSÓQñ &�˜!˜Xñ �v¨HÀ(ÑKÓLÐLà�$—+‘+˜cÓ"Ñ"á�vÔ0°Ó6¸Ó=Ð=ñ �6˜4 Ó&Ð&øô —N‘N¤LÐ1ò Ùðús   Á 8B4 Â4CÃCc                óŽ  — | j                   dk(  rPt        j                  | j                  › d| j                  › �j                  «       «      j                  d«      }d|› �S | j                  �)| j                   j                  «       › d| j                  › �S | j                   j                  «       › dt        | j                  «      › �S )ziProduce an ``Authorization`` header value representing this data.

        .. versionadded:: 2.0
        r3   r5   ÚasciizBasic r1   )r   r<   Ú	b64encoder6   r7   Úencoder>   r   Útitler   r   ©r   rD   s     r   Ú	to_headerzAuthorization.to_headerz   s¬   € ð
 �9‰9˜ÒÜ×$Ñ$Ø—=‘=�/  4§=¡= /Ð2×9Ñ9Ó;óç‰f�W‹oð ð ˜E˜7Ð#Ð#à�:‰:Ð!Ø—i‘i—o‘oÓ'Ð(¨¨$¯*©*¨Ð6Ð6à—)‘)—/‘/Ó#Ð$ A¤k°$·/±/Ó&BÐ%CÐDÐDr   c                ó"   — | j                  «       S r   ©rO   ©r   s    r   Ú__str__zAuthorization.__str__Š   ó   € Ø�~‰~ÓÐr   c                óV   — dt        | «      j                  › d| j                  «       › d�S ©Nú<r1   ú>©r   Ú__name__rO   rR   s    r   Ú__repr__zAuthorization.__repr__�   ó*   € Ø”4˜“:×&Ñ&Ð' q¨¯©Ó)9Ð(:¸!Ð<Ð<r   ©NN)r   Ústrr   údict[str, str | None] | Noner   ú
str | NoneÚreturnÚNone©r   r^   ra   r`   r   ©r"   r^   r#   r`   ra   r`   ©r"   r^   ra   Úbool©r.   Úobjectra   rf   ©rD   r`   ra   zte.Self | None©ra   r^   )rZ   Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r(   r/   ÚclassmethodrH   rO   rS   r[   © r   r   r   r      sx   „ ñð8 .2Ø ð	àðð +ðð ð	ð
 
óó0)ó)ô1ó&ó
ð ò'ó ð'ó@Eó  ô=r   r   c                  óX  ‡ — e Zd ZdZ	 	 d	 	 	 	 	 dd„Zdd„Zedd„«       Zej                  dd„«       Zedd„«       Z	e	j                  dd„«       Z	edd„«       Z
e
j                  dd	„«       Z
d d
„Zd!d„Zd"d„Zd#d„Zd$ˆ fd„Zd%d„Zd&d„Zd'd„Zd(d)d„Zed*d„«       Zdd„Zdd„Zdd„Zˆ xZS )+ÚWWWAuthenticateaÜ  Represents the parts of a ``WWW-Authenticate`` response header.

    Set :attr:`.Response.www_authenticate` to an instance of list of instances to set
    values for this header in the response. Modifying this instance will modify the
    header value.

    Depending on the auth scheme, either :attr:`parameters` or :attr:`token` should be
    set. The ``Basic`` scheme will encode ``username`` and ``password`` parameters to a
    token.

    For convenience, ``auth["key"]`` and ``auth.key`` both act on the :attr:`parameters`
    dict, and can be used to get, set, or delete parameters. ``auth.get("key")`` and
    ``"key" in auth`` are also provided.

    .. versionchanged:: 2.3
        The ``token`` parameter and attribute was added to support auth schemes that use
        a token instead of parameters, such as ``Bearer``.

    .. versionchanged:: 2.3
        The object is no longer a ``dict``.

    .. versionchanged:: 2.3
        The ``on_update`` parameter was removed.
    c                ót   ‡ — |j                  «       ‰ _        t        |ˆ fd„«      ‰ _        |‰ _        d ‰ _        y )Nc                ó$   •— ‰j                  «       S r   ©Ú_trigger_on_update©rF   r   s    €r   ú<lambda>z*WWWAuthenticate.__init__.<locals>.<lambda>³   s   ø€ ˜d×5Ñ5Ó7€ r   )r:   Ú_typer	   Ú_parametersÚ_tokenÚ
_on_update)r   r   Úvaluesr   s   `   r   r   zWWWAuthenticate.__init__«   s6   ø€ ð —_‘_Ó&ˆŒ
Ü2>ØÓ7ó3
ˆÔð ˆŒØIMˆ�r   c                ó@   — | j                   �| j                  | «       y y r   )r{   rR   s    r   ru   z"WWWAuthenticate._trigger_on_update¸   s   € Ø�?‰?Ð&Ø�O‰O˜DÕ!ð 'r   c                ó   — | j                   S )zDThe authorization scheme, like ``basic``, ``digest``, or ``bearer``.)rx   rR   s    r   r   zWWWAuthenticate.type¼   s   € ð �z‰zÐr   c                ó2   — || _         | j                  «        y r   )rx   ru   rN   s     r   r   zWWWAuthenticate.typeÁ   s   € àˆŒ
Ø×ÑÕ!r   c                ó   — | j                   S ©zA dict of parameters for the header. Only one of this or :attr:`token` should
        have a value for a given scheme.
        )ry   rR   s    r   r   zWWWAuthenticate.parametersÆ   s   € ð
 ×ÑÐr   c                óN   ‡ — t        |ˆ fd„«      ‰ _        ‰ j                  «        y )Nc                ó$   •— ‰j                  «       S r   rt   rv   s    €r   rw   z,WWWAuthenticate.parameters.<locals>.<lambda>Ï   s   ø€ ¸×9PÑ9PÓ9R€ r   )r	   ry   ru   rN   s   ` r   r   zWWWAuthenticate.parametersÍ   s   ø€ ä'¨Ó/RÓSˆÔØ×ÑÕ!r   c                ó   — | j                   S r�   )rz   rR   s    r   r   zWWWAuthenticate.tokenÒ   s   € ð
 �{‰{Ðr   c                ó2   — || _         | j                  «        y)z–A token for the header. Only one of this or :attr:`parameters` should have a
        value for a given scheme.

        .. versionadded:: 2.3
        N)rz   ru   rN   s     r   r   zWWWAuthenticate.tokenÙ   s   € ð ˆŒØ×ÑÕ!r   c                ó8   — | j                   j                  |«      S r   r   r'   s     r   r   zWWWAuthenticate.__getitem__ã   s   € Ø�‰×"Ñ" 3Ó'Ð'r   c                ó~   — |€|| j                   v r| j                   |= n|| j                   |<   | j                  «        y r   ©r   ru   )r   r"   rD   s      r   Ú__setitem__zWWWAuthenticate.__setitem__æ   s9   € Øˆ=Ø�d—o‘oÑ%Ø—O‘O CÑ(à#(ˆD�O‰O˜CÑ à×ÑÕ!r   c                ó\   — || j                   v r| j                   |= | j                  «        y y r   rˆ   r'   s     r   Ú__delitem__zWWWAuthenticate.__delitem__ï   s+   € Ø�$—/‘/Ñ!Ø—‘ Ð$Ø×#Ñ#Õ%ð "r   c                ó   — | |   S r   ro   r   s     r   r   zWWWAuthenticate.__getattr__ô   s   € Ø�D‰zÐr   c                ó:   •— |dv rt         ‰| �  ||«       y || |<   y )N>   rx   rz   r{   ry   )ÚsuperÚ__setattr__)r   r   rD   Ú	__class__s      €r   r�   zWWWAuthenticate.__setattr__÷   s$   ø€ ØÐCÑCÜ‰GÑ  eÕ,àˆD�ŠJr   c                ó
   — | |= y r   ro   r   s     r   Ú__delattr__zWWWAuthenticate.__delattr__ý   s	   € Ø�‰Jr   c                ó   — || j                   v S r   r&   r'   s     r   r(   zWWWAuthenticate.__contains__   r)   r   c                óÌ   — t        |t        «      st        S |j                  | j                  k(  xr4 |j                  | j                  k(  xr |j
                  | j
                  k(  S r   )r+   rq   r,   r   r   r   r-   s     r   r/   zWWWAuthenticate.__eq__  sU   € Ü˜%¤Ô1Ü!Ð!ð �J‰J˜$Ÿ)™)Ñ#ò 4Ø—‘˜tŸz™zÑ)ò4à× Ñ  D§O¡OÑ3ð	
r   c                ó:   — | j                   j                  ||«      S r   r   r!   s      r   r   zWWWAuthenticate.get  r$   r   c                óÔ   — |sy|j                  d«      \  }}}|j                  «       }|j                  d«      }d|j                  d«      v r | |t	        |«      d«      S  | |d|«      S )zÆParse a ``WWW-Authenticate`` header value and return an instance, or ``None``
        if the value is empty.

        :param value: The header value to parse.

        .. versionadded:: 2.3
        Nr1   r2   r8   )r9   r:   r;   rB   r   )rC   rD   rE   rF   rG   s        r   rH   zWWWAuthenticate.from_header  sn   € ñ ØàŸ/™/¨#Ó.‰ˆ��4Ø—‘“ˆØ�z‰z˜%Ó ˆà�$—+‘+˜cÓ"Ñ"á�vÔ0°Ó6¸Ó=Ð=ñ �6˜4 Ó&Ð&r   c                ó  — | j                   �)| j                  j                  «       › d| j                   › �S | j                  s| j                  j                  «       S | j                  dk(  rkg }| j                  j	                  «       D ]8  \  }}|dv rt        |d¬«      }nt        |«      }|j                  |› d|› �«       Œ: ddj                  |«      › �S | j                  j                  «       › dt        | j                  «      › �S )	zCProduce a ``WWW-Authenticate`` header value representing this data.r1   Údigest>   ÚqopÚnonceÚrealmÚdomainÚopaqueF)Úallow_tokenr8   zDigest z, )	r   r   rM   r   Úitemsr   ÚappendÚjoinr   )r   rŸ   r"   rD   s       r   rO   zWWWAuthenticate.to_header'  sì   € à�:‰:Ð!Ø—i‘i—o‘oÓ'Ð(¨¨$¯*©*¨Ð6Ð6à�ŠØ—9‘9—?‘?Ó$Ð$à�9‰9˜Ò ØˆEà"Ÿo™o×3Ñ3Ó5ò /‘
��UØÐGÑGÜ.¨uÀ%ÔH‘Eä.¨uÓ5�Eà—‘ ˜u A e WÐ-Õ.ð/ð ˜TŸY™Y uÓ-Ð.Ð/Ð/à—)‘)—/‘/Ó#Ð$ A¤k°$·/±/Ó&BÐ%CÐDÐDr   c                ó"   — | j                  «       S r   rQ   rR   s    r   rS   zWWWAuthenticate.__str__>  rT   r   c                óV   — dt        | «      j                  › d| j                  «       › d�S rV   rY   rR   s    r   r[   zWWWAuthenticate.__repr__A  r\   r   r]   )r   r^   r|   r_   r   r`   )ra   rb   rj   )rD   r^   ra   rb   )ra   zdict[str, str | None])rD   zdict[str, str]ra   rb   )ra   r`   )rD   r`   ra   rb   )r"   r^   ra   r`   )r"   r^   rD   r`   ra   rb   )r"   r^   ra   rb   rc   )r   r^   rD   r`   ra   rb   )r   r^   ra   rb   re   rg   r   rd   ri   )rZ   rk   rl   rm   r   ru   Úpropertyr   Úsetterr   r   r   r‰   r‹   r   r�   r’   r(   r/   r   rn   rH   rO   rS   r[   Ú__classcell__)r�   s   @r   rq   rq   ‘   s  ø„ ñð8 04Ø ð	NàðNð -ðNð ó	Nó"ð òó ðð 
‡[�[ò"ó ð"ð ò ó ð ð ×Ñò"ó ð"ð òó ðð ‡\�\ò"ó ð"ó(ó"ó&ó
õóó&ó
ô1ð ò'ó ð'ó,Eó. ÷=r   rq   )Ú
__future__r   r<   r?   Úcollections.abcÚabcÚcabcÚtypingÚtÚhttpr   r   r   Ú
structuresr	   ÚTYPE_CHECKINGÚtyping_extensionsÚter   rq   ro   r   r   ú<module>r²      sC   ðÝ "ã Û Ý Û å Ý $Ý %Ý $à‡?‚?Û"÷}=ñ }=÷@q=ò q=r   