yyqdbngt opened a new pull request, #5878: URL: https://github.com/apache/rocketmq-dashboard/pull/5878
## Why `AclService.createRule` validates the required rule fields (blank principal / resource each get a 400), but its twin `updateRule` only checked `rule.getId()`. An update request with a blank (`""` / whitespace) principal or resource therefore went straight through `replaceRule` and was persisted verbatim — an ACL rule whose principal matches nothing, with no way to notice at write time. ## What changed - `updateRule` now enforces the same `StringUtils.hasText` guards as `createRule` for `principal` and `resource`, throwing `BusinessException(400)` before any repository write or audit record. ## Validation - Red first: new tests `updateRuleShouldRejectBlankPrincipalLikeCreateRule` / `updateRuleShouldRejectBlankResourceLikeCreateRule` in `AclServiceTest` failed before the fix (the update reached the repository instead of being rejected). - After the fix: `mvn test -Dtest=AclServiceTest,AclControllerTest` — all green (84 tests). -- 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]
