
                             S r SSKJr  SSKJr  SSKJr  SSKrSSKJr  SSK	J
r
  SSK	Jr  SS	KJr  SS
KJr  SSKJr  SSKJr  SSKJr  SSKJr   " S S\
R2                  5      rg)zARevoke credentials being used by Application Default Credentials.    )absolute_import)division)unicode_literalsN)credentials)base)
exceptions)config)log)
console_io)creds)google_auth_credentials)storec                   .    \ rS rSrSr\S 5       rS rSrg)Revoke#   a  Revoke previously generated Application Default Credentials.

Revokes Application Default Credentials that have been previously generated by
`{parent_command} login` and deletes the local credential file.

This does not affect any credentials set up through other means,
such as credentials referenced by the Application Default Credentials
environment variable or service account credentials that are active on
a Google Compute Engine virtual machine.
c                     g )N )parsers    .lib/surface/auth/application_default/revoke.pyArgsRevoke.Args/   s        c                    [         R                  " 5       n[        R                  R	                  U5      (       d   [
        R                  R                  S5        g[        R                  " 5       R                  U5      u  p4[        R                  " U5      (       dg  [        R                  " U5      (       dL  [        R                  " U5      (       d1  [        R                  " U5      (       d  [        R                   " S5      e[#        U[$        R&                  5      (       a  [(        R&                  R+                  U5      n[,        R.                  " SR1                  US9SSS9   [2        R4                  " U5        [        R6                  " U5        [
        R                  R                  S5        g! [2        R8                   a<    [        R6                  " U5        [
        R:                  " S	R1                  US95         gf = f)
z'Revoke Application Default Credentials.zHApplication Default Credentials have not been set up, nothing to revoke.NzQThe given credential file is a service account credential, and cannot be revoked.z;You are about to revoke the credentials stored in: [{file}])fileT)throw_if_unattendedcancel_on_nozCredentials revoked.zqThe credentials stored in: [{file}] are not revocable from the server but have been deleted from the file system.)r	   ADCFilePathospathisfiler
   statusPrintc_credsGetGoogleAuthDefaultload_credentials_from_fileIsUserAccountCredentialsIsExternalAccountCredentials IsExternalAccountUserCredentials IsImpersonatedAccountCredentialsc_excBadFileException
isinstancegoogle_auth_credsCredentialsc_google_authFromGoogleAuthUserCredentialsr   PromptContinueformatc_storeRevokeCredentialsremoveRevokeErrorwarning)selfargs	cred_filer   _s        r   Run
Revoke.Run3   s    ""$I77>>)$$	jj , -++-HHHE,,U33007744U;;44U;;""    %*6677''EE
e ELL 	M 	 		&ii		jj-. ii		kk??Ev @F @s   $AF0 0AH ?H r   N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r<   __static_attributes__r   r   r   r   r   #   s     	 	 	%r   r   )rB   
__future__r   r   r   r   google.oauth2r   r-   googlecloudsdk.callioper   r   r*   googlecloudsdk.corer	   r
   googlecloudsdk.core.consoler   googlecloudsdk.core.credentialsr   r#   r   r/   r   r3   SilentCommandr   r   r   r   <module>rL      sD    H &  ' 	 : ( 7 & # 2 < T <5T 5r   