jupyterlab-link-share icon indicating copy to clipboard operation
jupyterlab-link-share copied to clipboard

Use JupyterHub sharing when available

Open minrk opened this issue 1 year ago • 3 comments

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:

  • share link with token, which always works, but spoofs authentication, bypassing all JupyterHub control (not good)
  • share link without credentials, which preserves jupyterhub authentication (good), but assumes the shared-with user already has access (annoying)

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.

minrk avatar Jan 23 '24 12:01 minrk

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?

krassowski avatar Jan 23 '24 12:01 krassowski

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.

minrk avatar Jan 23 '24 12:01 minrk