gcp

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGCPSecretSource

func NewGCPSecretSource(ctx context.Context, cfg *Config, client SecretVersionAccessor) (secrets.SecretSource, error)

NewGCPSecretSource creates a SecretSource backed by GCP Secret Manager. If client is nil, a new client is created using Application Default Credentials.

Types

type Config

type Config struct {
	ProjectID string `env:"PROJECT_ID" json:"projectID"`
}

Config configures the GCP Secret Manager client.

func (*Config) ValidateWithContext

func (cfg *Config) ValidateWithContext(ctx context.Context) error

ValidateWithContext validates the config.

type SecretVersionAccessor

type SecretVersionAccessor interface {
	AccessSecretVersion(ctx context.Context, req *secretmanagerpb.AccessSecretVersionRequest) (*secretmanagerpb.AccessSecretVersionResponse, error)
	Close() error
}

SecretVersionAccessor abstracts AccessSecretVersion for testability.

Jump to

Keyboard shortcuts

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