vault

package
v1.10.6 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// RenewThreshold is used to compare against the token expiration time
	RenewThreshold = "168h"
)

Functions

func Authenticate added in v1.1.0

func Authenticate(e UserEnv, st bool) *api.Client

Authenticate a user with Vault e : user environment st: flag to use the stored token

func DeleteSecret added in v1.0.1

func DeleteSecret(c *api.Client, key string) (bool, error)

DeleteSecret removes a secret from Vault

func ListSecrets

func ListSecrets(c *api.Client, path string) ([]*api.Secret, []error)

ListSecrets reads the list of secrets/data under a path in Vault c : Vault client path : path to secret/data in Vault

func ReadSecret

func ReadSecret(c *api.Client, key string) (map[string]interface{}, error)

ReadSecret requests the secret/data from Vault c : Vault client key : the key for the desired secret/data

func WriteSecret

func WriteSecret(c *api.Client, key string, data map[string]interface{}) (bool, error)

WriteSecret adds a secret to Vault c : Vault client key : the key for the secret data : config for use when writing data

Types

type UserEnv

type UserEnv struct {
	Addr, Token string
	Simulate    bool
}

UserEnv contains settings from the ENV

Jump to

Keyboard shortcuts

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