jupyterlab-contrib / jupyterlab-link-share

JupyterLab Extension to easily share a link to a running server on Binder
BSD 3-Clause "New" or "Revised" License
53 stars 14 forks source link

Use JupyterHub sharing when available #64

Open minrk opened 9 months ago

minrk commented 9 months ago

Is your feature request related to a problem? Please describe.

JupyterHub 5.0 will introduce the concept of sharing, so users can grant each other access to their server.

That PR includes an example javascript notebook and server configuration to grant JupyterLab permissions to make the necessary API requests.

Up to now, there have been two ways to share links to a shared server in jupyterhub:

With the new sharing permission, (expiring) links can be generated that grant permission without leaking credentials or bypassing anything.

A link-to-this-doc URL will look like:

/hub/accept-share?code=...&next=encoded(/user/name/lab/tree/...)

i.e. the default share link encoded in the next parameter of the accept URL.

Describe the solution you'd like

Use the jupyterhub share-codes API to generate sharing links that grant access to the server when called from within JupyterHub.

Additional context

sharing links with a token shouldn't ever be done in a JupyterHub context, so this should be able to replace the 'with credentials' links to one that preserves proper JupyterHub authentication, when available.

There are also options to specify the scopes to be shared, expiration, etc. if they should be different from the default. UI for that gets hairy.

krassowski commented 9 months ago

Part of the code for link sharing has been moved to https://github.com/jupyterlab/jupyter-collaboration (see https://github.com/jupyterlab/jupyter-collaboration/pull/150, https://github.com/jupyterlab-contrib/jupyterlab-link-share/issues/59#issuecomment-1569690374). This extension was not ported to lab 4.0 (https://github.com/jupyterlab-contrib/jupyterlab-link-share/issues/59). We will need to decide whether to archive it and implement your suggestion in jupyter-collaboration, or keep it alive and implement it here. Any thoughts?

minrk commented 9 months ago

Implementing in collaboration makes sense.

I think #60 discussed some points that would be needed to archive this in favor of collaboration. But the lack of maintenance capacity makes sense to push forward on collaboration first, at least.