Skip to content
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

WIP: Cleanup of handlers/urls #20

Conversation

maartenbreddels
Copy link
Member

For voila, I think it does not make sense (at least by default, or optional) to have authentication. At least to have a different behaviour for the notebook and the voila server extension.

What this allows, is to have a notebook server (normal authentication) but serve notebooks via voila without. This is very much a proof of concept and deserves more consideration. It exposes some of the issues that with notebook/jupyter_server has when you want to do this. For instance, to make ZMQChannelsHandler not check auth, we need to return a fake user.

I think in general, voila shakes the box a bit, because instead of exposing kernels/notebooks as a security issue, now all of the sudden a kernel can be safe to expose (since it does not allow execution). Also to keep in mind is that multiuser all of the sudden makes sense.

Long term vision/idea: You could have a notebook run under your account, it ran a simulation or report for ~2 hours. Now users can connect to voila, they just want to see this report, which can be without authentication, or with authentication that has nothing to do with the notebook authentication.

@timkpaine
Copy link
Member

Why not have it support an overrideable login handler like the server does, then the default login handler can just do no auth.

voila/app.py Outdated
(url_path_join(base_url, r'/api/kernels/%s' % _kernel_id_regex), KernelHandler),
(url_path_join(base_url, r'/api/kernels/%s/channels' % _kernel_id_regex), ZMQChannelsHandler),
(url_path_join(base_url, r'/voila/api/kernels/%s' % _kernel_id_regex), KernelHandler),
(url_path_join(base_url, r'/voila/api/kernels/%s/channels' % _kernel_id_regex), ZMQChannelsHandler),
Copy link
Member

Choose a reason for hiding this comment

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

👍 it should indeed not be the same handler as for the notebook.

@maartenbreddels maartenbreddels changed the title WIP: Bypass/no authentication WIP: Cleanup of handlers/urls Nov 20, 2018
@maartenbreddels
Copy link
Member Author

@timkpaine yes that was a good idea actually

I started doing that, but decided to first get to a clean PR that sets up the handlers correctly and cleans up the code. I'll open a PR later for the auth.

@SylvainCorlay if you decide to merge it, just squash it, I just want to keep the history of this branch so I didn't squash it myself.


def add_base_url_to_handlers(base_url, handlers):
"""Adds the base_url in front of the urls in the Tornado handlers"""
return [tuple([url_path_join(base_url, url)] + list(tail)) for url, *tail in handlers]
Copy link
Member Author

Choose a reason for hiding this comment

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

btw, this is py3 only, I guess that is ok

@maartenbreddels
Copy link
Member Author

Replaced bu #41

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