zjncs opened a new pull request, #5663:
URL: https://github.com/apache/rocketmq-dashboard/pull/5663
### Problem
`RocketMQDefaultClusterResolver` — the bridge to the legacy
namesrv-configured default cluster — had **no test**. Its contracts carry
security-relevant subtleties:
| Contract | Subtlety |
| --- | --- |
| discovery (`names()`) | runs **anonymously** when no admin credential is
configured — the documented one place that may not fail closed |
| `execute()` | fails closed with 422 when the admin credential is missing —
an ACL identity is never silently dropped |
| credential completeness | an **incomplete** credential (blank
access/secret key) is treated as unconfigured for discovery, but `execute()`
still refuses it |
| `find()` | returns a DIRECT/APACHE instance with the trimmed endpoint,
advertising the admin credential ref exactly when ACL is configured |
| cluster table | sorted names; a null `ClusterInfo`/table yields an empty
list |
### Change
Add `RocketMQDefaultClusterResolverTest` with nine tests (discovery executes
the real `AdminAction` against a mocked `DefaultMQAdminExt`, so the sort and
null-table handling inside the action are exercised, not bypassed).
### Verification
- New tests: **9/9 green** against unmodified code.
- Discriminating mutations on the resolver (build result verified):
- `execute()` falls back to anonymous instead of failing closed: **red**
- incomplete credentials no longer treated as unconfigured: **red**
- the `find()` namesrv guard is equivalent-through (`names()` has its own
guard) — pinned as observable behaviour, not claimed as discriminating.
- Restored: 9/9 green. No product code changed.
--
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]