You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "89799969 (via GitHub)" <gi...@apache.org> on 2026/09/11 11:37:24 UTC

[PR] fix(acl): escape LIKE wildcards in user and rule search [rocketmq-dashboard]

89799969 opened a new pull request, #4230:
URL: https://github.com/apache/rocketmq-dashboard/pull/4230

   ## What is the purpose of the change
   
   Fixes #4229.
   
   ACL inventory search treats `%` and `_` as SQL LIKE wildcards instead of literal characters:
   
   - `GET /api/acl/users/page?keyword=` filters `username` and `access_key` with unescaped `LIKE` (`MybatisPlusAclRepository.findUserPage`).
   - `GET /api/acl/rules/page?principal=` / `?resource=` filter `principal` and `resource` the same way (`MybatisPlusAclRepository.ruleQuery`).
   
   Usernames and ACL principals commonly contain underscores (`svc_monitor`, `prod_user`). Searching for `prod_user` therefore also matches `prodXuser`, and a trailing `%` matches any suffix — so the inventory silently returns unrelated accounts or rules.
   
   ## Brief changelog
   
   - Add a private `escapeLike` helper (same behaviour as the existing `QueryHistoryService.escapeLike`) and apply it to user-page keywords and rule-page principal/resource filters.
   - Two regression tests assert the bound LIKE value for `prod_user%` / `svc_monitor%` is escaped (`%prod\_user\%%`) rather than treated as a wildcard pattern.
   
   ## Verifying this change
   
   ```
   $ mvn -f server/pom.xml test -Dtest='Acl*Test,MybatisPlusAclRepositoryTest'
   [INFO] Tests run: 118, Failures: 0, Errors: 0, Skipped: 0
   [INFO] BUILD SUCCESS
   ```
   
   Checkstyle: 0 violations (module validate phase).
   
   Before the fix the two new tests fail because the bound parameters are `%prod_user%` / `%svc_monitor%`; after it they bind `%prod\_user\%%` / `%svc\_monitor\%%`.
   
   Related peers: #4192–#4194 (audit / instance / cloud-credential LIKE escape), #4223/#4224 (Studio user search).


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(acl): escape LIKE wildcards in user and rule search [rocketmq-dashboard]

Posted by "89799969 (via GitHub)" <gi...@apache.org>.
89799969 commented on PR #4230:
URL: https://github.com/apache/rocketmq-dashboard/pull/4230#issuecomment-5695287155

   @lizhimins Following up - shared `SqlLikeUtil` + explicit `ESCAPE` is pushed (`26a5cd8d`) and this branch is `MERGEABLE/CLEAN` on current `rocketmq-studio`. Ready for re-review.


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(acl): escape LIKE wildcards in user and rule search [rocketmq-dashboard]

Posted by "89799969 (via GitHub)" <gi...@apache.org>.
89799969 commented on PR #4230:
URL: https://github.com/apache/rocketmq-dashboard/pull/4230#issuecomment-5695183553

   Same mechanical fix as requested on #4224/#4233: shared `SqlLikeUtil` + explicit `ESCAPE` clause. Tests kept.


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(acl): escape LIKE wildcards in user and rule search [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed pull request #4230: fix(acl): escape LIKE wildcards in user and rule search
URL: https://github.com/apache/rocketmq-dashboard/pull/4230


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org