KMS.Client behaviour (kms v0.1.0)

Copy Markdown View Source

Public KMS client facade.

Calls are routed to the configured backend. Local storage is the default backend.

Summary

Callbacks

Functions

Types

get_result(value)

@type get_result(value) :: value | nil | {:error, term()}

Callbacks

add_kek_tags(binary, list, keyword)

@callback add_kek_tags(binary(), [binary()], keyword()) ::
  {:ok, [binary()]} | {:error, term()}

advance_session(binary, map)

@callback advance_session(binary(), map()) :: {:ok, term()} | {:error, term()}

begin_webauthn_authentication(binary, binary, keyword)

@callback begin_webauthn_authentication(binary(), binary(), keyword()) ::
  {:ok, map()} | {:error, term()}

begin_webauthn_registration(binary, binary, keyword)

@callback begin_webauthn_registration(binary(), binary(), keyword()) ::
  {:ok, map()} | {:error, term()}

create_alias(binary, keyword)

@callback create_alias(
  binary(),
  keyword()
) :: {:ok, term()} | {:error, term()}

create_binding(binary, map)

@callback create_binding(binary(), map()) :: {:ok, term()} | {:error, term()}

create_fallback_public_key(map)

@callback create_fallback_public_key(map()) :: {:ok, term()} | {:error, term()}

create_passphrase_session(map)

@callback create_passphrase_session(map()) :: {:ok, term()} | {:error, term()}

create_principal(map)

@callback create_principal(map()) :: {:ok, term()} | {:error, term()}

create_principal(map, keyword)

@callback create_principal(
  map(),
  keyword()
) :: {:ok, term()} | {:error, term()}

create_principal_factor(binary, binary, map)

@callback create_principal_factor(binary(), binary(), map()) ::
  {:ok, term()} | {:error, term()}

create_session(binary, binary, map)

@callback create_session(binary(), binary(), map()) :: {:ok, term()} | {:error, term()}

create_session(binary, binary, map, keyword)

@callback create_session(binary(), binary(), map(), keyword()) ::
  {:ok, term()} | {:error, term()}

decrypt_alias(arg1, binary, keyword)

@callback decrypt_alias(binary() | list(), binary(), keyword()) ::
  {:ok, binary() | list()} | {:error, term()}

decrypt_rmk_pdk(binary, binary, keyword)

@callback decrypt_rmk_pdk(binary(), binary(), keyword()) ::
  {:ok, binary()} | {:error, term()}

delete_binding(binary)

@callback delete_binding(binary()) :: {:ok, term()} | {:error, term()}

delete_fallback_public_key(binary)

@callback delete_fallback_public_key(binary()) :: {:ok, term()} | {:error, term()}

delete_principal(binary, binary)

@callback delete_principal(binary(), binary()) :: {:ok, term()} | {:error, term()}

delete_principal_factor(binary)

@callback delete_principal_factor(binary()) :: {:ok, term()} | {:error, term()}

delete_session(binary)

@callback delete_session(binary()) :: {:ok, term()} | {:error, term()}

delete_sessions(binary, binary, keyword)

@callback delete_sessions(binary(), binary(), keyword()) ::
  {:ok, non_neg_integer()} | {:error, term()}

encrypt_alias(binary, binary, keyword)

@callback encrypt_alias(binary(), binary(), keyword()) ::
  {:ok, binary()} | {:error, term()}

encrypt_rmk_pdk(binary, binary, keyword)

@callback encrypt_rmk_pdk(binary(), binary(), keyword()) ::
  {:ok, binary()} | {:error, term()}

fetch_active_session(binary)

@callback fetch_active_session(binary()) :: {:ok, term()} | {:error, term()}

fetch_binding(binary)

@callback fetch_binding(binary()) :: {:ok, term()} | {:error, term()}

fetch_fallback_public_key(binary)

@callback fetch_fallback_public_key(binary()) :: {:ok, term()} | {:error, term()}

fetch_fallback_public_key_by_name(binary)

@callback fetch_fallback_public_key_by_name(binary()) :: {:ok, term()} | {:error, term()}

fetch_principal(binary, binary, keyword)

@callback fetch_principal(binary(), binary(), keyword()) ::
  {:ok, term()} | {:error, term()}

fetch_principal_factor(binary)

@callback fetch_principal_factor(binary()) :: {:ok, term()} | {:error, term()}

fetch_session(binary)

@callback fetch_session(binary()) :: {:ok, term()} | {:error, term()}

finish_webauthn_authentication(binary, map, keyword)

@callback finish_webauthn_authentication(binary(), map(), keyword()) ::
  {:ok, term()} | {:error, term()}

finish_webauthn_registration(binary, map, keyword)

@callback finish_webauthn_registration(binary(), map(), keyword()) ::
  {:ok, term()} | {:error, term()}

get_binding(binary)

@callback get_binding(binary()) :: get_result(term())

get_principal(binary, binary)

@callback get_principal(binary(), binary()) :: get_result(term())

get_principal_factor(binary)

@callback get_principal_factor(binary()) :: get_result(term())

get_session(binary)

@callback get_session(binary()) :: get_result(term())

list_bindings(binary)

@callback list_bindings(binary()) :: [term()] | {:error, term()}

list_fallback_public_keys()

@callback list_fallback_public_keys() :: [term()] | {:error, term()}

list_kek_aliases_by_tag(binary, keyword)

@callback list_kek_aliases_by_tag(
  binary(),
  keyword()
) :: {:ok, [binary()]} | {:error, term()}

list_kek_fallbacks(binary)

@callback list_kek_fallbacks(binary()) :: [term()] | {:error, term()}

list_kek_tags(binary, keyword)

@callback list_kek_tags(
  binary(),
  keyword()
) :: {:ok, [binary()]} | {:error, term()}

list_principal_factors(binary, binary)

@callback list_principal_factors(binary(), binary()) :: [term()] | {:error, term()}

list_principal_fallbacks(binary)

@callback list_principal_fallbacks(binary()) :: [term()] | {:error, term()}

list_principals(keyword)

@callback list_principals(keyword()) :: [term()]

list_sessions(binary, binary)

@callback list_sessions(binary(), binary()) :: [term()] | {:error, term()}

nudge_session(binary, keyword)

@callback nudge_session(
  binary(),
  keyword()
) :: {:ok, term()} | {:error, term()}

refresh_session(term, keyword)

@callback refresh_session(
  term(),
  keyword()
) :: {:ok, term()} | {:error, term()}

remove_kek_tags(binary, list, keyword)

@callback remove_kek_tags(binary(), [binary()], keyword()) ::
  {:ok, [binary()]} | {:error, term()}

revoke_alias_passphrase(binary, binary, keyword)

@callback revoke_alias_passphrase(binary(), binary(), keyword()) :: :ok | {:error, term()}

rewrap_alias_for_passphrase(binary, binary, keyword)

@callback rewrap_alias_for_passphrase(binary(), binary(), keyword()) ::
  {:ok, binary()} | {:error, term()}

rewrap_alias_for_principal(binary, binary, binary, keyword)

@callback rewrap_alias_for_principal(binary(), binary(), binary(), keyword()) ::
  :ok | {:error, term()}

rotate_fallback_public_key(binary, map, binary, keyword)

@callback rotate_fallback_public_key(binary(), map(), binary(), keyword()) ::
  {:ok, term()} | {:error, term()}

unwrap_kek(binary, binary, binary, keyword)

@callback unwrap_kek(binary(), binary(), binary(), keyword()) ::
  {:ok, binary()} | {:error, term()}

unwrap_principal_private_key(binary, binary, binary, keyword)

@callback unwrap_principal_private_key(binary(), binary(), binary(), keyword()) ::
  {:ok, binary()} | {:error, term()}

update_binding(binary, map)

@callback update_binding(binary(), map()) :: {:ok, term()} | {:error, term()}

update_principal(binary, binary, map, keyword)

@callback update_principal(binary(), binary(), map(), keyword()) ::
  {:ok, term()} | {:error, term()}

update_principal_factor(binary, map)

@callback update_principal_factor(binary(), map()) :: {:ok, term()} | {:error, term()}

Functions

add_kek_tags(alias_name, tags, opts \\ [])

advance_session(secret, attrs)

begin_webauthn_authentication(kind, ref, opts \\ [])

begin_webauthn_registration(kind, ref, opts \\ [])

create_alias(alias_name, opts \\ [])

create_binding(principal_id, attrs)

create_fallback_public_key(attrs)

create_passphrase_session(attrs)

create_principal(attrs)

create_principal(attrs, opts)

create_principal_factor(kind, ref, attrs)

create_session(kind, ref, attrs)

create_session(kind, ref, attrs, opts)

decrypt_alias(encrypted, alias_name, opts \\ [])

decrypt_alias!(encrypted, alias_name, opts \\ [])

decrypt_rmk_pdk(encrypted, secret, opts \\ [])

delete_binding(id)

delete_fallback_public_key(id)

delete_principal(kind, ref)

delete_principal_factor(id)

delete_session(secret)

delete_sessions(kind, ref, opts \\ [])

encrypt_alias(cleartext, alias_name, opts \\ [])

encrypt_alias!(cleartext, alias_name, opts \\ [])

encrypt_rmk_pdk(cleartext, secret, opts \\ [])

fetch_active_session(secret)

fetch_binding(id)

fetch_fallback_public_key(id)

fetch_fallback_public_key_by_name(name)

fetch_principal(kind, ref, opts \\ [])

fetch_principal_factor(id)

fetch_session(secret)

finish_webauthn_authentication(challenge_id, response, opts \\ [])

finish_webauthn_registration(challenge_id, response, opts \\ [])

get_binding(id)

get_principal(kind, ref)

get_principal_factor(id)

get_session(secret)

list_bindings(principal_id)

list_fallback_public_keys()

list_kek_aliases_by_tag(tag, opts \\ [])

list_kek_fallbacks(kek_id)

list_kek_tags(alias_name, opts \\ [])

list_principal_factors(kind, ref)

list_principal_fallbacks(principal_id)

list_principals(opts \\ [])

list_sessions(kind, ref)

nudge_session(secret, opts \\ [])

refresh_session(session, opts \\ [])

remove_kek_tags(alias_name, tags, opts \\ [])

revoke_alias_passphrase(alias_name, wrapping_id, opts \\ [])

rewrap_alias_for_passphrase(alias_name, passphrase, opts \\ [])

rewrap_alias_for_principal(alias_name, target_kind, target_ref, opts \\ [])

rotate_fallback_public_key(public_key_ref, attrs, private_key, opts \\ [])

unwrap_kek(kek_id, public_key_ref, private_key, opts \\ [])

unwrap_principal_private_key(principal_id, public_key_ref, private_key, opts \\ [])

update_binding(id, attrs)

update_principal(kind, ref, attrs, opts \\ [])

update_principal_factor(id, attrs)