
    /                         S 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
  \R                   " S S	\R                  5      5       rg
)z/Authenticate clusters using the Anthos client..    )base)anthoscli_backend)flags)
kube_flags)messages)logc                   6    \ rS rSrSrSS0r\S 5       rS rSr	g)	Login   z.Authenticate clusters using the Anthos client.EXAMPLESa  
      To  add credentials to default kubeconfig file:

          $ {command} --cluster=testcluster --login-config=kubectl-anthos-config.yaml

      To add credentials to custom kubeconfig file:

          $ {command}  --cluster=testcluster --login-config=kubectl-anthos-config.yaml --kubeconfig=my.kubeconfig

      To generate the commands without executing them:

          $ {command} --cluster=testcluster --login-config=kubectl-anthos-config.yaml --dry-run

      To add credentials to default kubeconfig file using server side login:

          $ {command} --cluster=testcluster --server=<server-url>


      To add credentials to custom kubeconfig file using server side login:

          $ {command}  --cluster=testcluster --server=<server-url> --kubeconfig=my.kubeconfig


      To add credentials to custom kubeconfig file with server side login using a remote-device for login:

          $ {command}  --cluster=testcluster --server=<server-url> --kubeconfig=my.kubeconfig --no-browser
            c                    [         R                  " S5      R                  U 5        [        R                  " 5       R                  U 5        [        R
                  " 5       R                  U 5        [        R                  " 5       R                  U 5        [        R                  " 5       R                  U 5        [        R                  " S5      R                  U 5        [        R                  " 5       R                  U 5        [        R                  " 5       R                  U 5        [        R                  " 5       R                  U 5        [        R                  " 5       R                  U 5        g )NzKSpecifies the destination kubeconfig file where credentials will be stored.zAPrint out the generated kubectl commands but do not execute them.)r   GetKubeConfigFlagAddToParserr   GetUserFlagGetClusterFlagGetLoginConfigFlagGetLoginConfigCertFlagGetDryRunFlag!GetSetPreferredAuthenticationFlagGetServerFlagGetNoBrowserFlagGetRemoteBootstrapFlag)parsers     lib/surface/anthos/auth/login.pyArgs
Login.Args;   s      	,--8[-@	##F+	&&v.	**62	  "..v6	 3 44?K4G	++-99&A	%%f-	((0	  "..v6    c                    [         R                  " 5       nUR                  nUR                  (       a  [        R
                  R                  [        R                  5        U" SUUR                  UR                  UR                  UR                  UR                  UR                  [         R                  " SS0S9S9	n[         R                  " U5      $ UR                   =(       d    UR"                  n[         R$                  " XQR                  5      u  pVnUR&                  n[         R(                  " UUUUUS9u  pn[        R
                  R                  [        R                  5        U" SUUR                  UR*                  UUR                  UR                  UR,                  U
UU	[         R                  " SS0S9S9n[         R                  " XCS L S9$ )	NloginGCLOUD_AUTH_PLUGINtrue)
extra_vars)	commandclusterkube_configlogin_config_certdry_run
server_url
no_browserremote_bootstrapenv)r$   login_configconfig_contentsforce_updateis_url)r#   r$   r%   userr,   r&   r'   show_exec_error	ldap_user	ldap_passpreferred_authr+   )list_clusters_only)r   AnthosAuthWrapperCLUSTERserverr   statusPrintr   LOGIN_CONFIG_MESSAGE
kubeconfigr&   r'   r)   r*   GetEnvArgsForCommandLoginResponseHandlerr,   default_config_pathGetFileOrURLset_preferred_authGetPreferredAuthForClusterr0   r1   )selfargscommand_executorr$   responser,   r-   r/   r.   
authmethodldapuserldappasss               r   Run	Login.RunK   s   (::<llG {{	jjx445!oo 22,,[[__0044.7h 33H== $$L(8(L(LL ->,J,J,,-.)L6 **L44%+%	
 #J( JJX223OOYY!00,,!22,f5
H  11o8 8r    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   rJ   __static_attributes__rL   r   r   r
   r
      s/    6  -< 7 7=8r   r
   N)rQ   googlecloudsdk.callioper   !googlecloudsdk.command_lib.anthosr   r   (googlecloudsdk.command_lib.anthos.commonr   r   googlecloudsdk.corer   DefaultUniverseOnlyBinaryBackedCommandr
   rL   r   r   <module>r[      sF    6 ( ? 3 ? = # n8D$$ n8 n8r   