ExVault v0.1.0-beta.1 ExVault.KV2 View Source
A wrapper over the basic operations for working with KV v2 data.
Construct a backend--a client paired with the mount path for the kv
version 2 secrets engine it interacts with--using the ExVault.KV2.new/2
function.
Each of the operations in this module have a variant that operates on a client and mount path, and another that operates on a backend.
See the Vault documentation for the secrets engine.
Link to this section Summary
Functions
Read the value of a key
Read the value of a key
Create a new backend for the kv
version 2 secrets engine
Write the value of a key
Write the value of a key
Link to this section Types
get_data_response()
View Source
get_data_response() ::
{:ok, ExVault.KV2.GetData.t() | ExVault.Response.Error.t()} | {:error, any()}
get_data_response() :: {:ok, ExVault.KV2.GetData.t() | ExVault.Response.Error.t()} | {:error, any()}
Response type returned by get_data/3
and get_data/4
.
t()
View Source
t() :: %ExVault.KV2{client: ExVault.client(), mount: String.t()}
t() :: %ExVault.KV2{client: ExVault.client(), mount: String.t()}
Link to this section Functions
get_data(backend, path, opts \\ [])
View Source
get_data(t(), String.t(), keyword()) :: get_data_response()
get_data(t(), String.t(), keyword()) :: get_data_response()
Read the value of a key.
Params:
backend
theExVault.KV2
backend.path
the path to the key in the secrets engine.opts
TODO: document opts.
get_data(client, mount, path, opts)
View Source
get_data(ExVault.client(), String.t(), String.t(), keyword()) ::
get_data_response()
get_data(ExVault.client(), String.t(), String.t(), keyword()) :: get_data_response()
Read the value of a key.
Params:
client
theExVault
client.mount
the mount path for thekv
secrets engine.path
the path to the key in the secrets engine.opts
TODO: document opts.
new(client, mount)
View Source
new(ExVault.client(), String.t()) :: t()
new(ExVault.client(), String.t()) :: t()
Create a new backend for the kv
version 2 secrets engine.
Params:
client
theExVault
client.mount
the mount path for thekv
secrets engine.
put_data(backend, path, data, opts \\ [])
View Source
put_data(t(), String.t(), map(), keyword()) :: ExVault.response()
put_data(t(), String.t(), map(), keyword()) :: ExVault.response()
Write the value of a key.
Params:
backend
theExVault.KV2
backend.path
the path to the key in the secrets engine.data
the data to write as a JSON-compatible map.opts
TODO: document opts.
put_data(client, mount, path, data, opts)
View Source
put_data(ExVault.client(), String.t(), String.t(), map(), keyword()) ::
ExVault.response()
put_data(ExVault.client(), String.t(), String.t(), map(), keyword()) :: ExVault.response()
Write the value of a key.
Params:
client
theExVault
client.mount
the mount path for thekv
secrets engine.path
the path to the key in the secrets engine.data
the data to write as a JSON-compatible map.opts
TODO: document opts.