vault

package
v1.2.11 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuthOptions

type BasicAuthOptions struct {
	Username string
	Password string
}

BasicAuthOptions contains options regarding to basic authentication.

type Client

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

Client is a wrapper around the vault client

func New

func New(address, authType string, opts ...Option) (*Client, error)

New returns an *vault.Client with a connection to named machines. It returns an error if a connection to the cluster cannot be made.

func (*Client) Close

func (c *Client) Close()

Close is only meant to fulfill the easykv.ReadWatcher interface. Does nothing.

func (*Client) GetValues

func (c *Client) GetValues(keys []string) (map[string]string, error)

GetValues is used to lookup all keys with a prefix. Several prefixes can be specified in the keys array.

func (*Client) WatchPrefix

func (c *Client) WatchPrefix(ctx context.Context, prefix string, opts ...easykv.WatchOption) (uint64, error)

WatchPrefix - not implemented at the moment

type Option

type Option func(*Options)

Option configures the vault client.

func WithAppID

func WithAppID(id string) Option

WithAppID sets the AppID (app-id auth method).

func WithBasicAuth

func WithBasicAuth(b BasicAuthOptions) Option

WithBasicAuth enables the basic authentication and sets the username and password.

func WithRoleID

func WithRoleID(id string) Option

WithRoleID sets the RoleID (approle auth method).

func WithSecretID

func WithSecretID(id string) Option

WithSecretID sets the ScretID (approle auth method).

func WithTLSOptions

func WithTLSOptions(tls TLSOptions) Option

WithTLSOptions sets the TLSOptions.

func WithToken

func WithToken(token string) Option

WithToken sets the token (toke auth method).

func WithUserID

func WithUserID(id string) Option

WithUserID sets the UserID (app-id auth method).

type Options

type Options struct {
	RoleID   string
	SecretID string
	AppID    string
	UserID   string
	Token    string
	TLS      TLSOptions
	Auth     BasicAuthOptions
}

Options contains all values that are needed to connect to vault.

type TLSOptions

type TLSOptions struct {
	ClientCert   string
	ClientKey    string
	ClientCaKeys string
}

TLSOptions contains all certificates and keys.

Jump to

Keyboard shortcuts

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