File: //usr/local/CyberCP/lib/python3.10/site-packages/google/auth/__pycache__/_cloud_sdk.cpython-310.pyc
o
�h\ � @ s� d Z ddlZddlZddlmZ ddlmZ ddlmZ dZdZdZ dZ
d Zd
ZdZ
dZd
d� Zdd� Zdd� Zdd� Zddd�ZdS )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)�authzprint-access-tokenzH764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.comc C s� zt jtj W S ty Y nw t jdkr"t j�t j�d�dt �S zt j�t jt
t �W S tyE t j�dd�} t j�| dt � Y S w )z�Returns the absolute path the the Cloud SDK's configuration directory.
Returns:
str: The Cloud SDK config path.
�nt�~z.config�SystemDrivezC:�\)�os�environr �CLOUD_SDK_CONFIG_DIR�KeyError�name�path�join�
expanduser�_CONFIG_DIRECTORY�_WINDOWS_CONFIG_ROOT_ENV_VARr )�drive� r �I/usr/local/CyberCP/lib/python3.10/site-packages/google/auth/_cloud_sdk.py�get_config_path- s �
��r c C s t � } 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.
)r r r r �_CREDENTIALS_FILENAME)�config_pathr r r �(get_application_default_credentials_pathI s r c C s@ t tjd��}tj| |d�}W d � |S 1 sw Y |S )zJ Return subprocess.check_output with the given command and ignores stderr.�w��stderrN)�openr �devnull�
subprocess�check_output)�commandr$ �outputr r r �_run_subprocess_ignore_stderrU s
��r) c
C s^ t jdkrt} nt} zt| ft �}t�|��� }|r|W S dW S t j
ttfy. Y dS 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'