Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/site-packages/werkzeug/datastructures/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/site-packages/werkzeug/datastructures/__pycache__/auth.cpython-312.pyc

�

'ٜgG'���ddlmZddlZddlZddlmZddlZddl	m
Z
ddl	mZddl	mZddl
mZejrddlZGd	�d
�ZGd�d�Zy)
�)�annotationsN�)�dump_header)�parse_dict_header)�quote_header_value�)�CallbackDictc��eZdZdZ		d
							dd�Zdd�Zdd�Zddd�Zdd�Zdd�Z	e
dd	��Zdd
�Zdd�Z
dd�Zy)�
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�datars    �G/usr/local/lib/python3.12/site-packages/werkzeug/datastructures/auth.py�__init__zAuthorization.__init__+s2����	�R��<��D����	���
�	�c�8�|jj|�Sr
�r�get�r�names  r�__getattr__zAuthorization.__getattr__C������"�"�4�(�(rc�8�|jj|�Sr
rrs  r�__getitem__zAuthorization.__getitem__Frrc�:�|jj||�Sr
r�r�key�defaults   rrzAuthorization.getI������"�"�3��0�0rc��||jvSr
�r�rr"s  r�__contains__zAuthorization.__contains__L����d�o�o�%�%rc���t|t�stS|j|jk(xr4|j|jk(xr|j
|j
k(Sr
)�
isinstancer�NotImplementedrrr�r�others  r�__eq__zAuthorization.__eq__OsU���%��/�!�!�
�J�J�$�)�)�#�
4����t�z�z�)�
4�� � �D�O�O�3�	
rc��|sy|jd�\}}}|j�}|j�}|dk(rC	tj|�j�jd�\}}}||||d��Sd|jd�vr||t|�d�S||d|�S#tjtf$rYywxYw)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� �basic�:)�username�password�=)�	partition�lower�strip�base64�	b64decode�decode�binascii�Error�UnicodeError�rstripr)�cls�value�scheme�_�restr4r5s       r�from_headerzAuthorization.from_headerYs������/�/�#�.����4�������z�z�|���W��
�(.�(8�(8��(>�(E�(E�(G�(Q�(Q�RU�(V�%��!�X��v�H�(�K�L�L��$�+�+�c�"�"��v�0��6��=�=��6�4��&�&���N�N�L�1�
��
�s�6B1�1C
�C
c��|jdk(rPtj|j�d|j��j��j
d�}d|��S|j�)|jj��d|j��S|jj��dt|j���S)ziProduce an ``Authorization`` header value representing this data.

        .. versionadded:: 2.0
        r2r3�asciizBasic r1)rr:�	b64encoder4r5�encoder<r�titlerr�rrBs  r�	to_headerzAuthorization.to_headerxs���
�9�9����$�$��=�=�/��4�=�=�/�2�9�9�;���f�W�o�
��E�7�#�#��:�:�!��i�i�o�o�'�(��$�*�*��6�6��)�)�/�/�#�$�A�k�$�/�/�&B�%C�D�Drc�"�|j�Sr
�rM�rs r�__str__zAuthorization.__str__�����~�~��rc�V�dt|�j�d|j��d�S�N�<r1�>�r�__name__rMrPs r�__repr__zAuthorization.__repr__��*���4��:�&�&�'�q����)9�(:�!�<�<r�NN)r�strr�dict[str, str | None] | Noner�
str | None�return�None�rr\r_r^r
�r"r\r#r^r_r^�r"r\r_�bool�r.�objectr_rd�rBr^r_zte.Self | None�r_r\)rX�
__module__�__qualname__�__doc__rrrrr(r/�classmethodrFrMrQrY�rrrrsw���8.2� �	���+���	�

��0)�)�1�&�
��'��'�<E�  �=rrc�X��eZdZdZ		d					dd�Zdd�Zedd��Zejdd��Zedd��Z	e	jdd��Z	edd��Z
e
jdd	��Z
d d
�Zd!d�Zd"d�Z
d#d
�Zd$�fd�Zd%d�Zd&d�Zd'd�Zd(d)d�Zed*d��Zdd�Zdd�Zdd�Z�xZS)+�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|�fd���_|�_d�_y)Nc�$���j�Sr
��_trigger_on_update�rDrs �r�<lambda>z*WWWAuthenticate.__init__.<locals>.<lambda>�s���d�5�5�7r)r8�_typer	�_parameters�_token�
_on_update)rr�valuesrs`   rrzWWWAuthenticate.__init__�s6����_�_�&��
�2>��7�3
������IM��rc�@�|j�|j|�yyr
)ryrPs rrsz"WWWAuthenticate._trigger_on_update�s���?�?�&��O�O�D�!�'rc��|jS)zDThe authorization scheme, like ``basic``, ``digest``, or ``bearer``.)rvrPs rrzWWWAuthenticate.type�s���z�z�rc�2�||_|j�yr
)rvrsrLs  rrzWWWAuthenticate.type�s����
����!rc��|jS�zA dict of parameters for the header. Only one of this or :attr:`token` should
        have a value for a given scheme.
        )rwrPs rrzWWWAuthenticate.parameters�s��
���rc�N��t|�fd���_�j�y)Nc�$���j�Sr
rrrts �rruz,WWWAuthenticate.parameters.<locals>.<lambda>�s����9P�9P�9Rr)r	rwrsrLs` rrzWWWAuthenticate.parameters�s���'��/R�S������!rc��|jSr)rxrPs rrzWWWAuthenticate.token�s��
�{�{�rc�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)rxrsrLs  rrzWWWAuthenticate.token�s��������!rc�8�|jj|�Sr
rr's  rrzWWWAuthenticate.__getitem__�s�����"�"�3�'�'rc�~�|�||jvr|j|=n||j|<|j�yr
�rrs)rr"rBs   r�__setitem__zWWWAuthenticate.__setitem__�s9���=��d�o�o�%��O�O�C�(�#(�D�O�O�C� ����!rc�\�||jvr|j|=|j�yyr
r�r's  r�__delitem__zWWWAuthenticate.__delitem__�s+���$�/�/�!�����$��#�#�%�"rc��||Sr
rmrs  rrzWWWAuthenticate.__getattr__�s���D�z�rc�:��|dvrt�|�||�y|||<y)N>rvrxryrw)�super�__setattr__)rrrB�	__class__s   �rr�zWWWAuthenticate.__setattr__�s$����C�C��G���e�,��D��Jrc�
�||=yr
rmrs  r�__delattr__zWWWAuthenticate.__delattr__�s	����Jrc��||jvSr
r&r's  rr(zWWWAuthenticate.__contains__�r)rc���t|t�stS|j|jk(xr4|j|jk(xr|j
|j
k(Sr
)r+ror,rrrr-s  rr/zWWWAuthenticate.__eq__sU���%��1�!�!�
�J�J�$�)�)�#�
4����t�z�z�)�
4�� � �D�O�O�3�	
rc�:�|jj||�Sr
rr!s   rrzWWWAuthenticate.getr$rc���|sy|jd�\}}}|j�}|j�}d|jd�vr||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
        Nr1r6)r7r8r9r@r)rArBrCrDrEs     rrFzWWWAuthenticate.from_headersk�����/�/�#�.����4�������z�z�|���$�+�+�c�"�"��v�0��6��=�=��6�4��&�&rc���|j�)|jj��d|j��S|jdk(rkg}|jj	�D]8\}}|dvrt|d��}nt|�}|j
|�d|����:ddj|���S|jj��dt|j���S)	zCProduce a ``WWW-Authenticate`` header value representing this data.r1�digest>�qop�nonce�realm�domain�opaqueF)�allow_tokenr6zDigest z, )	rrrKr�itemsr�append�joinr)rr�r"rBs    rrMzWWWAuthenticate.to_header%s����:�:�!��i�i�o�o�'�(��$�*�*��6�6��9�9�� ��E�"�o�o�3�3�5�
��U��G�G�.�u�%�H�E�.�u�5�E�����u�A�e�W�-�.�
6��T�Y�Y�u�-�.�/�/��)�)�/�/�#�$�A�k�$�/�/�&B�%C�D�Drc�"�|j�Sr
rOrPs rrQzWWWAuthenticate.__str__9rRrc�V�dt|�j�d|j��d�SrTrWrPs rrYzWWWAuthenticate.__repr__<rZrr[)rr\rzr]rr^)r_r`rh)rBr\r_r`)r_zdict[str, str | None])rBzdict[str, str]r_r`)r_r^)rBr^r_r`)r"r\r_r^)r"r\rBr^r_r`)r"r\r_r`ra)rr\rBr^r_r`)rr\r_r`rcrer
rbrg)rXrirjrkrrs�propertyr�setterrrrr�r�rr�r�r(r/rrlrFrMrQrY�
__classcell__)r�s@rroro�s����804� �	N��N�-�N��	N�"�����
�[�[�"��"�� �� ����"��"������\�\�"��"�(�"�&�
���&�
�1��'��'�,E�( �=rro)�
__future__rr:r=�collections.abc�abc�cabc�typing�t�httprrr�
structuresr	�
TYPE_CHECKING�typing_extensions�terrormrr�<module>r�sC��"�
�����$�%�$��?�?�"�{=�{=�|n=�n=r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists