KMS.Client.Remote (kms v0.1.0)

Copy Markdown View Source

HTTP KMS client backend.

This backend lets application servers call a dedicated KMS.API authority service while using the same public KMS facade.

Configure with:

config :kms, :client, KMS.Client.Remote

config :kms, KMS.Client.Remote,
  base_url: "https://kms.internal.example.com",
  api_token: System.fetch_env!("KMS_REMOTE_API_TOKEN")

The API token authenticates backend HTTP access. It is separate from KMS session secrets, which are passed through opts[:session] when principal authorization is required.

Fallback recovery operations are local-only. This module returns {:error, :not_implemented} for them without issuing HTTP requests.

Convenience get_* functions return nil only for an API not_found response. Transport, HTTP, and response-decoding failures remain {:error, reason}. Use the corresponding fetch_* function when a uniform tagged result is preferable.

Summary

Functions

advance_session(secret, attrs, opts)

create_binding(principal_id, attrs, opts)

create_fallback_public_key(attrs, opts)

create_passphrase_session(attrs, opts)

create_principal_factor(kind, ref, attrs, opts)

delete_binding(id, opts)

delete_fallback_public_key(id, opts)

delete_principal(kind, ref, opts)

delete_principal_factor(id, opts)

delete_session(secret, opts)

fetch_active_session(secret, opts)

fetch_binding(id, opts)

fetch_fallback_public_key(id, opts)

fetch_fallback_public_key_by_name(name, opts)

fetch_principal_factor(id, opts)

fetch_session(secret, opts)

list_bindings(principal_id, opts)

list_fallback_public_keys(opts)

list_kek_fallbacks(kek_id, opts)

list_principal_factors(kind, ref, opts)

list_principal_fallbacks(principal_id, opts)

list_sessions(kind, ref, opts)

new(opts \\ [])

update_binding(id, attrs, opts)

update_principal_factor(id, attrs, opts)