HEX
Server: Apache/2.4.68 (Debian)
System: Linux as-cs-widget-demo-us-central1 6.1.0-44-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
User: root (0)
PHP: 8.2.32
Disabled: NONE
Upload Files
File: //usr/lib/google-cloud-sdk/lib/surface/artifacts/go/__pycache__/auth.cpython-312.pyc
�

��Z
����dZddlmZddlmZddlmZddlmZejejejj�Gd�dej���Z
y)	z8Implements commands for the GOAUTH environment variable.�)�base)�
endpoint_util)�go_util)�logc�0�eZdZdZddd�Zed��Zd�Zy)�Autha\Print authentication commands for the GOAUTH environment variable.

  This command implements the GOAUTH credential provider command introduced in
  Go 1.24. For more details about the GOAUTH environment variable, see
  https://pkg.go.dev/cmd/go#hdr-GOAUTH_environment_variable.  When you configure
  the GOAUTH environment variable for repositories, Artifact Registry looks for
  credentials in the following order:

  * Application Default Credentials (ADC)
  * Credentials provided by the Google Cloud CLI, including user credentials
      from the command `gcloud auth application-default login`.

  z
{description}a�    To configure the GOAUTH environment variable for repositories in `us-central1` and use your credentials:

        $ export GOAUTH="{command} --location=us-central1"

    To configure the GOAUTH environment variable for repositories in `us-central1` and use the credentials from a service account:

        $ export GOAUTH="{command} --location=us-central1 --json-key=path/to/key.json"
    )�DESCRIPTION�EXAMPLESc�~�|jddd��|jdddd�	�|jd
dd�
�y)z\Set up arguements for this command.

    Args:
      parser: An argparse.ArgumentPaser.
    �url�*z/A URL generated by Go to set up authentication.)�nargs�helpz
--location�LOCATIONTz5The location of the repository to print commands for.)�metavar�requiredrz
--json-key�JSON_KEYz�The path to the JSON key file to use for authentication. If not specified, the authentication commands printed will use the token from the logged in user.)rrN)�add_argument)�parsers � lib/surface/artifacts/go/auth.py�Argsz	Auth.Args7sa�����
��
>���
������
D�	�������
(�	��c��tj|jddd��}tj|j
�}tjj|�tjjd�tjj|�tjjd�y)zRun the go goauth command.�goF�https)�rep�protocol�N)	r�ArtifactRegistryDomainEndpoint�locationr�AuthorizationHeader�json_keyr�out�Print)�self�args�url_line�header_lines    r�RunzAuth.RunVsw���;�;��
�
�t����H��-�-�d�m�m�<�K��G�G�M�M�(���G�G�M�M�"���G�G�M�M�+���G�G�M�M�"�rN)�__name__�
__module__�__qualname__�__doc__�
detailed_help�staticmethodrr)�rrrrs1��� ��	
�-�����<
rrN)r-�googlecloudsdk.callioper�$googlecloudsdk.command_lib.artifactsrr�googlecloudsdk.corer�DefaultUniverseOnly�
ReleaseTracks�ReleaseTrack�GA�Commandrr0rr�<module>r9s_��?�(�>�8�#��������D�%�%�(�(�)�G�4�<�<�G�*��Gr