secretenv

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: BSD-3-Clause Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package secretenv lets a secret that used to be an environment variable be given by reference instead.

For each secret NAME the operator may set NAME (plaintext, deprecated: it is readable in /proc/PID/environ and inherited by every child process) or NAME_FROM, a github.com/go-authn/secretsource reference (systemd-creds:, keychain:, keepassxc:, file:). Both set is an error. Resolve reads the value once, stores it in memory and unsets the plaintext variable so that child processes do not inherit it; Get returns the stored value.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(name string) string

Get returns the secret resolved by Resolve. A name that was never resolved falls back to the process environment, so code that runs without the startup step (tests, embedding) keeps working.

func Resolve

func Resolve(ctx context.Context, warn io.Writer, names ...string) error

Resolve reads every named secret. warn receives the deprecation notice for a plaintext variable (nil discards). Errors never contain the value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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