ó
    €Ï»  ã                   ó¾   • S r SSKJr  SSKJr  SSKJr  SSKJr  Sr " S S\R                  5      r	 " S	 S
\	5      r
 " S S\	5      r " S S\	5      rS rS rSS jrg)z#Manages logic for service accounts.é    )Úconfig)Ú
exceptions)Úcreds)Úp12_service_accountÚservice_accountc                   ó   • \ rS rSrSrSrg)ÚErroré   zErrors raised by this module.© N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r   ó    Ú2lib/googlecloudsdk/api_lib/auth/service_account.pyr	   r	      s   † Ü%r   r	   c                   ó   • \ rS rSrSrSrg)ÚUnsupportedCredentialsTypeé   z5Raised when given type credentials cannot be created.r   Nr   r   r   r   r   r      s   † Ü=r   r   c                   ó   • \ rS rSrSrSrg)ÚBadCredentialFileExceptioné"   ú Raised when file cannot be read.r   Nr   r   r   r   r   r   "   ó   † Ü(r   r   c                   ó   • \ rS rSrSrSrg)ÚBadCredentialJsonFileExceptioné&   r   r   Nr   r   r   r   r   r   &   r   r   r   c                 óD   • U =(       d    0 R                  S5      [        :H  $ )zFReturns whether a JSON content corresponds to an service account cred.Útype)ÚgetÚ_SERVICE_ACCOUNT_TYPE)Úcontent_jsons    r   ÚIsServiceAccountConfigr%   *   s   € à
×
˜"×	!Ñ	! &Ó	)Ô-BÑ	BÐBr   c                 ó@  • SSK Jn  SU ;  a  [        S5      e[        R                  " U 5      U S'   UR
                  R                  nU" U [        R                  S9nU R                  S5      Ul
        U R                  S5      Ul        U R                  S	5      Ul        U$ )
zCCreates google-auth creds from a dict of application default creds.r   )r   Úclient_emailz,The .json key file is not in a valid format.Ú	token_uri)ÚscopesÚprivate_keyÚprivate_key_idÚ	client_id)Úgoogle.oauth2r   r   Úc_credsÚGetEffectiveTokenUriFromCredsÚCredentialsÚfrom_service_account_infor   ÚCLOUDSDK_SCOPESr"   r*   r+   r,   )Újson_keyÚgoogle_auth_service_accountÚservice_account_credentialsr   s       r   Ú CredentialsFromAdcDictGoogleAuthr6   /   s›   € õ Kð ˜8Ó#Ü
(Ø6ó8ð 8ô "×?Ò?ÀÓI€(ˆ;Ñð "×-Ñ-×GÑGð á
% h´v×7MÑ7MÑ
N€%ð —l‘l =Ó1€%ÔØ!Ÿ™Ð&6Ó7€%ÔØ—L‘L Ó-€%„/Ø	€,r   Nc                 óv   • [         R                  " U UU[        R                  " 0 5      [        R
                  S9$ )zGCreates credentials object from given p12 private key and account name.)Úservice_account_emailr(   r)   )r   ÚCreateP12ServiceAccountr.   r/   r   r2   )r*   ÚaccountÚpasswords      r   ÚCredentialsFromP12Keyr<   M   s7   € ô 
×	4Ò	4ØØØ#Ü×5Ò5°bÓ9Ü×#Ñ#ñ
ð r   )N)r   Úgooglecloudsdk.corer   r   Úgooglecloudsdk.core.credentialsr   r.   r   r#   r	   r   r   r   r%   r6   r<   r   r   r   Ú<module>r?      sd   ðñ *õ 'Ý *Ý <Ý ?à)Ð ô&ˆJ×Ñô &ô> ô >ô) ô )ô) Uô )òCò
õ<	r   