vault

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2019 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name is the Provider name
	Name = "vault"

	// VaultKeysSeparator is the separator between vault keys in KeysEnvVar
	VaultKeysSeparator = ":"

	// VaultKeySeparator is the separator between key and version in KeysEnvVar
	VaultKeySeparator = "@"
)

Variables

This section is empty.

Functions

func New

func New() (environ.Provider, error)

New returns a Client as an environ.Provider or an error if configuring failed. If running in a Kubernetes cluster and not provided a token, will use the service account token.

Types

type Client

type Client struct {
	*api.Client
	AuthMethod  string `env:"VAULT_AUTH_METHOD" envDefault:"kubernetes"`
	AuthPath    string `env:"VAULT_AUTH_PATH"`
	AuthData    string `env:"VAULT_AUTH_DATA" envDefault:"{}"`
	AppRole     string `env:"VAULT_APP_ROLE"`
	IamRole     string `env:"VAULT_IAM_ROLE"`
	AwsPath     string `env:"VAULT_AWS_PATH" envDefault:"aws"`
	AwsCredFile string `env:"AWS_SHARED_CREDENTIALS_FILE" envDefault:"/var/aws/credentials"`
	Keys        KVKeys `env:"VAULT_KV_KEYS"`
}

Client is an environ.Provider and github.com/hashicorp/vault/api.Client which will get the requested keys

func (*Client) AddToEnviron

func (c *Client) AddToEnviron(e *environ.Environ) error

AddToEnviron iterates through the given []VaultKeys, decoding the data returned from each key into a map[string]string and merging it into the environ.Environ

type KVKey added in v0.1.0

type KVKey struct {
	Path    string
	Version *int
}

KVKey is a kv ver2 key in Vault

type KVKeys added in v0.1.0

type KVKeys []*KVKey

KVKeys is an alias for []*KVKey. Needed for caarlos0/env to support parsing.

Jump to

Keyboard shortcuts

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