gcp

package
v0.9.21 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 18 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

Overview

Package gcp resolves secret.KindGCP refs by fetching from GCP Secret Manager. Service-account auth uses only the Go standard library (no Google SDK). Fetch-only: plaintext is held in memory, never written to Postgres.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ProjectID             string
	ServiceAccountJSON    []byte
	UseMetadataServer     bool
	HTTPClient            *http.Client
	TokenEndpoint         string
	SecretManagerEndpoint string
	MetadataEndpoint      string
	Now                   func() time.Time
}

Config holds GCP project and credentials for Secret Manager fetch-only resolution. ServiceAccountJSON and UseMetadataServer are mutually exclusive auth paths; when both are unset resolution errors at token fetch time.

func ConfigFromEnv

func ConfigFromEnv() (Config, error)

ConfigFromEnv reads GCP_PROJECT or GOOGLE_CLOUD_PROJECT, optional GCP_USE_METADATA_SERVER=1, and credentials from GCP_SA_JSON or GOOGLE_APPLICATION_CREDENTIALS. Returns an error when required config is missing.

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver fetches secrets from GCP Secret Manager (KindGCP only).

func New

func New(cfg Config) *Resolver

New returns a Resolver for secret.KindGCP refs.

func (*Resolver) Resolve

func (r *Resolver) Resolve(ctx context.Context, ref secret.Ref) ([]byte, error)

Jump to

Keyboard shortcuts

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