handler

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoVaultAddress means that we don't have a valid vault address
	ErrNoVaultAddress    = errors.New("no vault address defined")
	ErrActionUnsupported = errors.New("action unsupported")
)

Functions

This section is empty.

Types

type Data added in v0.1.2

type Data struct {
	Address string `json:"address" yaml:"address"`
	Token   string `json:"token" yaml:"token"`
}

type Handler

type Handler interface {
	// Name of the handler
	Name() string
	// Description of the handler
	Description() string
	// Path is the path where the data is stored
	Path() string
	// Get retrieves a token associated with the vaultAddr, and returns error if not being able to
	// retrieve a token
	Get(vaultAddr *url.URL) (string, error)
	// Store a token associated with the vaultAddr, and returns error if it fails to store the
	// vault token in the handler, otherwise nil
	Store(token string, vaultAddr *url.URL) error
	// Erase removes a token associated with the vaultAddr, and returns error if it fails to erase the
	// vault token in the handler, otherwise nil
	Erase(vaultAddr *url.URL) error
	// Decode the data that has been encoded by this handler
	Decode(path string) (Data, error)
	// Encode the data that represents the data
	Encode(data Data) ([]byte, error)
	// List the available tokens currently stored if supported by the handler
	List() ([]Data, error)
	// Purge all the tokens we currently have stored if supported by the handler, and returns all the deleted tokens
	Purge(dryRun bool) ([]Data, error)
}

Handler is a generic interface to which the Vault Token Helper must conform to

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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