
    {                     P   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	KJr  SS
KJr  SSKJ	r  SSKJr  SSKJr  Sr\R*                  \R,                  \R.                  " \R0                  R2                  5       " S S\R4                  5      5       5       5       rg)zHA docker credential helper that provides credentials for GCR registries.    )absolute_import)division)unicode_literalsN)base)
exceptions)log)
properties)creds)store)credential_utils3300sc                   6    \ rS rSrSrSrSr\S 5       rS r	Sr
g)	DockerHelper%   zAA Docker credential helper to provide access to GCR repositories.getlistc                 Z    U R                  SSS9  U R                  R                  S5        g )Nmethodz$The docker credential helper method.)helpjson)add_argumentdisplay_info	AddFormat)parsers    !lib/surface/auth/docker_helper.pyArgsDockerHelper.Args.   s*    
'MN
!!&)    c                    UR                   [        R                  :X  a*  [        R                  " 5        Vs0 s H	  nSU-   S_M     sn$ UR                   [        R
                  :X  Ga   [        R                  " SS9n[        R                  " W[        S9  [        R                   R#                  5       R%                  5       n[&        R(                  R*                  R,                  R/                  5       (       dM  UR1                  SSS5      [        R2                  " 5       ;  a#  [4        R6                  " S	R9                  US
95      e[:        R<                  " U5      (       a  UR>                  OUR@                  nUSS.$ URC                  5       RE                  S5        gs  snf ! [        R                   a0    [        R                  " S5        [        R                  " S5         GNif = f)zRun the helper command.zhttps://_dcgcloud_tokenT)use_google_authz}You do not currently have an active account selected. See https://cloud.google.com/sdk/docs/authorizing for more information.   )window z'Repository url [{url}] is not supported)url)SecretUsernamenoneN)#r   r   LISTr   DefaultAuthenticatedRegistriesGETc_storeLoadcreds_exceptionsNoActiveAccountExceptionr   PrintsysexitRefreshIfExpireWithinWindowTOKEN_MIN_LIFETIMEstdinreadstripr	   VALUES	artifactsallow_unrecognized_registryGetBoolreplaceSupportedRegistriesr   Errorformatc_credsIsGoogleAuthCredentialstokenaccess_tokenGetDisplayInfor   )selfargsr%   credrB   s        r   RunDockerHelper.Run4   s    {{l''' &DDF
 Gc //F  
((	(||D1 ))$7IJIINN""$c((DDLLNNKK
B"2"F"F"HI  7>>3>GI I ,,T22 **8<8I8I 
 '  	##F+U 66 		 ! 	" 		s   F)F# #A G'&G' N)__name__
__module____qualname____firstlineno____doc__r+   r)   staticmethodr   rH   __static_attributes__rJ   r   r   r   r   %   s)     J#	$* *
.r   r   )rO   
__future__r   r   r   r1   googlecloudsdk.callioper   googlecloudsdk.corer   r   r	   googlecloudsdk.core.credentialsr
   r@   r.   r   r,   googlecloudsdk.core.dockerr   r4   HiddenUniverseCompatibleReleaseTracksReleaseTrackGACommandr   rJ   r   r   <module>r]      s     O &  ' 
 ( * # * < J < 7   D%%(():4<< : *  :r   