-
Notifications
You must be signed in to change notification settings - Fork 524
Set JPY_SESSION_NAME to the notebook path (same as jupyer_server does) #1532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
0a51b9e
to
3706f00
Compare
Thanks for working on it. Could you verify if the exposed path is a relative path to the current voila directory or the absolute path to the notebook? |
3706f00
to
5967ffa
Compare
Reworked this to actually work :-) Now returns the absolute OS path to the notebook. Tested with invocations like |
Any additional changes you'd like to see? |
Hey, sorry for the late reply. I don't feel comfortable with exposing the full file path to the frontend. In JupyterLab, you have access to the server file system via the terminal or by executing Python code, so there is no point in hiding the file path. But Voila environment is more restrained, and exposing a relative path is enough. What do you think @jtpio @martinRenou? |
Sorry, I realized that I forgot to provide a use case which might help give more context: I'm using pixi-kernel to JIT-provision the notebook's environment. This depends on accessing the notebook's metadata to get the name of the Pixi environment that should be provisioned. I can imagine other solutions, but in general it seems preferable to minimize the number of special cases that users need to address when running a notebook with Voila that already works with other servers like Jupyter Lab. |
Hi @trungleduc @jtpio @martinRenou Just checking in to see if there have been any more thoughts or internal discussion on this topic? |
Similar feeling at first, without checking if it would be real security issue. Otherwise, have you tried to use a The docs mention:
Maybe your Pixi provisioner would be able to use the information the |
I agree that the security implications are important to consider, but I think there's simple way to look at this. From the security model perspective, keeping the notebook path information secret is hard to do so building a policy that assumes path secrecy creates a brittle contract: one debugging log message or third‑party extension can blow the guarantee. Voila’s existing model of "no code execution, no arbitrary file access" is a cleaner, testable boundary. Not wanting to add the notebook path to an environment variable feels like taking a "security through obscurity" approach.
I considered that initially, but it doesn't work with pre-heated kernerls which we plan to use soon. Open to suggestions here, but still feel like having Voila aligned out-of-the-box with the precedent set by Jupyter Server and JupyterLab maximizes portability, simplifies the ecosystem, and keeps security boundaries clear and enforceable. Thanks for considering — happy to elaborate or help with a documentation note if that would move the PR forward. |
@trungleduc @jtpio @martinRenou Friendly ping |
…(same as jupyer_server does)
e7dc88d
to
eff5ffe
Compare
References
Code changes
Set
JPY_SESSION_NAME
to the notebook path, same asjupyer_server
does. This ensures that notebooks that use this feature in Jupyter Lab continue to work when served by voila.User-facing changes
Backwards-incompatible changes