Repository navigation
feat: allow header assertions from secrets - #174
Merged
Merged
Conversation
Signed-off-by: Teryl Taylor <terylt@ibm.com>
Signed-off-by: Teryl Taylor <terylt@ibm.com>
This comment was marked as resolved.
This comment was marked as resolved.
Signed-off-by: Teryl Taylor <terylt@ibm.com>
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
araujof
approved these changes
Oct 6, 2026
araujof
left a comment
Member
There was a problem hiding this comment.
Approved.
- Keep injected secrets out of plugin, PDP, and audit views across hooks.
- Preserve redaction through config reloads and header case changes.
- Preserve upstream credentials when plugins modify other headers.
- Add regression tests and correct the facade compatibility notes.
Merged the latest main. All GitHub Actions checks are green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This adds
secret.<name>as an assertion source, so the engine renders the header from a value declared undersecrets.values.Closes: #93
Rules
secrets.valuesentry at config load. An unknown name fails startup.claim.tenantis a legitimate response source and a secret is not, even though the engine originates both.on_missingapplies as it does to any other source, and a denial namessecret.<name>rather than what it held.Containment
The value reaches the asserted header and nothing else: not a PDP, not a plugin payload, not a deny message, and not the effective policy artifact, which prints the name only.
Two separate mechanisms hold that up:
<redacted secret.<name>>in place of a secret-sourced entry. This holds on the response pass too, because the request header map travels with the exchange and a response contract has no secret of its own to rediscover it from. Only secret-sourced request entries are touched: the set comes from the resolved contract rather than from header names, so an asserted identity value, the client's own headers and every response header reach a sink unchanged, and the upstream still receives the credential.A sink's
on_effectview is clean for the first reason rather than the second, since an effect dispatches from insideperform_effectwhile the pipeline is still running. There is a test pinning that, because it is ordering and not enforcement, and a change that moved effect dispatch later would leak without it.Breaking changes
Rust callers of
praxis_policy_core::assertionsonly. A host reaching these through thepraxis-policyfacade is unaffected, since the facade does not re-exportassertions.SourcePath::capabilityreturnsOption<Capability>instead ofCapability. A secret answersNone, because no plugin-facing read of a declared secret exists for a capability to gate; naming one would tell an operator that some grant reaches the value. The artifact prints "no plugin capability reads this" instead.SourcePath::resolveandassertions::rendereach take the resolvedSecretStore, whereNoneis a host that resolved none.AssertionsConfig::validatetakes the document'sSecretsConfig, which is what makes an undeclared name a load error.SourcePathgains aSecret(String)variant and is now#[non_exhaustive], so an out-of-cratematchneeds a_arm. Marking it in the same release that already changes the enum means the next source added is not a breaking change.Deliberate omissions
read_secretsthat would have to be broken later, and a per-secret grant wants a consumer to scope it against.capability()returningOptionis the shape that admits one later without a further break.members:as well asfrom:, rendering inside the JSON object. The issue shows onlyfrom:. Chosen for uniformity, since there is no security difference.render.rshas a test pinning it, so refusing it is cheap if a reviewer prefers that. Amembers:entry mixing a secret with other sources has its whole value redacted in a record, because redacting one member would mean rendering the object twice.Verification
No live backend is involved. The file provider is what makes rotation testable without a network, so a rotation here is the file being rewritten and a refresh driven through the store.
The acceptance criteria are covered one for one in
crates/ppe-core/tests/assertions_e2e.rs: injection onto the upstream request, an unknown name refused at load, a response-direction entry refused, rotation after a refresh, redaction in the artifact, and the value reaching the asserted header and nothing else. Four more cover the audit seam: the sink view, that only the secret entry is redacted, that the upstream still receives the value after the emit, and the effect view.make lint,make test(both feature passes) andmake docpass.make lint-extrafails on items that predate this branch and are untouched by it.Summary by CodeRabbit
secret.<name>, including refreshed values on subsequent requests.