Documentation ¶
Overview ¶
Package vault defines structs that will be used frequently by clients which utilize HTTP transport.
Index ¶
Constants ¶
const ( // NamespaceHeader specifies the header name to use when including Namespace information in a request. NamespaceHeader = "X-Vault-Namespace" AuthTypeHeader = "X-Vault-Token" )
Variables ¶
This section is empty.
Functions ¶
func NewMockClient ¶ added in v0.0.15
func NewMockClient() loggingClient
NewMockClient creates a mock instance of loggingClient implementation
func NewSecretClientFactory ¶ added in v0.0.15
func NewSecretClientFactory() *secretClientFactory
NewSecretClientFactory creates a new factory for manufacturing secret clients the facotry is maintaining an internal map of Vault tokens and context cancel functions for gracefully terminating the background goroutine per token
Types ¶
type AuthenticationInfo ¶
AuthenticationInfo contains authentication information to be used when communicating with an HTTP based provider
type Caller ¶
Caller interface used to abstract the implementation details for issuing an HTTP request. This allows for easier testing by the way of mocks.
type Client ¶ added in v0.0.7
type Client struct { HttpConfig SecretConfig HttpCaller Caller // contains filtered or unexported fields }
Client defines the behavior for interacting with the Vault REST secret key/value store via HTTP(S).
func (Client) GetSecrets ¶ added in v0.0.7
GetSecrets retrieves the secrets at the provided subpath that matches the specified keys.
type ErrCaRootCert ¶
type ErrCaRootCert struct {
// contains filtered or unexported fields
}
ErrCaRootCert error when the provided CA Root certificate is invalid.
func (ErrCaRootCert) Error ¶
func (e ErrCaRootCert) Error() string
type MockLogger ¶ added in v0.0.15
type MockLogger struct { }
func (MockLogger) Debug ¶ added in v0.0.15
func (lc MockLogger) Debug(msg string, args ...interface{})
Debug simulates logging an entry at the DEBUG severity level
func (MockLogger) Info ¶ added in v0.0.15
func (lc MockLogger) Info(msg string, args ...interface{})
Info simulates logging an entry at the INFO severity level
func (MockLogger) Warn ¶ added in v0.0.15
func (lc MockLogger) Warn(msg string, args ...interface{})
Warn simulates logging an entry at the WARN severity level
type SecretConfig ¶
type SecretConfig struct { Host string Port int // Path is the base path to the secret's location in the secret store Path string Protocol string Namespace string RootCaCertPath string ServerName string Authentication AuthenticationInfo AdditionalRetryAttempts int RetryWaitPeriod string // contains filtered or unexported fields }
SecretConfig contains configuration settings used to communicate with an HTTP based secret provider
func (SecretConfig) BuildSecretsPathURL ¶ added in v0.0.17
func (c SecretConfig) BuildSecretsPathURL(subPath string) (url string, err error)
BuildSecretsPathURL constructs a URL which can be used to identify a secret's path subPath is the location of the secrets in the secrets engine
type TokenLookupMetadata ¶ added in v0.0.15
type TokenLookupResponse ¶ added in v0.0.15
type TokenLookupResponse struct {
Data TokenLookupMetadata
}