vault

package
v1.15.5 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ManagersRoot = root + ".managers"
)

Variables

This section is empty.

Functions

func ConfigAdd

func ConfigAdd(path string)

func ManageAll

func ManageAll(ctx context.Context, managers ...Manager)

ManageAll configures all managers to a new manager pool.

func ManagerConfigAdd

func ManagerConfigAdd(path string)

func NewClient

func NewClient(ctx context.Context) (*vault.Client, error)

NewClient returns a new vault client with default options.

func NewClientWithConfigPath

func NewClientWithConfigPath(ctx context.Context, path string) (*vault.Client, error)

NewClientWithConfigPath returns a new vault client with options from config path.

func NewClientWithOptions

func NewClientWithOptions(ctx context.Context, options *Options) (*vault.Client, error)

NewClientWithOptions returns a new vault client with options.

Types

type Manager

type Manager interface {
	Options() *ManagerOptions
	Close(context.Context) error
	Configure(context.Context, map[string]interface{}) error
}

Manager vault manager interface.

type ManagerOptions

type ManagerOptions struct {
	SecretPath string
	Watcher    struct {
		Enabled   bool
		Increment int
	}
	Keys map[string]string
}

ManagerOptions represents a vault client options.

func NewManagerOptionsWithPath

func NewManagerOptionsWithPath(path string) (opts *ManagerOptions, err error)

NewManagerOptionsWithPath unmarshals manager options based a given key path.

type ManagerPool

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

ManagerPool represents a manager pool for vault.

func NewManagerPool

func NewManagerPool(client *vault.Client, managers ...Manager) *ManagerPool

NewManagerPool returns a new manager pool.

func (*ManagerPool) Configure

func (m *ManagerPool) Configure(ctx context.Context, manager Manager) error

Configure configures manager with options from this manager pool.

func (*ManagerPool) ManageAll

func (m *ManagerPool) ManageAll(ctx context.Context)

ManageAll configures all managers from this manager pool.

type Options

type Options struct {
	Addr   string
	Type   string
	CaPath string
	Token  string
	K8s    struct {
		Role string
		Jwt  struct {
			File    string
			Content string
		}
	}
}

Options vault client options.

func NewOptions

func NewOptions() (*Options, error)

NewOptions returns options from config file or environment vars.

func NewOptionsWithPath

func NewOptionsWithPath(path string) (opts *Options, err error)

NewOptionsWithPath unmarshals a given key path into options and returns it.

Jump to

Keyboard shortcuts

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