An authenticator for Jupyterhub which authenticates against openBIS.
Project description
Jupyter-OpenBIS-Authenticator
Description
This authenticator module for JupyterHub connects to a given openBIS instance, using the pyBIS module. It exports the environment variables
- OPENBIS_URL
- OPENBIS_TOKEN
to the user environment. Later, in a notebook, a user is then able to use pyBIS without any url, username or credentials:
from pybis import Openbis
o = Openbis()
Compatibility
This Authenticator works only with Jupyterhub > 0.8.0. This module was tested with version 0.8.1
The authenticator uses the spawner.environment
feature to modify the users environment variables during session creation. This feature was introduced in Jupyterhub by version 0.8.0.
Installation
pip install jupyter_openbis_authenticator
Jupyterhub Configuration
Edit your jupyterhub_config.py
file and add the following to register jupyter_openbis_authenticator
as a JupyterHub authenticator class:
c.JupyterHub.authenticator_class = 'jupyter_openbis_authenticator.auth.OpenbisAuthenticator'
c.JupyterHub.spawner = 'jupyter_openbis_authenticator.auth.KerberosSudoSpawner'
if 'JUPYTERHUB_CRYPT_KEY' not in os.environ:
warnings.warn(
"Need JUPYTERHUB_CRYPT_KEY env for persistent auth_state.\n"
" export JUPYTERHUB_CRYPT_KEY=$(openssl rand -hex 32)"
)
c.CryptKeeper.keys = [ os.urandom(32) ]
# enable persisting auth_state, i.e. enable JupyterHub to change the environment variables of the user.
c.Authenticator.enable_auth_state = True
# openBIS settings
c.OpenbisAuthenticator.server_url = 'https://my_openbis_instance.ch'
c.OpenbisAuthenticator.verify_certificates = True
RRPPersistentBinderSpawner
This spawner reads directories from a specified project folder and presents them to the logged-in user. The user then can launch virtual machines (using kubernetes) with the given running environment that repo2docker detects in the chosen project folder.
Changes in jupyterhub_config.py
to enable this spawner:
c.JupyterHub.spawner_class = 'jupyter_openbis_authenticator.spawner.RRPPersistentBinderSpawner'
c.JupyterHub.spawner_class = 'rrp_pbh_spawner'
c.RRPPersistentBinderSpawner.projects_dir = '/path/to/my/projects'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file jupyter_openbis_authenticator-0.5.5.tar.gz
.
File metadata
- Download URL: jupyter_openbis_authenticator-0.5.5.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7f841cd8f9264bd0816c6ef7beeee572b3c5b0f7a17c4c70c798d490d4bfaec |
|
MD5 | a488f5f72038f9a7995ae0e0d39401da |
|
BLAKE2b-256 | 160862b82bd8b7658b50a62bb13486791991c6ba0db429a1dc5b828111e8240e |