secrets

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package secrets provides a HashiCorp Vault-backed implementation of config.SecretProvider. It authenticates once at startup (token, Kubernetes, or AppRole) and reads static secrets from KV / generic engines.

Scope note: secrets are fetched once and the client is then discarded — there is no background lease renewal. This is correct for static KV values (API keys, a database password). Dynamic/leased secrets (e.g. a "raw" reference to database/creds/<role>) are reachable but their short-lived credentials are NOT renewed here; renewing them would need a lease watcher and reconnect logic, which is intentionally out of scope.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

Provider reads secrets from Vault. It implements config.SecretProvider.

func New

func New(ctx context.Context, vcfg config.VaultConfig, log *slog.Logger) (*Provider, error)

New builds a Vault client from vcfg and authenticates using the configured method. The returned Provider is ready to resolve references.

func (*Provider) Get

func (p *Provider) Get(ctx context.Context, ref config.VaultRef) (string, error)

Get resolves a single reference. The engine kind decides how the read response is unwrapped.

Jump to

Keyboard shortcuts

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