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__/api_key.cpython-37.pyc
B

��f
�@s>dZddlmZddlmZddlmZGdd�dej�ZdS)z�Google API key support.
This module provides authentication using the `API key`_.
.. _API key:
    https://cloud.google.com/docs/authentication/api-keys/
�)�_helpers)�credentials)�
exceptionscs^eZdZdZ�fdd�Zedd��Zedd��Ze�	e
j�dd	��Zddd�Z
d
d�Z�ZS)�CredentialszeAPI key credentials.
    These credentials use API key to provide authorization to applications.
    cs&tt|���|st�d��||_dS)z�
        Args:
            token (str): API key string
        Raises:
            ValueError: If the provided API key is not a non-empty string.
        z(Token must be a non-empty API key stringN)�superr�__init__rZInvalidValue�token)�selfr)�	__class__��D/opt/alt/python37/lib/python3.7/site-packages/google/auth/api_key.pyrs
zCredentials.__init__cCsdS)NFr)r	rrr�expired+szCredentials.expiredcCsdS)NTr)r	rrr�valid/szCredentials.validcCsdS)Nr)r	�requestrrr�refresh3szCredentials.refreshNcCs|p|j|d<dS)z�Apply the API key token to the x-goog-api-key header.
        Args:
            headers (Mapping): The HTTP request headers.
            token (Optional[str]): If specified, overrides the current access
                token.
        zx-goog-api-keyN)r)r	�headersrrrr�apply7szCredentials.applycCs|�|�dS)aPerforms credential-specific before request logic.
        Refreshes the credentials if necessary, then calls :meth:`apply` to
        apply the token to the x-goog-api-key header.
        Args:
            request (google.auth.transport.Request): The object used to make
                HTTP requests.
            method (str): The request's HTTP method or the RPC method being
                invoked.
            url (str): The request's URI or the RPC service's URI.
            headers (Mapping): The request's headers.
        N)r)r	r�method�urlrrrr�before_request@szCredentials.before_request)N)�__name__�
__module__�__qualname__�__doc__r�propertyr
rrZcopy_docstringrrrrr�
__classcell__rr)r
rrs
	rN)rZgoogle.authrrrrrrrr�<module>s