Repository navigation
Conversation
…entrust-io#515) Synchronize conformance/schemas/trace-claim.json with schema/trace-claim.json, extend conformance/tests/test_digest_parity.py to cover all thirteen digest pattern sites in v0.2, add parity and v0.2 record tests in conformance/tests/test_packaged_schema_accepts_real_records.py, and align conformance/docs/ on sha256:/sha384: digest support and TR-RTE-002 format-only checking (agentrust-io#247, agentrust-io#448 items 2, 5, 23). Closes agentrust-io#515 Signed-off-by: Raghuvar Durga <177662415+drk-ram@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
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.
What this changes
Closes #515. Related: #247, #448 (items 2, 5, 23).
conformance/schemas/trace-claim.jsonwithschema/trace-claim.json(src/agentrust_trace/schema/trace-v0.2.json):schema/trace-claim.jsontoconformance/schemas/trace-claim.jsonso all three schema copies in the repository are byte-identical.referencesfrom §3.1.2,reproducibilityfrom §3.1.4, andappraisalsub-propertiesmethod,re_executionfrom §3.1.4, andplatform_measurementfrom §3.1.5),$defs/canonicalizableValueoncnf.jwk(Implementation findings from the Go verifier (#444): 26 items #448 item 2), theiatupper safe-integer bound (maximum: 9007199254740991), the canonical 86-character base64urlsignaturepattern ([AQgw]), the fullsubjectpattern (^(spiffe://[^/]+/.+|did:[a-z0-9]+:.+)$), and theRSAkey-materialallOfrequirement (nande).conformance/tests/test_digest_parity.py:SCHEMA_SITES,_schema_pattern, andvisitfrom 2-tuples to arbitrary schema property/item path tuples covering all 13^sha(256:[0-9a-f]{64}|384:[0-9a-f]{96})$digest sites inconformance/schemas/trace-claim.json.conformance/tests/test_packaged_schema_accepts_real_records.py:conformance/schemas/trace-claim.jsonis byte-identical to../schema/trace-claim.jsonwhen present in the consolidated repository.references,reproducibility,appraisal.re_execution, andappraisal.platform_measurementvalidate againstconformance/schemas/trace-claim.json.cnf.jwkaccepts canonicalizable RFC 7517 extension members (use,key_ops) while rejecting non-canonicalizable floats (1e21,1.5) and unsafe integers (9007199254740992) via$defs/canonicalizableValue(Implementation findings from the Go verifier (#444): 26 items #448 item 2).conformance/schemas/trace-claim.jsonrejectssubject: "spiffe://bernstein.run",iat: 9007199254740992, non-canonical 86-charsignature, and bare{"kty": "RSA"}cnf.jwk.conformance/docs/andconformance/tests/test_docs_match_the_modules.py(Implementation findings from the Go verifier (#444): 26 items #448 items 5 and 23):conformance/docs/modules/tr-sca.md,conformance/docs/modules/tr-txn.md,conformance/docs/modules.md,conformance/docs/error-codes.md, andconformance/docs/levels.mdsoTR-SCA-002,TR-TXN-001, andTR-RTE-002document bothsha256:(64 hex chars) andsha384:(96 hex chars).conformance/docs/levels.mdclaimingTR-RTE-002rejects all-zero measurements at Level 1, aligning withconformance/docs/modules/tr-rte.mdandtr_rte.py(trust-levels: the all-zero measurement convention is stated with two different scopes #240, Implementation findings from the Go verifier (#444): 26 items #448 item 23).Cold-reader review:
cnf.jwkrejection test inconformance/tests/test_packaged_schema_accepts_real_records.pyagainst the pre-fixconformance/schemas/trace-claim.json. In the pre-fix schema,cnf.jwkhad"additionalProperties": falserather than"$ref": "#/$defs/canonicalizableValue", so a test asserting only thatcnf.jwk["ext"] = 1e21fails would pass against the pre-fix schema for the wrong reason (it rejected every extra member, including valid RFC 7517 members such as"use": "sig"). Split this intotest_cnf_jwk_accepts_canonicalizable_extensions_and_rejects_non_canonicalizable_numbers, which first validates a record carrying"use": "sig"and"key_ops": ["verify"](failing on the pre-fix schema) and then asserts rejection of1e21,1.5, and9007199254740992.conformance/tests/test_packaged_schema_accepts_real_records.pycarried three pre-existing em dashes (U+2014) in its module docstring that lost theirconformance/import-manifest.jsonexemption once the file was edited; replaced them with standard punctuation sopython tools/check_dashes.pypasses cleanly.Contributor: Raghuvar Durga (@drk-ram)
Type of change
Spec section
No change to
spec/trace-v0.2.md; synchronizes the packaged conformance copyconformance/schemas/trace-claim.jsonandconformance/docs/withschema/trace-claim.json(§3.1, §3.1.2, §3.1.4, §3.1.5, §3.2.2).Tests for a fix
Each of the following tests in
conformance/tests/fails when the corresponding change inconformance/schemas/trace-claim.jsonorconformance/docs/is switched off:conformance/tests/test_packaged_schema_accepts_real_records.py::TestPackagedSchemaAcceptsRealRecords::test_packaged_schema_is_byte_identical_to_normative_schemaconformance/tests/test_packaged_schema_accepts_real_records.py::TestPackagedSchemaAcceptsRealRecords::test_v02_record_with_references_reproducibility_and_appraisal_extensions_validatesconformance/tests/test_packaged_schema_accepts_real_records.py::TestPackagedSchemaAcceptsRealRecords::test_cnf_jwk_accepts_canonicalizable_extensions_and_rejects_non_canonicalizable_numbersconformance/tests/test_packaged_schema_accepts_real_records.py::TestPackagedSchemaAcceptsRealRecords::test_packaged_schema_rejects_records_forbidden_by_normative_schema[<lambda>-SPIFFE prefix without workload path]conformance/tests/test_packaged_schema_accepts_real_records.py::TestPackagedSchemaAcceptsRealRecords::test_packaged_schema_rejects_records_forbidden_by_normative_schema[<lambda>-iat above IEEE 754 MAX_SAFE_INTEGER]conformance/tests/test_packaged_schema_accepts_real_records.py::TestPackagedSchemaAcceptsRealRecords::test_packaged_schema_rejects_records_forbidden_by_normative_schema[<lambda>-non-canonical 86-char base64url signature]conformance/tests/test_packaged_schema_accepts_real_records.py::TestPackagedSchemaAcceptsRealRecords::test_packaged_schema_rejects_records_forbidden_by_normative_schema[<lambda>-RSA cnf.jwk missing required n and e members]conformance/tests/test_docs_match_the_modules.py::test_digest_docs_name_both_sha256_and_sha384conformance/tests/test_docs_match_the_modules.py::test_levels_doc_agrees_with_tr_rte_on_all_zero_measurementsValidation commands run:
pytest conformance/tests->727 passed, 5 xpassedpytest tests/test_validate.py tests/test_the_schema_and_the_models_agree.py tests/test_conformance_import_style.py->43 passedruff check src tests scripts conformance/tests/test_digest_parity.py conformance/tests/test_packaged_schema_accepts_real_records.py conformance/tests/test_docs_match_the_modules.py-> passed (All checks passed!)python tools/check_dashes.py-> passed (no dashes outside examples/, spec/trace-v0.1.md)mypy src/agentrust_trace-> passed (Success: no issues found in 15 source files)Checklist
git commit -s)CHANGELOG.mdupdated (for any normative change)<!-- CHANGED: #NNN: description -->in spec text