tju-yxq opened a new issue, #5169:
URL: https://github.com/apache/rocketmq-dashboard/issues/5169

   ## Problem
   
   An access review of the ACL users page — "which accounts exist, which are 
admin, which clusters can each reach, which have IP whitelists" — can only be 
done against the paginated table, 20 rows at a time. The reviewer has no way to 
attach the account inventory to a ticket or spreadsheet: every neighboring 
inventory (cloud credentials, K8s certificates, topics, consumer groups, 
notification deliveries, audit logs) has an export, but the ACL user list — the 
one that answers "who can access the broker" — does not. When the reviewer also 
needs to record which access keys each account uses, the table shows masked 
keys but no copyable combined view.
   
   ## Current behavior and reproduction
   
   1. Open **Instance > ACL** and switch to the **用户管理 / Users** tab.
   2. Type a keyword into the search box: the table refilters server-side 
(`pageAclUsers` → `GET /api/acl/users/page?keyword=...`, page size 20).
   3. Scroll the table: each row shows username, masked access key, admin flag, 
cluster bindings and created time; Tencent role rows additionally show 
read/write permission.
   4. Want to hand the filtered account list to a compliance review as a file → 
there is no export action anywhere on the tab, and the controller has no export 
surface 
(`server/src/main/java/org/apache/rocketmq/studio/instance/acl/AclController.java`,
 lines 89-110: `GET /api/acl/users`, `GET /api/acl/users/page`, `GET 
/api/acl/users/{id}/credentials` only).
   
   The credentials themselves are deliberately protected: the list and page 
already mask both keys (`AclService.maskCredentials`, `CredentialUtils.mask`), 
and the plaintext is only served by the admin-only per-user credentials 
endpoint. The export has to keep exactly that boundary.
   
   ## Proposed behavior
   
   - A `GET /api/acl/users/export` endpoint streams the account inventory as 
CSV (`text/csv;charset=UTF-8`, attachment disposition), honouring the same 
`instanceId`/`keyword` filters as the page, for both Apache accounts (database 
pagination) and Tencent roles (provider list, keyword-filtered).
   - Columns: user id, username, **masked** access key (same 
`CredentialUtils.mask` as the list view), admin flag, cluster bindings 
(`;`-joined), read/write permission (Tencent roles), IP whitelist pattern, and 
created time. The secret key has **no column at all**.
   - The export is bounded (reject with 400 beyond 10,000 records) and 
BOM-prefixed, following the cloud credential export's conventions 
(`CloudCredentialService.exportMaskedCsv`).
   - The users tab gains an **Export users** button next to the existing search 
box; list, create, edit, delete and credentials-reveal behaviour are unchanged.
   
   ## Acceptance criteria
   
   - [ ] `GET /api/acl/users/export?keyword=...` returns `text/csv` with 
`Content-Disposition: attachment; filename="acl-users.csv"` and a BOM-prefixed 
header row.
   - [ ] Each row serializes the masked access key and never contains the 
plaintext or masked secret key (regression test asserts the raw secret does not 
appear anywhere in the CSV).
   - [ ] Cluster bindings serialize as `cluster-a;cluster-b`; Tencent role rows 
carry `permRead`/`permWrite`; the Apache path delegates to the repository with 
the trimmed keyword and export page size.
   - [ ] Requests whose result set exceeds 10,000 records fail with 400 naming 
the limit.
   - [ ] The users tab button downloads the file through the shared blob path 
and surfaces a failure message on error; existing users-tab behaviour (search, 
pagination, credentials reveal) is unchanged and covered by the existing tests.
   
   ## Importance
   
   Should-have. The workaround is manual transcription from a 20-row paginated 
table (or scripting against the JSON page endpoint), which is exactly what 
every other inventory in the console already solved with a one-click export. 
The masking design is not new — the list endpoint already masks — so the export 
is a read of already-safe data in a shareable format, and it finally gives 
access reviewers a file they can attach.
   
   ## Duplicate check
   
   Searched open and closed issues/PRs for `ACL user export`, `"user inventory" 
CSV`, `acl export`, and `export the ACL user inventory`. The closest match is 
PR #4082 (`feat(acl): export the ACL user inventory as CSV`, closed unmerged 
during the 2026-09-16 base-branch migration, no linked issue) — it is dead and 
nothing superseded it; this issue tracks the still-missing capability so the 
feature has an open tracking entry. The cloud-credential export (#3980 lineage, 
merged) covers cloud vendor credentials, not broker ACL accounts.
   


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