Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/oauthlib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/oauthlib/__pycache__/common.cpython-310.pyc
o

���an4�@s�dZddlZddlZddlZddlZddlZddlmZddlm	Z
mZm
ZddlmZzddlmZddlmZWneyOddlmZddlmZYnwd	Zd
Ze�dej�Ze�d�Zd
Ze�d�Zd:dd�Z	dd�Zdd�Z
dd�Z dd�Z!e"e�e"d�BZ#dd�Z$dd�Z%dd �Z&d!d"�Z'd#efd$d%�Z(d&d'�Z)d(d)�Z*d#efd*d+�Z+d,d-�Z,d;d/d0�Z-d1d2�Z.d<d4d5�Z/Gd6d7�d7e0�Z1Gd8d9�d9�Z2dS)=z|
oauthlib.common
~~~~~~~~~~~~~~

This module provides data structures and utilities common
to all implementations of OAuth.
�N)�quote�unquote�	urlencode�)�	get_debug)�randbits)�SystemRandom)�getrandbits�>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789z_ !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}z&([^&;]*(?:password|token)[^=]*=)[^&;]+z&%[^0-9A-Fa-f]|%[0-9A-Fa-f][^0-9A-Fa-f]zAABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-�oauthlib�/cCs:t|t�r
|�d�n|}t||�}t|t�r|�d�}|S�N�utf-8)�
isinstance�str�encode�_quote�bytes�decode)�s�safe�r�1/usr/lib/python3/dist-packages/oauthlib/common.pyr-s



rcCs t|�}t|t�r|�d�}|Sr
)�_unquoterrr)rrrrr7s

rcCs(t|�}t|�}t|t�r|S|�d�Sr
)�encode_params_utf8�
_urlencoderrr)�params�utf8_params�
urlencodedrrrrAs


rcC�Lg}|D]\}}|�t|t�r|�d�n|t|t�r|�d�n|f�q|S)ziEnsures that all parameters in a list of 2-element tuples are encoded to
    bytestrings using UTF-8
    r)�appendrrr)r�encoded�k�vrrrrJ��rcCr)zfEnsures that all parameters in a list of 2-element tuples are decoded to
    unicode using UTF-8.
    r)r rrr)r�decodedr"r#rrr�decode_params_utf8Vr$r&z=&;:%+~,*@!()/?'$cCsT|rt|�tksd}t|t|�t|f��t�|�rtd��tj|dd�}t|�S)a�Decode a query string in x-www-form-urlencoded format into a sequence
    of two-element tuples.

    Unlike urlparse.parse_qsl(..., strict_parsing=True) urldecode will enforce
    correct formatting of the query string by validation. If validation fails
    a ValueError will be raised. urllib.parse_qsl will only raise errors if
    any of name-value pairs omits the equals sign.
    z�Error trying to decode a non urlencoded string. Found invalid characters: %s in the string: '%s'. Please ensure the request/response body is x-www-form-urlencoded.z%Invalid hex encoding in query string.T��keep_blank_values)�setr�
ValueError�INVALID_HEX_PATTERN�search�urlparse�	parse_qslr&)�query�errorrrrr�	urldecodees

r1cCs�t|ttf�rzt|�}W|Styd}Y|Swt|d�rQzt|�Wnty2d}Y|Sty=d}Y|Swtt|t�rH|�	�n|�}t
|�}|Sd}|S)a*Extract parameters and return them as a list of 2-tuples.

    Will successfully extract parameters from urlencoded query strings,
    dicts, or lists of 2-tuples. Empty strings/dicts/lists will return an
    empty list of parameters. Any other input will result in a return
    value of None.
    N�__iter__)rrrr1r*�hasattr�dict�	TypeError�list�itemsr&)�rawrrrr�extract_params�s.
��
	���r9cCstttd��t��S)a�Generate pseudorandom nonce that is unlikely to repeat.

    Per `section 3.3`_ of the OAuth 1 RFC 5849 spec.
    Per `section 3.2.1`_ of the MAC Access Authentication spec.

    A random 64-bit number is appended to the epoch timestamp for both
    randomness and to decrease the likelihood of collisions.

    .. _`section 3.2.1`: https://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-01#section-3.2.1
    .. _`section 3.3`: https://tools.ietf.org/html/rfc5849#section-3.3
    �@)rr�generate_timestamprrrr�generate_nonce�sr<cCsttt����S)aDGet seconds since epoch (UTC).

    Per `section 3.3`_ of the OAuth 1 RFC 5849 spec.
    Per `section 3.2.1`_ of the MAC Access Authentication spec.

    .. _`section 3.2.1`: https://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-01#section-3.2.1
    .. _`section 3.3`: https://tools.ietf.org/html/rfc5849#section-3.3
    )r�int�timerrrrr;�s	r;�cs$t��d���fdd�t|�D��S)aXGenerates a non-guessable OAuth token

    OAuth (1 and 2) does not specify the format of tokens except that they
    should be strings of random characters. Tokens should not be guessable
    and entropy when generating the random characters is important. Which is
    why SystemRandom is used instead of the default random.choice method.
    �c3s�|]}����VqdS�N)�choice)�.0�x��chars�randrr�	<genexpr>���z!generate_token.<locals>.<genexpr>)r�join�range��lengthrFrrEr�generate_token�srNcCsTddl}tj��}|j|tj|jd�d�}|�|j�|�||d�}t	|d�}|S)Nr)�seconds)�scope�exp�RS256�UTF-8)
�jwt�datetime�utcnowrP�	timedelta�
expires_in�update�claimsr�
to_unicode)�private_pem�requestrT�nowrZ�tokenrrr�generate_signed_token�s
�
r`cCsddl}|j||dgd�S)NrrR)�
algorithms)rTr)�
public_pemr_rTrrr�verify_signed_token�srccCs
t||�S)z�Generates an OAuth client_id

    OAuth 2 specify the format of client_id in
    https://tools.ietf.org/html/rfc6749#appendix-A.
    )rNrLrrr�generate_client_id�s
rdcCs2t|t�r	|��}tj|dd�}|�|�t|�S)z)Extend a query with a list of two-tuples.Tr')rr4r7r-r.�extendr)r/r�queryparamsrrr�add_params_to_qs�s


rgFc	CsFt�|�\}}}}}}|rt||�}nt||�}t�||||||f�S)z5Add a list of two-tuples to the uri query components.)r-rg�
urlunparse)	�urir�fragment�sch�net�path�parr/�frarrr�add_params_to_uri�s

rpcCsHt|�t|�kr
dSd}t||�D]\}}|t|�t|�AO}q|dkS)a Near-constant time string comparison.

    Used in order to avoid timing attacks on sensitive information such
    as secret keys during request verification (`rootLabs`_).

    .. _`rootLabs`: http://rdist.root.org/2010/01/07/timing-independent-array-comparison/

    Fr)�len�zip�ord)�a�b�resultrD�yrrr�safe_string_equals�s	rxrScs�t|t�r|St|t�rt|�d�St|d�rKzt|�Wnty'Y|Sty8�fdd�|D�YSwt|d�rB|��}�fdd�|D�S|S)z:Convert a number of different types of objects to unicode.��encodingr2c3s�|]}t|��VqdSrA�r[)rC�iryrrrHrIzto_unicode.<locals>.<genexpr>r7cs"i|]
\}}t|��t|���qSrr{)rCr"r#ryrr�
<dictcomp>$s"zto_unicode.<locals>.<dictcomp>)rrrr3r4r5r*r7)�datarzrryrr[s"



��
r[csbeZdZdZiZdd�Zdd�Z�fdd�Z�fdd	�Zddd�Z	�fd
d�Z
�fdd�Z�ZS)�CaseInsensitiveDictz3Basic case insensitive dict with strings only keys.cCs*dd�|D�|_|D]}||||<q
dS)NcSsi|]}|��|�qSr)�lower)rCr"rrrr}0sz0CaseInsensitiveDict.__init__.<locals>.<dictcomp>)�proxy)�selfr~r"rrr�__init__/s�zCaseInsensitiveDict.__init__cCs|��|jvSrA)r�r�)r�r"rrr�__contains__4sz CaseInsensitiveDict.__contains__cs*|j|��}t��|�|j|��=dSrA)r�r��super�__delitem__�r�r"�key��	__class__rrr�7szCaseInsensitiveDict.__delitem__cs|j|��}t��|�SrA)r�r�r��__getitem__r�r�rrr�<szCaseInsensitiveDict.__getitem__NcCs||vr||S|SrAr)r�r"�defaultrrr�get@szCaseInsensitiveDict.getcs t��||�||j|��<dSrA)r��__setitem__r�r�)r�r"r#r�rrr�CszCaseInsensitiveDict.__setitem__cs8t�j|i|��t|i|��D]	}||j|��<qdSrA)r�rYr4r�r�)r��args�kwargsr"r�rrrYGs�zCaseInsensitiveDict.updaterA)
�__name__�
__module__�__qualname__�__doc__r�r�r�r�r�r�r�rY�
__classcell__rrr�rr)s
rc@sReZdZdZ		ddd�Zdd�Zd	d
�Zedd��Zed
d��Z	edd��Z
dS)�Requesta:A malleable representation of a signable HTTP request.

    Body argument may contain any data, but parameters will only be decoded if
    they are one of:

    * urlencoded query string
    * dict
    * list of 2-tuples

    Anything else will be treated as raw body data to be passed through
    unmolested.
    �GETNrcs�fdd�}||�|_||�|_t||pi��|_||�|_t|j�|_g|_i|_idd�dd�dd�dd�dd�dd�d	d�d
d�dd�dd�d
d�dd�dd�dd�dd�dd�dd�dddddddddddddd�
�|_	|j	�
tt|j
���|j	�
t|jp�g��dS)Ncs�rt|��S|SrAr{)rDryrr�<lambda>_sz"Request.__init__.<locals>.<lambda>�access_token�client�	client_id�
client_secret�code�code_challenge�code_challenge_method�
code_verifier�extra_credentials�
grant_type�redirect_uri�
refresh_token�
request_token�
response_typerP�scopes�state)
r_�user�token_type_hint�
response_mode�nonce�display�promptrZ�max_age�
ui_locales�
id_token_hint�
login_hint�
acr_values)ri�http_methodr�headers�bodyr9�decoded_body�oauth_params�
validator_log�_paramsrYr4r1�	uri_query)r�rir�r�r�rzrrryrr�\sv


��������	�
���
�����
�"zRequest.__init__cCs||jvr
|j|St|��rA)r��AttributeError)r��namerrr�__getattr__�s

zRequest.__getattr__cCsRt�sdS|j}|j��}|rt�dt|��}d|vrd|d<d�|j|j	||�S)Nz<oauthlib.Request SANITIZED>z<SANITIZED>�
Authorizationz<SANITIZED>zF<oauthlib.Request url="{}", http_method="{}", headers="{}", body="{}">)
rr�r��copy�SANITIZE_PATTERN�subr�formatrir�)r�r�r�rrr�__repr__�s
�zRequest.__repr__cCst�|j�jSrA)r-rir/�r�rrrr��szRequest.uri_querycCs|jsgStj|jddd�S)NT)r(�strict_parsing)r�r-r.r�rrr�uri_query_params�s

�zRequest.uri_query_paramscCsPt�t�}dd�|jpg|jD�}|D]
}||d7<qdd�|��D�S)Ncss�|]}|dVqdS)rNr)rC�prrrrH�s��z+Request.duplicate_params.<locals>.<genexpr>rcSsg|]
\}}|dkr|�qS)rr)rCr"�crrr�
<listcomp>�sz,Request.duplicate_params.<locals>.<listcomp>)�collections�defaultdictr=r�r�r7)r��	seen_keys�all_keysr"rrr�duplicate_params�s
�zRequest.duplicate_params)r�NNr)r�r�r�r�r�r�r��propertyr�r�r�rrrrr�Ms

�2

r�)r)F)rS)3r�r�rU�logging�rer>�urllib.parse�parser-rrrrrrr@r�secretsrr�ImportError�randomr	�UNICODE_ASCII_CHARACTER_SET�CLIENT_ID_CHARACTER_SET�compile�
IGNORECASEr�r+�always_safe�	getLogger�logrr&r)rr1r9r<r;rNr`rcrdrgrprxr[r4rr�rrrr�<module>sT�




	!	
	

$

Spamworldpro Mini