
    (php                     >   S r SSKrSSKrSSKrSSKrSSKrSSKJr  SSKJr  SSK	r
\R                  " \5      rSrSrSrSrS	rS
r\\\\\\4rSrSrSrS r SS jr SS jrS rS S jrS S jrS rS!S jr S"S jr  S"S jr!S S jr"S!S jr#S r$S r%S r&S r'SS jr(g)#zgApplication 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_accountzYour 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                 z    SSK Jn  U R                  UR                  :X  a  [        R
                  " [        5        gg)zDetermines 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   s     G/var/www/html/venv/lib/python3.13/site-packages/google/auth/_default.py#_warn_about_problematic_credentialsr   B   s-     '
 > >>45 ?    c                    [         R                  R                  U 5      (       d%  [        R                  " SR                  U 5      5      e[        R                  " U S5       n [        R                  " U5      n SSS5        [        U WXX45      $ ! [         a-  n[        R                  " SR                  U 5      U5      nXeSnAff = f! , (       d  f       NV= f)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.

.. warning::
    Important: If you accept a credential configuration (credential JSON/File/Stream)
    from an external source for authentication to Google Cloud Platform, you must
    validate it before providing it to any Google API or client library. Providing an
    unvalidated credential configuration to Google APIs or libraries can compromise
    the security of your systems and data. For more information, refer to
    `Validate credential configurations from external sources`_.

    .. _Validate credential configurations from external sources:
        https://cloud.google.com/docs/authentication/external/externally-sourced-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.
zFile {} 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_excs	            r   load_credentials_from_filer.   O   s    Z 77>>(##00$++H5
 	
 
3	8	*99X&D 
  '$0@   	* 883::8DjG )		* 
 	s*   !C
#B
C(CCC


Cc                     [        U [        5      (       d.  [        R                  " SR	                  [        U 5      5      5      e[        SXX#U5      $ )a  Loads Google credentials from a dict.

The credentials file must be a service account key, stored authorized
user credentials, external account credentials, or impersonated service
account credentials.

.. warning::
    Important: If you accept a credential configuration (credential JSON/File/Stream)
    from an external source for authentication to Google Cloud Platform, you must
    validate it before providing it to any Google API or client library. Providing an
    unvalidated credential configuration to Google APIs or libraries can compromise
    the security of your systems and data. For more information, refer to
    `Validate credential configurations from external sources`_.

.. _Validate credential configurations from external sources:
    https://cloud.google.com/docs/authentication/external/externally-sourced-credentials

Args:
    info (Dict[str, Any]): A dict object containing the credentials
    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.
z6info object was of type {} but dict type was expected.zdict object)
isinstancedictr   r   r   typer$   )r+   r&   r'   r(   r)   s        r   load_credentials_from_dictr3      sP    Z dD!!00DKKDQUJW
 	
 't^w r   c                    SSK Jn  UR                  S5      nU[        :X  a  [	        XU5      u  pOU[
        :X  a  [        XX#5      u  pOU[        :X  a  [        UU UUUS9u  pOrU[        :X  a  [        XU5      u  pOYU[        :X  a  [        XU5      u  pO@U[        :X  a  [        X5      u  pO([        R                   " SR#                  X[$        S95      e['        X5      (       a  [)        X5      nX4$ )Nr   CredentialsWithQuotaProjectr2   )r&   r'   r)   zZThe file {file} does not have a valid type. Type is {type}, expected one of {valid_types}.)filer2   valid_types)google.auth.credentialsr6   get_AUTHORIZED_USER_TYPE _get_authorized_user_credentials_SERVICE_ACCOUNT_TYPE _get_service_account_credentials_EXTERNAL_ACCOUNT_TYPE!_get_external_account_credentials&_EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE1_get_external_account_authorized_user_credentials"_IMPERSONATED_SERVICE_ACCOUNT_TYPE-_get_impersonated_service_account_credentials_GDCH_SERVICE_ACCOUNT_TYPE%_get_gdch_service_account_credentialsr   r   r   _VALID_TYPESr0   _apply_quota_project_id)
r%   r+   r&   r'   r(   r)   r6   credential_typer   
project_ids
             r   r$   r$      s     Dhhv&O//"BF#
Z 
1	1"BF#
Z 
2	2"C)#
Z 
B	B"SG#
Z 
>	>"OF#
Z 
6	6"G"WZ00==CV >D >
 	
 +;;-kL""r   c                 "   SSK Jn  [        R                  S5        UR	                  5       n[
        R                  R                  U5      (       d  [        R                  S5        g[        X S9u  p4X#l	        U(       d  UR                  5       nX44$ )z7Gets the credentials and project ID from the Cloud SDK.r   r   z9Checking Cloud SDK credentials as part of auth process...z7Cloud SDK credentials not found on disk; not using themNNr(   )r   r   _LOGGERdebug(get_application_default_credentials_pathr   r   isfiler.   _cred_file_pathget_project_id)r(   r   credentials_filenamer   rJ   s        r   _get_gcloud_sdk_credentialsrU      sy    &MMMN &NNP77>>.//OP8K #7..0
""r   c                 z   SSK Jn  UR                  5       n[        R                  R                  [        R                  5      n[        R                  SU5        Ub$  X2:X  a  [        R                  SU5        [        U S9$ Ub8  [        [        R                  [        R                     U S9u  pEU S3Ul        XE4$ g)zNGets credentials from the GOOGLE_APPLICATION_CREDENTIALS environment
variable.r   r   z?Checking %s for explicit credentials as part of auth process...zrExplicit credentials path %s is the same as Cloud SDK credentials path, fall back to Cloud SDK credentials flow...rM   zA file via the GOOGLE_APPLICATION_CREDENTIALS environment variablerL   )r   r   rP   r   environr:   r   CREDENTIALSrN   rO   rU   r.   rR   )r(   r   cloud_sdk_adc_pathexplicit_filer   rJ   s         r   !_get_explicit_environ_credentialsr[     s     '#LLNJJNN#3#?#?@MMMI=  ]%H 	 A	
 +<LMM "<JJ'334GW#
 *77x&y#&& r   c                     [         R                  R                  [        R                  5      S:w  a  g [
        R                  S5        SSKJs  J	n    U R                  5       nU R                  5       nX4$ ! [         a    [
        R                  S5         gf = f! [         a    [
        R                  S5         gf = f)z?Gets Google App Engine App Identity credentials and project ID.python27rL   z:Checking for App Engine runtime as part of auth process...r   Nz)Import of App Engine auth library failed.z]No App Engine library was found so cannot authentication via App Engine Identity Credentials.)r   rW   r:   r   LEGACY_APPENGINE_RUNTIMErN   rO   google.auth.app_engineauth
app_engineImportErrorwarningCredentialsrS   EnvironmentError)ra   r   rJ   s      r   _get_gae_credentialsrf   0  s     
zz~~&??@JNRS33
 ,,...0
&&  CD  k	
 	s#   A6 "B 6BBB=<B=c                     SSK Jn  SSKJn  U c2  [        R                  R                  R                  R                  5       n UR                  U S9(       a.   UR                  U S9nUR!                  5       n[#        XQ5      nXT4$ [
        R                  S5        g! [         a    [
        R                  S5         gf = f! [        R                   a    Sn Nqf = f)	z>Gets credentials and project ID from the GCE Metadata Service.r   )compute_engine)	_metadataz-Import of Compute Engine auth library failed.rL   Nr)   z]Authentication failed using Compute Engine authentication due to unavailable metadata server.)r   rh   google.auth.compute_engineri   rb   rN   rc   googler`   	transport_http_clientRequest	is_on_gcerS   r   TransportErrorrd   rH   )r)   r(   rh   ri   rJ   creds         r   _get_gce_credentialsrs   K  s    .8
 ++''44<<>7+	"11'1BJ ))+&t>k	
 -  GH (( 	J	s#   B C  B=<B= CCc                 P   U R                  S5      [        :X  a!  SSKJn  UR                  R                  XUS9nOuU R                  S5      bB  U R                  S5      R                  S5      b!  SSKJn  UR                  R                  XUS9nO! SS	KJn  UR                  R                  XUS9nUc2  SSKn	U	R                  R                  R                  R!                  5       nXfR#                  US94$ ! [         a&    [        R                  " S
R                  U5      5      ef = f)a  Loads external account Credentials from the parsed external account info.

The credentials information must correspond to a supported external account
credentials.

Args:
    info (Mapping[str, str]): The external account info in Google format.
    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.
    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. External account credentials project
        IDs may not always be determined.

Raises:
    google.auth.exceptions.DefaultCredentialsError: if the info dictionary
        is in the wrong format or is missing required information.
subject_token_typer   )awsr&   r'   credential_sourceN
executable)	pluggable)identity_poolz3Failed to load external account credentials from {}rj   )r:   _AWS_SUBJECT_TOKEN_TYPEr   rv   rd   	from_inforz   r{   r#   r   r   r   google.auth.transport.requestsr`   rm   requestsro   rS   )
r+   r%   r&   r'   r)   rv   r   rz   r{   rl   s
             r   r@   r@   p  s$   @ xx$%)@@#oo// 0 
 	$%1HH()--l;G)++55 6 
	1'33==N > K -++''0088:2272CCC  	 44ELLXV 	s    C5 50D%c                      SSK Jn  UR                  R                  U5      nUS 4$ ! [         a&    [
        R                  " SR                  U 5      5      ef = f)Nr   )r   zCFailed to load external account authorized user credentials from {})r   r   rd   r}   r#   r   r   r   )r%   r+   r&   r'   r)   r   r   s          r   rB   rB     sb    	
@6BBLLTR   
00QXX
 	

s	   !' 0Ac                     SSK Jn   UR                  R                  XS9nUS 4$ ! [         a.  nSR                  U 5      n[        R                  " XT5      nXdeS nAff = f)Nr   r   r&   z2Failed to load authorized user credentials from {})google.oauth2r   rd   from_authorized_user_infor#   r   r   r   )r%   r+   r&   r   r,   msgr-   s          r   r<   r<     sn    )&!--GG H 
 	  &BII(S44SE%&   % 
A)AAc                     SSK Jn   UR                  R                  XUS9nXQR                  S5      4$ ! [         a.  nSR                  U 5      n[        R                  " Xv5      nXeS nAff = f)Nr   )r   rw   z2Failed to load service account credentials from {}rJ   )	r   r   rd   from_service_account_infor#   r   r   r   r:   )	r%   r+   r&   r'   r   r   r,   r   r-   s	            r   r>   r>     sw    -&%11KK L 
 ...	  &BII(S44SE%&s   4 
A,)A''A,c                     SSK Jn   UR                  R                  XS9nUS 4$ ! [         a.  nSR                  U 5      n[        R                  " Xe5      nXueS nAff = f)Nr   )impersonated_credentialsr   z?Failed to load impersonated service account credentials from {})r   r   rd   &from_impersonated_service_account_infor#   r   r   r   )r%   r+   r&   r   r   r,   r   r-   s           r   rD   rD     ss    4	&.::aa b 
   &OVV
 44SE%&r   c                     SSK Jn   UR                  R                  U5      nX1R                  S5      4$ ! [         a.  nSR                  U 5      n[        R                  " XT5      nXdeS nAff = f)Nr   )gdch_credentialsz7Failed to load GDCH service account credentials from {}project)	r   r   ServiceAccountCredentialsr   r#   r   r   r   r:   )r%   r+   r   r   r,   r   r-   s          r   rF   rF     so    .&&@@ZZ
 +++	  &GNNxX44SE%&s   5 
A-)A((A-c                 0    SSK Jn  UR                  U 5      $ )z*Return credentials with the given API key.r   )api_key)r   r   rd   )keyr   s     r   get_api_key_credentialsr     s    #s##r   c                     U(       a  U R                  U5      n OU R                  5       n SSKJn  [	        XR
                  5      (       a  U R                  (       d  [        U 5        U $ )Nr   r   )with_quota_project#with_quota_project_from_environmentr   r   r0   rd   r(   r   )r   r(   authorized_user_credentialss      r   rH   rH     sO    !445EF!EEGH+FFGG((+K8r   c                   ^^ SSK Jn  SSK Jn  [        R                  R                  [        R                  [        R                  R                  [        R                  5      5      nU4S jU4S j[        UU4S j4nU H  nU" 5       u  pU	c  M  U" XUS9n	U=(       d    U
nU(       d_  [        [        U	S	S5      5      (       aD  Tc2  SSKnUR                  R                  R                  R!                  5       mU	R#                  TS
9nT(       a!  [%        X5      (       a  U	R'                  T5      n	U(       d$  [(        R+                  S[        R                  5        X4s  $    [,        R.                  " [0        5      e)a  Gets the default credentials for the current environment.

`Application Default Credentials`_ provides an easy way to obtain
credentials to call Google APIs for server-to-server or local applications.
This function acquires credentials from the environment in the following
order:

1. If the environment variable ``GOOGLE_APPLICATION_CREDENTIALS`` is set
   to the path of a valid service account JSON private key file, then it is
   loaded and returned. The project ID returned is the project ID defined
   in the service account file if available (some older files do not
   contain project ID information).

   If the environment variable is set to the path of a valid external
   account JSON configuration file (workload identity federation), then the
   configuration file is used to determine and retrieve the external
   credentials from the current environment (AWS, Azure, etc).
   These will then be exchanged for Google access tokens via the Google STS
   endpoint.
   The project ID returned in this case is the one corresponding to the
   underlying workload identity pool resource if determinable.

   If the environment variable is set to the path of a valid GDCH service
   account JSON file (`Google Distributed Cloud Hosted`_), then a GDCH
   credential will be returned. The project ID returned is the project
   specified in the JSON file.
2. If the `Google Cloud SDK`_ is installed and has application default
   credentials set they are loaded and returned.

   To enable application default credentials with the Cloud SDK run::

        gcloud auth application-default login

   If the Cloud SDK has an active project, the project ID is returned. The
   active project can be set using::

        gcloud config set project

3. If the application is running in the `App Engine standard environment`_
   (first generation) then the credentials and project ID from the
   `App Identity Service`_ are used.
4. If the application is running in `Compute Engine`_ or `Cloud Run`_ or
   the `App Engine flexible environment`_ or the `App Engine standard
   environment`_ (second generation) then the credentials and project ID
   are obtained from the `Metadata Service`_.
5. If no credentials are found,
   :class:`~google.auth.exceptions.DefaultCredentialsError` will be raised.

.. _Application Default Credentials: https://developers.google.com            /identity/protocols/application-default-credentials
.. _Google Cloud SDK: https://cloud.google.com/sdk
.. _App Engine standard environment: https://cloud.google.com/appengine
.. _App Identity Service: https://cloud.google.com/appengine/docs/python            /appidentity/
.. _Compute Engine: https://cloud.google.com/compute
.. _App Engine flexible environment: https://cloud.google.com            /appengine/flexible
.. _Metadata Service: https://cloud.google.com/compute/docs            /storing-retrieving-metadata
.. _Cloud Run: https://cloud.google.com/run
.. _Google Distributed Cloud Hosted: https://cloud.google.com/blog/topics            /hybrid-cloud/announcing-google-distributed-cloud-edge-and-hosted

Example::

    import google.auth

    credentials, project_id = google.auth.default()

Args:
    scopes (Sequence[str]): The list of scopes for the credentials. If
        specified, the credentials will automatically be scoped if
        necessary.
    request (Optional[google.auth.transport.Request]): An object used to make
        HTTP requests. This is used to either detect whether the application
        is running on Compute Engine or to determine the associated project
        ID for a workload identity pool resource (external account
        credentials). If not specified, then it will either use the standard
        library http client to make requests for Compute Engine credentials
        or a google.auth.transport.requests.Request client for external
        account credentials.
    quota_project_id (Optional[str]): The project ID used for
        quota and billing.
    default_scopes (Optional[Sequence[str]]): Default scopes passed by a
        Google client library. Use 'scopes' for user-defined scopes.
Returns:
    Tuple[~google.auth.credentials.Credentials, Optional[str]]:
        the current environment's credentials and project ID. Project ID
        may be None, which indicates that the Project ID could not be
        ascertained from the environment.

Raises:
    ~google.auth.exceptions.DefaultCredentialsError:
        If no credentials were found, or if the credentials found were
        invalid.
r   )with_scopes_if_requiredr5   c                     > [        T S9$ NrM   )r[   rM   s   r   <lambda>default.<locals>.<lambda>  s    1CSTr   c                     > [        T S9$ r   )rU   rM   s   r   r   r     s    +=MNr   c                     > [        TT S9$ r   )rs   )r(   r)   s   r   r   r     s    $W?OPr   N)r'   rS   rj   zvNo project ID could be determined. Consider running `gcloud config set project` or setting the %s environment variable)r9   r   r6   r   rW   r:   r   PROJECTLEGACY_PROJECTrf   callablegetattrr~   r`   rm   r   ro   rS   r0   r   rN   rc   r   r   _CLOUD_SDK_MISSING_CREDENTIALS)r&   r)   r(   r'   r   r6   explicit_project_idcheckerscheckerr   rJ   effective_project_idrl   s    ``          r   defaultr     sL   B @C**..  "**..1A1P1P"Q 	UNP	H "))"1NK $7#D* 
 (H%5t<- - ?9$kk33<<DDFG'2'A'A''A'R$J% % *<<=MN'+ %,,	 44C F 
,
,-K
LLr   )NNNN)NrL   )NNN))__doc__r   r!   loggingr   r   r   r   r   "google.auth.transport._http_clientrl   	getLogger__name__rN   r;   r=   r?   rA   rC   rE   rG   r   r   r|   r   r.   r3   r$   rU   r[   rf   rs   r@   rB   r<   r>   rD   rF   r   rH   r    r   r   <module>r      s  
 
   	  ( " )


H
% * ) + )K &%C "3 *&" "  H 
6 PT<@ LP4n.#b#0D6"L ?CCDN ?C"/ ,$VMr   