gcpsm

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package gcpsm provides a Google Cloud Secret Manager provider.

Index

Constants

View Source
const Name = "gcpsm"

Name of the provider.

Variables

This section is empty.

Functions

func New

func New(
	override, rawValue bool,
	config *Config,
	secretInformation *SecretInformation,
) (provider.IProvider, error)

New creates a Google Cloud Secret Manager provider using Application Default Credentials.

func NewWithConfig

func NewWithConfig(
	override, rawValue bool,
	config *Config,
	secretInformation *SecretInformation,
	clientOptions ...googleoption.ClientOption,
) (provider.IProvider, error)

NewWithConfig creates a Google Cloud Secret Manager provider with additional Google API client options. When no options are supplied, Application Default Credentials are used.

Types

type Config

type Config struct {
	ProjectID string `json:"project_id" validate:"required,gte=1"`
}

Config contains Google Cloud configuration settings.

type GCPSM

type GCPSM struct {
	*provider.Provider `json:"-" validate:"required"`

	*Config            `json:"-" validate:"required"`
	*SecretInformation `json:"-" validate:"required"`
	// contains filtered or unexported fields
}

GCPSM provider definition.

func (*GCPSM) Load

func (g *GCPSM) Load(ctx context.Context, opts ...option.LoadKeyFunc) (map[string]string, error)

Load retrieves configuration from Google Cloud Secret Manager and exports it to the environment.

func (*GCPSM) Write

func (g *GCPSM) Write(ctx context.Context, values map[string]interface{}, opts ...option.WriteFunc) error

Write stores values as a new secret version. If the target secret does not exist, Write creates it with automatic replication first.

type SecretInformation

type SecretInformation struct {
	SecretNames []string `json:"secret_names" validate:"required,gte=1,dive,required"`
}

SecretInformation contains information about which secrets to retrieve.

Jump to

Keyboard shortcuts

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