vault

package
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

View Source
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 CreateHTTPClient added in v0.0.28

func CreateHTTPClient(config types.SecretConfig) (pkg.Caller, error)

CreateHTTPClient creates and configures an HTTP client which can be used to communicate with the underlying secret-store based on the SecretConfig. Returns ErrCaRootCert is there is an error with the certificate.

Types

type Client added in v0.0.7

type Client struct {
	HttpConfig types.SecretConfig
	HttpCaller pkg.Caller
	// contains filtered or unexported fields
}

Client defines the behavior for interacting with the Vault REST secret key/value store via HTTP(S).

func NewClient added in v0.0.28

func NewClient(config types.SecretConfig, caller pkg.Caller, lc logger.LoggingClient) Client

func (Client) GetSecrets added in v0.0.7

func (c Client) GetSecrets(subPath string, keys ...string) (map[string]string, error)

GetSecrets retrieves the secrets at the provided sub-path that matches the specified keys.

func (Client) GetTokenLookupResponseData added in v0.0.28

func (c Client) GetTokenLookupResponseData() (*TokenLookupResponse, error)

func (Client) RefreshToken added in v0.0.28

func (c Client) RefreshToken(ctx context.Context, tokenExpiredCallback pkg.TokenExpiredCallback) error

func (Client) StoreSecrets added in v0.0.11

func (c Client) StoreSecrets(subPath string, secrets map[string]string) error

StoreSecrets stores the secrets at the provided sub-path for 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 ErrHTTPResponse added in v0.0.28

type ErrHTTPResponse struct {
	StatusCode int
	ErrMsg     string
}

func (ErrHTTPResponse) Error added in v0.0.28

func (err ErrHTTPResponse) Error() string

type TokenLookupMetadata added in v0.0.15

type TokenLookupMetadata struct {
	ExpireTime string `json:"expire_time"`
	Period     int    `json:"period"` // in seconds
	Renewable  bool   `json:"renewable"`
	Ttl        int    `json:"ttl"` // in seconds
}

type TokenLookupResponse added in v0.0.15

type TokenLookupResponse struct {
	Data TokenLookupMetadata
}

Jump to

Keyboard shortcuts

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