File: //usr/local/CyberCP/lib64/python3.10/site-packages/google/auth/__pycache__/_default.cpython-310.pyc
o
�hzo � @ s2 d Z ddlZddlZddlZddlZddlZddlmZ ddlmZ ddl Z
e�e�Z
dZdZdZdZd Zd
ZeeeeeefZdZdZd
Zdd� Z d0dd�Z d0dd�Zdd� Zd1dd�Zd1dd�Zdd� Zd2dd�Z d3dd�Z d3d d!�Z!d1d"d#�Z"d2d$d%�Z#d&d'� Z$d(d)� Z%d*d+� Z&d,d-� Z'd0d.d/�Z(dS )4zgApplication default credentials.
Implements application default credentials and project ID detection.
� N)�environment_vars)�
exceptions�authorized_user�service_account�external_account� external_account_authorized_user�impersonated_service_account�gdch_service_accountz�Your default credentials were not found. To set up Application Default Credentials, see https://cloud.google.com/docs/authentication/external/set-up-adc for more information.a' Your application has authenticated using end user credentials from Google Cloud SDK without a quota project. You might receive a "quota exceeded" or "API not enabled" error. See the following page for troubleshooting: https://cloud.google.com/docs/authentication/adc-troubleshooting/user-creds. z+urn:ietf:params:aws:token-type:aws4_requestc C s* ddl m} | j|jkrt�t� dS dS )z�Determines if the credentials are problematic.
Credentials from the Cloud SDK that are associated with Cloud SDK's project
are problematic because they may not have APIs enabled and have limited
quota. If this is the case, warn about it.
r ��
_cloud_sdkN)�google.authr � client_id�CLOUD_SDK_CLIENT_ID�warnings�warn�_CLOUD_SDK_CREDENTIALS_WARNING)�credentialsr � r �G/usr/local/CyberCP/lib/python3.10/site-packages/google/auth/_default.py�#_warn_about_problematic_credentialsB s �r c C s� t j�| �st�d�| ���t�| d��(}zt� |�}W n t
y4 } zt�d�| �|�}||�d}~ww W d � n1 s?w Y t| |||||�S )a� Loads Google credentials from a file.
The credentials file must be a service account key, stored authorized
user credentials, external account credentials, or impersonated service
account credentials.
Args:
filename (str): The full path to the credentials file.
scopes (Optional[Sequence[str]]): The list of scopes for the credentials. If
specified, the credentials will automatically be scoped if
necessary
default_scopes (Optional[Sequence[str]]): Default scopes passed by a
Google client library. Use 'scopes' for user-defined scopes.
quota_project_id (Optional[str]): The project ID used for
quota and billing.
request (Optional[google.auth.transport.Request]): An object used to make
HTTP requests. This is used to determine the associated project ID
for a workload identity pool resource (external account credentials).
If not specified, then it will use a
google.auth.transport.requests.Request client to make requests.
Returns:
Tuple[google.auth.credentials.Credentials, Optional[str]]: Loaded
credentials and the project ID. Authorized user credentials do not
have the project ID information. External account credentials project
IDs may not always be determined.
Raises:
google.auth.exceptions.DefaultCredentialsError: if the file is in the
wrong format or is missing.
zFile {} was not found.�rz!File {} is not a valid json file.N)�os�path�existsr �DefaultCredentialsError�format�io�open�json�load�
ValueError�_load_credentials_from_info) �filename�scopes�default_scopes�quota_project_id�request�file_obj�info�
caught_exc�new_excr r r �load_credentials_from_fileO s&