env

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 4 Imported by: 0

README

Environment Variable Secret Source (env://)

The Environment Variable secret source allows you to retrieve secrets directly from the process's environment variables.

Status

Built-in: This source is included and enabled by default in spelunk.

Usage

To use the Environment Variable source, use the env:// scheme followed by the name of the environment variable.

Syntax
env://<VARIABLE_NAME>
  • Type: env
  • Location: The name of the environment variable to look up.
Example

Suppose you have an environment variable named API_KEY with the value 12345-abcde.

export API_KEY="12345-abcde"

To retrieve this secret:

env://API_KEY

Behavior

  1. Lookup: The source uses os.LookupEnv to find the variable.
  2. Validation: If the environment variable is not set, DigUp will return an error (ErrSecretNotFound).
  3. Result: Returns the string value of the environment variable.

Use Cases

  • Twelve-Factor Apps: Adhering to the 12-factor methodology by storing config in the environment.
  • Containerization: Easily injecting secrets into containers via environment variables.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SecretSourceEnv

type SecretSourceEnv struct{}

SecretSourceEnv digs up secrets from environment variables. The URI scheme for this source is "env".

env://MY_API_KEY

This types.SecretSource is built-in to spelunker.Spelunker.

func (*SecretSourceEnv) DigUp

func (*SecretSourceEnv) Type

func (s *SecretSourceEnv) Type() string

Jump to

Keyboard shortcuts

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