Repository navigation
feat(sdk): add opt-in hexless policy binding - #421
Draft
pflynn-virtru wants to merge 1 commit into
Draft
pflynn-virtru wants to merge 1 commit into
pflynn-virtru wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Paul Flynn <pflynn-virtru@users.noreply.github.com>
Contributor
|
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. Comment |
2 of 3 tasks
|
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.



Summary
Adds an opt-in hexless policy binding: each key access object's policy binding hash is written as
Base64(HMAC), the form the TDF spec defines, instead of the legacyBase64(hex(HMAC)). Default output is unchanged. Mirrors opentdf/platform#4232 (Go).Config.withHexlessPolicyBinding()and the cmdline flag--hexless-policy-binding.Config.withTargetModeoverrides the opt-in and keeps the legacy form, whatever the option order.Base64(hex(HMAC)). Both forms carry the same HMAC, and every KAS verifies the legacy form, so this SDK can decrypt hexless TDFs against any KAS. Legacy bindings pass through unchanged, and the manifest itself is never modified. Older readers forward the binding unchanged and need a KAS with fix(kas): accept spec-compliant policy bindings platform#4223.Part of opentdf/platform#3578.
Testing
mvn -pl sdk,cmdline -am test: sdk 315, sdk-pqc-bc 28, cmdline 14, all passing.PolicyBindingTest(known answers for both forms; re-encode only for 32-byte bindings; null and bare-string handling),TDFTest.hexlessPolicyBindingOnEveryKeyAccess(two-KAS split),TDFTest.legacyTargetModeOverridesHexlessPolicyBinding(both orders),TDFTest.rewrapRequestCarriesLegacyBinding,ConfigTest,CommandTest.encrypt_hexlessPolicyBindingFlag_acceptedByPicocli.🤖 Generated with Claude Code