Documentation
¶
Overview ¶
Package auth provides authentication for Google Cloud APIs.
It supports multiple authentication methods: - Application Default Credentials (for local development via gcloud). - GCP Metadata Server (for GCE, GKE, Cloud Run, Cloud Functions, App Engine).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessToken ¶
AccessToken retrieves a GCP access token. It tries Application Default Credentials first, then falls back to the metadata server. In test mode, ADC is skipped to ensure mock servers are used.
func SetMetadataURL ¶
func SetMetadataURL(urlStr string) func()
SetMetadataURL sets a custom metadata server URL for testing. Returns a function that restores the original URL. WARNING: This function should only be called in test code. Set DS9_ALLOW_TEST_OVERRIDES=true to enable in non-test environments.
Types ¶
This section is empty.