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

Types

Response type returned by get_data/3 and get_data/4

t()

Functions

Read the value of a key

Read the value of a key

Create a new backend for the kv version 2 secrets engine

Link to this section Types

Link to this type

get_data_response() View Source
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.

Link to this type

t() View Source
t() :: %ExVault.KV2{client: ExVault.client(), mount: String.t()}

Link to this section Functions

Link to this function

get_data(backend, path, opts \\ []) View Source
get_data(t(), String.t(), keyword()) :: get_data_response()

Read the value of a key.

Params:

  • backend the ExVault.KV2 backend.
  • path the path to the key in the secrets engine.
  • opts TODO: document opts.
Link to this function

get_data(client, mount, path, opts) View Source

Read the value of a key.

Params:

  • client the ExVault client.
  • mount the mount path for the kv secrets engine.
  • path the path to the key in the secrets engine.
  • opts TODO: document opts.

Create a new backend for the kv version 2 secrets engine.

Params:

  • client the ExVault client.
  • mount the mount path for the kv secrets engine.
Link to this function

put_data(backend, path, data, opts \\ []) View Source
put_data(t(), String.t(), map(), keyword()) :: ExVault.response()

Write the value of a key.

Params:

  • backend the ExVault.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.
Link to this function

put_data(client, mount, path, data, opts) View Source

Write the value of a key.

Params:

  • client the ExVault client.
  • mount the mount path for the kv 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.