vault

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: MIT Imports: 4 Imported by: 0

README

Vault

Vault loader, read/write key-value pairs from vault.

go get github.com/rytsh/liz/loader/vault

Usage

Environment variable Description
VAULT_ROLE_ID Role ID
VAULT_ROLE_SECRET Role secret
VAULT_ADDR Vault address
VAULT_TOKEN Vault token
VAULT_AGENT_ADDR Vault agent address
VAULT_MAX_RETRIES Max retries
VAULT_CACERT CA certificate
VAULT_CACERT_BYTES CA certificate bytes
VAULT_CAPATH CA path
VAULT_CLIENT_CERT Client certificate
VAULT_CLIENT_KEY Client key
VAULT_RATE_LIMIT Rate limit
VAULT_CLIENT_TIMEOUT Client timeout
VAULT_SKIP_VERIFY Skip verify
VAULT_SRV_LOOKUP SRV lookup
VAULT_TLS_SERVER_NAME TLS server name
VAULT_HTTP_PROXY HTTP proxy
VAULT_PROXY_ADDR Proxy address
VAULT_DISABLE_REDIRECTS Disable redirects
VAULT_APPROLE_BASE_PATH /auth/approle/login/

Test

First initialize vault:

make vault
# make vault-destroy

Login with token:

make vault-login TOKEN=...

Set approle:

make vault-role

Then run tests:

VAULT_ROLE_ID=... make test

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Client          *api.Client
	AppRoleBasePath string
}

func (*API) Connect

func (c *API) Connect() error

func (*API) LoadMap

func (c *API) LoadMap(ctx context.Context, mountPath string, key string) (map[string]interface{}, error)

func (*API) Login

func (c *API) Login(ctx context.Context) error

func (*API) SetMap

func (c *API) SetMap(ctx context.Context, mountPath string, key string, value map[string]interface{}) error

Jump to

Keyboard shortcuts

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