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__/fetchers.cpython-311.pyc
�

|=�^	>����dZgd�ZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z	ddlZn
#e$rdZYnwxYw	ddlZn
#e$rdZYnwxYwdej�de
j�d�ZdZdd�Zd	�Zdad
�Zd d�Zd
�ZGd�de��ZGd�de��Zd�ZGd�de��Z Gd�de��Z!Gd�de��Z"Gd�de ��Z#Gd�de��Z$Gd�de��Z%dS)!zN
This module contains the HTTP fetcher interface and several implementations.
)�fetch�getDefaultFetcher�setDefaultFetcher�HTTPResponse�HTTPFetcher�createHTTPFetcher�HTTPFetchingError�	HTTPError�Nzpython-openid/z (�)�c�L�t��}|�|||��S)z�Invoke the fetch method on the default fetcher. Most users
    should need only this method.

    @raises Exception: any exceptions that may be raised by the default fetcher
    )rr)�url�body�headers�fetchers    �1/usr/lib/python3/dist-packages/openid/fetchers.pyrr*s%�� �!�!�G��=�=��d�G�,�,�,�c�N�t�t��}nt��}|S)zDCreate a default HTTP fetcher instance

    prefers Curl to urllib2.)�pycurl�Urllib2Fetcher�CurlHTTPFetcher�rs rrr4s&���~� �"�"���!�#�#���Nrc�T�t�tt����tS)z�Return the default fetcher instance
    if no fetcher has been set, it will create a default fetcher.

    @return: the default fetcher
    @rtype: HTTPFetcher
    )�_default_fetcherrr�rrrrFs%�����+�-�-�.�.�.��rTc�4�|�|s|adSt|��adS)aSet the default fetcher

    @param fetcher: The fetcher to use as the default HTTP fetcher
    @type fetcher: HTTPFetcher

    @param wrap_exceptions: Whether to wrap exceptions thrown by the
        fetcher wil HTTPFetchingError so that they may be caught
        easier. By default, exceptions will be wrapped. In general,
        unwrapped fetchers are useful for debugging of fetching errors
        or if your fetcher raises well-known exceptions that you would
        like to catch.
    @type wrap_exceptions: bool
    N)r�ExceptionWrappingFetcher)r�wrap_exceptionss  rrrUs-����o��"����3�G�<�<���rc��t��}t|t��r|j}t|t��S)z>Whether the currently set HTTP fetcher is a Curl HTTP fetcher.)r�
isinstancerrrrs r�	usingCurlr!js7���!�!�G��'�3�4�4�"��/���g��/�/�/rc�0�eZdZdZdZdZdZdZdd�Zd�Z	dS)rzXXX document attributesNc�>�||_||_||_||_dS�N)�	final_url�statusrr)�selfr%r&rrs     r�__init__zHTTPResponse.__init__ys"��"�����������	�	�	rc�B�d|jj�d|j�d|j�d�S)N�<z status z for �>)�	__class__�__name__r&r%�r's r�__repr__zHTTPResponse.__repr__s-���*.�.�*A�*A�*A�4�;�;�;�*.�.�.�.�:�	:r)NNNN)
r-�
__module__�__qualname__�__doc__rr&rr%r(r/rrrrrrsQ������!�!��G�
�F��D��I�����:�:�:�:�:rrc��eZdZdZdd�ZdS)rz�
    This class is the interface for openid HTTP fetchers.  This
    interface is only important if you need to write a new fetcher for
    some reason.
    Nc��t�)a�
        This performs an HTTP POST or GET, following redirects along
        the way. If a body is specified, then the request will be a
        POST. Otherwise, it will be a GET.


        @param headers: HTTP headers to include with the request
        @type headers: {str:str}

        @return: An object representing the server's HTTP response. If
            there are network or protocol errors, an exception will be
            raised. HTTP error responses, like 404 or 500, do not
            cause exceptions.

        @rtype: L{HTTPResponse}

        @raise Exception: Different implementations will raise
            different errors based on the underlying HTTP library.
        )�NotImplementedError)r'rrrs    rrzHTTPFetcher.fetch�s
��("�!r�NN)r-r0r1r2rrrrrr�s2��������"�"�"�"�"�"rrc�T�tj�|��}|ddvS)Nr
)�http�https)�urllib�parse�urlparse)r�parseds  r�_allowedURLr>�s'��
�\�
"�
"�3�
'�
'�F��!�9�)�)�)rc��eZdZdZdd�ZdS)rz�Exception that is wrapped around all exceptions that are raised
    by the underlying fetcher when using the ExceptionWrappingFetcher

    @ivar why: The exception that caused this exception
    Nc�J�t�||��||_dSr$)�	Exceptionr(�why)r'rBs  rr(zHTTPFetchingError.__init__�s#�����4��%�%�%�����rr$)r-r0r1r2r(rrrrr�s2�������������rrc�(�eZdZdZeeefZd�Zd�Z	dS)rz�Fetcher that wraps another fetcher, causing all exceptions

    @cvar uncaught_exceptions: Exceptions that should be exposed to the
        user if they are raised by the fetch call
    c��||_dSr$r)r'rs  rr(z!ExceptionWrappingFetcher.__init__�s
������rc��	|jj|i|��S#|j$r�tj��dd�\}}|�|}t|����xYw)N�)rB)rr�uncaught_exceptions�sys�exc_infor)r'�args�kwargs�exc_cls�exc_insts     rrzExceptionWrappingFetcher.fetch�sw��
	2�%�4�<�%�t�6�v�6�6�6���'�	�	�	��	2� #����r��r� 2��G�X���"��#��1�1�1�1���s	��>AN)
r-r0r1r2�
SystemExit�KeyboardInterrupt�MemoryErrorrGr(rrrrrr�sL��������&�'8�+�F�����2�2�2�2�2rrc�V�eZdZdZeejj��Zdd�Zd�Z	d�Z
d�ZdS)rz,An C{L{HTTPFetcher}} that uses urllib2.
    Nc�N�t|��std|�����|�i}|�dt�dtjj����t|t��rt|d���}tj�
|||���}d}	|�|��}tj
|��5|�|��cddd��S#1swxYwYdS#tjj$rS}tj
|��5|�|��}|cddd��cYd}~S#1swxYwYYd}~dSd}~wtjjt$jjf$r}�d}~wt*$r}t-|���d}~wwxYw)NzBad URL scheme: �
User-Agentz Python-urllib/zutf-8)�encoding)�datar)r>�
ValueError�
setdefault�
USER_AGENTr:�request�__version__r �str�bytes�Request�urlopen�
contextlib�closing�
_makeResponse�errorr	�URLErrorr8�client�
BadStatusLinerA�AssertionError)r'rrr�req�url_resourcerB�resps        rrzUrllib2Fetcher.fetch�sr���3���	=��*�S�S�;�<�<�<��?��G����<�&�J�J���(B�(B�*D�	E�	E�	E��d�C� � �	1����0�0�0�D��n�$�$�S�t�W�$�E�E����	&��<�<��,�,�L��#�L�1�1�
8�
8��)�)�,�7�7�
8�
8�
8�
8�
8�
8�
8�
8�
8�
8�
8�
8����
8�
8�
8�
8�
8�
8���|�%�	�	�	��#�C�(�(�
�
��)�)�#�.�.���
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�
�
�
�
�
�
�������%�t�{�'@�A�	�	�	�������	&�	&�	&� ��%�%�%�����	&���s~� )C8�	C+�C8�+C/�/C8�2C/�3C8�8F$�E� E	�7E�F$�	E
	�
E�E
	�E�(F$�F�
F$�F�F$c��t��}|�tdz��|_|���|_|�tt|�	���
��������|_t|d��r
|j
|_nd|_|�|j�dd����\}}|�dd��}	|j�|��|_n#t$$rYnwxYw|S)z�
        Construct an HTTPResponse from the the urllib response. Attempt to
        decode the response body from bytes to str if the necessary information
        is available.
        r�code��zcontent-type��charset�latin1)r�read�MAX_RESPONSE_KBr�geturlr%�_lowerCaseKeys�dict�list�info�itemsr�hasattrrkr&�_parseHeaderValue�get�decoderA)r'�urllib2_responseri�_�
extra_dictrns      rrazUrllib2Fetcher._makeResponse�s-���~�~��$�)�)�/�D�*@�A�A��	�)�0�0�2�2����*�*���&�+�+�-�-�3�3�5�5�6�6�7�7�9�9����#�V�,�,�	�*�/�D�K�K��D�K��.�.��L���^�R�0�0�2�2�
��:�
�.�.��H�5�5��	��	�(�(��1�1�D�I�I���	�	�	��D�	�����s�D.�.
D;�:D;c�l�i}|���D]\}}|||���<�|Sr$)rw�lower)r'�headers_dict�new_dict�k�vs     rrszUrllib2Fetcher._lowerCaseKeyss@���� �&�&�(�(�	$�	$�D�A�q�"#�H�Q�W�W�Y�Y����rc�j�|�dd��}t|��dkr
|difS|d|d�d��}}i}|D]U}	|�dd��\}}|���||���<�F#t$rY�RwxYw||fS)z�
        Parse out a complex header value (such as Content-Type, with a value
        like "text/html; charset=utf-8") into a main value and a dictionary of
        extra information (in this case, 'text/html' and {'charset': 'utf8'}).
        �;�r
�=)�split�len�striprV)	r'�header_value�values�
main_value�extra_valuesr~�value_string�key�values	         rryz Urllib2Fetcher._parseHeaderValues����#�#�C��+�+���v�;�;�!����!�9�b�=� �#)�!�9�f�Q�i�o�o�c�.B�.B�L�
��
�(�	�	�L�
�)�/�/��Q�7�7�
��U�*/�+�+�-�-�
�3�9�9�;�;�'�'���
�
�
���
�����:�%�%s�AB!�!
B.�-B.r6)r-r0r1r2�staticmethodr:rYr^rrarsryrrrrr�su��������
�l�6�>�1�2�2�G�&�&�&�&�:���<���&�&�&�&�&rrc��eZdZdZdS)r	z
    This exception is raised by the C{L{CurlHTTPFetcher}} when it
    encounters an exceptional situation fetching a URL.
    N)r-r0r1r2rrrr	r	-s��������	�Drr	c�0�eZdZdZdZd�Zd�Zd�Zdd�ZdS)	rzh
    An C{L{HTTPFetcher}} that uses pycurl for fetching.
    See U{http://pycurl.sourceforge.net/}.
    �c�f�t�|��t�td���dS)NzCannot find pycurl library)rr(r�RuntimeErrorr.s rr(zCurlHTTPFetcher.__init__=s1�����T�"�"�"��>��;�<�<�<��>rc�&�|�d��d�|D��}i}|D]j}	|�dd��\}}n #t$rtd|�����wxYw|���}|���}|||<�k|S)Nr
c�b�g|],}d|v�|��������-S)�:)r{r�)�.0�lines  r�
<listcomp>z1CurlHTTPFetcher._parseHeaders.<locals>.<listcomp>Fs1��O�O�O�4�$�$�,�,������$�$�&�&�,�,�,r�:r�z(Malformed HTTP header line in response: )�seekr�rVr	r�r�)r'�header_file�linesrr��namer�s       r�
_parseHeaderszCurlHTTPFetcher._parseHeadersBs����������P�O�;�O�O�O�����	"�	"�D�
*�"�j�j��a�0�0���e�e���
*�
*�
*��i�!%��!)�*�*�*�
*�����K�K�M�M�E��:�:�<�<�D�!�G�D�M�M��s�A�A c� �t|��Sr$)r>)r'rs  r�	_checkURLzCurlHTTPFetcher._checkURLXs���3���rNc���ttj����|jz}|j}|�i}|�dt�dt
j����g}|�H|���D]3\}}|�d|��}	|�|	�	�����4tj
��}
	|
�t
jd��|r |
�t
j
|��|�@|
�t
jd��|
�t
j|��|dk�r|�|��st#d|�����t%j����fd�}t%j��}|
�t
j|��|
�t
j|j��|
�t
j|��|
�t
jt2j�|����|
���|�|��}
|
�t
j��}|dvrJ|
�d	��}|�t#d
|z���|
�t
jd��ndtA��}|
|_!||_"||_#��$���%��|_&||
�'��S|ttj����z
}|dk��t#d|�����#|
�'��wxYw)NrS� z: r�r
zFetching URL not allowed: c�r������dtzkrdS��|��S)Nrr
)�tellrq�write)�chunkrUs �r�
write_dataz)CurlHTTPFetcher.fetch.<locals>.write_datas2����y�y�{�{�d�_�&<�=�=� �q�#�z�z�%�0�0�0r)i-i.i/i3�locationz)Redirect (%s) returned without a locationzTimed out fetching: )(�int�time�ALLOWED_TIMErWrXr�versionrw�append�encode�Curl�setopt�NOSIGNAL�
HTTPHEADER�POST�
POSTFIELDSr�r	�io�BytesIO�
WRITEFUNCTION�HEADERFUNCTIONr��TIMEOUT�URL�openid�urinorm�performr��getinfo�
RESPONSE_CODErzrrr&r%�getvaluer{r�close)r'rrr�stop�off�header_list�header_namer��header�cr��response_header_data�response_headersrkrirUs                @rrzCurlHTTPFetcher.fetch]s4����4�9�;�;���$�"3�3������?��G����<�&0�j�j�&�.�.�C�	E�	E�	E�����-4�]�]�_�_�
4�
4�)��\�%0�[�[�,�,�?���"�"�6�=�=�?�?�3�3�3�3��K�M�M��8	�
�H�H�V�_�a�(�(�(��
9�����*�K�8�8�8��������a�(�(�(�����*�D�1�1�1���'�'��~�~�c�*�*�N�#�)�c�c�$L�M�M�M��z�|�|��1�1�1�1�1�(*�z�|�|�$�����-�z�:�:�:�����.�0D�0J�K�K�K�������-�-�-������V�^�%;�%;�C�%@�%@�A�A�A��	�	����#'�#5�#5�6J�#K�#K� ��y�y��!5�6�6���/�/�/�*�.�.�z�:�:�C��{�'�G�$�N�P�P�P��H�H�V�[�!�,�,�,�,�
(�>�>�D�#3�D�L�"&�D�K�%(�D�N� $�
�
��� 6� 6� 8� 8�D�I��
�G�G�I�I�I�I�	�S�����-�-�-��S��'�'�V�)���>�?�?�?��
�G�G�I�I�I�I���s�?I$M4�8<M4�4N
r6)	r-r0r1r2r�r(r�r�rrrrrr6sl���������L�=�=�=�
���, � � �
I�I�I�I�I�Irrc�,��eZdZdZd�fd�	Zdd�Z�xZS)�HTTPLib2Fetcherz�A fetcher that uses C{httplib2} for performing HTTP
    requests. This implementation supports HTTP caching.

    @see: http://bitworking.org/projects/httplib2/
    Nc����t�td���tt|�����tj|��|_d|j_dS)z�@param cache: An object suitable for use as an C{httplib2}
            cache. If a string is passed, it is assumed to be a
            directory name.
        NzJCannot find httplib2 library. See http://bitworking.org/projects/httplib2/F)�httplib2r��superr�r(�Http�force_exception_to_status_code)r'�cacher,s  �rr(zHTTPLib2Fetcher.__init__�si���
��� N�O�O�
O�	�o�t�$�$�-�-�/�/�/�!�
�e�,�,��
�8=��
�4�4�4rc
���|rd}nd}|�i}|�d��s'|�d��std|�����|j�||||���\}}	|d}n(#t$r|jrJ�|jd	ksJ�|}YnwxYwt|���|tt|�������|j�
��S)z�Perform an HTTP request

        @raises Exception: Any exception that can be raised by httplib2

        @see: C{L{HTTPFetcher.fetch}}
        r��GETNzhttp://zhttps://zURL is not a HTTP URL: )rrzcontent-locationrl)rr%rr&)�
startswithrVr�rY�KeyError�previousr&rr{rtrurw)r'rrr�method�httplib2_response�contentr%s        rrzHTTPLib2Fetcher.fetch�s7���	��F�F��F��?��G����y�)�)�	D�S�^�^�J�-G�-G�	D��*�C�C�B�C�C�C�%)�]�%:�%:���d�G�&;�&5�&5�"��7�	�)�*<�=�I�I���	�	�	�(�1�1�1�1�%�+�s�2�2�2�2��I�I�I�
	��������!�!����/�5�5�7�7�8�8�9�9�$�+�	/�/�/�	/s�*A3�3"B�Br$r6)r-r0r1r2r(r�
__classcell__)r,s@rr�r��s[���������=�=�=�=�=�=�$+/�+/�+/�+/�+/�+/�+/�+/rr�r6)T)&r2�__all__�urllib.requestr:�urllib.error�urllib.parse�http.clientr8r�r�rHr_r��openid.urinormr��ImportErrorrrZ�platformrXrqrrrrrr!�objectrrr>rArrrr	rr�rrr�<module>r�s���������
��������������������	�	�	�	�
�
�
�
�����
�
�
�
�������O�O�O�O�������H�H�H�����
��M�M�M�M������
�F�F�F������)/�(:�(:�(:�C�L�L�L�
I�
���-�-�-�-�	�	�	������=�=�=�=�*0�0�0�:�:�:�:�:�6�:�:�:�$"�"�"�"�"�&�"�"�"�<*�*�*�	�	�	�	�	�	�	�	�	�2�2�2�2�2�{�2�2�2�4\&�\&�\&�\&�\&�[�\&�\&�\&�~	�	�	�	�	�!�	�	�	�p�p�p�p�p�k�p�p�p�fD/�D/�D/�D/�D/�k�D/�D/�D/�D/�D/s�5�?�?�A�A�A

Youez - 2016 - github.com/yon3zu
LinuXploit