Repository navigation
test(xtest): DSPX-1561 cover assertion verification key selection - #706
Draft
dmihalcik-virtru wants to merge 1 commit into
Draft
dmihalcik-virtru wants to merge 1 commit into
dmihalcik-virtru wants to merge 1 commit into
Conversation
Adds the Phase 0 feature gate assertion_header_key_pinning. Every cli.sh answers no until a release ships; branch builds run the cases with XT_FORCE_SUPPORTS=assertion_header_key_pinning. test_assertion_verification.py builds assertions into TDFs that each SDK wrote and checks that each reader verifies them only with the key it selects from its configuration: the per-ID key, else the default key, else the payload key with HS256. It covers embedded jwk and x5c headers, a failure with the selected key not falling through to another source, the default key through each CLI's verification-keys file, and the documented default-key behaviour (spec 6.1): a Java-written TDF read with only a default RS256 key fails with algorithm-mismatch on its payload-key system-metadata assertion, while an empty keys file reads it. Every rejection is matched by its reported reason and has a positive control under the same configuration. The reference reader in assertions.py checks each built assertion before an SDK sees it. The module runs in the standard and focused xtest steps. tdfs.update_manifest_text rewrites a manifest's raw JSON text, for changes the Manifest model cannot represent. Signed-off-by: Dave Mihalcik <dmihalcik@virtru.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
This was referenced Nov 9, 2026
dmihalcik-virtru
added a commit
that referenced
this pull request
Nov 9, 2026
Every CI step named its test files, so each new suite edited the same lines of xtest.yml or check.yml (see #703, #706, #705) and conflicted with every other PR doing the same. Worse, a forgotten entry looks exactly like a pass: test_root_signature.py and test_audit_logs_integration.py are on main and run in no workflow at all. Each test module now declares one tier -- units, harness, core, legacy, multikas, benchmark, zip64 -- with pytestmark, *_units.py files are units by name, and each step selects with -m. conftest.py fails collection on any test without exactly one tier. check.yml's -m units step collects every module, so an untiered suite fails every PR rather than going unrun. Behaviour changes: - test_root_signature.py (core) and test_audit_logs_integration.py (multikas) now run in CI for the first time. - test_audit_logs.py runs offline in check.yml (units) instead of in the platform-backed helper step; it never needed the platform. - test_audit_logs_on_tampered_file is xfail(strict=True) pending #709: it has failed since it was written, unseen because nothing ran it. Signed-off-by: Dave Mihalcik <dmihalcik@virtru.com>
dmihalcik-virtru
added a commit
that referenced
this pull request
Nov 9, 2026
Every CI step named its test files, so each new suite edited the same lines of xtest.yml or check.yml (see #703, #706, #705) and conflicted with every other PR doing the same. Worse, a forgotten entry looks exactly like a pass: test_root_signature.py and test_audit_logs_integration.py are on main and run in no workflow at all. Each test module now declares one tier -- units, harness, core, legacy, multikas, benchmark, zip64 -- with pytestmark, *_units.py files are units by name, and each step selects with -m. conftest.py fails collection on any test without exactly one tier. check.yml's -m units step collects every module, so an untiered suite fails every PR rather than going unrun. Behaviour changes: - test_root_signature.py (core) and test_audit_logs_integration.py (multikas) now run in CI for the first time. - test_audit_logs.py runs offline in check.yml (units) instead of in the platform-backed helper step; it never needed the platform. - test_audit_logs_on_tampered_file xfails its audit assertion pending #709: it has failed since it was written, unseen because nothing ran it. The decrypt-rejection check stays blocking, and an audit pass fails the test so the xfail gets removed. Signed-off-by: Dave Mihalcik <dmihalcik@virtru.com>
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
Split out of #702 (draft; the complete change). Stacked on #705.
test_assertion_verification.pybuilds assertions into TDFs that each SDK wrote. It checks that each reader verifies an assertion only with the key it selects from its own configuration: the per-ID key, else the default key, else the payload key with HS256. The cases cover:jwkandx5cheaders, which may only match the selected key;system-metadataassertion, while an empty keys file reads it.Every rejection is matched by its reported
reason=<code>and has a positive control under the same configuration. Before any SDK sees a built assertion, the reference reader checks it.assertion_header_key_pinning. It is force-only until the SDK releases ship: everycli.shanswers no.tdfs.update_manifest_textrewrites a manifest's raw JSON text, for changes theManifestmodel cannot represent.xtest.ymlruns the module in the standard and focused steps.Testing
cd xtest && uv run ruff check . && uv run ruff format --check . && uv run pyright, plus the offline unit tests fromcheck.yml.XT_FORCE_SUPPORTS=assertion_header_key_pinning uv run pytest test_assertion_verification.py --sdks "go java js"against the SDK branches.Related pull requests