具有oauth身份验证的jupyterhub的派生程序。
jupyterhub_oauth_spawner的Python项目详细描述
OAuth身份验证用户的派生程序。这个派生程序使用相同的jupyterhub用户进行操作系统操作,但是您可以控制oauth用户。
安装
pip install jupyterhub_oauth_spawner
在jupyterhub配置文件中:
from jupyterhub_oauth_spawner.oauth_spawner import OAuthSpawner c.JupyterHub.spawner_class = OAuthSpawner c.OAuthSpawner.pre_start_hook = your_function c.OAuthSpawner.pre_stop_hook = your_function c.OAuthSpawner.post_start_hook = your_function c.OAuthSpawner.post_stop_hook = your_function
您的函数应该需要一个user_对象和name属性用于用户登录,以及hook_name属性用于调用hook。
所以在您的函数中:
your_function(user, hook_name): send_info(user.name, hook_name)