vault

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AuthPath             string
	Noprompt             bool
	Address              string
	Username             string
	UsernameSkipPrompt   bool
	Timeout              time.Duration
	InitialTokenDuration time.Duration
	Log                  Logger
}

type CustomError added in v0.0.7

type CustomError interface {
	Error() string
	// contains filtered or unexported methods
}

customError is custom error interface with one method that will block other functions from using this Error. This is not interchangeable with the standard error.

type CustomVaultError added in v0.0.7

type CustomVaultError struct {
	MessageParts  []string
	OriginalError error
}

CustomVaultError is the custom error type for this package

func (CustomVaultError) Error added in v0.0.7

func (verr CustomVaultError) Error() string

Error returns the error string

type Logger added in v0.0.2

type Logger interface {
	Debug(...interface{})
	Warn(...interface{})
	Fatal(...interface{})
}

type Vault added in v0.0.2

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

func New added in v0.0.2

func New(config *Config) (*Vault, error)

func (*Vault) AWScredentials added in v0.0.3

func (v *Vault) AWScredentials(account string, role string) (*api.Secret, error)

func (*Vault) GetAddress added in v0.0.7

func (v *Vault) GetAddress() (string, error)

GetAddress returns the currently configured Vault address

func (*Vault) GetCurrentTokenTTL added in v0.0.5

func (v *Vault) GetCurrentTokenTTL() (time.Duration, error)

GetCurrentTokenTTL gets the TTL of the current token

func (*Vault) GetHealth added in v0.1.3

func (v *Vault) GetHealth() (*api.HealthResponse, error)

GetHealth returns the Vault api health response

func (*Vault) GetMounts added in v0.0.3

func (v *Vault) GetMounts(mountType string) ([]string, error)

GetMounts retrieves a list of mounts Will return a string array filtered with given type. Example 'aws'

func (*Vault) GetSecret added in v0.0.3

func (v *Vault) GetSecret(path string) (*api.Secret, error)

GetSecret takes a secret path and returns the secret(s) in a Vault object

func (*Vault) GetSecretKey added in v0.0.2

func (v *Vault) GetSecretKey(path string, key string) (string, error)

GetSecretKey takes a secret path and key and returns, if successful, the secret string present in that key.

func (*Vault) GetSecretKeys added in v0.0.2

func (v *Vault) GetSecretKeys(path string) (map[string]string, error)

GetSecretKeys takes a secret path and returns, if successful, a map of all the keys at that path.

func (*Vault) GetToken added in v0.0.4

func (v *Vault) GetToken() (string, error)

GetToken returns the raw token

func (*Vault) GetUser added in v0.0.2

func (v *Vault) GetUser() string

func (*Vault) GetUsername added in v0.1.5

func (v *Vault) GetUsername() (string, error)

GetMeta returns the username metadata for the current token

func (*Vault) IsNewLogin added in v0.0.3

func (v *Vault) IsNewLogin() bool

IsNewLogin will help high level funcs know if a login prompt was used

func (*Vault) ListSecrets added in v0.0.2

func (v *Vault) ListSecrets(path string) ([]string, error)

ListSecrets takes a secret path and returns, if successful, a list of all child paths under that path.

func (*Vault) Login added in v0.0.2

func (v *Vault) Login() error

Login will authenticate the user with Vault Will detect if user needs to re-login

func (*Vault) RenewLease added in v0.0.6

func (v *Vault) RenewLease(leaseID string, duration time.Duration) (time.Duration, error)

Renew lease takes a Vault lease ID and renews it for the provided duration Returns the actual renew time (may be different than requested)

func (*Vault) Version added in v0.1.3

func (v *Vault) Version() (string, error)

Version returns the version of the Vault server

Jump to

Keyboard shortcuts

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