Documentation ¶
Overview ¶
Package vault exposes an opinionated way to interact with Vault.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Address is the Vault server address to connect to. This should be a complete // URL. // // Default: // // "http://127.0.0.1:8200" Address string `json:"address"` // AgentAddress is the local Vault agent address to connect to. This should be // a complete URL. // // Example: // // "http://127.0.0.1:8200" AgentAddress string `json:"agent_address"` // Namespace sets the namespace to connect to, if not already set via environment // variable. Namespace string `json:"namespace"` // Token sets the token to use, if not already set via environment variable. Token string `json:"-"` // TLSConfig configures TLS to communicate with the Vault server. // // Important: Only the first Root CA file will be used and applied. TLS integration.ConfigTLS `json:"tls"` }
Config is used to configure the Vault integration.
type KeyValue ¶
type KeyValue interface { Delete(ctx context.Context, secretpath string) error DeleteMetadata(ctx context.Context, secretpath string) error DeleteVersions(ctx context.Context, secretpath string, versions []int) error Destroy(ctx context.Context, secretpath string, versions []int) error Get(ctx context.Context, secretpath string) (*api.KVSecret, error) GetMetadata(ctx context.Context, secretpath string) (*api.KVMetadata, error) GetVersion(ctx context.Context, secretpath string, version int) (*api.KVSecret, error) GetVersionsAsList(ctx context.Context, secretpath string) ([]api.KVVersionMetadata, error) Patch(ctx context.Context, secretpath string, data map[string]any) (*api.KVSecret, error) PatchMetadata(ctx context.Context, secretpath string, metadata api.KVMetadataPatchInput) error Put(ctx context.Context, secretpath string, data map[string]any) (*api.KVSecret, error) PutMetadata(ctx context.Context, secretpath string, metadata api.KVMetadataPutInput) error Rollback(ctx context.Context, secretpath string, toVersion int) (*api.KVSecret, error) Undelete(ctx context.Context, secretpath string, versions []int) error }
KeyValue exposes an opinionated way to interact with Vault Key-Value v2. All functions automatically handle distributed tracing as well as error recording within traces.
Click to show internal directories.
Click to hide internal directories.