Repository navigation
feat(sdk): add opt-in hexless policy binding - #421
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>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
|
@coderabbitai review |
✅ Action performedReview finished.
|



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
Summary by CodeRabbit
New Features
Bug Fixes
Tests