Expand description
The mandatory RPC dispatch PEP (epic #1267 T3, #1268).
This is the single mandatory, unavoidable MAC gate between claims
verification and handler invocation in [crate::service::dispatch:: process_request]. It is the RPC-plane analogue of the 9P
NinePAccessDecider (hyprstream/src/mac/pep.rs): both resolve a
trusted object label and check clearance.can_access(label) before
the data reaches the handler.
§Why this exists
process_request verifies the caller’s identity and JWT claims, then
invokes handle_request with no object-label resolution, no lattice
floor check, and no can_access (issue #1268). Method-level Casbin
(#[authorize]) is discretionary — a handler that forgets the attribute
is unmediated. This PEP is the mandatory floor no handler can bypass.
§The three-step check (per design §10, S1 interface contract)
1. Subject: ctx.security_context() → Option<SecurityContext>
None ⇒ Deny(NoClearance)
2. Object: resolver.resolve(svc, method) → Option<SecurityLabel>
None ⇒ Deny(UnlabeledObject)
3. Decision: ctx.can_access(label) → bool
false ⇒ Deny(FloorDeny)Once a PEP is installed, every None or false produced by that PEP is a
hard deny. There is no permissive mode inside an active PEP (epic #547
invariant: “no unlabeled-default-allow”).
§Clearance provenance (#698 dependency)
EnvelopeContext::security_context() already composes Claims × VerifiedKeyMaterial via the S1 SubjectContextClaims trait — this IS the
clearance seam. Until #698 wires the clearance field onto Claims in
production, security_context() resolves to None and the PEP denies
every request — which is correct fail-closed behavior, not a bug.
§Process-global installation
Like the PQ trust store and compiled MAC policy, the PEP is installed at
startup via install_mac_dispatch_pep. Until installed, dispatch denies
with MacDenyReason::NoPepInstalled. Once installed, every request is
mediated and every installed-PEP denial is authoritative.
Structs§
- Default
MacDispatch Pep - The production-shaped MAC dispatch PEP wiring the three-step check.
- Deny
AllMac Pep - A PEP that unconditionally denies.
- Deny
AllObject Resolver - Fail-closed object resolver: every object is unlabeled ⇒ deny.
Enums§
- MacDecision
- The MAC decision returned by the dispatch PEP.
- MacDeny
Reason - Why a MAC decision denied. Auditable and testable.
Traits§
- MacDispatch
Pep - The mandatory, unavoidable RPC dispatch PEP for native MAC (epic #547, activation-gate T3, #1268).
- RpcObject
Label Resolver - Resolve the trusted
SecurityLabelfor the concrete object a dispatching RPC acts on.
Functions§
- check_
dispatch_ mac - Check the installed dispatch PEP, or deny if installation was omitted.
- global_
mac_ dispatch_ pep - The installed MAC dispatch PEP, if any.
- install_
mac_ dispatch_ pep - Install the node’s MAC dispatch PEP.