vault

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(data string) (bt []byte, err error)

Decode converts and decompresses the BASE64-encoded data, returning the original byte array.

func Encode

func Encode(data []byte) (str string, err error)

Encode compresses data using ZLIB and returns its BASE64 representation.

Types

type Vault

type Vault struct {
	// contains filtered or unexported fields
}

Vault is a client to communicate with an instance of Hashicorp's Vault.

func NewWithAppRole added in v0.3.0

func NewWithAppRole(vaultURL, roleID, secretID, prefix, store string) (out *Vault, err error)

NewWithAppRole creates a new Vault client using AppRole as the authentication method. The token retrieved using roleID and secretID is automatically refreshed. VaultURL is the URL of the Vault server to connect to. prefix is the string prefix used when storing the secrets in Vault. store the store path used when storing secrets.

func NewWithToken added in v0.3.0

func NewWithToken(vaultURL, token, prefix, store string) (out *Vault, err error)

NewWithToken creates a new Vault client using an authentication token. VaultURL is the URL of the Vault server to connect to. prefix is the string prefix used when storing the secrets in Vault. store the store path used when storing secrets.

func (*Vault) Delete

func (v *Vault) Delete(name string) error

Delete removes a secret from Vault.

func (*Vault) Get

func (v *Vault) Get(name string) (out string, err error)

Get retrieves the content of a Vault secret.

func (*Vault) GetBin

func (v *Vault) GetBin(name string) (out []byte, err error)

GetBin retrieves the binary content of a Vault secret.

func (*Vault) Set

func (v *Vault) Set(name, data string) error

Set populates a Vault secret content.

func (*Vault) SetBin

func (v *Vault) SetBin(name string, data []byte) (err error)

SetBin populates a Vault secret content using binary data.

Jump to

Keyboard shortcuts

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