vault

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppRoleAuth

type AppRoleAuth struct {
	RoleID    string
	SecretID  string
	MountPath string
}

AppRoleAuth is a struct for working with Vault that uses AppRole

func NewAppRoleAuth

func NewAppRoleAuth(roleID, secretID, mountPath string) *AppRoleAuth

NewAppRoleAuth initalizes a new AppRolAuth with role id and secret id

func (*AppRoleAuth) Authenticate

func (a *AppRoleAuth) Authenticate(vaultClient *api.Client) error

Authenticate authenticates with Vault using App Role and returns a token

type GithubAuth

type GithubAuth struct {
	AccessToken string
	MountPath   string
}

GithubAuth is a struct for working with Vault that uses the Github Auth method

func NewGithubAuth

func NewGithubAuth(token, mountPath string) *GithubAuth

NewGithubAuth initializes a new GithubAuth with token

func (*GithubAuth) Authenticate

func (g *GithubAuth) Authenticate(vaultClient *api.Client) error

Authenticate authenticates with Vault and returns a token

type K8sAuth

type K8sAuth struct {
	// Optional, will use default path of auth/kubernetes if left blank
	MountPath string

	// Optional, will use default service account if left blank
	TokenPath string

	Role string
}

K8sAuth TODO

func NewK8sAuth

func NewK8sAuth(role, mountPath, tokenPath string) *K8sAuth

NewK8sAuth initializes and returns a K8sAuth Struct

func (*K8sAuth) Authenticate

func (k *K8sAuth) Authenticate(vaultClient *api.Client) error

Authenticate authenticates with Vault via K8s and returns a token

type TokenAuth

type TokenAuth struct{}

Just a plain vault token

func (*TokenAuth) Authenticate

func (t *TokenAuth) Authenticate(vaultClient *api.Client) error

The vault client auto-detect if the VAULT_TOKEN is set, so just leave everything to the vault client

type UserPassAuth added in v1.13.0

type UserPassAuth struct {
	Username  string
	Password  string
	MountPath string
}

UserPassAuth is a struct for working with Vault that uses Username & Password

func NewUserPassAuth added in v1.13.0

func NewUserPassAuth(username, password, mountPath string) *UserPassAuth

NewUserPassAuth initalizes a new NewUserPassAuth with username & password

func (*UserPassAuth) Authenticate added in v1.13.0

func (a *UserPassAuth) Authenticate(vaultClient *api.Client) error

Authenticate authenticates with Vault using userpass and returns a token

Jump to

Keyboard shortcuts

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