
                         $   S r SSKJr  SSKJr  SSKrSSK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 rS rS rS r\S:X  a  \R.                  " 5          \" 5         gg! \ a  r\R4                  " \S5         SrCgSrCff = f)z&A convenience wrapper for starting bq.    )absolute_import)unicode_literalsN)util)
exceptions)config)
properties)gce)storec                 H    Uc  g U R                  SR                  XS95        g )Nz--{name}={value})namevalue)appendformat)argsr   r   s      bin/bootstrapping/bq.py_MaybeAddOptionr      s%    
]
++ ''T'?@    c                     U SS   H?  n[         R                  " SU5      (       a    g[         R                  " SU5      (       d  M?    g   g )N   z--use_google_auth(=(T|t)rue)*Tz1(--nouse_google_auth|--use_google_auth=(F|f)alse)Fre	fullmatchargvargs     r   _GetGoogleAuthFlagValuer      sA    !"Xc	||4c::	||H#NN	 
 
r   c                 X    U SS   H!  n[         R                  " SU5      (       d  M!    g   g)Nr   z--oauth_access_token=.+TFr   r   s     r   _IsOAuthAccessTokenFlagPresentr   %   s,    !"Xc	||.44  
r   c                  	   [         R                  " SS5      n [         R                  " SU S9  SS0n[         R                  " 5       n[         R                  " X!5        USS  Vs/ s H  o3R                  S	5      (       a  M  UPM     nn[        U5      nUSL nU(       + =(       a    U(       + n/ nS
n	[        U5      S:X  a  US   S:X  a  Sn	U(       Ga  US   S;  Ga  [        U5      (       Gd{  [        R                  " 5       [        l        [        R                  " 5       n
[         R                  " 5       u  pU	(       a  [        SU5        [        SU5        [         R"                  " 5       R%                  U5      n[         R"                  " 5       R'                  U5      nU(       a  U	(       a  [        S5        S/nGOM[         R(                  " 5       (       a"  U	(       a  [        S5        SU
R*                  /nGO[,        R.                  " 5       (       a=  U[,        R.                  " 5       R1                  5       ;   a  U	(       a  [        S5        S/nO[2        R4                  R7                  U5      (       a!  U(       a  U	(       a  [        S5        SSUSU/nOu[         R"                  " 5       R9                  U5      n[2        R4                  R7                  U5      (       a-  U(       a&  U	(       a  [        S5        [        S5        SSUSUSU/n[2        R:                  " S S!5      R=                  5       S":H  nU(       a#  U	(       a  [        S#5        UR?                  S$5        [A        US%U5        [         RB                  " S5        [D        RF                  RH                  n[A        US&URJ                  RM                  5       5        [A        US'URN                  RM                  5       5        [A        US(URP                  RM                  5       5        [A        US)URR                  RM                  5       5        [A        US*[D        RF                  RT                  RV                  RY                  5       5        [A        US+[D        RF                  RZ                  R\                  RM                  5       5        U	(       a  [        S,U5        [         R^                  " SS-/UQ76   gs  snf ).zLaunches bq.zplatform/bqVERSIONbq)versioninitz!To authenticate, run gcloud auth.r   N-Fr   infoT)r"   helpzProject:zAccount:zUsing Google authz--use_google_authzUsing Oauthz--oauth_access_tokenzUsing a GCE service accountz--use_gce_service_accountzUsing an ADC pathz--nouse_google_authz%--application_default_credential_filez--credential_filezDFalling back to p12 credentials. WARNING these are being deprecated.a  Using the deprecated P12 service account key format with legacy auth may introduce security vulnerabilities and will soon be unsupported. If you are unable to migrate to using the newer JSON key format, file a report to inform the BQ CLI team of your use case.z--service_accountz!--service_account_credential_filez"--service_account_private_key_file!GOOGLE_API_USE_CLIENT_CERTIFICATEfalseTRUEz
Using MTLSz--mtls
project_idproxy_address
proxy_portproxy_usernameproxy_passworddisable_ssl_validationca_certificates_filezArgs passed from gcloud:zbq.py)0bootstrappingReadFileContentsCommandStartGetDecodedArgvWarnAndExitOnBlockedCommand
startswithr   lenr   iamcred_util ImpersonationAccessTokenProviderr
   IMPERSONATION_TOKEN_PROVIDERLoadGetActiveProjectAndAccountprintr   PathsLegacyCredentialsAdcPathLegacyCredentialsBqPath"GetActiveImpersonateServiceAccounttokenr	   MetadataAccountsospathisfileLegacyCredentialsP12KeyPathgetenvupperr   r   CheckUpdatesr   VALUESproxyaddressGetportusernamepasswordauthr/   GetBoolcorecustom_ca_certs_fileExecutePythonTool)r"   blocked_commandsr   r   cmd_argsuse_google_authuse_google_auth_unspecifiednouse_google_authr   print_loggingcredsprojectaccountadc_pathsingle_store_pathp12_key_pathuse_client_certproxy_paramss                     r   mainrf   ,   s   **=)D'T731 
	%	%	'$++DC!!"XAXc^^C-@cX(A+D1/ /4 7))M2M.M	$-]aHQK61M 
1+0
0,T22 	557 
& JJLE$??AGJ J ||~66w?H>>wG	!"!"d		9	9	;	;	m$ekk2d	Gs||~'>'>'@@	+,)*d		!	!&7	!"

1


d \\^??Hl		%	%6   $!12$ 			5w?EEG	  	l
kk(D,0T"""((,$)=)=)A)A)CD$l&7&7&;&;&=>$(,*?*?*C*C*EF$(,*?*?*C*C*EF
33;;=
 
11557 	
$d+!!-@4@S Bs   #S S__main__r!   )__doc__
__future__r   r   rE   r   r1   %googlecloudsdk.api_lib.iamcredentialsr   r8   googlecloudsdk.callioper   googlecloudsdk.corer   r   googlecloudsdk.core.credentialsr	   r
   r   r   r   rf   __name__"DisallowIncompatiblePythonVersions	ExceptioneHandleError r   r   <module>rt      s   
 - & ' 	 	  F . & * / 1AsAl z224$F  
 $1d##$s   #A, ,B2B

B