envprovider

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package envprovider implements secrets.Provider for the "env" scheme: references of the form "secretref://env/<VAR>" are resolved from the process environment. This is the local/dev provider; cloud providers follow the same layout at adapters/secrets/<name>provider.

See docs/blueprint/12-configuration-and-deployment.md §5 and decision D-0013 in docs/implementation/decisions.md.

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 resolves "secretref://env/<VAR>" from the process environment.

func New

func New() *Provider

New returns a Provider backed by os.LookupEnv.

func NewWithLookup

func NewWithLookup(lookup func(string) (string, bool)) *Provider

NewWithLookup returns a Provider using an injectable lookup function. The function must match os.LookupEnv semantics: returning (value, true) when the variable is set (even if empty) and ("", false) when absent.

func (*Provider) Resolve

func (p *Provider) Resolve(_ context.Context, ref secrets.Ref) (string, error)

Resolve returns the environment-variable value named by ref.Path.

ref.Provider must be "env"; any other provider name is rejected so that a mis-routed reference fails fast rather than silently resolving nothing.

Missing and empty-string variables are both treated as errors: an absent variable is a deployment gap, and an empty secret is a deployment bug (a deliberately blank value must be modelled as an absent feature, not an empty secret reference).

Jump to

Keyboard shortcuts

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