/api/v1/credentials: runtime client credentials, the client_id and
client_secret an application environment's SDK authenticates with.
Through EndPointBlank.Management.for_managed_client/2, a managed client's.
A credential is %{"id", "client_id", "secret_last_4", "application_environment_id", "application_id", "environment", "previous_secret", "expired_at", "created_at", "updated_at"}: metadata
only. The secret itself,
"client_secret", is in the answer to create/3 and rotate/3 and
nowhere else, ever: store it then. This module never logs it.
If that answer is lost, a retry with the same Idempotency-Key is refused
with "idempotency_replay_unavailable" (the API does not keep the secret to
replay it). Get or list the credential to see where it stands, and rotate
it for a new secret.
Summary
Functions
Issues a credential for an application environment. attrs:
application_environment_id (required). The answer carries
"client_secret", shown this once. Options: idempotency_key:.
Revokes credential id: %{"id", "deleted" => true}. Refused with
"delete_refused" when intake revoked it but its record could not be
removed: retry the call.
One credential (metadata only).
One page of credentials (metadata only). Options: limit:, after:,
application_environment_id:.
Same as delete/2.
Issues a new secret for credential id; the old one keeps working for the
grace window ("previous_secret"). The answer carries the new
"client_secret", shown this once. Options: idempotency_key:.
Every credential, with list/2's filter. Raises EndPointBlank.Management.Error.
Functions
@spec create(EndPointBlank.Management.t(), map() | keyword(), keyword()) :: EndPointBlank.Management.result(map())
Issues a credential for an application environment. attrs:
application_environment_id (required). The answer carries
"client_secret", shown this once. Options: idempotency_key:.
@spec delete(EndPointBlank.Management.t(), String.t()) :: EndPointBlank.Management.result(map())
Revokes credential id: %{"id", "deleted" => true}. Refused with
"delete_refused" when intake revoked it but its record could not be
removed: retry the call.
@spec get(EndPointBlank.Management.t(), String.t()) :: EndPointBlank.Management.result(map())
One credential (metadata only).
@spec list( EndPointBlank.Management.t(), keyword() ) :: EndPointBlank.Management.result(EndPointBlank.Management.Page.t())
One page of credentials (metadata only). Options: limit:, after:,
application_environment_id:.
@spec revoke(EndPointBlank.Management.t(), String.t()) :: EndPointBlank.Management.result(map())
Same as delete/2.
@spec rotate(EndPointBlank.Management.t(), String.t(), keyword()) :: EndPointBlank.Management.result(map())
Issues a new secret for credential id; the old one keeps working for the
grace window ("previous_secret"). The answer carries the new
"client_secret", shown this once. Options: idempotency_key:.
@spec stream( EndPointBlank.Management.t(), keyword() ) :: Enumerable.t()
Every credential, with list/2's filter. Raises EndPointBlank.Management.Error.