vault

package
v1.17.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyToken          = errors.New("unable to authenticate to vault with empty token")
	ErrNoAuthInfo          = errors.New("no auth info was returned after login")
	ErrVaultAuthentication = func(err error) error {
		return errors.Wrap(err, "unable to authenticate to vault")
	}
	ErrPartialCredentials = func(err error) error {
		return eris.Wrap(err, "only partial credentials were provided for AWS IAM auth: ")
	}
	ErrAccessKeyId     = errors.New("access key id must be defined for AWS IAM auth")
	ErrSecretAccessKey = errors.New("secret access key must be defined for AWS IAM auth")
)
View Source
var (
	MLastLoginSuccess     = utils.Int64Measure("gloo.solo.io/vault/last_login_success", "Timestamp of last successful authentication of vault")
	MLastLoginSuccessView = utils.ViewForCounter(MLastLoginSuccess, view.LastValue())

	MLastLoginFailure     = utils.Int64Measure("gloo.solo.io/vault/last_login_failure", "Timestamp of last failed authentication of vault")
	MLastLoginFailureView = utils.ViewForCounter(MLastLoginFailure, view.LastValue())

	MLoginSuccesses     = utils.Int64Measure("gloo.solo.io/vault/login_successes", "Number of successful authentications of vault")
	MLoginSuccessesView = utils.ViewForCounter(MLoginSuccesses, view.Sum())

	MLoginFailures     = utils.Int64Measure("gloo.solo.io/vault/login_failures", "Number of failed authentications of vault")
	MLoginFailuresView = utils.ViewForCounter(MLoginFailures, view.Sum())
)

Functions

func AuthenticateClient

func AuthenticateClient(ctx context.Context, client *vault.Client, clientAuth ClientAuth) (*vault.Secret, error)

AuthenticateClient authenticates the provided vault client with the provided clientAuth.

func NewAuthenticatedClient

func NewAuthenticatedClient(ctx context.Context, vaultSettings *v1.Settings_VaultSecrets, clientAuth ClientAuth) (*vault.Client, error)

NewAuthenticatedClient returns a vault client that has been authenticated with the provided settings, or an error if construction or authentication fails.

func NewUnauthenticatedClient

func NewUnauthenticatedClient(vaultSettings *v1.Settings_VaultSecrets) (*vault.Client, error)

NewUnauthenticatedClient returns a vault client that has not yet been authenticated

Types

type ClientAuth

type ClientAuth interface {
	vault.AuthMethod
}

func ClientAuthFactory

func ClientAuthFactory(vaultSettings *v1.Settings_VaultSecrets) (ClientAuth, error)

ClientAuthFactory returns a vault ClientAuth based on the provided settings.

func NewRemoteTokenAuth

func NewRemoteTokenAuth(authMethod vault.AuthMethod, retryOptions ...retry.Option) ClientAuth

NewRemoteTokenAuth is a constructor for RemoteTokenAuth

func NewStaticTokenAuth

func NewStaticTokenAuth(token string) ClientAuth

NewStaticTokenAuth is a constructor for StaticTokenAuth

type RemoteTokenAuth

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

func (*RemoteTokenAuth) Login

func (r *RemoteTokenAuth) Login(ctx context.Context, client *vault.Client) (*vault.Secret, error)

Login logs into vault using the provided authMethod

type StaticTokenAuth

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

func (*StaticTokenAuth) GetToken

func (s *StaticTokenAuth) GetToken() string

GetToken returns the value of the token field

func (*StaticTokenAuth) Login

func (s *StaticTokenAuth) Login(ctx context.Context, _ *vault.Client) (*vault.Secret, error)

Login logs in to vault using a static token

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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