tju-yxq opened a new pull request, #5170:
URL: https://github.com/apache/rocketmq-dashboard/pull/5170
### Which Issue(s) This PR Fixes
- Fixes #5169
### Brief Description
Adds a `GET /api/acl/users/export` endpoint that streams the ACL account
inventory as CSV (UTF-8 BOM, `text/csv;charset=UTF-8`, attachment disposition),
honouring the same `instanceId`/`keyword` filters as the users page. The access
key is masked with the same `CredentialUtils.mask` the list view already uses,
the secret key has no column at all, and the plaintext stays behind the
explicit per-user credentials endpoint. Both paths are covered: Apache accounts
through database pagination, Tencent roles through the provider list with the
page's keyword filter; requests beyond 10,000 records fail with 400 naming the
cap, following the cloud-credential export's conventions. The users tab gains
an **Export users** button next to the search box.
### How Did You Test This Change?
Run on the branch (`77800af4`, based on `master` @ `0228dad5`):
```
cd server && mvn -B -ntp '-Dtest=AclServiceTest,AclControllerTest' test
AclControllerTest: 28, AclServiceTest: 81
Tests run: 109, Failures: 0, Errors: 0, Skipped: 0 — BUILD SUCCESS
cd web && npm test -- AclPage --run
Test Files 1 passed (1)
Tests 24 passed (24)
cd web && npm run lint
0 errors (11 pre-existing warnings in unrelated files)
```
New coverage: the service test asserts the BOM, the header, the masked
access key (`acce****3456`), `;`-joined clusters, the whitelist and created
time, and that the raw secret key appears nowhere in the CSV; the Tencent path
is asserted to keyword-filter and mask; the 400 on a 10,001-record result set;
the controller test asserts the `text/csv` content type, the
`Content-Disposition` filename, the BOM-prefixed body and the keyword
pass-through; the page test switches to the users tab, clicks **导出用户**, and
asserts the service call and the blob download.
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in
- [x] Commit subject follows Conventional Commits
- [x] Tests added or updated for non-trivial changes, test methods named
`...Test`
- [x] New UI text has both Chinese and English entries under `web/src/i18n/`
- [x] Architecture constraints stay green (`mvn test` runs the ArchUnit
checks)
- [x] New source files carry the ASF license header
- [ ] Documentation touched where behaviour changed (README / `docs/` /
in-app help)
--
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]