HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //snap/google-cloud-cli/396/platform/bq/auth/utils.py
#!/usr/bin/env python
"""BQ CLI helper functions for authentication."""

import os

import bq_flags
import bq_utils


_DEFAULT_TOKEN_HOST = 'https://oauth2.googleapis.com/token'
_DEFAULT_MTLS_TOKEN_HOST = 'https://oauth2.mtls.googleapis.com/token'


_CLOUD_CLI_CLIENT_ID = '32555940559.apps.googleusercontent.com'
_CLOUD_CLI_CLIENT_SECRET = 'ZmssLNjJy2998hD4CTg2ejr2'
_CLOUD_CLI_CLIENT_USER_AGENT = 'google-cloud-sdk' + os.environ.get(
    'CLOUDSDK_VERSION', bq_utils.VERSION_NUMBER
)

_BQ_CLI_CLIENT_ID = '977385342095.apps.googleusercontent.com'
_BQ_CLI_CLIENT_SECRET = 'wbER7576mc_1YOII0dGk7jEE'
_BQ_CLI_CLIENT_USER_AGENT = 'bq/' + bq_utils.VERSION_NUMBER


def get_client_id() -> str:
  if os.environ.get('CLOUDSDK_WRAPPER') == '1':
    return _CLOUD_CLI_CLIENT_ID
  else:
    return _BQ_CLI_CLIENT_ID


def get_client_secret() -> str:
  if os.environ.get('CLOUDSDK_WRAPPER') == '1':
    return _CLOUD_CLI_CLIENT_SECRET
  else:
    return _BQ_CLI_CLIENT_SECRET


def get_client_user_agent() -> str:
  if os.environ.get('CLOUDSDK_WRAPPER') == '1':
    return _CLOUD_CLI_CLIENT_USER_AGENT
  else:
    return _BQ_CLI_CLIENT_USER_AGENT


def get_token_uri() -> str:
  # TODO: b/394417874 - Read user's gcloud properties too.
  if bq_flags.MTLS.value:
    return _DEFAULT_MTLS_TOKEN_HOST
  return _DEFAULT_TOKEN_HOST