[HOTFIX] Validate note access for interpreter bindings - #5431
Conversation
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
This hotfix enforces note-level permissions for interpreter binding operations so that binding reads/writes are rejected unless the caller has the appropriate note access.
Changes:
- Add reader permission check to
GET_INTERPRETER_BINDINGS. - Add writer permission check to
SAVE_INTERPRETER_BINDINGSand suppress successful response when unauthorized. - Add regression tests covering permitted and rejected read/write requests.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java | Adds authz gates for reading/writing interpreter bindings and conditions response on authorization. |
| zeppelin-server/src/test/java/org/apache/zeppelin/socket/NotebookServerTest.java | Adds regression tests verifying authz enforcement for interpreter binding read/write operations. |
Suppressed comments (1)
zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java:1
permittedis returned astrueeven whennote == null(line 649), which makes the method send anOP.INTERPRETER_BINDINGSresponse for a non-existent note. Ifpermittedis intended to reflect “authorized & actionable”, returnfalsewhennote == null(and consider initializingpermittedtofalseand setting it totrueonly after both the permission check passes and the note exists). This keeps the response behavior consistent with the intention of “stop before returning binding data or applying changes.”
/*
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
What is this PR for?
Ensure that interpreter binding operations follow the permissions of the associated note.
What type of PR is it?
Hot Fix
Todos
NotebookServerTestWhat is the Jira issue?
N/A
How should this be tested?
mkdir -p spark/interpreter/target ./mvnw -pl spark/interpreter resources:resources@copy-interpreter-setting ./mvnw -pl zeppelin-server -Dtest=NotebookServerTest testResult: 25 tests run, 0 failures, 0 errors.
Screenshots (if appropriate)
N/A
Questions: