403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/openid/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/openid/__pycache__/message.cpython-311.pyc
�

|=�^�X���dZgd�ZddlZddlZddlZddlZddlmZddlm	Z		ej
��Zn
#e$rdZYnwxYwdZ
dZdZd	ZeefZd
Zejd��Zejd��Zejd
��ZdZgd�ZGd�de��ZGd�de��Ze��ZiaGd�de��Z d�Z!Gd�de��Z"Gd�de��Z#dS)z#Extension argument processing code
)
�Message�NamespaceMap�
no_default�registerNamespaceAlias�	OPENID_NS�BARE_NS�
OPENID1_NS�
OPENID2_NS�SREG_URI�IDENTIFIER_SELECT�N)�oidutil)�kvformz2http://specs.openid.net/auth/2.0/identifier_selectzhttp://openid.net/sreg/1.0zhttp://openid.net/signon/1.0zhttp://openid.net/signon/1.1z http://specs.openid.net/auth/2.0zNull namespacezOpenID namespacezBare namespacei�)�ns�mode�error�	return_to�contact�	reference�signed�
assoc_type�session_type�
dh_modulus�dh_gen�dh_consumer_public�
claimed_id�identity�realm�invalidate_handle�op_endpoint�response_nonce�sig�assoc_handle�
trust_root�openidc��eZdZdZdS)�UndefinedOpenIDNamespaceznRaised if the generic OpenID namespace is accessed when there
    is no OpenID namespace set for this message.N��__name__�
__module__�__qualname__�__doc__���0/usr/lib/python3/dist-packages/openid/message.pyr&r&Qs������4�4�4�4r-r&c��eZdZdZd�ZdS)�InvalidOpenIDNamespacezxRaised if openid.ns is not a recognized value.

    For recognized values, see L{Message.allowed_openid_namespaces}
    c�>�d}|jr|d|jd��z
}|S)NzInvalid OpenID Namespace� r��args)�self�ss  r.�__str__zInvalidOpenIDNamespace.__str__\s-��&���9�	*�
�A�$�)�A�,�,�)�)�A��r-N)r(r)r*r+r7r,r-r.r0r0Vs-��������
����r-r0c��eZdZdZdS)�NamespaceAliasRegistrationErrorzL
    Raised when an alias or namespace URI has already been registered.
    Nr'r,r-r.r9r9ls��������	�Dr-r9c��t�|��|krdS|tt�����vrt	d|�d����|tvrt	d|�d����|t|<dS)a:
    Registers a (namespace URI, alias) mapping in a global namespace
    alias map.  Raises NamespaceAliasRegistrationError if either the
    namespace URI or alias has already been registered with a
    different value.  This function is required if you want to use a
    namespace with an OpenID 1 message.
    NzNamespace uri z already registeredzAlias )�registered_aliases�get�list�valuesr9)�
namespace_uri�aliass  r.rrss������e�$�$�
�5�5�����/�6�6�8�8�9�9�9�9�-�-�5B�]�]�E�G�G�	G�
�"�"�"�-�-�/4�u�u�/8�9�9�	9�!.��u���r-c��eZdZdZeeegZd!d�Ze	d���Z
e	d���Zd�Zd�Z
d�Zd	�Zd
�Zd�Zd�Ze	e��Zd
�Zd�Zd�Z		d"d�Zd�Zd�Zd�Zd�Zd�Zd�Zd!d�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$d!d �Z%dS)#ra�
    In the implementation of this object, None represents the global
    namespace as well as a namespace with no key.

    @cvar namespaces: A dictionary specifying specific
        namespace-URI to alias mappings that should be used when
        generating namespace aliases.

    @ivar ns_args: two-level dictionary of the values in this message,
        grouped by namespace URI. The first level is the namespace
        URI.
    Nc��i|_t��|_|�	d|_dS|tv}|�||��dS)z�Create an empty Message.

        @raises InvalidOpenIDNamespace: if openid_namespace is not in
            L{Message.allowed_openid_namespaces}
        N)r4r�
namespaces�_openid_ns_uri�OPENID1_NAMESPACES�setOpenIDNamespace)r5�openid_namespace�implicits   r.�__init__zMessage.__init__�sR����	�&�.�.����#�"&�D����'�+=�=�H��#�#�$4�h�?�?�?�?�?r-c�^�|��}i}|���D]v\}}t|t��rtd|�����	|�dd��\}}n#t
$rd}YnwxYw|dkr||jt|f<�q|||<�w|�|��|S)zAConstruct a Message containing a set of POST arguments.

        zLquery dict must have one value for each key, not lists of values.  Query is �.�Nr$)	�items�
isinstancer=�	TypeError�split�
ValueErrorr4r�_fromOpenIDArgs)�clsr4r5�openid_args�key�value�prefix�rests        r.�fromPostArgszMessage.fromPostArgs�s���
�s�u�u�����*�*�,�,�
	*�
	*�J�C���%��&�&�
P��i�GK�t�!O�P�P�P�
�"�y�y��a�0�0�������
�
�
�����
������!�!�,1��	�7�C�.�)�)�$)��D�!�!����[�)�)�)��s�A(�(A7�6A7c�D�|��}|�|��|S)z�Construct a Message from a parsed KVForm message.

        @raises InvalidOpenIDNamespace: if openid.ns is not in
            L{Message.allowed_openid_namespaces}
        )rR)rSrTr5s   r.�fromOpenIDArgszMessage.fromOpenIDArgs�s(���s�u�u�����[�)�)�)��r-c���g}|���D]�\}}	|�dd��\}}n#t$rt}|}YnwxYw|dkr|j�||���[|tkr|dkr|�|d����|�|||f����|���s|�td��|D]�\}}}|j�
|��}|�P|�|��}|�|���}|�d|��}n|j�||d���|�|||����dS)NrKrLrFT)rH)
rMrPrQ�NULL_NAMESPACErC�addAliasrF�append�getOpenIDNamespacer�getNamespaceURI�_getDefaultNamespace�setArg)r5rT�ns_argsrXrV�ns_alias�ns_key�ns_uris        r.rRzMessage._fromOpenIDArgs�s�����'�,�,�.�.�
	:�
	:�K�D�%�
�#'�:�:�c�1�#5�#5� ��&�&���
�
�
�)������
�����4�����(�(���7�7�7�7��^�+�+��$����'�'��u�5�5�5�5�����&�%�8�9�9�9�9��&�&�(�(�	6��#�#�J��5�5�5�*1�	/�	/�%�X�v�u��_�4�4�X�>�>�F��~��2�2�8�<�<���>�!�4�4�6�6�F�(0���&�&�9�F�F��O�,�,�V�X��,�M�M�M��K�K����.�.�.�.�	/�	/s�7�A
�A
c�b�|���rt�|��SdS)zWOpenID 1 compatibility: look for a default namespace URI to
        use for this alias.N)�	isOpenID1r;r<)r5�
mystery_aliass  r.rbzMessage._getDefaultNamespace�s/���>�>���	�%�)�)�-�8�8�8��4r-c���t|t��rt|d���}||jvrt	|���|j�|t|��||_dS)z�Set the OpenID namespace URI used in this message.

        @raises InvalidOpenIDNamespace: if the namespace is not in
            L{Message.allowed_openid_namespaces}
        �utf-8��encodingN)	rN�bytes�str�allowed_openid_namespacesr0rCr^r]rD)r5�
openid_ns_urirHs   r.rFzMessage.setOpenIDNamespacesm���m�U�+�+�	A��
��@�@�@�M��� >�>�>�(��7�7�7��� � ����I�I�I�+����r-c��|jS�N)rD�r5s r.r`zMessage.getOpenIDNamespaces���"�"r-c�8�|���tvSrt)r`rErus r.rizMessage.isOpenID1s���&�&�(�(�,>�>�>r-c�<�|���tkSrt)r`r	rus r.�	isOpenID2zMessage.isOpenID2s���&�&�(�(�J�6�6r-c�P�|�tj|����S)z%Create a Message from a KVForm string)r[r�kvToDict)rS�
kvform_strings  r.�
fromKVFormzMessage.fromKVForms ���!�!�&�/�-�"@�"@�A�A�Ar-c�*�tj|��Srt)�copy�deepcopyrus r.r~zMessage.copys���}�T�"�"�"r-c�p�i}|j���D]J\}}|j�|��r� |tkrd}nd|z}t	j|��||<�K|j���D]5\\}}}|�||��}t	j|��||<�6|S)zk
        Return all arguments with openid. in front of namespaced arguments.
        @return bytes
        z	openid.nsz
openid.ns.)rCrM�
isImplicitr]r
�	toUnicoder4�getKey)r5r4rgr@rfrVrUs       r.�
toPostArgszMessage.toPostArgs s���
��"�_�2�2�4�4�	5�	5�M�F�E���)�)�&�1�1�
����&�&�$���%��-��"�,�V�4�4�D��L�L�'+�y���'8�'8�	1�	1�#��V�V�e��+�+�f�f�-�-�C��)�%�0�0�D��I�I��r-c���|���}i}|���D]6\}}|�d��std���|||dd�<�7|S)zWReturn all namespaced arguments, failing if any
        non-namespaced arguments exist.�openid.znThis message can only be encoded as a POST, because it contains arguments that are not prefixed with "openid."�N)r�rM�
startswithrQ)r5�	post_args�kvargs�k�vs     r.�toArgszMessage.toArgs8s~���O�O�%�%�	����O�O�%�%�	"�	"�D�A�q��<�<�	�*�*�
"� �N�O�O�O�!"��q����u�
�
��
r-�Continuec��t�td���|�J�t�d��}|r$|���D]\}}||j|<�tj|��|jd<d|jd<d|jd<d	|jd
<|������D]]\}}dtj|��tj|��d�}|�t�d
|�����^t�d
dtj|��d���}	|�|	��tt�
|d���d���S)a:Generate HTML form markup that contains the values in this
        message, to be HTTP POSTed as x-www-form-urlencoded UTF-8.

        @param action_url: The URL to which the form will be POSTed
        @type action_url: str

        @param form_tag_attrs: Dictionary of attributes to be added to
            the form tag. 'accept-charset' and 'enctype' have defaults
            that can be overridden. If a value is supplied for
            'action' or 'method', it will be replaced.
        @type form_tag_attrs: {unicode: unicode}

        @param submit_text: The text that will appear on the submit
            button for this form.
        @type submit_text: unicode

        @returns: A string containing (X)HTML markup for a form that
            encodes the values in this Message object.
        @rtype: str
        Nz#This function requires ElementTree.�form�action�post�methodzUTF-8zaccept-charsetz!application/x-www-form-urlencoded�enctype�hidden)�type�namerV�input�submit)r�rVrlrm)�ElementTree�RuntimeError�ElementrM�attribr
r�r�r_rp�tostring)
r5�
action_url�form_tag_attrs�submit_textr�r��attrrV�attrsr�s
          r.�toFormMarkupzMessage.toFormMarkupHs���0���D�E�E�E��%�%�%��"�"�6�*�*���	)�,�2�2�4�4�
)�
)�
��d�$(���D�!�!� '� 1�*� =� =���H�� &���H��(/���$�%�!D���I���?�?�,�,�2�2�4�4�	=�	=�K�D�%� ��)�$�/�/� �*�5�1�1���E�

�K�K��+�+�G�U�;�;�<�<�<�<��$�$����'��4�4�
6�
6�7�7��	
���F�����;�'�'��w�'�?�?�#�%�%�%�	%r-c�P�tj||�����S)z\Generate a GET URL with the parameters in this message
        attached as query parameters.)r
�
appendArgsr�)r5�base_urls  r.�toURLz
Message.toURL�s!���!�(�D�O�O�,=�,=�>�>�>r-c�N�tj|�����S)z�Generate a KVForm string that contains the parameters in
        this message. This will fail if the message contains arguments
        outside of the 'openid.' prefix.
        )r�dictToKVr�rus r.�toKVFormzMessage.toKVForm�s��
��t�{�{�}�}�-�-�-r-c��t|��������}tj�|��S)z#Generate an x-www-urlencoded string)�sortedr�rM�urllib�parse�	urlencode)r5r4s  r.�toURLEncodedzMessage.toURLEncoded�s;���d�o�o�'�'�-�-�/�/�0�0���|�%�%�d�+�+�+r-c���t|t��rt|d���}|tkr|j�td���|j}|tkr't|t��std|�����|tkrVd|vrRd}tj	||fzt��|dkr,d	}tj	|tfzt��tS|S)
z�Convert an input value into the internally used values of
        this object

        @param namespace: The string or constant to convert
        @type namespace: str or unicode or BARE_NS or OPENID_NS
        rlrmNzOpenID namespace not setz6Namespace must be BARE_NS, OPENID_NS or a string. got �:z7OpenID 2.0 namespace identifiers SHOULD be URIs. Got %r�sregz'Using %r instead of "sreg" as namespace)rNrorprrDr&rrO�warnings�warn�DeprecationWarningr
)r5�	namespace�fmts   r.�_fixNSzMessage._fixNS�s����i��'�'�	9��I��8�8�8�I��	�!�!��"�*�.�/I�J�J�J� �/�	�����
�9�c�(B�(B���)������
�����C�y�$8�$8�K�C��M�#��
�-�/A�B�B�B��F�"�"�?���
��8�,�&�&�*�*�*� ���r-c�B�|�|��}||f|jvSrt�r�r4)r5r�rfs   r.�hasKeyzMessage.hasKey�s%���K�K�	�*�*�	��6�"�d�i�/�/r-c��|�|��}|tkr|S|j�|��}|�dS|tkr|}n|�d|��}d|zS)z0Get the key for a particular namespaced argumentNrKr�)r�rrC�getAliasr])r5r�rfre�tails     r.r�zMessage.getKey�sr���K�K�	�*�*�	������M��?�+�+�I�6�6�����4��~�%�%��D�D�&�h�h���/�D��4��r-c��|�|��}||f}	|j|S#t$r|turt||f���|cYSwxYw)a�Get a value for a namespaced key.

        @param namespace: The namespace in the message for this key
        @type namespace: str

        @param key: The key to get within this namespace
        @type key: str

        @param default: The value to use if this key is absent from
            this message. Using the special value
            openid.message.no_default will result in this method
            raising a KeyError instead of returning the default.

        @rtype: str or the type of default
        @raises KeyError: if default is no_default
        @raises UndefinedOpenIDNamespace: if the message has not yet
            had an OpenID namespace set
        )r�r4�KeyErrorr)r5r�rU�default�args_keys     r.�getArgzMessage.getArg�ss��&�K�K�	�*�*�	��s�#��	��9�X�&�&���	�	�	��*�$�$��	�3�/�0�0�0�����		���s�(�&A�Ac�p�|�|��}g}|j���D]w\\}}}||krit|t��rt|d���}n|}t|t��rt|d���}n|}|�||f���xt|��S)z�Get the arguments that are defined for this namespace URI

        @returns: mapping from namespaced keys to values
        @returntype: dict of {str:bytes}
        rlrm)r�r4rMrNrorpr_�dict)r5r�r4�pair_nsrfrVr�r�s        r.�getArgszMessage.getArgs�s����K�K�	�*�*�	���*.�)�/�/�*;�*;�
	$�
	$�&�
�g�v���)�#�#��f�e�,�,���F�W�5�5�5�A�A��A��e�U�+�+���E�G�4�4�4�A�A��A����Q��F�#�#�#���D�z�z�r-c��|�|��}|���D]\}}|�|||���dS)z�Set multiple key/value pairs in one call

        @param updates: The values to set
        @type updates: {unicode:unicode}
        N)r�rMrc)r5r��updatesr�r�s     r.�
updateArgszMessage.updateArgs�sS���K�K�	�*�*�	��M�M�O�O�	)�	)�D�A�q��K�K�	�1�a�(�(�(�(�	)�	)r-c���|�J�|�J�|�|��}t|t��rt|d���}||j||f<|t
ur|j�|��dSdS)z'Set a single argument in this namespaceNrlrm)r�rNrorpr4rrC�add)r5r�rUrVs    r.rczMessage.setArgs�������� � � ��K�K�	�*�*�	��e�U�#�#�	1����0�0�0�E�&+��	�9�c�"�#��W�$�$��O���	�*�*�*�*�*�%�$r-c�D�|�|��}|j||f=dSrtr�)r5r�rUs   r.�delArgzMessage.delArgs(���K�K�	�*�*�	��I�y�#�&�'�'�'r-c�L�d|jj�d|jj�d|j�d�S)N�<rKr2�>)�	__class__r)r(r4rus r.�__repr__zMessage.__repr__s4���#�~�8�8�8�#�~�6�6�6��	�	�	�C�	Cr-c�"�|j|jkSrtr3�r5�others  r.�__eq__zMessage.__eq__s���y�E�J�&�&r-c��||kSrtr,r�s  r.�__ne__zMessage.__ne__s���E�M�"�"r-c��|dkr|���S|�d��r:|j�|dd���}|�|tkrt
�|S|S	|�dd��\}}|j�|��}n#t$rd}YnwxYw|�|}|���}|�|||��S)Nrzns.�rKrL)	r`r�rCrarr�rPrQr�)r5�aliased_keyr��urir@rUrs       r.�
getAliasedArgzMessage.getAliasedArg!s���$����*�*�,�,�,��!�!�%�(�(�	��/�1�1�+�a�b�b�/�B�B�C��{��j�(�(�"�N�"�N��
�	8�$�*�*�3��2�2�J�E�3�
��0�0��7�7�B�B��	�	�	�	��B�B�B�	�����:��C��(�(�*�*�B��{�{�2�s�G�,�,�,s�+B�B.�-B.rt)Nr�)&r(r)r*r+r�THE_OTHER_OPENID1_NSr	rqrI�classmethodrYr[rRrbrFr`rirxr|r~r�r�r�r�r�r�r�r�r�r�r�r�rcr�r�r�r�r�r,r-r.rr�s3��������",�-A�:� N��@�@�@�@�����[��6����[��#/�#/�#/�J	�	�	�,�,�,�#�#�#�?�?�?�7�7�7�B�B�B���Z�(�(�J�#�#�#����0���$%)�!+�7%�7%�7%�7%�r?�?�?�
.�.�.�,�,�,�
 � � �D0�0�0� � � �&����:���*)�)�)�
+�
+�
+�(�(�(�C�C�C�'�'�'�#�#�#�-�-�-�-�-�-r-rc�V�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	dd	�Z
d
�Zd�Zd�Z
d
�ZdS)rzBMaintains a bijective map between namespace uris and aliases.
    c�0�i|_i|_g|_dSrt)�alias_to_namespace�namespace_to_alias�implicit_namespacesrus r.rIzNamespaceMap.__init__Bs ��"$���"$���#%�� � � r-c�6�|j�|��Srt)r�r<�r5r?s  r.r�zNamespaceMap.getAliasGs���&�*�*�=�9�9�9r-c�6�|j�|��Srt)r�r<)r5r@s  r.razNamespaceMap.getNamespaceURIJs���&�*�*�5�1�1�1r-c�*�t|j��S)z*Return an iterator over the namespace URIs)�iterr�rus r.�iterNamespaceURIszNamespaceMap.iterNamespaceURIsM����D�+�,�,�,r-c�*�t|j��S)z#Return an iterator over the aliases)r�r�rus r.�iterAliaseszNamespaceMap.iterAliasesQr�r-c�4�|j���S)zWIterate over the mapping

        @returns: iterator of (namespace_uri, alias)
        )r�rMrus r.rMzNamespaceMap.itemsUs��
�&�,�,�.�.�.r-Fc��t|t��rt|d���}|tvs
J|�d����t|t��rd|vs
J|�d����|j�|��}|� ||krd}|||||fz}t
|���|j�|��}|�||krd}t
||||fz���|tks4t|��ttfvsJt|�����||jvsJ�||j|<||j|<|r|j�|��|S)	zBAdd an alias from this namespace URI to the desired alias
        rlrmz" is not an allowed namespace aliasrKz must not contain a dotNz;Cannot map %r to alias %r. %r is already mapped to alias %rz;Cannot map %r to alias %r. It is already mapped to alias %r)
rNrorp�OPENID_PROTOCOL_FIELDSr�r<r�r�r]r��reprr�r_)r5r?�
desired_aliasrH�current_namespace_urir��msgr@s        r.r^zNamespaceMap.addAlias\s����m�U�+�+�	A��
��@�@�@�M��$:�:�:�:�9F���H�;�:�:�
�m�S�)�)�	B��m�+�+�+�2?�-�-�A�,�+�+�
!%� 7� ;� ;�M� J� J��!�-�%��6�6�6�C���
�7L�&�(�(�C��3�-�-���'�+�+�M�:�:�����-�!7�!7�6�C��3�-���!F�F�G�G�G���/�/��]�#�#��S�z�1�1�1�D��4G�4G�1�1�1��D�$<�<�<�<�<�1>���
�.�1>���
�.��	;��$�+�+�M�:�:�:��r-c���|j�|��}|�|Sd}	dt|��z}	|�||��|S#t$r|dz
}YnwxYw�A)zXAdd this namespace URI to the mapping, without caring what
        alias it ends up withNrT�extrL)r�r<rpr^r�)r5r?r@�is    r.r�zNamespaceMap.add�s����'�+�+�M�:�:�����L�
��	��C��F�F�N�E�
��
�
�m�U�3�3�3�����
�
�
��Q�����
����		s�A
�
A�Ac��||jvSrt)r�r�s  r.�	isDefinedzNamespaceMap.isDefined�s���� 7�7�7r-c�,�|�|��Srt)r�r�s  r.�__contains__zNamespaceMap.__contains__�s���~�~�m�,�,�,r-c��||jvSrt)r�r�s  r.r�zNamespaceMap.isImplicit�s���� 8�8�8r-N)F)r(r)r*r+rIr�rar�r�rMr^r�r�r�r�r,r-r.rr>s���������&�&�&�
:�:�:�2�2�2�-�-�-�-�-�-�/�/�/�,�,�,�,�\$�$�$�*8�8�8�-�-�-�9�9�9�9�9r-r)$r+�__all__r~r��urllib.requestr��urllib.errorr$r
r�importElementTreer��ImportErrorrr
rr�rEr	�Symbolr]rr�OPENID1_URL_LIMITr�rQr&r0�objectrr;�	Exceptionr9rrrr,r-r.�<module>r	sF�������������������������������������+�'�+�-�-�K�K�������K�K�K�����I��(��,�
�5���!5�5��0�
� ��� 0�1�1��
�G�N�-�.�.�	��'�.�)�
*�
*��������44�4�4�4�4�z�4�4�4�

�
�
�
�
�Z�
�
�
��V�X�X�
���	�	�	�	�	�i�	�	�	�.�.�.�0p-�p-�p-�p-�p-�f�p-�p-�p-�f
h9�h9�h9�h9�h9�6�h9�h9�h9�h9�h9s�4�>�>

Youez - 2016 - github.com/yon3zu
LinuXploit