Documentation ¶
Index ¶
- Variables
- type EnvProvider
- type JSONProvider
- type VaultAppRoleAuthOptions
- type VaultClient
- func (vc *VaultClient) AppRoleLogin(ctx context.Context, roleId string, secretId string) error
- func (vc *VaultClient) GetValues(ctx context.Context, path string, mountPath string) (map[string]interface{}, error)
- func (vc *VaultClient) Initialize(url string, requestTimeout time.Duration) error
- func (vc *VaultClient) KubernetesLogin(ctx context.Context, jwt string, role string) error
- type VaultClienter
- type VaultKubernetesAuthOptions
- type VaultOptions
- type VaultProvider
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidVaultAuthConfig = errors.New("exactly one auth method options must be specified") ErrVaultConnection = errors.New("error connecting to the Vault server") ErrVaultAuth = errors.New("error authenticating with Vault") ErrVaultSecretFetch = errors.New("error fetching secret from Vault") ErrVaultSecretValueType = errors.New("error getting secret value as string") )
Functions ¶
This section is empty.
Types ¶
type EnvProvider ¶ added in v1.0.0
type EnvProvider struct{}
func NewEnvProvider ¶ added in v1.0.0
func NewEnvProvider() EnvProvider
type JSONProvider ¶ added in v1.0.0
type JSONProvider struct {
// contains filtered or unexported fields
}
func NewJSONProvider ¶ added in v1.0.0
func NewJSONProvider(filePath string) (*JSONProvider, error)
func NewJSONProviderFromFs ¶ added in v1.2.0
func NewJSONProviderFromFs(fs fs.FS, filePath string) (*JSONProvider, error)
type VaultAppRoleAuthOptions ¶ added in v1.1.0
type VaultClient ¶ added in v1.1.0
type VaultClient struct {
// contains filtered or unexported fields
}
func NewVaultClient ¶ added in v1.1.0
func NewVaultClient() *VaultClient
func (*VaultClient) AppRoleLogin ¶ added in v1.1.0
func (*VaultClient) Initialize ¶ added in v1.1.0
func (vc *VaultClient) Initialize(url string, requestTimeout time.Duration) error
func (*VaultClient) KubernetesLogin ¶ added in v1.1.0
type VaultClienter ¶ added in v1.1.0
type VaultClienter interface { Initialize(url string, requestTimeout time.Duration) error AppRoleLogin(ctx context.Context, roleId string, secretId string) error KubernetesLogin(ctx context.Context, jwt string, role string) error GetValues(ctx context.Context, path string, mountPath string) (map[string]interface{}, error) }
VaultClienter Serves as an abstraction layer to the actual vault client We're using this, so we can unit test the vault provider without worrying about the Vault client
type VaultKubernetesAuthOptions ¶ added in v1.1.0
type VaultOptions ¶ added in v1.1.0
type VaultOptions struct { // The Vault Server url Url string // The request timeout for the vault client in seconds (default 1m) RequestTimeout int // Options for app role authentication AppRoleAuth *VaultAppRoleAuthOptions // Options for kubernetes authentication KubernetesAuth *VaultKubernetesAuthOptions // The KV mount path MountPath string // The path of the secret Path string }
type VaultProvider ¶
type VaultProvider struct {
// contains filtered or unexported fields
}
func NewVaultProvider ¶ added in v1.1.0
func NewVaultProvider(options VaultOptions) (*VaultProvider, error)
Click to show internal directories.
Click to hide internal directories.