HEX
Server: LiteSpeed
System: Linux server.nevid-deploma.com 4.18.0-553.111.1.lve.el8.x86_64 #1 SMP Fri Mar 13 13:42:17 UTC 2026 x86_64
User: smilepac (1037)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/cppython/lib/python3.8/site-packages/google/auth/__pycache__/_cloud_sdk.cpython-38.pyc
U

KD�g\�@s�dZddlZddlZddlmZddlmZddlmZdZdZdZ	dZ
d	Zd
ZdZ
dZd
d�Zdd�Zdd�Zdd�Zddd�ZdS)z9Helpers for reading the Google Cloud SDK's configuration.�N)�_helpers)�environment_vars)�
exceptionsZgcloud�APPDATAz$application_default_credentials.jsonz
gcloud.cmd)�config�get�project)�authzprint-access-tokenzH764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.comcCs�ztjtjWStk
r"YnXtjdkrFtj�tj�d�dt	�Sztj�tjt
t	�WStk
r�tj�dd�}tj�|dt	�YSXdS)z�Returns the absolute path the the Cloud SDK's configuration directory.

    Returns:
        str: The Cloud SDK config path.
    �nt�~z.configZSystemDrivezC:�\N)�os�environrZCLOUD_SDK_CONFIG_DIR�KeyError�name�path�join�
expanduser�_CONFIG_DIRECTORY�_WINDOWS_CONFIG_ROOT_ENV_VARr)�drive�r�C/opt/cppython/lib/python3.8/site-packages/google/auth/_cloud_sdk.py�get_config_path-s
�rcCst�}tj�|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.
    )rr
rr�_CREDENTIALS_FILENAME)Zconfig_pathrrr�(get_application_default_credentials_pathIsrc	Cs*ttjd��}tj||d�}W5QRX|S)zJ Return subprocess.check_output with the given command and ignores stderr.�w��stderr)�openr
�devnull�
subprocess�check_output)�commandr �outputrrr�_run_subprocess_ignore_stderrUsr%c
Csbtjdkrt}nt}z*t|ft�}t�|���}|r:|ndWSt	j
ttfk
r\YdSXdS)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#rrrr�get_project_id\s
�r.c
Cs�tjdkrt}nt}zD|r0|ftd|f}n
|ft}tj|tjd�}|�d��	�WStj
ttfk
r�}zt
�d|�}||�W5d}~XYnXdS)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=rzutf-8zFailed to obtain access tokenN)r
rr&r'�$_CLOUD_SDK_USER_ACCESS_TOKEN_COMMANDr!r"�STDOUT�decoder*r+r,r-rZUserAccessTokenError)�accountr#Zaccess_tokenZ
caught_exc�new_excrrr�get_auth_access_tokenus(
���
�r4)N)�__doc__r
r!Zgoogle.authrrrrrrr'r&r(r/ZCLOUD_SDK_CLIENT_IDrrr%r.r4rrrr�<module>s&�