unbridled-41 opened a new issue, #5899:
URL: https://github.com/apache/rocketmq-dashboard/issues/5899

   ### Studio Version
   branch: `rocketmq-studio` @ `7e7aa344` (the revision verified; the branch is 
based on it)
   deployed as: not required to reproduce
   
   ### Runtime Environment
   
   Reproduced with the backend tests (`cd server && mvn -o -B -ntp test 
-Dtest='AclServiceTest,AclControllerTest'`); no cluster needed. Demo mode hides 
it because the mock service filters client-side.
   
   ### Connected RocketMQ Cluster
   
   Any instance with ACL rules of more than one version; on a Tencent instance 
every role-backed rule is version 1.0.
   
   ### Describe the Bug
   
   The ACL rules table offers a 版本 filter (全部 / ACL 1.0 / ACL 2.0) and sends 
the picked value:
   
   ```ts
   // web/src/pages/instance/acl.tsx:203
   aclVersion: ruleVersionFilter === 'all' ? undefined : ruleVersionFilter
   ```
   
   but it never reached the query:
   
   - `AclController.listRules` declared no `aclVersion` `@RequestParam`, and 
Spring discards an unmatched query parameter.
   - `AclService.listRules` had no such parameter and passed a literal `null` 
into the predicate that already existed: `MybatisPlusAclRepository.ruleQuery` 
renders `.eq(StringUtils.hasText(aclVersion), "acl_version", aclVersion)`.
   
   So selecting ACL 1.0 (or 2.0) returned rules of both versions with an 
unchanged total, and on a Tencent instance selecting ACL 2.0 still listed the 
1.0 rules.
   
   ### Steps to Reproduce
   
   1. Create an ACL 2.0 rule and keep a legacy ACL 1.0 rule on the same 
instance.
   2. Open the ACL page and pick 版本 = ACL 1.0.
   3. Both rules remain listed and the pagination total does not change. `GET 
/api/acl/rules?instanceId=<apache>&aclVersion=1.0` returns the 2.0 rule as well.
   
   ### What Did You Expect to See?
   
   Only the rules of the selected version, with the total limited to them.
   
   ### What Did You See Instead?
   
   The filter only changed the query string.
   
   ### Evidence
   
   - `web/src/pages/instance/acl.tsx:203`, `web/src/api/acl.ts:67`, 
`server/.../instance/acl/AclController.java:58-69`, 
`server/.../instance/acl/AclService.java:83-100`, 
`server/.../instance/acl/MybatisPlusAclRepository.java:415-425`.
   - `cd server && mvn -o -B -ntp test 
-Dtest='AclServiceTest#listRulesShouldForwardTheAclVersionFilterToTheRepositoryTest'`
 - before the fix the repository receives `null`; the controller case fails 
with "Argument(s) are different".
   
   ### Impact
   
   A first-class filter silently returns a superset (including on the Tencent 
path, where the versions are meaningful), so an operator auditing or cleaning 
up ACL 1.0 rules works from wrong data.
   
   ### Acceptance Criteria
   
   - The parameter is bound by the controller, forwarded by the service to the 
repository predicate, applied to the Tencent projection, documented in 
`docs/api-spec.md`, and pinned by a regression test per hop.
   
   **Corresponding PR:** #ISSUEPR#
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to