vault

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadTLSConfig = errors.New("bad TLS configuration")
)

Functions

This section is empty.

Types

type Parameters

type Parameters struct {
	// connection and credential parameters
	Address         string
	ApproleRoleID   string
	ApproleSecretID string
	CACertBytes     []byte
}

type SecretProperties

type SecretProperties struct {
	MountPath     string
	Path          string
	UserField     string
	PasswordField string
	SecretName    string
	UserName      string
}

the locations / field names of kv2 secrets

type Vault

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

func NewVaultAppRoleClient

func NewVaultAppRoleClient(ctx context.Context, parameters Parameters) (*Vault, error)

NewVaultAppRoleClient logs in to Vault using the AppRole authentication method, returning an authenticated client and the auth token itself, which can be periodically renewed.

func (*Vault) GetKVSecret

func (v *Vault) GetKVSecret(ctx context.Context, props *SecretProperties, secret string) (*vault.KVSecret, error)

GetKVSecret fetches the latest version of secret api key from kv-v1 or kv-v2

func (*Vault) IsLoggedIn

func (v *Vault) IsLoggedIn() bool

func (*Vault) RenewToken

func (v *Vault) RenewToken(ctx context.Context, doneRenew, tokenLifecycle chan bool, wg *sync.WaitGroup)

Jump to

Keyboard shortcuts

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