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/lazr/restfulclient/authorize/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/lazr/restfulclient/authorize/__pycache__/oauth.cpython-310.pyc
o

��.^V(�@s�dZzddlmZWneyddlmZYnwddlZddlZddlZddlZddl	m
Z
ddlZddlm
Z
mZddlmZddlmZeZgd	�Zd
ZGdd�d�ZGd
d�d�ZGdd�dej�ZGdd�de�ZGdd�de�ZdS)z.OAuth classes for use with lazr.restfulclient.�)�ConfigParser)�SafeConfigParserN)�oauth1)�parse_qs�	urlencode)�HttpAuthorizer)�CredentialsFileError)�AccessToken�Consumer�OAuthAuthorizer�SystemWideConsumer�1c@seZdZdZddd�ZdS)r
z An OAuth consumer (application).�NcCs||_||_||_dS)anInitialize

        :param key: The OAuth consumer key
        :param secret: The OAuth consumer secret. Don't use this. It's
            a misfeature, and lazr.restful doesn't expect it.
        :param application_name: An application name, if different
            from the consumer key. If present, this will be used in
            the User-Agent header.
        N)�key�secret�application_name)�selfrrr�r�D/usr/lib/python3/dist-packages/lazr/restfulclient/authorize/oauth.py�__init__;s

zConsumer.__init__�rN)�__name__�
__module__�__qualname__�__doc__rrrrrr
8sr
c@s2eZdZdZd
dd�Zdd�ZeZedd	��ZdS)r	zAn OAuth access token.rNcCs||_||_||_dS�N)rr�context)rrrrrrrrMs
zAccessToken.__init__cCstd|jfd|jfg�S)N�oauth_token_secret�oauth_token)rrr�rrrr�	to_stringRs�zAccessToken.to_stringcCs.t|dd�}|dd}|dd}|||�S)NF)�keep_blank_valuesrrr)r)�cls�s�paramsrrrrr�from_stringZs
zAccessToken.from_stringr)	rrrrrr �__str__�classmethodr%rrrrr	Js
r	c@seZdZdZdd�ZeZdS)�TruthyStringz&A Unicode string which is always true.cCsdS)NTrrrrr�__bool__eszTruthyString.__bool__N)rrrrr)�__nonzero__rrrrr(bsr(cs2eZdZdZdZd�fdd�	Zedd��Z�ZS)	rz�A consumer associated with the logged-in user rather than an app.

    This can be used to share a single OAuth token among multiple
    desktop applications. The OAuth consumer key will be derived from
    system information (platform and hostname).
    zSystem-wide: %s (%s)rcstt|��|j||�dS)a	Constructor.

        :param application_name: An application name. This will be
            used in the User-Agent header.
        :param secret: The OAuth consumer secret. Don't use this. It's
            a misfeature, and lazr.restful doesn't expect it.
        N)�superrr�consumer_key)rrr��	__class__rrrts
�zSystemWideConsumer.__init__cCsNz
ddl}|��}Wntyd}Ynw|dkrt��}|j|t��fS)z�The system-wide OAuth consumer key for this computer.

        This key identifies the platform and the computer's
        hostname. It does not identify the active user.
        rNr)�distro�name�	Exception�platform�system�
KEY_FORMAT�socket�gethostname)rr/�distnamerrrr,s�zSystemWideConsumer.consumer_key)r)	rrrrr4r�propertyr,�
__classcell__rrr-rrksrc@sXeZdZdZ			ddd�Zedd��Zd	d
�Zedd��Z	d
d�Z
dd�Zdd�ZdS)rzBA client that signs every outgoing request with OAuth credentials.Nr�OAuthcCs,d|_|durt|||�|_||_||_dSr)�consumerr
�access_token�oauth_realm)r�
consumer_name�consumer_secretr<r=rrrrr�s�
zOAuthAuthorizer.__init__cCs:i}|jdur	|S|jj|d<|jjdur|jj|d<|S)zoAny information necessary to identify this user agent.

        In this case, the OAuth consumer name.
        N�oauth_consumer�application)r;rr)rr$rrr�user_agent_params�s
z!OAuthAuthorizer.user_agent_paramscCs~t�}t|d|j�}||�|�t�stdt��|�td�}|�td�}t||�|_|�td�}|�td�}t	||�|_
dS)akLoad credentials from a file-like object.

        This overrides the consumer and access token given in the constructor
        and replaces them with the values read from the file.

        :param readable_file: A file-like object to read the credentials from
        :type readable_file: Any object supporting the file-like `read()`
            method
        �	read_filezNo configuration for version %sr,r?r<�
access_secretN)r�getattr�readfp�has_section�CREDENTIALS_FILE_VERSIONr�getr
r;r	r<)r�
readable_file�parser�readerr,r?r<rDrrr�load�s*
�����zOAuthAuthorizer.loadcCs&|�}t|d�}|�|�|��|S)a�Convenience method for loading credentials from a file.

        Open the file, create the Credentials and load from the file,
        and finally close the file and return the newly created
        Credentials instance.

        :param path: In which file the credential file should be saved.
        :type path: string
        :return: The loaded Credentials instance.
        :rtype: `Credentials`
        �r)�openrM�close)r"�path�credentials�credentials_filerrr�load_from_path�s


zOAuthAuthorizer.load_from_pathcCs�|jdur	td��|jdurtd��t�}|�t�|�td|jj�|�td|jj�|�td|jj�|�td|jj�|�	|�dS)aHWrite the credentials to the file-like object.

        :param writable_file: A file-like object to write the credentials to
        :type writable_file: Any object supporting the file-like `write()`
            method
        :raise CredentialsFileError: when there is either no consumer or no
            access token
        NzNo consumerzNo access tokenr,r?r<rD)
r;rr<r�add_sectionrH�setrr�write)r�
writable_filerKrrr�save�s&
	

����zOAuthAuthorizer.savecCsBt�t�|tjtjBtjBtjtjB�d�}|�	|�|�
�dS)aTConvenience method for saving credentials to a file.

        Create the file, call self.save(), and close the
        file. Existing files are overwritten. The resulting file will
        be readable and writable only by the user.

        :param path: In which file the credential file should be saved.
        :type path: string
        �wN)�os�fdopenrO�O_CREAT�O_TRUNC�O_WRONLY�stat�S_IREAD�S_IWRITErYrP)rrQrSrrr�save_to_path�s

��
zOAuthAuthorizer.save_to_pathc
Cs�tj|jj|jjt|jjpd�|jjtj|jd�}t|j	�|_	|�
|�\}}}|��D]\}}	tj
r<|�d�}|	�d�}	|	||<q+dS)z&Sign a request with OAuth credentials.r)�
client_secret�resource_owner_key�resource_owner_secret�signature_method�realmzUTF-8N)r�Clientr;rrr(r<�SIGNATURE_PLAINTEXTr=re�sign�items�six�PY2�encode)
r�absolute_uri�method�body�headers�client�_�signed_headersr�valuerrr�authorizeRequests �


�z OAuthAuthorizer.authorizeRequest)NrNr:N)
rrrrrr8rBrMr'rTrYrcrxrrrrr�s
�



r)r�configparserrr�ImportErrorr[r2r`r5�oauthlibrrm�six.moves.urllib.parserr�lazr.restfulclient.authorizer�lazr.restfulclient.errorsr�type�
__metaclass__�__all__rHr
r	�	text_typer(rrrrrr�<module>s.�	'

Spamworldpro Mini