# `AttestoPhoenix.RouteControls`
[🔗](https://github.com/XukuLLC/attesto_phoenix/blob/v5.0.0/lib/attesto_phoenix/route_controls.ex#L1)

Which optional protocol routes `attesto_routes/1` left unmounted.

`par: false`, `revocation: false`, `introspection: false`,
`registration_read: false` and `registration_update: false` are compile-time
router options, while the metadata documents are built at request time from
`AttestoPhoenix.Config`. The macro records the omitted routes on the routes
that need to know (both metadata documents and the authorization endpoint),
and this module is the one place that reads the record back, so the RFC 8414
document and the OpenID Provider document cannot disagree about which
endpoints exist.

Registration management routes also read this record when constructing
their `Allow` header (RFC 9110 §10.2.1). Omitting read or update does not
remove the registration endpoint from discovery.

# `control`

```elixir
@type control() ::
  :par
  | :revocation
  | :introspection
  | :registration_read
  | :registration_update
```

# `check_par!`

```elixir
@spec check_par!(Plug.Conn.t(), AttestoPhoenix.Config.t()) :: :ok
```

Raise when the router omits the PAR endpoint while the configuration
requires pushed authorization requests (RFC 9126 §5).

No client could complete an authorization request under that combination.
The router options are compile-time and the configuration is resolved per
request, so nothing sees both at boot; the check runs on the metadata and
authorization routes instead.

# `controls`

```elixir
@spec controls() :: [control()]
```

The route controls this module tracks.

# `drop_omitted`

```elixir
@spec drop_omitted(map(), [control()]) :: map()
```

Remove the metadata members of every omitted route from `metadata`.

# `omitted`

```elixir
@spec omitted(Plug.Conn.t()) :: [control()]
```

The routes the macro that dispatched `conn` left unmounted.

# `private_key`

```elixir
@spec private_key() :: atom()
```

The `conn.private` key the router macro records omitted routes under.

---

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