Q&A-3Define the authorization request contract.
Answer
Core answer (first 90 seconds)
The authorization request contract is the tuple a policy enforcement point (PEP) hands to a policy decision point (PDP): authenticated principal, canonical action, canonical resource type and ID, and the minimum context the policy cannot derive. Everything else (ownership, group membership, tenant boundaries, current resource state) the PDP resolves from authoritative sources at decision time. The caller supplies identifiers and claims; it never supplies the facts that decide the outcome.
Assumptions: one logical PDP per trust domain, PEP co-located with the service that owns the resource, policy and data versioned, PDP fails closed.
The shape
{
"principal": { "type": "User", "id": "u_8812", "tenant_id": "t_44" },
"action": "document:read",
"resource": { "type": "Document", "id": "doc_901" },
"context": { "request_time": "2025-06-01T14:03:11Z", "source_ip": "203.0.113.7", "mfa": true },
"policy_version": "2025-05-30T00:00:00Z",
"data_version": "doc_901@rev_17"
}Cedar's request is exactly this four-tuple (principal, action, resource, context) and context is the only place arbitrary data goes. XACML 3.0 splits the same information into Subject, Resource, Action and Environment attributes; OPA takes it as one input document. The names differ; the contract does not.
Why each element earns its place:
- principal: authenticated, not asserted. If the PEP trusts a client-supplied user ID, any caller impersonates any user.
- action: canonical and namespaced (
document:read, notreadorGET /docs/901). Ambiguous action names are how a policy matches the wrong operation. - resource: type plus ID, not the object. The PDP fetches attributes from a policy information point.
- context: only what policy needs and cannot derive.
Absent vs false. "mfa": false and a missing mfa key are different inputs. In Cedar, reading a missing attribute is an error, which denies; in OPA, input.context.mfa == false is undefined when the key is absent, so the rule simply does not fire. A contract that lets the key vanish silently turns a deny into a no-op. Require the key present with an explicit value, or write the policy to fail closed on absence.
Trace. Request hits the PEP → PEP validates the token, extracts the principal, maps the route to a canonical action, reads the resource ID → sends the tuple to the PDP → PDP calls the PIP for resource attributes (owner, classification, tenant) and principal attributes (groups, clearance) → evaluates policy → returns Permit/Deny plus obligations → PEP applies the decision to the same resource ID it sent. If the PEP re-resolves the resource after the decision, you have a time-of-check/time-of-use gap.
Failure modes
| failure | what breaks | detection |
|---|---|---|
| Caller-supplied attributes | privilege escalation | policy tests asserting attributes come from the PIP |
Stale data_version | decision on a revoked resource | compare version at enforcement; re-evaluate on change |
policy_version skew | decision under the wrong policy | PDP rejects unknown versions |
| Malformed input | PDP crash or default-allow | schema validation at the PEP; PDP denies on parse error |
| Context bloat | latency, unused fields | audit which context keys any policy reads |
Trade-off: include or resolve. Include a field when the PDP cannot reach the source. Request-time-only data like source IP or MFA freshness, or a source in another network zone. Resolve it when the source is authoritative and shared: group membership, resource ownership. Including those means every caller must compute them correctly, and you get N implementations of the same lookup, each a place to drift.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.