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

   ## Summary
   
   Adds `BrokerTopologyGuardsTest`, a first unit test for the shared guards 
that reject offset-style message ids whose embedded broker address is outside 
the selected instance topology before remoting is allowed to connect to that 
address directly. `MQAdminExt` is mocked; offset message ids are built with the 
real `MessageDecoder` from hex-encoded IP/port fixtures.
   
   Coverage:
   - non-offset (undecodable) message ids are treated as safe without ever 
querying the topology;
   - ids whose embedded broker address belongs to the cluster are accepted, ids 
pointing outside it are rejected;
   - an unverifiable topology (admin failure) rejects instead of handing an 
unverified address to remoting;
   - `validatedBrokerAddr` returns the address only for known endpoints;
   - unresolvable/non-`InetSocketAddress` embedded addresses yield no address 
and never reach the topology query;
   - `knownBrokerEndpoints` collects and trims addresses across brokers, 
skipping empty tables and empty entries.
   
   ## Why
   
   This guard is the security boundary against message ids steering remoting to 
user-influenced broker addresses; it had no direct test.
   
   ## Testing
   
   `mvn -B test -Dtest=BrokerTopologyGuardsTest` — 7/7 pass; checkstyle 
(validate) clean.


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