File: //usr/local/CyberCP/lib/python3.10/site-packages/google/auth/__pycache__/app_engine.cpython-310.pyc
o
�h� � @ s� d Z ddlZddlmZ ddlmZ ddlmZ ddlmZ zddlmZ W n e y1 dZY nw G dd � d ej
�Z
d
d� ZG dd
� d
ejej
ej�ZdS )a Google 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 @ s0 e Zd ZdZedd� �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.
c C s dS )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� ��selfr r �I/usr/local/CyberCP/lib/python3.10/site-packages/google/auth/app_engine.py�key_id/ s z
Signer.key_idc C s t �|�}t�|�\}}|S �N)r �to_bytesr � sign_blob)r
�message�_� signaturer r r �sign9 s
zSigner.signN)�__name__�
__module__�__qualname__�__doc__�propertyr r �copy_docstringr r r r r r r r ( s
r c C s t du r t�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.
N�&The App Engine APIs are not available.)r r �OSError�get_application_idr r r r �get_project_id@ s
r c s� e Zd ZdZ d� fdd� Ze�ej�dd� �Z e
dd� �Ze
d d
� �Ze�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.
Nc sD t du r t�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.
Nr )r r r �superr �__init__�_scopes�_default_scopes�_service_account_idr �_signer�_quota_project_id)r
�scopes�default_scopes�service_account_id�quota_project_id�� __class__r r r Z s
zCredentials.__init__c C sF | j d ur| j n| j}t�|| j�\}}tj�|�}||| _| _d S r
) r! r"