Ë
    ùmxi[  ã                   ó|   — d Z ddlZddlZddlmZ ddlmZ ddlmZ dZdZdZ	dZ
d	Zd
ZdZdZd„ Zd„ Zd„ Zd„ Zdd„Zy)z9Helpers for reading the Google Cloud SDK's configuration.é    N)Ú_helpers)Úenvironment_vars)Ú
exceptionsÚgcloudÚAPPDATAz$application_default_credentials.jsonz
gcloud.cmd)ÚconfigÚgetÚproject)Úauthzprint-access-tokenzH764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.comc                  ó*  — 	 t         j                  t        j                     S # t        $ r Y nw xY wt         j
                  dk7  rBt         j                  j                  t         j                  j                  d«      dt        «      S 	 t         j                  j                  t         j                  t           t        «      S # t        $ rH t         j                  j                  dd«      } t         j                  j                  | dt        «      cY S w xY w)z�Returns the absolute path the the Cloud SDK's configuration directory.

    Returns:
        str: The Cloud SDK config path.
    Úntú~z.configÚSystemDrivezC:ú\)ÚosÚenvironr   ÚCLOUD_SDK_CONFIG_DIRÚKeyErrorÚnameÚpathÚjoinÚ
expanduserÚ_CONFIG_DIRECTORYÚ_WINDOWS_CONFIG_ROOT_ENV_VARr	   )Údrives    úM/home/htdocs/ttos/venv/lib/python3.12/site-packages/google/auth/_cloud_sdk.pyÚget_config_pathr   -   sÏ   € ðÜ�z‰zÔ*×?Ñ?Ñ@Ð@øÜò Ùðúô 
‡w�w�$‚Ü�w‰w�|‰|œBŸG™G×.Ñ.¨sÓ3°YÔ@QÓRÐRð	@Ü—7‘7—<‘<Ü—
‘
Ô7Ñ8Ô:Kóð øô ò 	@ô —J‘J—N‘N =°$Ó7ˆEÜ—7‘7—<‘<  tÔ->Ó?Ò?ð		@ús   ‚ # £	/®/Â8C ÃADÄDc                  ó^   — t        «       } t        j                  j                  | t        «      S )z°Gets the path to the application default credentials file.

    The path may or may not exist.

    Returns:
        str: The full path to application default credentials.
    )r   r   r   r   Ú_CREDENTIALS_FILENAME)Úconfig_paths    r   Ú(get_application_default_credentials_pathr!   I   s"   € ô "Ó#€KÜ�7‰7�<‰<˜Ô%:Ó;Ð;ó    c                 ó”   — t        t        j                  d«      5 }t        j                  | |¬«      }ddd«       |S # 1 sw Y   S xY w)zIReturn subprocess.check_output with the given command and ignores stderr.Úw©ÚstderrN)Úopenr   ÚdevnullÚ
subprocessÚcheck_output)Úcommandr(   Úoutputs      r   Ú_run_subprocess_ignore_stderrr-   U   sA   € ä	Œb�j‰j˜#Ó	ð B 'Ü×(Ñ(¨¸ÔAˆ÷Bà€M÷Bà€Mús	   ›=½Ac                  ó  — t         j                  dk(  rt        } nt        } 	 t	        | ft
        z   «      }t        j                  |«      j                  «       }|r|S dS # t        j                  t        t        f$ r Y yw xY w)zaGets the project ID from the Cloud SDK.

    Returns:
        Optional[str]: The project ID.
    r   N)r   r   Ú_CLOUD_SDK_WINDOWS_COMMANDÚ_CLOUD_SDK_POSIX_COMMANDr-   Ú%_CLOUD_SDK_CONFIG_GET_PROJECT_COMMANDr   Ú
from_bytesÚstripr)   ÚCalledProcessErrorÚOSErrorÚIOError)r+   r
   s     r   Úget_project_idr7   \   s|   € ô 
‡w�w�$‚Ü,‰ä*ˆðô 0ØˆJÔ>Ñ>ó
ˆô
 ×%Ñ% gÓ.×4Ñ4Ó6ˆÙ!ˆwÐ+ tÐ+øÜ×)Ñ)¬7´GÐ<ò Ùðús   ¢9A ÁA ÁA?Á>A?c                 ó†  — t         j                  dk(  rt        }nt        }	 | r|ft        z   d| z   fz   }n
|ft        z   }t        j                  |t
        j                  ¬«      }|j                  d«      j                  «       S # t
        j                  t        t        f$ r}t        j                  d|«      }||‚d}~ww xY w)a“  Load user access token with the ``gcloud auth print-access-token`` command.

    Args:
        account (Optional[str]): Account to get the access token for. If not
            specified, the current active account will be used.

    Returns:
        str: The user access token.

    Raises:
        google.auth.exceptions.UserAccessTokenError: if failed to get access
            token from gcloud.
    r   z
--account=r%   zutf-8zFailed to obtain access tokenN)r   r   r/   r0   Ú$_CLOUD_SDK_USER_ACCESS_TOKEN_COMMANDr)   r*   ÚSTDOUTÚdecoder3   r4   r5   r6   r   ÚUserAccessTokenError)Úaccountr+   Úaccess_tokenÚ
caught_excÚnew_excs        r   Úget_auth_access_tokenrA   u   sÀ   € ô 
‡w�w�$‚Ü,‰ä*ˆð&Ùà�
Ü6ñ7à 'Ñ)Ð+ñ,ñ ð �jÔ#GÑGˆGä!×.Ñ.¨w¼z×?PÑ?PÔQˆà×"Ñ" 7Ó+×1Ñ1Ó3Ð3øÜ×)Ñ)¬7´GÐ<ò &Ü×1Ñ1Ø+¨Zó
ˆð ˜:Ð%ûð	&ús   ¢A!B ÂC Â"B;Â;C )N)Ú__doc__r   r)   Úgoogle.authr   r   r   r   r   r   r0   r/   r1   r9   ÚCLOUD_SDK_CLIENT_IDr   r!   r-   r7   rA   © r"   r   ú<module>rF      sm   ðñ @ã 	Û å  Ý (Ý "ð Ð à(Ð ð ?Ð à#Ð Ø)Ð à(DÐ %à'EÐ $ð Oð ò
@ò8	<òòô2$&r"   