fix(xtest): reclassify policy binding failures as KAS request errors#421
fix(xtest): reclassify policy binding failures as KAS request errors#421marythought merged 2 commits intomainfrom
Conversation
Policy binding mismatches (unbound policy, altered binding) cause KAS to return a 400 Bad Request, which is a request-level error — not a tamper/integrity issue detected by the SDK. Add assert_kas_request_error for these cases, accepting both the new "KAS request error" classification and legacy "tamper" strings for backward compatibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Mary Dickson <mary.dickson@virtru.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors error handling in Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Blocked by / companion to: opentdf/platform#3166 This PR should merge first so that the platform PR's xtest CI passes. |
There was a problem hiding this comment.
Code Review
This pull request correctly refactors the error handling for policy binding failures in tests. A new assert_kas_request_error function is introduced to check for KAS request errors, which is more accurate than the previous classification as tamper errors. The changes are backward compatible by checking for both new and legacy error messages. The old logic for this case has been cleanly removed from assert_tamper_error. I've identified a minor improvement opportunity to simplify the signature of the new helper function.
X-Test Results✅ java-main |
|
X-Test Results✅ java-v0.13.0 |



Summary
assert_kas_request_errorfor policy binding failure tests (test_tdf_with_unbound_policy,test_tdf_with_altered_policy_binding)KAS request error,rewrap request 400) and legacy (tamper,InvalidFileError) error strings"wrap"case fromassert_tamper_errorContext
Companion to opentdf/platform#3166, which reclassifies
ErrRewrapBadRequestaway fromErrTamperedand under a newErrKASRequestError. Policy binding mismatches cause KAS to return 400 Bad Request — a request-level error, not a tamper/integrity issue.Test plan
🤖 Generated with Claude Code