Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Normal terminal loads never open a WebSocket because the iframe omits the authorization request, and shared personalized executions can invalidate another user's pending challenge.
2 open issues
What changed in this PR
Reworks Apache Zeppelin’s terminal authorization to bind shell access to a paragraph execution instead of a shared terminal-server token.
Changes:
- Adds execution-specific keys, scoped proofs, and a permission-checked REST endpoint.
- Connects classic and Angular result views to the terminal authorization flow.
- Adds single-use challenge validation, lifecycle updates, and regression coverage.
| File | Description |
|---|---|
zeppelin-web/src/app/notebook/paragraph/result/result.controller.test.js |
Tests classic UI proof relaying and cleanup. |
zeppelin-web/src/app/notebook/paragraph/result/result.controller.js |
Adds iframe validation and proof relaying. |
zeppelin-web-angular/src/app/services/notebook.service.ts |
Adds the terminal-proof REST request. |
zeppelin-web-angular/src/app/pages/workspace/share/result/result.component.ts |
Adds Angular iframe authorization handling. |
zeppelin-web-angular/src/app/pages/workspace/share/result/result.component.spec.ts |
Tests origin checks and detached-frame handling. |
zeppelin-web-angular/src/app/pages/workspace/published/paragraph/paragraph.component.html |
Passes note identity to published results. |
zeppelin-web-angular/src/app/pages/workspace/notebook/paragraph/paragraph.component.html |
Passes note identity to notebook results. |
zeppelin-server/src/test/java/org/apache/zeppelin/rest/NotebookSecurityRestApiTest.java |
Tests permissions and personalized execution proofs. |
zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java |
Adds permission-checked terminal-proof issuance. |
zeppelin-server/src/main/java/org/apache/zeppelin/rest/message/TerminalAuthorizationRequest.java |
Defines the challenge request payload. |
zeppelin-server/src/main/java/org/apache/zeppelin/notebook/Paragraph.java |
Creates and retains terminal execution authentication. |
zeppelin-interpreter/src/test/java/org/apache/zeppelin/user/SessionProofTest.java |
Tests proof generation and context binding. |
zeppelin-interpreter/src/main/java/org/apache/zeppelin/user/SessionProof.java |
Implements random keys and scoped cryptographic proofs. |
zeppelin-interpreter/src/main/java/org/apache/zeppelin/user/AuthenticationInfo.java |
Carries execution keys and supports authentication copying. |
shell/src/test/java/org/apache/zeppelin/shell/TerminalInterpreterTest.java |
Updates terminal connection and authentication tests. |
shell/src/test/java/org/apache/zeppelin/shell/terminal/TerminalSocketTest.java |
Makes received-message storage thread-safe. |
shell/src/test/java/org/apache/zeppelin/shell/terminal/TerminalAuthorizationRegistryTest.java |
Tests challenge scope, expiry, replacement, and concurrent claims. |
shell/src/main/resources/ui_templates/terminal-dashboard.jinja |
Marks terminal iframes for authorization relays. |
shell/src/main/resources/html/js/index.js |
Handles proof responses before opening the WebSocket. |
shell/src/main/java/org/apache/zeppelin/shell/TerminalInterpreter.java |
Issues execution-bound challenges and updates listener lifecycle. |
shell/src/main/java/org/apache/zeppelin/shell/terminal/websocket/TerminalSocket.java |
Validates proofs before starting shell sessions. |
shell/src/main/java/org/apache/zeppelin/shell/terminal/TerminalThread.java |
Owns the challenge registry and coordinates startup. |
shell/src/main/java/org/apache/zeppelin/shell/terminal/TerminalSession.java |
Moves idle-timeout ownership to the socket handler. |
shell/src/main/java/org/apache/zeppelin/shell/terminal/TerminalManager.java |
Makes context storage concurrent and tightens cleanup matching. |
shell/src/main/java/org/apache/zeppelin/shell/terminal/TerminalAuthorizationRegistry.java |
Implements expiring, single-use terminal challenges. |
Review effort: Balanced
| // be used to give control of the terminal to something else. When that | ||
| // thing is complete, should call io.pop() to restore control to the | ||
| // previous io object. | ||
| }; |
Comment on lines
+58
to
+61
| String terminalId = formatId(noteId, paragraphId); | ||
| String previousChallengeDigest = terminalIdToChallengeDigest.remove(terminalId); | ||
| if (previousChallengeDigest != null) { | ||
| pendingAuthorizations.remove(previousChallengeDigest); |
Emit bounded authorization requests when the terminal iframe initializes. Scope pending challenges by execution owner and add focused regressions.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This associates terminal WebSocket connections with the paragraph execution that created them.
The core, quick, and frontend workflows provide the full validation.