config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSecretDirectory = "/tmp/vault"
	DefaultSecretFile      = "secret.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	Role              string
	Provider          string
	IAMServerID       string
	STSEndpointRegion string
	VaultAddress      string
}

AuthConfig holds config required for logging in to Vault.

func AuthConfigFromEnv

func AuthConfigFromEnv() AuthConfig

AuthConfigFromEnv reads config from the environment for authenticating to Vault.

type ConfiguredSecret

type ConfiguredSecret struct {
	VaultPath string // The path to read from in Vault
	FilePath  string // The path to write to in the file system
	// contains filtered or unexported fields
}

ConfiguredSecret represents a pair of environment variables of the form:

VAULT_SECRET_PATH_FOO=/kv/data/foo VAULT_SECRET_FILE_FOO=/tmp/vault/secret/foo

Where FOO is the name, and must match across both env vars to form a valid secret configuration. The name can also be empty.

func ParseConfiguredSecrets

func ParseConfiguredSecrets() ([]ConfiguredSecret, error)

ParseConfiguredSecrets reads environment variables to determine which secrets to read from Vault, and where to write them on disk.

func (ConfiguredSecret) Name

func (cs ConfiguredSecret) Name() string

Name is the name parsed from the environment variable name. This name is used as a key to match secrets with file paths.

func (ConfiguredSecret) Valid

func (cs ConfiguredSecret) Valid() bool

Valid checks that both a secret path and a destination path are given.

Jump to

Keyboard shortcuts

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