devpi锁定:为读取访问启用身份验证的工具

devpi-lockdown的Python项目详细描述


devpi锁定:用于启用读访问身份验证的工具

这个插件添加了一些视图,允许锁定对devpi的读访问。

目前为止只有nginx测试过。

安装

devpi-lockdown需要与devpi-server一起安装。

您可以使用以下命令安装它:

pip install devpi-lockdown

使用量

要锁定对devpi的读取访问,需要在devpi前面有一个代理,该代理可以使用提供的视图来限制访问。

视图如下:

/+验证检查

This returns ^{tt3}$ when the user is authenticated or ^{tt4}$ if not. It uses the regular devpi credential checks and an additional credential check using a cookie provided by ^{tt1}$ to allow login with a browser.

/+登录

A plain login form to allow access via browsers for use with ^{tt6}$.

/+注销

Drops the authentication cookie.

For nginx the auth_request module is required and the configuration would something look like this:

server{...# this redirects to the login view when not logged in
error_page401=@error401;location@error401{return302/+login;}# the location to check whether the provided infos authenticate the user
location=/+authcheck{internal;proxy_pass_request_bodyoff;proxy_set_headerContent-Length"";proxy_set_headerX-Original-URI$request_uri;proxy_set_headerX-outside-urlhttps://$host;proxy_passhttp://localhost:3141;}# lock down everything by default
auth_request/+authcheck;# pass on /+login without authentication check to allow login
location=/+login{auth_requestoff;proxy_set_headerX-outside-urlhttps://$host;proxy_passhttp://localhost:3141;}# pass on /+api without authentication check for URL endpoint discovery
location~/\+api${auth_requestoff;proxy_set_headerX-outside-urlhttps://$host;proxy_passhttp://localhost:3141;}# pass on /+static without authentication check for browser access to css etc
location/+static/{auth_requestoff;proxy_set_headerX-outside-urlhttps://$host;proxy_passhttp://localhost:3141;}# use auth_request to lock down all the rest
location/{proxy_set_headerX-outside-urlhttps://$host;proxy_passhttp://localhost:3141;}}

更改日志

1.0.1-2018年11月16日

  • 修复棱锥体的导入>;=1.10.0。
  • 将/+static添加到配置中
  • 默认情况下锁定配置中的所有内容,并且只允许 必要位置

1.0.0-2017年3月10日

  • 初始版本

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

推荐PyPI第三方库


热门话题
分离实体上的java JPA merge()在其存在时进行插入   java Android Javamail自定义身份验证   java如何找出EAR包中执行的第一个文件   sockets Java:如何重用SocketChannel   java通过MQTT和ssl连接安卓设备   java如何修复控制台中的“未知命令”错误?   java为多线程FizzBuzz编写测试用例   java解析findBy中的嵌套对象属性   异常Java:在这种特殊情况下,如何处理ConcurrentModificationException?   从java教科书中绘制图形   java找不到类型为com的响应对象的MessageBodyWriter。太阳运动衫应用程序编程接口。json。JSONWithPadding媒体类型:application/xjavascript   java如何在Android中将光标设置在tableLayout的行/列中所需的位置   Elasticsearch:java。lang.IllegalArgumentException:在docker容器上运行时不允许自我抑制   如何在Java中继承此方法?   java为什么我的消息消费者不接收所有其他消息?   java为什么@ApplicationScoped bean在CDI扩展的关闭前阶段有一个新实例?