vault

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultKeyServer                  = "VAULT_SERVER"
	DefaultKeyCertificateFilePath     = "VAULT_CERTIFICATE_FILE_PATH"
	DefaultKeyAuthToken               = "VAULT_AUTH_TOKEN"
	DefaultKeyAuthKubernetesRole      = "VAULT_AUTH_KUBERNETES_ROLE"
	DefaultKeyAuthKubernetesTokenPath = "VAULT_AUTH_KUBERNETES_TOKEN_PATH"
	DefaultKeyAuthKubernetesBackend   = "VAULT_AUTH_KUBERNETES_BACKEND"
	DefaultKeySecretsConfig           = "VAULT_SECRETS_CONFIG"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	ObtainSecrets(ctx context.Context, path string) (map[string]string, error)
}

type ClientImpl

type ClientImpl struct {
	aurestclientapi.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, config Config) (*ClientImpl, error)

func (*ClientImpl) ObtainSecrets

func (c *ClientImpl) ObtainSecrets(ctx context.Context, fullSecretsPath string) (map[string]string, error)

type Config

type Config interface {
	Server() string
	PublicCertificate() []byte
	AuthToken() string
	AuthKubernetesRole() string
	AuthKubernetesTokenPath() string
	AuthKubernetesBackend() string
	SecretsConfig() SecretsConfig
}

type DefaultConfigImpl

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

func NewDefaultConfig

func NewDefaultConfig() *DefaultConfigImpl

func (*DefaultConfigImpl) AuthKubernetesBackend

func (c *DefaultConfigImpl) AuthKubernetesBackend() string

func (*DefaultConfigImpl) AuthKubernetesRole

func (c *DefaultConfigImpl) AuthKubernetesRole() string

func (*DefaultConfigImpl) AuthKubernetesTokenPath

func (c *DefaultConfigImpl) AuthKubernetesTokenPath() string

func (*DefaultConfigImpl) AuthToken

func (c *DefaultConfigImpl) AuthToken() string

func (*DefaultConfigImpl) ConfigItems

func (c *DefaultConfigImpl) ConfigItems() []auconfigapi.ConfigItem

func (*DefaultConfigImpl) ObtainValues

func (c *DefaultConfigImpl) ObtainValues(getter func(string) string) error

func (*DefaultConfigImpl) PublicCertificate

func (c *DefaultConfigImpl) PublicCertificate() []byte

func (*DefaultConfigImpl) SecretsConfig

func (c *DefaultConfigImpl) SecretsConfig() SecretsConfig

func (*DefaultConfigImpl) Server

func (c *DefaultConfigImpl) Server() string

type K8sAuth

type K8sAuth struct {
	ClientToken string `json:"client_token"`
}

type K8sAuthRequest

type K8sAuthRequest struct {
	Jwt  string `json:"jwt"`
	Role string `json:"role"`
}

type K8sAuthResponse

type K8sAuthResponse struct {
	Auth   *K8sAuth `json:"auth"`
	Errors []string `json:"httperrors"`
}

type SecretConfig

type SecretConfig struct {
	VaultKey  string  `json:"vaultKey"`
	ConfigKey *string `json:"configKey,omitempty"`
}

type SecretsConfig

type SecretsConfig map[string][]SecretConfig

type SecretsResponse

type SecretsResponse struct {
	Data   *SecretsResponseData `json:"data"`
	Errors []string             `json:"httperrors"`
}

type SecretsResponseData

type SecretsResponseData struct {
	Data map[string]string `json:"data"`
}

type Vault

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

func New

func New(
	config Config,
	client Client,
) *Vault

func (*Vault) ObtainSecrets

func (v *Vault) ObtainSecrets(ctx context.Context) (map[string]string, error)

func (*Vault) ValuesProvider

func (v *Vault) ValuesProvider() func([]auconfigapi.ConfigItem) (map[string]string, error)

Jump to

Keyboard shortcuts

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