
                             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
\R                  5      rg)z^Command to create a configuration file to allow authentication from 3rd party user identities.    )absolute_import)division)unicode_literalsN)base)flags)cred_configc                   Z    \ rS rSrSrS\R                  " S5      0rSr\	S 5       r
S rSrg	)
CreateCredConfig   zCreate a configuration file for generated credentials.

This command creates a configuration file to allow access to authenticated
Google Cloud actions from a variety of external user accounts.
EXAMPLESa            To create a file-sourced credential configuration for your project, run:

            $ {command} locations/$REGION/workforcePools/$WORKFORCE_POOL_ID/providers/$PROVIDER_ID --credential-source-file=$PATH_TO_OIDC_ID_TOKEN --workforce-pool-user-project=$PROJECT_NUMBER --output-file=credentials.json

          To create a URL-sourced credential configuration for your project, run:

            $ {command} locations/$REGION/workforcePools/$WORKFORCE_POOL_ID/providers/$PROVIDER_ID --credential-source-url=$URL_FOR_OIDC_TOKEN --credential-source-headers=Key=Value --workforce-pool-user-project=$PROJECT_NUMBER --output-file=credentials.json

          To create an executable-source credential configuration for your project, run the following command:

            $ {command} locations/$REGION/workforcePools/$WORKFORCE_POOL_ID/providers/$PROVIDER_ID --executable-command=$EXECUTABLE_COMMAND --executable-timeout-millis=30000 --executable-output-file=$CACHE_FILE --workforce-pool-user-project=$PROJECT_NUMBER --output-file=credentials.json

          To use the resulting file for any of these commands, set the GOOGLE_APPLICATION_CREDENTIALS environment variable to point to the generated file.
          Fc                 j   [         R                  " U[        R                  R                  5        UR                  SSS9  UR                  SSSS9nUR                  SSS9  UR                  S	S
S9  UR                  SSS9  UR                  SSSS9  UR                  SSS9  UR                  SSSSS9  g )Naudiencez*The workforce pool provider resource name.)helpTzCredential types.)mutexrequiredr   z--credential-source-filez5The location of the file which stores the credential.z--credential-source-urlz&The URL to obtain the credential from.z--executable-commandzqThe full command to run to retrieve the credential. Must be an absolute path for the program including arguments.z--workforce-pool-user-projectzThe client project number used to identify the application (client project) to the server when calling Google APIs. The user principal must have serviceusage.services.use IAM permission to use the specified project.)r   r   z--subject-token-typezkThe type of token being used for authorization. This defaults to urn:ietf:params:oauth:token-type:id_token.z--enable-mtlszUse mTLS for STS endpoints.
store_true)r   actionhidden)r   AddCommonByoidCreateConfigFlagsr   
ConfigTypeWORKFORCE_POOLSadd_argument	add_group)clsparsercredential_typess      5lib/surface/iam/workforce_pools/create_cred_config.pyArgsCreateCredConfig.Args9   s    
))&&668 E  G ''T(; ( =!!"D " F !!!5 " 7 !!B "  '!    F  G
 *	      c                 b    [         R                  " U[         R                  R                  5        g )N)r   create_credential_configr   r   )selfargss     r   RunCreateCredConfig.Runh   s"    (()4)?)?)O)OQr     N)__name__
__module____qualname____firstlineno____doc__textwrapdedentdetailed_help_use_pluggable_authclassmethodr   r%   __static_attributes__r'   r    r   r
   r
      sD     (//-( , ,\Qr    r
   )r,   
__future__r   r   r   r-   googlecloudsdk.callioper   googlecloudsdk.command_lib.iamr   .googlecloudsdk.command_lib.iam.byoid_utilitiesr   CreateCommandr
   r'   r    r   <module>r8      s6    e &  '  ( 0 FNQt)) NQr    