Expand description
Reviewed registry of HTTP routes intentionally exempt from native MAC
mediation — the “public / declassifier exemption registry” (issue #1273,
epic #1267, audit item NEW-PUBLIC-EXEMPTIONS).
§Why this exists
Native MAC (crate::mac) is the mandatory floor: every object path must
be mediated by a verified subject SecurityContext and a trusted object
label before use. Activation’s “all non-exempt paths mediated” claim is only
enforceable if the set of intentionally-unmediated routes is explicit and
reviewed, not implicit. Without a registry, a newly added public route can
silently become a bypass — exactly the drift this module prevents.
§Contract (do not circumvent)
- A route defaults to mediated. Any HTTP route not listed in
PUBLIC_EXEMPTIONSmust sit behind the protected (auth-mediated) router. Once the MAC PEP is installed there is no permissive mode (crate::macis fail-closed per #547); “public” is an opt-in, reviewed exemption, never a default. - The public routers are built from this registry.
crate::serverconstructs its public route set by iteratingPUBLIC_EXEMPTIONSfor its face, so adding an unmediated route requires adding a reviewedPublicExemptionentry plus a handler arm — two review surfaces, no silent addition. - The drift test pins the live set to the registry.
public_exemptions_match_live_routesasserts registry self-consistency, handler-enum parity, per-face wiring, and that the public/protected split is live (registry paths answer without auth; a protected path does not).
§Scope and dependencies
This registry covers genuinely no-auth public routes: health metadata,
.well-known discovery, and pre-credential browser provisioning.
OAuth2.1 protocol endpoints (token,
authorize, jwks, device, SCIM …) are the credential-issuance control
plane that MAC sits beneath, not tenant-object access; they remain out of
scope here and are tracked separately. Real MAC enforcement remains dormant
(uninstalled, so dispatch permits as a pre-activation pass-through) pending
production clearance provenance (#698). Once installed, the PEP is
fail-closed. This registry is the activation-gate structure that ships now
so the exempt set is locked.
Structs§
- Public
Exemption - One reviewed public/declassifier exemption. Every field is
&'staticso the registry is a compile-time constant and the drift test needs no allocation.
Enums§
- Exemption
Category - Why a route is intentionally unmediated. Used by activation review to confirm each exemption is a narrow, justified carve-out.
- Http
Face - Which HTTP face serves the exempt route. Each face builds its public router
from its own slice of
PUBLIC_EXEMPTIONS; the drift test cross-checks every face against the registry. - Public
Route Handler - Tag identifying which handler serves an exempt route. The public-router
builders match exhaustively on this, so wiring a new route requires both a
PublicExemptionentry and a handler arm — the double review touch that keeps the exempt set from silently growing. - Registry
Error - Error raised by
validatewhen the registry has drifted from its contract. - Route
Method - HTTP method of an exempt route. Only the methods used by public routes are represented; anything else must go through the protected router.
Statics§
- PUBLIC_
EXEMPTIONS - The authoritative, reviewed registry. This is the single source of truth for which HTTP routes bypass native MAC mediation.
Functions§
- for_
face - Yields the registry entries owned by
face, in declaration order. - require
- Looks up an exemption by id. Router builders use this to reference the reviewed path/method rather than a string literal, so a typo or unregistered route is caught at startup instead of silently bypassing MAC.
- validate
- Validates the registry against its contract: