vaultclient

package
v0.0.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSecret

func GetSecret(secretPath string) (map[string]interface{}, error)

func GetSecretValue

func GetSecretValue(secretPath string, key string) (string, error)

func Init

func Init(role string, url string)

func SetSecret

func SetSecret(secretPath string, value []byte) (bool, error)

Types

type VaultClient

type VaultClient struct {
	Context        context.Context
	Client         *vault.Client
	Url            string
	Role           string
	Token          string
	Exp            int64
	Ttl            int32
	RenewThreshold int64
}

func GetInitiatedVaultClient

func GetInitiatedVaultClient() *VaultClient

TODO: Remove this function, it is only used to support legacy code

func NewVaultClient

func NewVaultClient(role string, url string) *VaultClient

func (VaultClient) CheckHealth

func (rc VaultClient) CheckHealth() []health.Check

func (VaultClient) GetClient

func (v VaultClient) GetClient() *vault.Client

func (VaultClient) Ping

func (v VaultClient) Ping() bool

type VaultCredentials

type VaultCredentials struct {
	Username  string
	Password  string
	VaultPath string
	Exp       int64
}

func (*VaultCredentials) CheckAndRenew

func (vc *VaultCredentials) CheckAndRenew() bool

func (*VaultCredentials) GetUsernamePassword

func (vc *VaultCredentials) GetUsernamePassword() (string, string)

func (*VaultCredentials) Init

func (vc *VaultCredentials) Init(vaultpath string)

func (*VaultCredentials) IsExpired

func (vc *VaultCredentials) IsExpired() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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