# `Lockspire.Admin.ServerPolicy`

Query and command boundary for Lockspire server policy.

# `client_secret_jwt_registration_truth`

```elixir
@type client_secret_jwt_registration_truth() :: %{
  self_registration_allowed?: boolean(),
  signing_algorithm: String.t(),
  fapi_effective?: boolean()
}
```

# `error_detail`

```elixir
@type error_detail() :: %{field: atom(), reason: atom(), detail: term()}
```

# `private_key_jwt_registration_truth`

```elixir
@type private_key_jwt_registration_truth() :: %{
  self_registration_allowed?: boolean(),
  supported_assertion_signing_algorithms: [String.t()]
}
```

# `client_secret_jwt_registration_truth`

```elixir
@spec client_secret_jwt_registration_truth(Lockspire.Domain.ServerPolicy.t()) ::
  client_secret_jwt_registration_truth()
```

# `get_dcr_policy`

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

Returns the current DCR policy view as the same `%Domain.ServerPolicy{}` used by
`get_server_policy/0`. The admin UI, registration intake, and
`Lockspire.Protocol.DcrPolicy.resolve/3` therefore share one policy representation.

# `get_server_policy`

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

# `private_key_jwt_registration_truth`

```elixir
@spec private_key_jwt_registration_truth(Lockspire.Domain.ServerPolicy.t()) ::
  private_key_jwt_registration_truth()
```

# `put_access_token_format`

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

# `put_dcr_policy`

```elixir
@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.

# `put_dpop_policy`

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

# `put_max_delegation_depth`

```elixir
@spec put_max_delegation_depth(integer()) ::
  {:ok, Lockspire.Domain.ServerPolicy.t()}
  | {:error, Ecto.Changeset.t()}
  | {:error, term()}
```

# `put_security_profile`

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

# `put_server_policy`

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
