secrets

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheTTL time.Duration

CacheTTL controls how long resolved secrets remain valid. A zero duration disables expiry so values persist until ClearCache is called.

Functions

func ClearCache

func ClearCache()

ClearCache empties the cached secret values.

func LoadRandomSecret

func LoadRandomSecret(ctx context.Context, refs []string) (string, error)

LoadRandomSecret selects one of the provided secret references at random and resolves it via LoadSecret. When multiple references are given a unique seed is used for the random generator to ensure a different selection on each invocation.

func LoadSecret

func LoadSecret(ctx context.Context, ref string) (string, error)

LoadSecret resolves a secret reference using the registered plugins.

func Register

func Register(p Plugin)

Register adds a secret plugin for a prefix.

func ValidateSecret

func ValidateSecret(ref string) error

ValidateSecret checks that the reference uses a known prefix.

Types

type Plugin

type Plugin interface {
	Prefix() string
	Load(ctx context.Context, id string) (string, error)
}

Plugin fetches a secret value for a given identifier.

Directories

Path Synopsis
aws
env
gcp
k8s

Jump to

Keyboard shortcuts

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