Aias00 opened a new issue, #4502:
URL: https://github.com/apache/rocketmq-dashboard/issues/4502

   ### Before Creating the Bug Report
   
   - [x] I searched open and closed issues and pull requests for client 
diagnostics, `namesrvAddr`, registry validation, and admin-client cache bounds.
   - [x] I verified the behavior against current `master` 
(`987b748e8f4f421c5cd3c4c4e51a064cc7e59f18`).
   - [x] No live NameServer endpoint was contacted while validating this report.
   
   ### Problem
   
   `GET /api/clients` accepts a caller-supplied `namesrvAddr`. 
`ClientService.listConnectionsAt` checks only that the value is nonblank, then 
forwards it to `RocketMQClientProvider`, which executes through 
`MqAdminExtFactory`. The factory creates and caches a started admin client for 
every distinct normalized address.
   
   The Clients page itself only submits endpoints returned by the NameServer 
registry, but the backend does not enforce that same boundary. A read-only user 
can therefore make Studio attempt outbound RocketMQ connections to addresses 
that were never registered by an administrator, and distinct addresses can 
allocate long-lived cache entries until explicit release or application 
shutdown.
   
   ### Proposed Design
   
   Keep the existing frontend and `/api/clients` request contract, but enforce 
the registry boundary in the backend:
   
   1. Add a `NameserverRegistryService` lookup that normalizes the requested 
value with `NamesrvAddrParser` and returns it only when the normalized address 
exists in `rmq_nameserver`.
   2. Make `ClientService.listConnectionsAt` require that registered address 
before invoking `ClientProvider.findConnectionsAt`.
   3. Reject unknown addresses before any provider or `MqAdminExtFactory` 
interaction.
   4. Preserve existing cluster/type filtering and the Clients-page workflow.
   
   This keeps read-only diagnostics available to readers while ensuring 
administrators control the outbound endpoint set through the existing registry 
mutation APIs. Cache policy changes are intentionally out of scope.
   
   ### Acceptance Criteria
   
   - Registered NameServer endpoints continue to support client connection 
diagnostics.
   - Address formatting is normalized consistently with registry create/update.
   - An unregistered endpoint is rejected before provider execution.
   - Existing `clusterId` and `type` filters are unchanged.
   - Focused service tests cover registered, normalized, blank, and 
unregistered addresses.
   - Backend tests, Checkstyle, and `git diff --check` pass.
   
   AI-assisted static analysis; the request-to-cache call path was verified 
from source without active endpoint probing.


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