Repository navigation
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues blocking the notebook-conversion authorization change.
No open issues 🎉
What changed in this PR
This hotfix applies Apache Zeppelin’s existing note-read authorization check before returning converted Jupyter notebook content, while preserving the response format for authorized users.
Changes:
- Passes the authenticated service context into conversion and returns the existing permission-denied response when read access is denied.
- Adds regression coverage for denied requests and successful reader conversions, including notebook content and filename preservation.
| File | Description |
|---|---|
zeppelin-server/src/test/java/org/apache/zeppelin/socket/NotebookServerTest.java |
Tests denied and allowed conversions with isolated ticket state and cleanup. |
zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java |
Checks read permission before serializing and sending converted notebook content. |
Review effort: Balanced
Contributor
|
LGTM 👍 |
seung-00
reviewed
Dec 5, 2026
Comment on lines
1357
to
+1365
| String noteId = fromMessage.get("noteId").toString(); | ||
| getNotebook().processNote(noteId, | ||
| note -> { | ||
| if (note == null) { | ||
| throw new IOException("No such note: " + noteId); | ||
| } else { | ||
| Message resp = new Message(OP.CONVERTED_NOTE_NBFORMAT) | ||
| .put("nbformat", new JupyterUtil().getNbformat(note.toJson())) | ||
| .put("noteName", fromMessage.get("noteName")); | ||
| conn.send(serializeMessage(resp)); | ||
| } | ||
| if (!authorizationService.isReader(noteId, context.getUserAndRoles())) { | ||
| permissionError(conn, "convert", context.getAutheInfo().getUser(), | ||
| context.getUserAndRoles(), authorizationService.getReaders(noteId)); |
Contributor
There was a problem hiding this comment.
Could we check permissions before loading the note to reduce reads?
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 updates notebook conversion to apply the existing note access check before returning converted content.
The core and quick workflows provide the full validation.