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

   ### Motivation
   
   `AclService.updateUser` (local plain-access path) carefully preserves every 
existing field of the account through a partial update — `accessKey`, 
`secretKey`, `admin`, `clusters`, `gmtCreate` — but the merge builder omits 
`whiteRemoteAddress`:
   
   ```java
   AclUserVO merged = AclUserVO.builder()
           .id(existing.getId())
           .username(...)
           .accessKey(existing.getAccessKey())
           .secretKey(existing.getSecretKey())
           .admin(...)
           .clusters(...)
           .gmtCreate(existing.getGmtCreate())
           .build();
   ```
   
   `whiteRemoteAddress` is a real, persisted field of local plain-access 
accounts (`rmq_acl_user.white_remote_address`, written by 
`createAndUpdatePlainAccessConfig`, read back by `toUserVO`). The stored row 
survives the update (MyBatis-Plus `updateById` skips null columns), but 
`replaceUser` returns the merged VO, so `POST /api/acl/users/update` responds 
with `whiteRemoteAddress: null` after a harmless rename — the API reports the 
account's IP whitelist as gone even though it is still enforced.
   
   ### Modifications
   
   Carry `existing.getWhiteRemoteAddress()` through the merge, like every other 
preserved field.
   
   ### Verification
   
   New test `updateUserShouldKeepTheExistingWhiteRemoteAddress` (model: 
`updateUserShouldSaveExistingUser`): existing user with `whiteRemoteAddress = 
"10.0.1.0/24"`, rename via DTO.
   - Before the fix: fails — `whiteRemoteAddress` in the response is `null`.
   - After the fix: passes.
   - ACL suite regression: `mvn -f server/pom.xml test 
-Dtest='AclServiceTest,MybatisPlusAclRepositoryTest,AclControllerTest'` → 
**Tests run: 114, Failures: 0, Errors: 0**.
   


-- 
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