没有项目描述

jhub-remote-auth-mount的Python项目详细描述


https://travis-ci.org/rasmunk/jhub_remote_auth_mount.svg?branch=master

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”属性,该属性包含接受的字典头。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java有可能让一个bean在春天拥有多个父对象吗?   java将字符串转换为sparql URI   java如何仅从JPQL中的日期时间字段按日期分组   java到节点。js代码转换   java为什么即使构建成功,applet也不启动?   java多人查询jpql   令牌“}”上的java语法错误,{应为   基于列表的简单留言板实现中的java NullPointerException   javasimplenlg:我们如何指定数量?   java如何仅从Freemarker中的字符串获取字母表?   java Spring引导JPA按实体排序集合   java排序单链表与排序双链表   eclipse将版权头添加到所有项目文件(.java、.xml、…)