HEX
Server: LiteSpeed
System: Linux srv146.niagahoster.com 4.18.0-553.30.1.lve.el8.x86_64 #1 SMP Tue Dec 3 01:21:19 UTC 2024 x86_64
User: kodi1989 (1633)
PHP: 8.1.34
Disabled: symlink,shell_exec,exec,popen,system,dl,passthru,escapeshellarg,escapeshellcmd,show_source,pcntl_exec
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/google/auth/__pycache__/app_engine.cpython-37.pyc
B

��f��@s�dZddlZddlmZddlmZddlmZddlmZyddlmZWne	k
rddZYnXGdd	�d	ej
�Z
d
d�ZGdd
�d
ejej
ej�ZdS)aGoogle App Engine standard environment support.

This module provides authentication and signing for applications running on App
Engine in the standard environment using the `App Identity API`_.


.. _App Identity API:
    https://cloud.google.com/appengine/docs/python/appidentity/
�N)�_helpers)�credentials)�crypt)�
exceptions)�app_identityc@s0eZdZdZedd��Ze�ej	�dd��Z
dS)�Signerz�Signs messages using the App Engine App Identity service.

    This can be used in place of :class:`google.auth.crypt.Signer` when
    running in the App Engine standard environment.
    cCsdS)z�Optional[str]: The key ID used to identify this private key.

        .. warning::
           This is always ``None``. The key ID used by App Engine can not
           be reliably determined ahead of time.
        N�)�selfrr�G/opt/alt/python37/lib/python3.7/site-packages/google/auth/app_engine.py�key_id/sz
Signer.key_idcCst�|�}t�|�\}}|S)N)r�to_bytesrZ	sign_blob)r	�message�_�	signaturerrr
�sign9s
zSigner.signN)�__name__�
__module__�__qualname__�__doc__�propertyrr�copy_docstringrrrrrrr
r(s
rcCstdkrt�d��t��S)z�Gets the project ID for the current App Engine application.

    Returns:
        str: The project ID

    Raises:
        google.auth.exceptions.OSError: If the App Engine APIs are unavailable.
    Nz&The App Engine APIs are not available.)rr�OSErrorZget_application_idrrrr
�get_project_id@s
rcs�eZdZdZd�fdd�	Ze�ej�dd��Z	e
dd��Ze
d	d
��Ze�ej
�ddd��Ze�ej�d
d��Ze�ej�dd��Ze
e�ej�dd���Ze
e�ej�dd���Z�ZS)�Credentialsz�App Engine standard environment credentials.

    These credentials use the App Engine App Identity API to obtain access
    tokens.
    NcsDtdkrt�d��tt|���||_||_||_t	�|_
||_dS)a�
        Args:
            scopes (Sequence[str]): Scopes to request from the App Identity
                API.
            default_scopes (Sequence[str]): Default scopes passed by a
                Google client library. Use 'scopes' for user-defined scopes.
            service_account_id (str): The service account ID passed into
                :func:`google.appengine.api.app_identity.get_access_token`.
                If not specified, the default application service account
                ID will be used.
            quota_project_id (Optional[str]): The project ID used for quota
                and billing.

        Raises:
            google.auth.exceptions.OSError: If the App Engine APIs are unavailable.
        Nz&The App Engine APIs are not available.)rrr�superr�__init__�_scopes�_default_scopes�_service_account_idr�_signerZ_quota_project_id)r	�scopes�default_scopes�service_account_id�quota_project_id)�	__class__rr
rZs
zCredentials.__init__cCsF|jdk	r|jn|j}t�||j�\}}tj�|�}|||_|_dS)N)	rrrZget_access_tokenr�datetime�utcfromtimestamp�token�expiry)r	�requestr r'Zttlr(rrr
�refresh~szCredentials.refreshcCs|jdkrt��|_|jS)zThe service account email.N)rrZget_service_account_name)r	rrr
�service_account_email�s

z!Credentials.service_account_emailcCs|jo|jS)z�Checks if the credentials requires scopes.

        Returns:
            bool: True if there are no scopes set otherwise False.
        )rr)r	rrr
�requires_scopes�szCredentials.requires_scopescCs|j|||j|jd�S)N)r r!r"r#)r$rr#)r	r r!rrr
�with_scopes�s
zCredentials.with_scopescCs|j|j|j|d�S)N)r r"r#)r$rr)r	r#rrr
�with_quota_project�szCredentials.with_quota_projectcCs|j�|�S)N)rr)r	r
rrr
�
sign_bytes�szCredentials.sign_bytescCs|jS)N)r+)r	rrr
�signer_email�szCredentials.signer_emailcCs|jS)N)r)r	rrr
�signer�szCredentials.signer)NNNN)N)rrrrrrrrrr*rr+r,�Scopedr-�CredentialsWithQuotaProjectr.�Signingr/r0r1�
__classcell__rr)r$r
rQs 		
r)rr%Zgoogle.authrrrrZgoogle.appengine.apir�ImportErrorrrr2r4r3rrrrr
�<module>s