File: //lib/google-cloud-sdk/lib/surface/auth/__pycache__/login.cpython-312.pyc
�
��WN � �~ � d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlm Z
ddlmZ dd l
mZ dd
l
mZ ddl
mZ ddlmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm!Z" ddlmZ# ddlm$Z% ddlm&Z' d� Z(d� Z)d� Z*ejV G d� dejX � � Z-d� Z.d� Z/d� Z0d� Z1y) z(The auth command gets tokens via oauth2.� )�absolute_import)�division)�unicode_literalsN)�external_account)�service_account)�util)�actions)�base)�
exceptions)� auth_util)�flags)�workforce_login_config)�config)�log)�
properties)�
console_io)�creds)�devshell)�gce)�storec �> � t j � r+t j d� }t j
|�� S t
j � j r@t j | � s+t j d� }t j
|�� S y)z�Prompts users if they try to login in managed environments.
Args:
cred_config: Json object loaded from the file specified in --cred-file.
Returns:
True if users want to continue the login command.
z�
You are already authenticated with gcloud when running
inside the Cloud Shell and so do not need to run this
command. Do you wish to proceed anyway?
)�messagea�
You are running on a Google Compute Engine virtual machine.
It is recommended that you use service accounts for authentication.
You can run:
$ gcloud config set account `ACCOUNT`
to switch accounts if necessary.
Your credentials may be visible to others with access to this
virtual machine. Are you sure you want to authenticate with
your personal account?
T)�
c_devshell�IsDevshellEnvironment�textwrap�dedentr �PromptContinue�c_gce�Metadata� connected�auth_external_account�IsExternalAccountConfig)�cred_configr s �lib/surface/auth/login.py�ShouldContinueLoginr% , s} � � �%�%�'��o�o� � �G�
�$�$�W�5�5�
����"�"�!�9�9�+�F��o�o�
�
�G� �$�$�W�5�5�� c � � t j }|t j fz
}| j r|t j
fz
}|S �N)r �CLOUDSDK_SCOPES�REAUTH_SCOPE�enable_gdrive_accessr �GOOGLE_DRIVE_SCOPE)�args�scopess r$ � GetScopesr/ Q sC � ��!�!�&� �V�
�
�"�"�&� ���
�y�+�+�-�-�F� �-r&