没有项目描述
jhub-remote-auth-mount的Python项目详细描述
jupyterhub远程用户身份验证器
使用可设置 远程用户头。 还支持向jupyter用户传递附加信息。这包括 安装收割台。
安装
从PYPI安装:
pip install jhub_remote_auth_mount
从本地Git存储库安装:
cd jhub_remote_auth_mount pip install .
配置
您应该编辑jupyterhub_config.pyconfig文件来设置 验证器类:
c.JupyterHub.authenticator_class = 'jhub_remote_auth_mount.RemoteUserAuthenticator'
你应该可以启动Jupyterhub。“/login”资源 将在http头“remote user”中查找经过身份验证的用户名。 如果找到,并且不是空的,您将作为该用户登录。
或者,也可以使用RemoteUserLocalAuthenticator
c.JupyterHub.authenticator_class = 'jhub_remote_auth_mount.RemoteUserLocalAuthenticator'
这提供了相同的身份验证功能,但派生自 localauthenticator因此提供了诸如 通过管理界面添加本地帐户(如果已配置)。
远程用户身份验证扩展了装载功能
提供向jupyterhub用户提供一组ssh密钥的功能,这些密钥稍后可用于装载特定用户的主驱动器,通过在jupyterhub配置文件中设置以下选项可以激活扩展身份验证器:
c.JupyterHub.authenticator_class = 'jhub_remote_auth_mount.MountRemoteUserAuthenticator'
这将向jupyterhub web应用程序添加两个基本请求路径:
'/login' -> requires a non empty Remote-User header '/mount' -> requires both a non empty Remote-User and Mount header
mount头的预期格式是,传递的字符串可以通过:
try: mount_header_dict = literal_eval(mount_header)
在成功地对字典求值之后,要求头包含以下信息:
{ HOST: 'hostname of the target mount host', USERNAME: 'A random string that identifies an active mount session', PATH: 'The target URL of the system/service that grants jupyter users to mount their notebook against, e.g @idmc.dk:', MOUNTSSHPRIVATEKEY: 'private key', }
注意:
由于我们是通过网络传递私钥的,因此通过加密通道发送此信息是很重要的,此外,授予此装载信息的主机/服务应限制密钥集的有效性,例如,在必须生成新的密钥集且旧的密钥集无效之前,可以使用2小时。 成功解析头后,活动jupyterhub用户实例将附加一个“mount”属性,该属性包含接受的字典头。