Documentation ¶
Overview ¶
Package kv provides an API client for the Vault KVv1 secrets engine.
To use the default KV secrets engine mounted at "/secret", use the DefaultClient:
// List the KV secret keys at the path "/secret/some/nested/path". kv.DefaultClient.ReadSecret("some/nested/path") kv.ListSecrets("some/nested/path") // shorthand of the above line
To use a kv secrets engine mounted at a custom path, create a new Client:
// Create a secret at the KV path "/my-kv/some/path". c := kv.NewClient("/my-kv", nil) c.WriteSecret("some/path", map[string]interface{}{"foo": "bar"})
See https://www.vaultproject.io/api-docs/secret/kv/kv-v1 for more information on the available endpoints.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultClient = NewClient(defaultMountPath, nil)
DefaultClient is a KVv1 API client mounted at the default path in Vault.
Functions ¶
func DeleteSecret ¶
DeleteSecret deletes the secret at the specified path using the DefaultClient.
See https://www.vaultproject.io/api/secret/kv/kv-v1#delete-secret.
func ListSecrets ¶
ListSecrets lists the secret keys at the specified path using the DefaultClient.
See https://www.vaultproject.io/api/secret/kv/kv-v1#list-secrets.
func ReadSecret ¶
ReadSecret reads the secret at the specified path using the DefaultClient.
See https://www.vaultproject.io/api/secret/kv/kv-v1#read-secret.
func WriteSecret ¶
WriteSecret creates or updates the secret at the specified path using the DefaultClient.
See https://www.vaultproject.io/api/secret/kv/kv-v1#create-update-secret.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an API client for the Vault KVv1 secrets engine.
See https://www.vaultproject.io/api-docs/secret/kv/kv-v1#kv-secrets-engine-version-1-api.
func NewClient ¶
func NewClient(path string, client vault.LogicalClient) *Client
NewClient creates a new KVv1 API client for the secrets engine mounted at the given path in Vault.
func (*Client) DeleteSecret ¶
DeleteSecret deletes the secret at the specified path.
See https://www.vaultproject.io/api/secret/kv/kv-v1#delete-secret.
func (*Client) ListSecrets ¶
ListSecrets lists the secret keys at the specified path.
See https://www.vaultproject.io/api/secret/kv/kv-v1#list-secrets.
func (*Client) ReadSecret ¶
ReadSecret reads the secret at the specified path.
See https://www.vaultproject.io/api/secret/kv/kv-v1#read-secret.
func (*Client) WriteSecret ¶
WriteSecret creates or updates the secret at the specified path.
See https://www.vaultproject.io/api/secret/kv/kv-v1#create-update-secret.