Skip to content

fix(relay): scope-gate PDP context headers#338

Merged
jeremi merged 3 commits into
mainfrom
agent/208-gate-pdp-context-headers
Jul 10, 2026
Merged

fix(relay): scope-gate PDP context headers#338
jeremi merged 3 commits into
mainfrom
agent/208-gate-pdp-context-headers

Conversation

@jeremi

@jeremi jeremi commented Jul 10, 2026

Copy link
Copy Markdown
Member

Summary

  • require exact-value registry:trust:<field>:<value> scopes before Relay accepts subject, relationship, delegation actor, credential-format, or source-observation headers as PDP context
  • exercise the real Relay decision path for all five ticket fields, proving absent and mismatched scopes deny while the exact value scope permits
  • add Relay-local redacted audit provenance for the four newly authenticated context fields on Permit and Deny, without changing shared PDP semantics for Notary
  • document the complete ten-header trust-context surface, policy-authoring guardrail, protocol requirement, and breaking client impact

Closes #208.

Security review

The platform PDP review confirmed these fields are not universally match-only. Required-context, relationship, credential-format, and freshness policy shapes can use their presence or value on a Permit path. Relay therefore omits every listed header from PDP context unless the authenticated principal carries the exact value-bearing trust scope.

Audit provenance enrichment stays at the Relay boundary after exact-scope validation because other platform PDP consumers do not assign the same trust semantics to these context fields. Decision audits record field names only; tests cover Permit and Deny and prove that raw subject, relationship, delegation, and credential-format values are absent.

No route, static scope, source-read ordering, redaction, error shape, or OpenAPI surface changes. Data-Purpose remains caller-stated purpose context and is explicitly not documented as trust evidence. The mechanical security-invariant checklist passes. A final independent staff review approved the corrected design with no actionable findings.

Validation

  • cargo test --locked -p registry-platform-pdp
  • cargo test --locked -p registry-notary-server matching_pdp_decision_ --lib
  • focused Relay scope-gating and Permit/Deny audit-provenance tests
  • cargo test --locked -p registry-relay
  • cargo test --locked -p registry-relay --all-features
  • cargo check --locked --workspace --all-targets
  • workspace clippy and Relay all-feature clippy with -D warnings
  • root cargo deny check
  • Relay just openapi-contract and Notary just openapi-check
  • docs npm test and full npm run check, including current and archived builds plus link validation

The Relay-local deny.toml step in just ci still rejects the workspace-pinned Crosswalk git source and lacks the root advisory ignores. The authoritative root cargo deny check passes; this is the documented pre-existing per-product deny mismatch, not a change from this PR.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 209c2ee377

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/registry-relay/docs/api.md
@jeremi jeremi force-pushed the agent/208-gate-pdp-context-headers branch from 209c2ee to 8381cb0 Compare July 10, 2026 07:01
jeremi added 3 commits July 10, 2026 19:00
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
@jeremi jeremi force-pushed the agent/208-gate-pdp-context-headers branch from 8381cb0 to 3b32b28 Compare July 10, 2026 12:02
@jeremi jeremi enabled auto-merge (squash) July 10, 2026 12:02
@jeremi jeremi merged commit c237b99 into main Jul 10, 2026
11 checks passed
@jeremi jeremi deleted the agent/208-gate-pdp-context-headers branch July 10, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant