Repository navigation
feat(xtest): DSPX-5520 add shared assertion conformance vectors - #705
Draft
dmihalcik-virtru wants to merge 3 commits into
Draft
dmihalcik-virtru wants to merge 3 commits into
dmihalcik-virtru wants to merge 3 commits into
Conversation
xtest/vectors/assertions-phase0.json is the shared vector set for Phase 0 of the ZTDF assertions contract (DSPX-5519). The Go, Java, and JS SDKs vendor it byte-for-byte and run every vector in their unit tests. It covers parsing, the hash input (starting with the spec Section 4.4 worked examples), binding forms, and single-assertion verification. vectors/generate_assertion_vectors.py produces it deterministically from two committed, test-only RSA-2048 keys. The offline test_assertion_vectors_units.py, now run by the check workflow, regenerates the file and requires a byte-identical match, checks the Section 4.4 anchor hashes, and runs every vector against the reference reader in assertions.py. Every expected assertionHash was also cross-checked against Go github.com/gowebpki/jcs and JS json-canonicalize. Signed-off-by: Dave Mihalcik <dmihalcik@virtru.com>
Moves the vector generator's JSON-text builder into xtest/jsontext.py and its JWS, JWK, certificate, and binding-claims helpers into assertions.py, so the xtest cases that put assertions into real TDFs build them the same way the DSPX-5520 vectors do. The generated vector file is unchanged byte for byte. Signed-off-by: Dave Mihalcik <dmihalcik@virtru.com>
…est in the shared vectors Extend the shared assertion vectors and the reference reader to the revised parsing rule: a member is rejected when it is a case variant of a name listed for its level, or when two members of a listed object are case variants of each other. The file now carries the level table (modelledNames) and the IsStreamable exception, so SDK tests can check their own tables against it. Also add vectors for strict base64url and canonical x5c base64, minimal RSA integers, well-formed EC and OKP embedded keys, x5c leaf structure, duplicate JWS header and claim members, ignored registered claims, invalid UTF-8 and BOMs anywhere in the manifest, and unusable configured keys. 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. |
1 of 3 tasks
|
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 #704.
xtest/vectors/assertions-phase0.jsonis the shared vector set for Phase 0 of the draft ZTDF assertions contract (DSPX-5519). It holds 288 vectors covering parsing, hash input (starting with the Section 4.4 worked examples), binding forms, and single-assertion verification. Each vector gives an expectedassertionHashor failure reason. The Go, Java, and JS SDKs vendor it byte for byte and run every vector in their unit tests.vectors/generate_assertion_vectors.pyproduces the file deterministically from two committed, test-only RSA-2048 keys.test_assertion_vectors_units.pyregenerates the file and requires a byte-identical match. It checks the Section 4.4 anchor hashes and runs every vector against the reference reader.check.ymlnow runs it.assertions.py, and the JSON-text builder intoxtest/jsontext.py, so xtest cases build assertions the same way the vectors do.modelledNames) and theIsStreamableexception, so each SDK can check its own table against it.Every expected
assertionHashwas also cross-checked against Gogithub.com/gowebpki/jcsand JSjson-canonicalize.The three commits review separately: the vectors, a byte-identical refactor of the helpers, then the whole-manifest rule with its added vectors.
Testing
cd xtest && uv run ruff check . && uv run ruff format --check . && uv run pyright.uv run pytest test_assertions_units.py test_assertion_vectors_units.py, plus the rest of the offline unit tests fromcheck.yml.Related pull requests