Repository navigation
fix(sdk): DSPX-1561 parse manifests strictly - #436
Open
dmihalcik-virtru wants to merge 1 commit into
Open
dmihalcik-virtru wants to merge 1 commit into
dmihalcik-virtru wants to merge 1 commit into
Conversation
Apply the JSON profile of the ZTDF assertions specification (Section 3) while the manifest streams, before a typed field can keep only one of two values, and whether or not assertions are verified later: - duplicate member names in any object, compared after decoding escapes, are rejected with duplicate-member; - at every level the SDK models, from the manifest root through key access objects, integrity information and segments down to each assertion's statement and binding, a case variant of a modelled member name, or two members whose names are case variants of each other, is rejected with ambiguous-member. IsStreamable in encryptionInformation.method, which java-sdk wrote up to v0.7.5, is still accepted; - inside assertion objects, lone surrogates, Unicode noncharacters and numbers outside the IEEE 754 double range are rejected with invalid-json. The manifest is read as strict JSON and decoded as strict UTF-8 rather than replacing invalid bytes with U+FFFD, and may not start with a byte order mark. Add SDK.AssertionFailureException, a subclass of AssertionException that carries the assertion id (when one could be read) and an AssertionFailureReason with the Section 9 codes. Its message contains reason=<code>, with the id and detail escaped and length-limited. Signed-off-by: Dave Mihalcik <dmihalcik@virtru.com>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
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
|
Contributor
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.




Proposed Changes
duplicate-member;payload,encryptionInformation, key access objects and theirpolicyBinding,method,integrityInformation,rootSignature, segments, and each assertion's object,statement, andbinding), a case variant of a modelled member name, or two members whose names differ only in case, fails withambiguous-member;invalid-json.IsStreamableinencryptionInformation.method, is still accepted. java-sdk wrote it up to v0.7.5.SDK.AssertionFailureException(a subclass ofSDK.AssertionException) carries the assertion id, when one could be read, and anAssertionFailureReasonholding the Section 9 code. Its message includesreason=<code>, with the id and detail escaped and length-capped.Split out of #432 (draft; the complete change). Cross-SDK counterparts: opentdf/platform#4305, opentdf/web-sdk#1139; cross-SDK test: opentdf/tests#707.
Compatibility: manifests with duplicate or case-variant member names, invalid UTF-8, or a byte order mark no longer load.
Checklist
Testing Instructions
mvn -pl sdk,cmdline -am test(new cases inStrictManifestParsingTest, including the 0.7.5 golden TDF withIsStreamableand a long segment list).