§
    8?Äj,  ã                   ón   — d Z ddlZddlZddlmZmZ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dS )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k    rCt           j                             t           j                             d¦  «        dt          ¦  «        S 	 t           j                             t           j        t                   t          ¦  «        S # t          $ rI t           j                             dd¦  «        } t           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    úGC:\Projects\Historical\venv\Lib\site-packages\google/auth/_cloud_sdk.pyÚget_config_pathr   *   sñ   € ðÝŒzÕ*Ô?Ô@Ð@øÝð ð ð Øˆðøøøõ 
„w�$‚€ÝŒw�|Š|�BœG×.Ò.¨sÑ3Ô3°YÕ@QÑRÔRÐRð	@Ý”7—<’<Ý”
Õ7Ô8Õ:Kñô ð øõ ð 	@ð 	@ð 	@õ ”J—N’N =°$Ñ7Ô7ˆEÝ”7—<’<  tÕ->Ñ?Ô?Ð?Ð?Ð?ð		@øøøs   ‚ ž
+ª+Â9B< Â<ADÄDc                  óh   — t          ¦   «         } t          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!   F   s&   € õ "Ñ#Ô#€KÝŒ7�<Š<˜Õ%:Ñ;Ô;Ð;ó    c                 ó–   — t          t          j        d¦  «        5 }t          j        | |¬¦  «        }ddd¦  «         n# 1 swxY w Y   |S )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-   R   s�   € å	�bŒj˜#Ñ	Ô	ð B 'ÝÔ(¨¸ÐAÑAÔAˆðBð Bð Bñ Bô Bð Bð Bð Bð Bð Bð Bøøøð Bð Bð Bð Bà€Ms   ›>¾AÁAc                  ó  — t           j        dk    rt          } nt          } 	 t	          | ft
          z   ¦  «        }t          j        |¦  «                             ¦   «         }|r|ndS # t          j
        t          t          f$ r Y dS 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   Y   s•   € õ 
„w�$‚€Ý,ˆˆå*ˆðõ 0ØˆJÕ>Ñ>ñ
ô 
ˆõ
 Ô% gÑ.Ô.×4Ò4Ñ6Ô6ˆØ!Ð+ˆwˆw tÐ+øÝÔ)­7µGÐ<ð ð ð Øˆtˆtðøøøs   ¡AA% Á%BÂB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        ¬¦  «        }|                     d¦  «         	                    ¦   «         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   r   sÞ   € õ 
„w�$‚€Ý,ˆˆå*ˆð&Øð 	Hà�
Ý6ñ7à 'Ñ)Ð+ñ,ð ˆGð �jÕ#GÑGˆGå!Ô.¨w½zÔ?PÐQÑQÔQˆà×"Ò" 7Ñ+Ô+×1Ò1Ñ3Ô3Ð3øÝÔ)­7µGÐ<ð &ð &ð &ÝÔ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      s×   ðð @Ð ?à 	€	€	€	Ø Ð Ð Ð à >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >ð Ð à(Ð ð ?Ð à#Ð Ø)Ð à(DÐ %à'EÐ $ð Oð ð
@ð @ð @ð8	<ð 	<ð 	<ðð ð ðð ð ð2$&ð $&ð $&ð $&ð $&ð $&r"   