# 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:
```python
c.JupyterHub.spawner_class = 'jupyter_openbis_authenticator.spawner.RRPPersistentBinderSpawner'
c.JupyterHub.spawner_class = 'rrp_pbh_spawner'
c.RRPPersistentBinderSpawner.projects_dir = '/path/to/my/projects'
```
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共17个文件
txt:5个
py:3个
pkg-info:2个
资源分类:Python库 所属语言:Python 资源全名:jupyter_openbis_authenticator-0.4.8rc7.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
jupyter_openbis_authenticator-0.4.8rc7.tar.gz (17个子文件)
jupyter_openbis_authenticator-0.4.8rc7
MANIFEST.in 92B
PKG-INFO 3KB
README.rst 792B
LICENSE 11KB
setup.cfg 38B
setup.py 960B
CHANGELOG.md 353B
jupyter_openbis_authenticator.egg-info
PKG-INFO 3KB
requires.txt 67B
SOURCES.txt 509B
entry_points.txt 106B
top_level.txt 30B
dependency_links.txt 1B
zip-safe 1B
README.md 2KB
jupyter_openbis_authenticator
auth.py 11KB
spawner.py 3KB
共 17 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功