Lockspire.Admin (lockspire v1.0.0)

Copy Markdown

Operator-facing service boundary for Lockspire admin workflows.

Summary

Functions

Activates a key as the current active signing key.

Creates a new client.

Generates a new signing key.

Gets a client by ID.

Gets a consent by ID.

Gets the Dynamic Client Registration (DCR) policy.

Gets a key by its ID.

Gets the server policy.

Gets token details by ID.

Lists registered clients.

Lists all consents.

Lists consents for a specific account.

Lists device authorizations.

Lists all signing keys.

Lists all active tokens.

Publishes a key for external use.

Updates the DCR policy.

Updates the DPoP policy mode.

Updates the security profile.

Updates the server policy mode.

Retires a key so it is no longer used for signing.

Revokes a specific consent.

Revokes a specific token.

Revokes a token and its entire family (e.g. refresh token chains).

Rotates the client secret for a given client.

Updates an existing client.

Functions

activate_key(key_id, attrs \\ %{})

@spec activate_key(integer(), map() | keyword()) ::
  {:ok, Lockspire.Admin.Keys.key_view()} | {:error, term()}

Activates a key as the current active signing key.

create_client(attrs)

@spec create_client(map() | keyword()) ::
  {:ok, Lockspire.Clients.RegistrationResult.t()}
  | {:error, [Lockspire.Clients.error_detail()]}

Creates a new client.

disable_client(client_id, attrs \\ %{})

@spec disable_client(String.t(), map() | keyword()) ::
  {:ok, Lockspire.Domain.Client.t()} | {:error, :not_found | term()}

Disables a client.

enable_client(client_id, attrs \\ %{})

@spec enable_client(String.t(), map() | keyword()) ::
  {:ok, Lockspire.Domain.Client.t()} | {:error, :not_found | term()}

Enables a client.

generate_key(use \\ :sig)

@spec generate_key(Lockspire.Domain.SigningKey.use_type()) ::
  {:ok, Lockspire.Admin.Keys.key_view()} | {:error, term()}

Generates a new signing key.

get_client(client_id)

@spec get_client(String.t()) ::
  {:ok, Lockspire.Domain.Client.t()} | {:error, :not_found | term()}

Gets a client by ID.

get_consent(grant_id)

@spec get_consent(integer()) ::
  {:ok, Lockspire.Admin.Consents.consent_view() | nil} | {:error, term()}

Gets a consent by ID.

get_dcr_policy()

@spec get_dcr_policy() :: {:ok, Lockspire.Domain.ServerPolicy.t()} | {:error, term()}

Gets the Dynamic Client Registration (DCR) policy.

get_key(key_id)

@spec get_key(integer()) ::
  {:ok, Lockspire.Admin.Keys.key_view() | nil} | {:error, term()}

Gets a key by its ID.

get_server_policy()

@spec get_server_policy() ::
  {:ok, Lockspire.Domain.ServerPolicy.t()} | {:error, term()}

Gets the server policy.

get_token(token_id)

@spec get_token(integer()) ::
  {:ok, Lockspire.Admin.Tokens.token_detail() | nil} | {:error, term()}

Gets token details by ID.

list_clients(opts \\ [])

@spec list_clients(keyword()) ::
  {:ok, [Lockspire.Domain.Client.t()]} | {:error, term()}

Lists registered clients.

list_consents(opts \\ [])

@spec list_consents(keyword()) ::
  {:ok, [Lockspire.Admin.Consents.consent_view()]} | {:error, term()}

Lists all consents.

list_consents_for_account(account_id)

@spec list_consents_for_account(String.t()) ::
  {:ok, [Lockspire.Admin.Consents.consent_view()]} | {:error, term()}

Lists consents for a specific account.

list_device_authorizations(opts \\ [])

@spec list_device_authorizations(keyword()) ::
  {:ok, [Lockspire.Domain.DeviceAuthorization.t()]} | {:error, term()}

Lists device authorizations.

list_keys(opts \\ [])

@spec list_keys(keyword()) ::
  {:ok, [Lockspire.Admin.Keys.key_view()]} | {:error, term()}

Lists all signing keys.

list_tokens(opts \\ [])

@spec list_tokens(keyword()) ::
  {:ok, [Lockspire.Admin.Tokens.token_view()]} | {:error, term()}

Lists all active tokens.

publish_key(key_id, attrs \\ %{})

@spec publish_key(integer(), map() | keyword()) ::
  {:ok, Lockspire.Admin.Keys.key_view()} | {:error, term()}

Publishes a key for external use.

put_dcr_policy(attrs)

@spec put_dcr_policy(map()) ::
  {:ok, Lockspire.Domain.ServerPolicy.t()}
  | {:error, [Lockspire.Admin.ServerPolicy.error_detail()]}
  | {:error, term()}

Updates the DCR policy.

put_dpop_policy(mode)

@spec put_dpop_policy(atom() | String.t()) ::
  {:ok, Lockspire.Domain.ServerPolicy.t()}
  | {:error, [Lockspire.Admin.ServerPolicy.error_detail()]}
  | {:error, term()}

Updates the DPoP policy mode.

put_security_profile(profile)

@spec put_security_profile(atom() | String.t()) ::
  {:ok, Lockspire.Domain.ServerPolicy.t()}
  | {:error, [Lockspire.Admin.ServerPolicy.error_detail()]}
  | {:error, term()}

Updates the security profile.

put_server_policy(mode)

@spec put_server_policy(atom() | String.t()) ::
  {:ok, Lockspire.Domain.ServerPolicy.t()}
  | {:error, [Lockspire.Admin.ServerPolicy.error_detail()]}
  | {:error, term()}

Updates the server policy mode.

retire_key(key_id, attrs \\ %{})

@spec retire_key(integer(), map() | keyword()) ::
  {:ok, Lockspire.Admin.Keys.key_view()} | {:error, term()}

Retires a key so it is no longer used for signing.

revoke_consent(grant_id, attrs \\ %{})

@spec revoke_consent(integer(), map()) ::
  {:ok, Lockspire.Admin.Consents.consent_view()} | {:error, term()}

Revokes a specific consent.

revoke_token(token_id, attrs \\ %{})

@spec revoke_token(integer(), map()) ::
  {:ok, Lockspire.Admin.Tokens.token_detail()} | {:error, term()}

Revokes a specific token.

revoke_token_family(token_id, attrs \\ %{})

@spec revoke_token_family(integer(), map()) ::
  {:ok,
   %{count: non_neg_integer(), token: Lockspire.Admin.Tokens.token_detail()}}
  | {:error, term()}

Revokes a token and its entire family (e.g. refresh token chains).

rotate_client_secret(client_id, attrs \\ %{})

@spec rotate_client_secret(String.t(), map() | keyword()) ::
  {:ok, %{client: Lockspire.Domain.Client.t(), client_secret: String.t()}}
  | {:error, [Lockspire.Clients.error_detail()]}
  | {:error, term()}

Rotates the client secret for a given client.

update_client(client_id, attrs)

@spec update_client(String.t(), map() | keyword()) ::
  {:ok, Lockspire.Domain.Client.t()}
  | {:error, [Lockspire.Clients.error_detail()]}
  | {:error, term()}

Updates an existing client.