vault

package
v0.0.0-...-e3e1202 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppRole    = "approle"
	Kubernetes = "kubernetes"
	UserPass   = "userpass"
	Token      = "token"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthAppRole

type AuthAppRole struct {
	RoleID        string         `yaml:"role_id" category:"experimental"`
	SecretID      flagext.Secret `yaml:"secret_id" category:"experimental"`
	WrappingToken bool           `yaml:"wrapping_token,omitempty" category:"experimental"`
	MountPath     string         `yaml:"mount_path,omitempty" category:"experimental"`
}

func (*AuthAppRole) RegisterFlagsWithPrefix

func (cfg *AuthAppRole) RegisterFlagsWithPrefix(f *flag.FlagSet, prefix string)

type AuthConfig

type AuthConfig struct {
	AuthType string `yaml:"type" category:"experimental"`

	AuthAppRole    AuthAppRole    `yaml:"approle,omitempty" category:"experimental"`
	AuthKubernetes AuthKubernetes `yaml:"kubernetes,omitempty" category:"experimental"`
	AuthUserPass   AuthUserPass   `yaml:"userpass,omitempty" category:"experimental"`
	AuthToken      AuthToken      `yaml:"token,omitempty" category:"experimental"`
}

func (*AuthConfig) RegisterFlagsWithPrefix

func (cfg *AuthConfig) RegisterFlagsWithPrefix(f *flag.FlagSet, prefix string)

type AuthKubernetes

type AuthKubernetes struct {
	RoleName                string         `yaml:"role_name" category:"experimental"`
	ServiceAccountToken     flagext.Secret `yaml:"service_account_token,omitempty" category:"experimental"`
	ServiceAccountTokenPath string         `yaml:"service_account_token_path,omitempty" category:"experimental"`
	MountPath               string         `yaml:"mount_path,omitempty" category:"experimental"`
}

func (*AuthKubernetes) RegisterFlagsWithPrefix

func (cfg *AuthKubernetes) RegisterFlagsWithPrefix(f *flag.FlagSet, prefix string)

type AuthToken

type AuthToken struct {
	Token flagext.Secret `yaml:"token" category:"experimental"`
}

func (*AuthToken) RegisterFlagsWithPrefix

func (cfg *AuthToken) RegisterFlagsWithPrefix(f *flag.FlagSet, prefix string)

type AuthUserPass

type AuthUserPass struct {
	Username  string         `yaml:"username" category:"experimental"`
	Password  flagext.Secret `yaml:"password" category:"experimental"`
	MountPath string         `yaml:"mount_path,omitempty" category:"experimental"`
}

func (*AuthUserPass) RegisterFlagsWithPrefix

func (cfg *AuthUserPass) RegisterFlagsWithPrefix(f *flag.FlagSet, prefix string)

type Config

type Config struct {
	Enabled bool `yaml:"enabled" category:"experimental"`

	URL       string     `yaml:"url" category:"experimental"`
	MountPath string     `yaml:"mount_path" category:"experimental"`
	Auth      AuthConfig `yaml:"auth" category:"experimental"`

	Mock SecretsEngine `yaml:"-"`
}

Config for the Vault used to fetch secrets

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(f *flag.FlagSet)

func (*Config) Validate

func (cfg *Config) Validate() error

type SecretsEngine

type SecretsEngine interface {
	Get(ctx context.Context, path string) (*hashivault.KVSecret, error)
}

type Vault

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

func NewVault

func NewVault(cfg Config, l log.Logger, registerer prometheus.Registerer) (*Vault, error)

func (*Vault) KeepRenewingTokenLease

func (v *Vault) KeepRenewingTokenLease(ctx context.Context) error

func (*Vault) ReadSecret

func (v *Vault) ReadSecret(path string) ([]byte, error)

Jump to

Keyboard shortcuts

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