storage

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: Unlicense Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TTLUnknown time.Duration = 0
	//TTLInfinite means that no further renewal is necessary, as the auth will
	//last forever
	TTLInfinite = time.Duration(0x7FFFFFFFFFFFFFFF)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Accessor

type Accessor interface {
	List() (PathList, error)
	Get(path string) (map[string]string, error)
	//Authenticate receives metadata returned from the last run of a call to
	//authenticate. It is guaranteed to receive the value that was returned by
	//its constructor on the first run. It should return the new TTL, any
	//metadata to send to the next run, and an error if one occurred.
	//Authenticate must be called at some point before any calls to List or Get.
	Authenticate(last interface{}) (TTL time.Duration, nextMetadata interface{}, err error)
}

func NewAccessor

func NewAccessor(accessorType string, conf map[string]interface{}) (
	Accessor,
	interface{},
	error,
)

NewAccessor generates an accessor of the provided type, configured with the provided configuration object. returns the Accessor, the struct to be passed to the accessor's first auth call, and an error if one occurred.

type ConfigServerAccessor

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

func (*ConfigServerAccessor) Authenticate

func (a *ConfigServerAccessor) Authenticate(last interface{}) (
	TTL time.Duration,
	next interface{},
	err error,
)

func (*ConfigServerAccessor) Get

func (a *ConfigServerAccessor) Get(path string) (map[string]string, error)

func (*ConfigServerAccessor) List

func (a *ConfigServerAccessor) List() (PathList, error)

List attempts to get all of the paths in the config server

type ConfigServerConfig

type ConfigServerConfig struct {
	Address            string `yaml:"address"`
	InsecureSkipVerify bool   `yaml:"insecure_skip_verify"`
	CACerts            string `yaml:"ca_certs"`
	Auth               struct {
		GrantType    string `yaml:"grant_type"`
		ClientID     string `yaml:"client_id"`
		ClientSecret string `yaml:"client_secret"`
		Username     string `yaml:"username"`
		Password     string `yaml:"password"`
	} `yaml:"auth"`
}

type OmAccessor

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

func (*OmAccessor) Authenticate

func (v *OmAccessor) Authenticate(last interface{}) (time.Duration, interface{}, error)

func (*OmAccessor) Get

func (v *OmAccessor) Get(path string) (map[string]string, error)

Get attempts to get the secret stored at the requested backend path and return it as a map.

func (*OmAccessor) List

func (v *OmAccessor) List() (PathList, error)

List attempts to list the paths in the ops manager that could have certs

type OmConfig

type OmConfig struct {
	Address            string `yaml:"address"`
	InsecureSkipVerify bool   `yaml:"insecure_skip_verify"`
	CACerts            string `yaml:"ca_certs"`
	Auth               struct {
		GrantType    string `yaml:"grant_type"`
		Username     string `yaml:"username"`
		Password     string `yaml:"password"`
		ClientID     string `yaml:"client_id"`
		ClientSecret string `yaml:"client_secret"`
	} `yaml:"auth"`
}

type PathFilter

type PathFilter struct {
	Under    []string
	Matching []string
}

Multiple filters are "or"d together

type PathList

type PathList []string

func (PathList) Except

func (k PathList) Except(filter PathFilter) (ret PathList)

Doesn't modify reciever list

func (PathList) Only

func (k PathList) Only(filter PathFilter) (ret PathList)

Doesn't modify reciever list

type TLSClientAccessor

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

func (*TLSClientAccessor) Authenticate

func (t *TLSClientAccessor) Authenticate(_ interface{}) (time.Duration, interface{}, error)

func (*TLSClientAccessor) Get

func (t *TLSClientAccessor) Get(host string) (map[string]string, error)

func (*TLSClientAccessor) List

func (t *TLSClientAccessor) List() (PathList, error)

type TLSClientConfig

type TLSClientConfig struct {
	Hosts   []string `yaml:"hosts"`
	Timeout int      `yaml:"timeout"`
}

type VaultAccessor

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

func (*VaultAccessor) Authenticate

func (v *VaultAccessor) Authenticate(last interface{}) (
	time.Duration,
	interface{},
	error,
)

func (*VaultAccessor) Get

func (v *VaultAccessor) Get(path string) (map[string]string, error)

Get attempts to get the secret stored at the requested backend path and return it as a map.

func (*VaultAccessor) List

func (v *VaultAccessor) List() (PathList, error)

List attempts to list all the paths under the configured base path

type VaultConfig

type VaultConfig struct {
	Address            string `yaml:"address"`
	InsecureSkipVerify bool   `yaml:"insecure_skip_verify"`
	CACerts            string `yaml:"ca_certs"`
	Namespace          string `yaml:"namespace"`
	BasePath           string `yaml:"base_path"`
	Trace              bool   `yaml:"trace"`
	Auth               struct {
		Token    string `yaml:"token"`
		RoleID   string `yaml:"role_id"`
		SecretID string `yaml:"secret_id"`
	} `yaml:"auth"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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