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

   <!-- Make sure the base branch is `rocketmq-studio`: that is the RocketMQ 
Studio trunk. -->
   
   ### Which Issue(s) This PR Fixes
   
   No issue. This replaces #4798, which the stale bot closed before review and 
which can no longer be reopened. It is rebased onto the current trunk.
   
   ### Brief Description
   
   `AuthInterceptor.isLoginRequired` and `AuthController.isLoginRequired` read 
the same `authProperties.isLoginRequired()` and the same runtime `requireLogin` 
settings row, but they disagree on the failure branches (current trunk):
   
   | Persisted policy | Interceptor (enforces) | `/api/auth/status` (reports) |
   | --- | --- | --- |
   | row absent (`null`) | login required (fail closed) | `loginRequired: 
false` |
   | read throws (e.g. an undeserializable JSON column) | login required (fail 
closed) | uncaught, HTTP 500 |
   
   The frontend picks the login page or the console from `/api/auth/status`. 
With an absent row it opens the console, and every API call is then rejected by 
the interceptor. With an unreadable row it stays on the error screen, where 
retrying cannot succeed, while the login page that would work is unreachable.
   
   The controller now applies the interceptor's rule: an absent or unreadable 
policy reports `loginRequired: true`.
   
   ### How Did You Test This Change?
   
   - `cd server && mvn -B -ntp -Dtest='AuthControllerTest,AuthInterceptorTest' 
test`: 11 + 52 tests, 0 failures. Two new cases cover the missing row and the 
read failure.
   - With `AuthController` reverted to trunk, the two new tests fail (2 
failures), so they cover the change.
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`feat:` / `fix:` / 
`refactor:` / `chore:` / `docs:` / `perf:`)
   - [x] Tests added or updated for non-trivial changes, test methods named 
`...Test`
   - [ ] New UI text has both Chinese and English entries under `web/src/i18n/` 
(no UI text)
   - [x] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks)
   - [ ] New source files carry the ASF license header (no new files)
   - [ ] Documentation touched where behaviour changed (no documented behaviour 
changes)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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