storage

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func AvailableBackends

func AvailableBackends() []string

AvailableBackends returns the available backends on this platform

Types

type Keyring added in v0.3.0

type Keyring struct {
	Backend string          `mapstructure:"backend"`
	Config  keyring.Config  `mapstructure:"config"`
	Ring    keyring.Keyring `yaml:"-"`
}

func (*Keyring) Erase added in v0.3.0

func (k *Keyring) Erase(vaultAddr string) error

Error erases the token for the vaultAddr from the token store. A missing token is not an error. Errors are returned if there are errors communicating with the token store.

func (*Keyring) Get added in v0.3.0

func (k *Keyring) Get(vaultAddr string) (Token, error)

Get retrieves a token for the vaultAddr if one is available in the token store. A missing token is not an error. Errors are returned if there are errors communicating with the token store.

func (*Keyring) InitKeyring added in v0.3.0

func (k *Keyring) InitKeyring() error

InitKeyring initializes the token storage into the main package var 'backendStorage'. It is not called during the early init phase to avoid errors with commands that do not need access to a backend. Instead, commands that interact with a backend should call InitKeyring and propagate errors back to the rootCmd.

func (*Keyring) List added in v0.3.0

func (k *Keyring) List() ([]Token, error)

List retrieves all tokens available in the token storage. An empty store is not an error. Errors are returned if there are errors communicating with the token store.

func (*Keyring) Store added in v0.3.0

func (k *Keyring) Store(token Token) error

Store saves the token in the token storage, returning any errors that occur while trying to persist the token.

type Token

type Token struct {
	VaultAddr string
	Token     string
	// contains filtered or unexported fields
}

Token represents a Vault token stored in a backend credential store

func (Token) Created

func (t Token) Created() time.Time

func (Token) LastModified

func (t Token) LastModified() time.Time

Jump to

Keyboard shortcuts

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