fix(acl): align ACL 2.0 binding type validation with the policy service - #2927
Open
yyqdbngt wants to merge 1 commit into
Open
fix(acl): align ACL 2.0 binding type validation with the policy service#2927yyqdbngt wants to merge 1 commit into
yyqdbngt wants to merge 1 commit into
Conversation
RockteMQ-AI
approved these changes
Sep 1, 2026
RockteMQ-AI
left a comment
There was a problem hiding this comment.
LGTM. Clean fix that properly aligns the model validator with the service validator's binding-type vocabulary.
Observations
- Correctness ✓ — The null/blank guard (
boundType == null || boundType.trim().isEmpty()) correctly prevents the previous silent pass-through of null values. - Case-insensitive matching via
toUpperCase(Locale.ROOT)is the right approach — locale-safe and consistent with the service layer. - Tests ✓ — Good parameterized coverage for both accepted and rejected types, including edge cases like whitespace-only strings.
Minor Note
java.util.Localeis fully qualified inline — consider adding an import for consistency with the rest of the file, but this is purely stylistic.
Automated review by github-manager-bot
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
Acl2PolicyContext.validate()with the operationalAclService#validateAcl2Policybinding-type vocabularyboundTypeand acceptTOPIC,GROUP,*,USER,SERVICE_ACCOUNTcase-insensitivelyWhy
Two validators for the same ACL 2.0 policy concept disagreed: the model validator only accepted exactly-cased
USER/GROUP/SERVICE_ACCOUNTand silently let a nullboundTypethrough, while the service validator (covered byAclServiceTest) requires a non-blank type and accepts the widerTOPIC/GROUP/*/USER/SERVICE_ACCOUNTset case-insensitively. A policy the service accepts ("topic","user") failed the model'svalidate()with a misleading exception, and a null binding type passed the model but failed the service.Testing
cd server && mvn -q -Dtest=Acl2PolicyContextTest test— 11 tests pass (new class)cd server && mvn -q -Dtest=AclServiceTest test— all tests pass (regression for the aligned vocabulary)