gcp

package
v1.235.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClientOptions

func GetClientOptions(opts AuthOptions) []option.ClientOption

GetClientOptions returns Google Cloud client options based on the provided authentication configuration. This function provides unified authentication handling across all Google Cloud services in Atmos.

Authentication precedence: 1. Explicit credentials (JSON content or file path) 2. GOOGLE_OAUTH_ACCESS_TOKEN environment variable (static access token) 3. Application Default Credentials (ADC) which automatically handles:

  • GOOGLE_APPLICATION_CREDENTIALS environment variable
  • Compute Engine metadata service
  • Cloud Shell credentials
  • gcloud user credentials (from `gcloud auth application-default login`)
  • Workload Identity (in GKE)

func GetCredentialsFromBackend

func GetCredentialsFromBackend(backend map[string]any) string

GetCredentialsFromBackend extracts credentials from a Terraform backend configuration. This is used by the GCS Terraform backend.

func GetCredentialsFromStore

func GetCredentialsFromStore(credentials *string) string

GetCredentialsFromStore extracts credentials from a store configuration. This is used by the Google Secret Manager store.

Types

type AuthOptions

type AuthOptions struct {
	// Credentials can be either:
	// - JSON content (if starts with "{")
	// - File path to service account JSON file
	// - Empty string to use Application Default Credentials (ADC)
	Credentials string

	// AccessToken is an OAuth2 access token to use directly. This is preferred
	// by Atmos GCP WIF/service-account identities because their generated ADC
	// files do not contain refresh tokens.
	AccessToken string //nolint:gosec // Intentional credential field passed directly to Google client options.
	TokenExpiry time.Time

	// Endpoint overrides the default Google API endpoint. This is primarily used
	// by local emulators and integration tests.
	Endpoint string

	// EndpointInsecure allows plaintext gRPC for local endpoints.
	EndpointInsecure bool

	// WithoutAuthentication disables Google authentication for local endpoints
	// that do not validate credentials.
	WithoutAuthentication bool
}

AuthOptions contains configuration for Google Cloud authentication.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL