vault

package module
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSecret

func CreateSecret(ctx context.Context, engine, key, value string) error

CreateSecret takes a given key for an engine, and adds a new key/value pair in vault.

func DeleteSecret

func DeleteSecret(ctx context.Context, engine, key string) error

func GetSecretVersions

func GetSecretVersions(ctx context.Context, secretVersions *map[string]int64, secretNames []string) error

GetSecretVersions fills a map with the versions of secrets pulled from Vault.

func GetSecrets

func GetSecrets(ctx context.Context, secretValues *map[string]map[string]string, secretNames []string) error

GetSecrets fills a map with the values of secrets pulled from Vault.

func ListEngines

func ListEngines(ctx context.Context, path string) ([]string, error)

ListEngines fills a map with the secrets engines pulled from Vault.

func NewVaultClient

func NewVaultClient(ctx context.Context, c *config) (*vaultClient, error)

NewVaultClient configures and returns an initialized vault client.

func NewVaultToken

func NewVaultToken(vc *vaultClient) (string, error)

NewVaultToken uses a github token or service account to get a vault auth token

func UpdateSecret

func UpdateSecret(ctx context.Context, engine, key, value string) error

UpdateSecret takes a given key for an engine, and modifies its value in vault.

Types

type AuthClient

type AuthClient interface {
	GetVaultToken(vc *vaultClient) (string, error)
}

AuthClient is a type that satifies the necesary authorization layer for a vault client.

func NewAuthClient

func NewAuthClient(c *config) AuthClient

func NewGcpAuthClient

func NewGcpAuthClient() AuthClient

NewAuthClient returns a new instance of an auth client

func NewGithubAuthClient

func NewGithubAuthClient() AuthClient

NewAuthClient returns a new instance of an auth client

Jump to

Keyboard shortcuts

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