fix(resolver): filter payload in its own scope - #188
Open
LKSNDRTMLKV wants to merge 1 commit into
Open
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 4 |
| Duplication | 2 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
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.
A restricted product-group field could have reached the public view. Based on #187, not on
main.What happened
The resolver filters a passport in two passes: the envelope with the passport-level policy, then
productGroupData— removed from the envelope and handed on as its own root document — with the product group's policy.The core library now scopes a product group's disclosure classes to that payload (dpp-core #183). That makes the second pass a caller that must declare its root is already inside the product group. Filtering it as an envelope applies none of that product group's classes and serves every restricted field in it.
Why this needed a new test
The wrong scope compiles, returns 200, and produces a body that looks right unless you know which field should be missing. Nothing in 864 tests caught it — the resolver's existing fixtures carry no restricted payload fields, so every audience saw the same thing either way.
There is now a test asserting an Annex XIII point 2 field (
cathodeMaterial) is absent from the public response bytes. It was confirmed to fail with the wrong scope before being committed with the right one: a redaction test that has never been seen to fail proves nothing.Same caveat as #187
CI cannot pass until core is released — this builds against unreleased core. Green locally against the sibling checkout.