Skip to content

[ZEPPELIN-6528] Handle forbidden interpreter responses in classic UI - #5416

Merged
pan3793 merged 2 commits into
apache:masterfrom
jongyoul:codex/ZEPPELIN-6528-handle-shiro-403
Aug 12, 2026
Merged

[ZEPPELIN-6528] Handle forbidden interpreter responses in classic UI#5416
pan3793 merged 2 commits into
apache:masterfrom
jongyoul:codex/ZEPPELIN-6528-handle-shiro-403

Conversation

@jongyoul

Copy link
Copy Markdown
Member

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.testAnyOfRolesUser to fail with Expected 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

  • Handle HTTP 403 authorization denials in the classic interpreter page
  • Preserve the existing HTTP 401 behavior
  • Add regression tests for both response statuses

What is the Jira issue?

How should this be tested?

cd zeppelin-web
npm run karma-test -- --single-run

Local validation:

  • ESLint passed for the changed controller and test.
  • git diff --check passed.
  • Karma compiled the application and test bundle successfully, but the browser run could not start locally because Firefox is not installed in the worktree environment.

Screenshots

N/A

Questions

  • Does the license files need to update? No
  • Is there breaking changes for older versions? No
  • Does this need documentation? No

@jongyoul
jongyoul marked this pull request as ready for review August 12, 2026 03:20
Copilot AI lite review requested due to automatic review settings August 12, 2026 03:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@pan3793 pan3793 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@pan3793
pan3793 merged commit e887d7c into apache:master Aug 12, 2026
17 of 18 checks passed
@pan3793

pan3793 commented Aug 12, 2026

Copy link
Copy Markdown
Member

thanks, merged to master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants