secret

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package secret resolves secret references to plaintext values. Multiple backends are supported; the format of the reference string selects the backend:

  • "" — returns the plaintext fallback as-is (dev mode)
  • "env:VAR_NAME" — reads from environment variable VAR_NAME
  • "file:/path/to/file" — reads the file and trims surrounding whitespace
  • "arn:aws:..." — AWS Secrets Manager (cached for 5 min)

New backends can be added here without touching any other code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache is a thread-safe resolver with a time-bounded cache for remote secret backends. The zero value is ready to use.

func (*Cache) Resolve

func (c *Cache) Resolve(ctx context.Context, ref, plaintext string) (string, error)

Resolve returns the secret for ref. If ref is empty, plaintext is returned. See package doc for supported ref formats.

Jump to

Keyboard shortcuts

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