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/extensions/draft/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

8O�^}@����dZgd�ZddlmZddlZddlZdZdZdZdZ	d	Z
ejd
��ZdZ
dZGd
�de��ZGd�de��Zee_Gd�de��Zee_dS)z�An implementation of the OpenID Provider Authentication Policy
Extension 1.0, Draft 5

@see: http://openid.net/developers/specs/

@since: 2.1.0
)�Request�Response�ns_uri�AUTH_PHISHING_RESISTANT�AUTH_MULTI_FACTOR�AUTH_MULTI_FACTOR_PHYSICAL�LEVELS_NIST�LEVELS_JISA�)�	ExtensionNz+http://specs.openid.net/extensions/pape/1.0zEhttp://schemas.openid.net/pape/policies/2007/06/multi-factor-physicalz<http://schemas.openid.net/pape/policies/2007/06/multi-factorzBhttp://schemas.openid.net/pape/policies/2007/06/phishing-resistantz4http://schemas.openid.net/pape/policies/2007/06/nonez$^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\dZ$zDhttp://csrc.nist.gov/publications/nistpubs/800-63/SP800-63V1_0_2.pdfz*http://www.jisa.or.jp/spec/auth_level.htmlc�2�eZdZeed�Zd�Zdd�Zd�Zd�Z	dS)�
PAPEExtension)�nist�jisac�B�|j���|_dS�N)�_default_auth_level_aliases�copy�auth_level_aliases��selfs �?/usr/lib/python3/dist-packages/openid/extensions/draft/pape5.py�__init__zPAPEExtension.__init__/s��"&�"B�"G�"G�"I�"I�����Nc��|�;	|�|��}nX#t$r|���}Yn8wxYw|j�|��}|�||krtd|||���||j|<dS)a&Add an auth level URI alias to this request.

        @param auth_level_uri: The auth level URI to send in the
            request.

        @param alias: The namespace alias to use for this auth level
            in this message. May be None if the alias is not
            important.
        Nz-Attempting to redefine alias %r from %r to %r)�	_getAlias�KeyError�_generateAliasr�get�r�auth_level_uri�alias�existing_uris    r�_addAuthLevelAliasz PAPEExtension._addAuthLevelAlias2s����=�
.����~�6�6�����
.�
.�
.��+�+�-�-����
.���� �2�6�6�u�=�=�L��'�L�N�,J�,J��N�$�l�N�D�D�D�*8����&�&�&s��;�;c�j�td��D]}d|fz}||jvr|cS�td���)z!Return an unused auth level aliasi�zcust%dz,Could not find an unused alias (tried 1000!))�ranger�RuntimeError)r�ir!s   rrzPAPEExtension._generateAliasIsP���t���	�	�A���u�$�E��D�3�3�3�����4��I�J�J�Jrc�r�|j���D]\}}||kr|cS�t|���)zmReturn the alias for the specified auth level URI.

        @raises KeyError: if no alias is defined
        )r�itemsrrs    rrzPAPEExtension._getAliasRsP��
&*�%<�%B�%B�%D�%D�	�	�!�U�L���-�-�����.��~�&�&�&rr)
�__name__�
__module__�__qualname__rr	rrr#rr�rrr
r
)sn��������#�#��
J�J�J�8�8�8�8�.K�K�K�	'�	'�	'�	'�	'rr
c�r��eZdZdZdZ			d
�fd�	Zd�Zd�Zdd�Zd�Z	d	�Z
ee
��Z
dd�Zd�Z
�xZS)raDA Provider Authentication Policy request, sent from a relying
    party to a provider

    @ivar preferred_auth_policies: The authentication policies that
        the relying party prefers
    @type preferred_auth_policies: [str]

    @ivar max_auth_age: The maximum time, in seconds, that the relying
        party wants to allow to have elapsed before the user must
        re-authenticate
    @type max_auth_age: int or NoneType

    @ivar preferred_auth_level_types: Ordered list of authentication
        level namespace URIs

    @type preferred_auth_level_types: [str]
    �papeNc����tt|�����|�g}||_||_g|_|�|D]}|�|���dSdSr)�superrr�preferred_auth_policies�max_auth_age�preferred_auth_level_types�addAuthLevel)rr2r3r4�
auth_level�	__class__s     �rrzRequest.__init__ss����	�g�t���%�%�'�'�'�"�*�&(�#�'>��$�(���*,��'�%�1�8�
.�
.�
��!�!�*�-�-�-�-�2�1�
.�
.rc�J�t|jp|jdup|j��Sr)�boolr2r3r4rs r�__bool__zRequest.__bool__�s4���D�0�4��%�T�1�4��3�5�5�	5rc�P�||jvr|j�|��dSdS)a�Add an acceptable authentication policy URI to this request

        This method is intended to be used by the relying party to add
        acceptable authentication types to the request.

        @param policy_uri: The identifier for the preferred type of
            authentication.
        @see: http://openid.net/specs/openid-provider-authentication-policy-extension-1_0-05.html#auth_policies
        N)r2�append�r�
policy_uris  r�addPolicyURIzRequest.addPolicyURI�s7���T�9�9�9��(�/�/�
�;�;�;�;�;�:�9rc�|�|�||��||jvr|j�|��dSdSr)r#r4r<)rr r!s   rr5zRequest.addAuthLevel�sL�������6�6�6���!@�@�@��+�2�2�>�B�B�B�B�B�A�@rc�4�dd�|j��i}|j�t|j��|d<|jrVg}|jD]4}|�|��}||d|��<|�|���5d�|��|d<|S)�/@see: C{L{Extension.getExtensionArgs}}
        r2� Nr3�auth_level.ns.r4)�joinr2r3�strr4rr<)r�ns_args�preferred_typesr r!s     r�getExtensionArgszRequest.getExtensionArgs�s���
&�s�x�x��0L�'M�'M�
����(�&)�$�*;�&<�&<�G�N�#��*�	N� �O�"&�"A�
.�
.�����~�6�6��:H���e�e�6�7��&�&�u�-�-�-�-�47�H�H�_�4M�4M�G�0�1��rc���|��}|j�|j��}|j���}|ikrdS|�||��|S)zaInstantiate a Request object from the arguments in a
        C{checkid_*} OpenID message
        N)�message�getArgsr�	isOpenID1�parseExtensionArgs)�cls�requestr�args�
is_openid1s     r�fromOpenIDRequestzRequest.fromOpenIDRequest�sb���s�u�u����&�&�t�{�3�3���_�.�.�0�0�
��2�:�:��4�����j�1�1�1��rFc���g|_|�d��}|rat|t��rt	|d���}|�d��D]%}||jvr|j�|���&|�d��}d|_|r)	t|��|_n#t$r|r�YnwxYw|�d��}|r�|�
�����}|D]p}	d|	��}
	||
}n/#t$r"|r|j�|	��}nd}YnwxYw|�|rtd	|	�d
�����X|�
||	���odSdS)a-Set the state of this request to be that expressed in these
        PAPE arguments

        @param args: The PAPE arguments without a namespace

        @param strict: Whether to raise an exception if the input is
            out of spec or otherwise malformed. If strict is false,
            malformed input will be ignored.

        @param is_openid1: Whether the input should be treated as part
            of an OpenID1 request

        @rtype: None

        @raises ValueError: When the max_auth_age is not parseable as
            an integer
        r2zutf-8)�encodingrCr3Nr4rDzpreferred auth level z is not defined in this message)r2r�
isinstance�bytesrF�splitr<r3�int�
ValueError�striprrr5)rrQrR�strict�policies_str�uri�max_auth_age_strr4�aliasesr!�keys           rrNzRequest.parseExtensionArgs�s��((*��$��x�x� 9�:�:���	=��,��.�.�
C�"�<�'�B�B�B��#�)�)�#�.�.�
=�
=���d�:�:�:��0�7�7��<�<�<�� �8�8�N�3�3�� ����	�
�$'�(8�$9�$9��!�!���
�
�
������
����
&*�X�X�.J�%K�%K�"�%�	2�0�6�6�8�8�>�>�@�@�G� �
2�
2���,1�E�4��#��s�)�C�C���#�#�#�!�#�"�>�B�B�5�I�I���"����	#�����;��P�(�j�FK�e�e�*O�P�P�P�P��%�%�c�5�1�1�1�1�%	2�	2�
2�
2s$�B4�4
C�C�D�)E�Ec�P�tt|jj|����S)a�Given a list of authentication policy URIs that a provider
        supports, this method returns the subsequence of those types
        that are preferred by the relying party.

        @param supported_types: A sequence of authentication policy
            type URIs that are supported by a provider

        @returns: The sub-sequence of the supported types that are
            preferred by the relying party. This list will be ordered
            in the order that the types appear in the supported_types
            sequence, and may be empty if the provider does not prefer
            any of the supported authentication types.

        @returntype: [str]
        )�list�filterr2�__contains__)r�supported_typess  r�preferredTypeszRequest.preferredTypes�s,�� ��4�/�<�o�N�N�P�P�	Pr�NNNr�F)r*r+r,�__doc__�ns_aliasrr:r?r5rIrS�classmethodrNrg�
__classcell__�r7s@rrr^s����������$�H�*.�"�,0�.�.�.�.�.�.� 5�5�5�
<�<�<�C�C�C�C�
���,���$��$5�6�6��=2�=2�=2�=2�~P�P�P�P�P�P�Prrc���eZdZdZdZd�fd�	Zdd�Zd�Zd�Ze	ed�	��Z
d
�Zd�Zdd
�Z
ee��Zd�Z�xZS)rz�A Provider Authentication Policy response, sent from a provider
    to a relying party

    @ivar auth_policies: List of authentication policies conformed to
        by this OpenID assertion, represented as policy URIs
    r/Nc���tt|�����|r||_ng|_||_i|_|�i}|���D]\}}|�||���dSr)r1rr�
auth_policies�	auth_time�auth_levelsr)�setAuthLevel)rrqrrrsr^�levelr7s      �rrzResponse.__init__ s����
�h����&�&�(�(�(��	$�!.�D���!#�D��"���������K�%�+�+�-�-�	*�	*�J�C�����c�5�)�)�)�)�	*�	*rc�F�|�||��||j|<dS)a�Set the value for the given auth level type.

        @param level: string representation of an authentication level
            valid for level_uri

        @param alias: An optional namespace alias for the given auth
            level URI. May be omitted if the alias is not
            significant. The library will use a reasonable default for
            widely-used auth level types.
        N)r#rs)r�	level_urirur!s    rrtzResponse.setAuthLevel0s-��	
���	�5�1�1�1�&+����#�#�#rc��|j|S)aReturn the auth level for the specified auth level
        identifier

        @returns: A string that should map to the auth levels defined
            for the auth level type

        @raises KeyError: If the auth level type is not present in
            this message
        )rs)rrws  r�getAuthLevelzResponse.getAuthLevel>s����	�*�*rc�t�	t|�t����S#t$rYdSwxYwr)rYryrrrs r�_getNISTAuthLevelzResponse._getNISTAuthLevelJsE��	��t�(�(��5�5�6�6�6���	�	�	��4�4�	���s�&)�
7�7z7Backward-compatibility accessor for the NIST auth level)�docc��|tkrtd���||jvr|j�|��dSdS)a�Add a authentication policy to this response

        This method is intended to be used by the provider to add a
        policy that the provider conformed to when authenticating the user.

        @param policy_uri: The identifier for the preferred type of
            authentication.
        @see: http://openid.net/specs/openid-provider-authentication-policy-extension-1_0-01.html#auth_policies
        z4To send no policies, do not set any on the response.N)�	AUTH_NONEr&rqr<r=s  rr?zResponse.addPolicyURITs\����"�"��F�H�H�
H��T�/�/�/���%�%�j�1�1�1�1�1�0�/rc��|��}|�|j��}|���}|�|�||��|SdS)a9Create a C{L{Response}} object from a successful OpenID
        library response
        (C{L{openid.consumer.consumer.SuccessResponse}}) response
        message

        @param success_response: A SuccessResponse from consumer.complete()
        @type success_response: C{L{openid.consumer.consumer.SuccessResponse}}

        @rtype: Response or None
        @returns: A provider authentication policy response from the
            data that was supplied with the C{id_res} response or None
            if the provider sent no signed PAPE response arguments.
        N)�getSignedNSrrMrN)rO�success_responserrQrRs     r�fromSuccessResponsezResponse.fromSuccessResponsees_���s�u�u�� �+�+�D�K�8�8��%�/�/�1�1�
����#�#�D�*�5�5�5��K��4rFc�r�|�d��}|r|�d��}n|rtd���g}t|��dkr|rt|vrtd|�����d|vr)d}|rt|���tj|d�	��d
�|D��}||_|���D]�\}}|�	d��r�|dd
�}	|	�	d��r�:	|d|	��}
n/#t$r"|r|j�|	��}
nd
}
YnwxYw|
�|rtd|	�������|�|
||	����|�d��}|r4t�|��r	||_d
S|rtd���d
Sd
S)a�Parse the provider authentication policy arguments into the
        internal state of this object

        @param args: unqualified provider authentication policy
            arguments

        @param strict: Whether to raise an exception when bad data is
            encountered

        @returns: None. The data is parsed into the internal fields of
            this object.
        rqrCzMissing auth_policies�z;Got some auth policies, as well as the special "none" URI: �nonez0"none" used as a policy URI (see PAPE draft < 5)�)�
stacklevelc�(�g|]}|dtfv�
|��S)r�)r~)�.0�us  r�
<listcomp>z/Response.parseExtensionArgs.<locals>.<listcomp>�s.��
�
�
���&�)�1D�(D�(D�A�(D�(D�(Dr�auth_level.�Nzns.rDzUndefined auth level alias: rr�#auth_time must be in RFC3339 format)rrXrZ�lenr~�warnings�warnrqr)�
startswithrrrt�TIME_VALIDATOR�matchrr)rrQrRr\r]rq�msgra�valr!r^rrs            rrNzResponse.parseExtensionArgs�s_���x�x��0�0���	�(�.�.�s�3�3�M�M�
�	��4�5�5�5��M��
����"�"�v�"�)�}�2L�2L��*�1>��B�C�C�
C��]�"�"�D�C��
1� ��o�o�%��
�c�a�0�0�0�0�
�
�$�
�
�
�
�+����*�*�,�,�	7�	7�J�S�#��~�~�m�,�,�
7��B�C�C����#�#�E�*�*���#��$�U�U�=�>�C�C���#�#�#�!�#�"�>�B�B�5�I�I���"����	#�����;��4�(�j�*/�%�*3�4�4�4�4��%�%�c�3��6�6�6���H�H�[�)�)�	��	H��#�#�I�.�.�
H�!*������
H� �!F�G�G�G�		H�	H�
H�
Hs�D�)D8�7D8c��t|j��dkr
dti}ndd�|j��i}|j���D]7\}}|�|��}||d|��<t|��|d|��<�8|j�8t�
|j��std���|j|d<|S)	rBr
rqrCrDr�Nr�rr)r�rqr~rErsr)rrFrrr�r�rZ)rrG�
level_typerur!s     rrIzResponse.getExtensionArgs�s����t�!�"�"�a�'�'����G�G�
 ����$�*<�!=�!=��G�"&�!1�!7�!7�!9�!9�	>�	>��J���N�N�:�.�.�E�6@�G�G�%�%�2�3�36�u�:�:�G�G�u�u�/�0�0��>�%�!�'�'���7�7�
H� �!F�G�G�G�#'�>�G�K� ��rrhrri)r*r+r,rjrkrrtryr{�property�nist_auth_levelr?r�rNrlrIrmrns@rrrs�����������H�*�*�*�*�*�*� ,�,�,�,�
+�
+�
+�����h��E�G�G�G�O�2�2�2�"���8BH�BH�BH�BH�H&�+�&9�:�:��������rr)rj�__all__�openid.extensionrr��rerrrrr~�compiler�rr	r
rrr-rr�<module>r�sC����	�	�	��'�&�&�&�&�&�����	�	�	�	�	6��L��C��I��;�
����C�D�D��T��:��2'�2'�2'�2'�2'�I�2'�2'�2'�jrP�rP�rP�rP�rP�m�rP�rP�rP�j���H�H�H�H�H�}�H�H�H�V����r

Youez - 2016 - github.com/yon3zu
LinuXploit