Skip to content

amjackson11/gcp-adc-smoke-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gcp-adc-smoke-test

A tiny read-only CLI for checking whether Google Cloud Application Default Credentials are usable from your local environment.

It is meant for the boring but common situation where a local script, notebook, or internal tool fails and you need to quickly answer:

  • Are Application Default Credentials available?
  • Can the credentials be refreshed?
  • Can this identity read BigQuery metadata for a project?
  • Can this identity access a specific Cloud Storage bucket?

The tool does not create, update, or delete Google Cloud resources.

Installation

From a local checkout:

pip install -e .

For development:

pip install -e '.[dev]'

Authentication

This tool uses Google Application Default Credentials.

gcloud auth application-default login

If your environment does not provide a default project, pass one explicitly with --project.

Usage

Check that ADC loads and refreshes:

gcp-adc-smoke-test

Check BigQuery access for a project:

gcp-adc-smoke-test --project my-gcp-project --bigquery

Check a Cloud Storage bucket:

gcp-adc-smoke-test \
  --project my-gcp-project \
  --storage-bucket my-bucket

Check both BigQuery and Storage:

gcp-adc-smoke-test \
  --project my-gcp-project \
  --bigquery \
  --storage-bucket my-bucket

Example output:

GCP ADC Smoke Test

[OK] Application Default Credentials: ADC loaded successfully.
[OK] Credential identity: Resolved credential identity: user@example.com
[OK] BigQuery access: BigQuery access confirmed for project: my-gcp-project
[OK] Cloud Storage bucket access: Storage bucket access confirmed: my-bucket

All requested checks passed.

Some credential types do not expose a stable email or service account identity. In that case, the identity check may report that credentials are valid but the identity is not exposed.

Design constraints

  • Read-only checks only
  • No service account key management
  • No credential storage
  • No OAuth setup wizard
  • No broad resource inventory
  • Intended for local diagnostics before running scripts or internal tools

Development

Run tests:

pytest

Run linting:

ruff check .

Run type checking:

mypy src

License

MIT

About

A small read-only CLI for verifying that local Google Cloud Application Default Credentials can load and access BigQuery or Cloud Storage before running GCP-dependent scripts.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages