File: //usr/lib/google-cloud-sdk/lib/surface/auth/__pycache__/revoke.cpython-312.pyc
�
��f � �� � d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlmZ ddl
mZ dd lm
Z
dd
lmZ ddlmZ ddlmZ ddlmZ dd
lmZ ddlmZ G d� dej0 � Zd� Zy)z.Revoke credentials being used by the CloudSDK.� )�absolute_import)�division)�unicode_literalsN)�base)�
exceptions)� auth_util)�config)�log)�
properties)�creds)�store)�resource_printerc �, � e Zd ZdZed� � Zd� Zd� Zy)�Revokea� Revoke access credentials for an account.
Revokes credentials for the specified user accounts, service accounts or
external accounts (workload identity pools).
When given a user account, this command revokes the user account token on the
server. If the revocation is successful, or if the token has already been
revoked, this command removes the credential from the local machine.
When given a service account, this command does not revoke the service account
token on the server because service account tokens are not revocable. Instead,
it will print a warning and remove the credential from the local machine. When
used with a service account, this command has only a local effect and the key
associated with the service account is not deleted. This can be done by
executing `gcloud iam service-accounts keys delete` after `revoke`.
When given an external account (workload identity pool), whether impersonated
or not, the command does not revoke the corresponding token on the server
because these tokens are not revocable. The underlying external credentials
(OIDC, AWS, etc.) used to generate these access tokens have to be revoked too,
but gcloud has no control over that. Instead, it will print a warning and
remove the credential from the local machine.
If no account is specified, this command revokes credentials for the currently
active account, effectively logging out of that account. If --all is given,
the behaviors described above apply individually to each account in the list.
You can revoke credentials when you want to prevent gcloud and other Google
Cloud CLI tools from using the specified account. You do not need to revoke
credentials to switch between accounts.
c � � | j ddd�� | j ddd�� | j j d � y )
N�accounts�*z-Accounts whose credentials are to be revoked.)�nargs�helpz--all�
store_truez$Revoke credentials for all accounts.)�actionr z"list[title="Revoked credentials:"])�add_argument�display_info� AddFormat)�parsers �lib/surface/auth/revoke.py�ArgszRevoke.ArgsE sM � �
���
�#�L� � N�
�����C� � E�
���!�!�"F�G� c � � |j xs g }t |t � r|g}t j � }t |� t |� z
}|r%t
j ddj |� � �|j r|}t j j j j � }|s|r|g}|st
j dd� �d}|D �]V }||k( r8t j t j j j d� t j"