Lockspire.Admin.ServerPolicy
(lockspire v1.0.0)
Copy Markdown
Query and command boundary for Lockspire server policy.
Summary
Functions
Returns the current DCR policy view as a %Domain.ServerPolicy{} (the same struct
used by get_server_policy/0 — DCR fields land on the singleton row per D-04).
Persists the DCR-shaped fields onto the server-policy singleton row, preserving any
non-DCR fields (notably par_policy) on the same row.
Types
Functions
@spec get_dcr_policy() :: {:ok, Lockspire.Domain.ServerPolicy.t()} | {:error, term()}
Returns the current DCR policy view as a %Domain.ServerPolicy{} (the same struct
used by get_server_policy/0 — DCR fields land on the singleton row per D-04).
Phase 28 admin LiveView consumes this; Phase 26 intake validator and
Lockspire.Protocol.DcrPolicy.resolve/3 consume the same struct.
@spec get_server_policy() :: {:ok, Lockspire.Domain.ServerPolicy.t()} | {:error, term()}
@spec private_key_jwt_registration_truth(Lockspire.Domain.ServerPolicy.t()) :: private_key_jwt_registration_truth()
@spec put_dcr_policy(map()) :: {:ok, Lockspire.Domain.ServerPolicy.t()} | {:error, [error_detail()]} | {:error, term()}
Persists the DCR-shaped fields onto the server-policy singleton row, preserving any
non-DCR fields (notably par_policy) on the same row.
Accepts a map keyed by atoms or strings. Unknown keys are ignored. Validates the
:registration_policy value is :disabled | :initial_access_token | :open.
Returns {:ok, %Domain.ServerPolicy{}} on success or a list-shaped error per the
error_detail typespec.
@spec put_dpop_policy(atom() | String.t()) :: {:ok, Lockspire.Domain.ServerPolicy.t()} | {:error, [error_detail()]} | {:error, term()}
@spec put_max_delegation_depth(integer()) :: {:ok, Lockspire.Domain.ServerPolicy.t()} | {:error, Ecto.Changeset.t()} | {:error, term()}
@spec put_security_profile(atom() | String.t()) :: {:ok, Lockspire.Domain.ServerPolicy.t()} | {:error, [error_detail()]} | {:error, term()}
@spec put_server_policy(atom() | String.t()) :: {:ok, Lockspire.Domain.ServerPolicy.t()} | {:error, [error_detail()]} | {:error, term()}