[ZEPPELIN-6528] Handle forbidden interpreter responses in classic UI - #5416
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the classic UI interpreter settings page to correctly handle Apache Shiro 2.0.6’s authorization-denial behavior by treating HTTP 403 (forbidden) the same as HTTP 401 (unauthorized) for the existing “no permission” toast + redirect flow, and adds regression tests to prevent the issue from recurring.
Changes:
- Extend the interpreter settings fetch error handling to trigger the existing permission toast/redirect on both HTTP 401 and HTTP 403.
- Add a classic UI controller test that verifies the toast + redirect timer behavior for both HTTP statuses.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
zeppelin-web/src/app/interpreter/interpreter.controller.js |
Treats HTTP 403 as an authorization denial alongside HTTP 401 for the interpreter settings request. |
zeppelin-web/src/app/interpreter/interpreter.controller.test.js |
Adds regression coverage asserting the permission toast and redirect timer are triggered for both 401 and 403. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
LGTM. This correctly handles the 403 returned for an authenticated user who lacks the required interpreter role, while preserving the existing 401 flow. The new controller tests cover both responses.
Non-blocking: please link apache/shiro#2186 in the PR description and clarify that the behavior changed in Shiro 2.0.6.
|
thanks, merged to master |
What is this PR for?
Apache Shiro 2.0.6 returns HTTP 403 for an authenticated user who lacks a required role. Shiro 1.13.0 returned HTTP 401 for the same authorization denial.
The classic interpreter page only handled HTTP 401, so a 403 response did not show the permission error toast or redirect the user. This also caused
AuthenticationIT.testAnyOfRolesUserto fail withExpected ngToast not found.This PR handles both 401 and 403 responses and adds controller tests covering both statuses.
What type of PR is it?
Bug Fix
Todos
What is the Jira issue?
How should this be tested?
cd zeppelin-web npm run karma-test -- --single-runLocal validation:
git diff --checkpassed.Screenshots
N/A
Questions