跳转到主要内容

Web应用安全中间件

项目描述

https://travis-ci.org/dstufft/guard.png?branch=master https://coveralls.io/repos/dstufft/guard/badge.png?branch=master

Guard是一个通用的WSGI中间件和实用工具集合,用于提高Web应用程序的安全性。

内容安全策略

guard.ContentSecurityPolicy 提供了一个WSGI中间件,可用于为Web应用程序提供内容安全策略。

用法

import guard, wsgi_app

# Default Policy
app = guard.ContentSecurityPolicy(wsgi_app.application)

# Custom Directives
app = guard.ContentSecurityPolicy(wsgi_app.application, {"img-src": ["*"]})

# Report Only
app = guard.ContentSecurityPolicy(wsgi_app.application, report_only=True)

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪个,请了解更多关于 安装软件包 的信息。

源代码分发

guard-1.0.1.tar.gz (3.0 kB 查看哈希值)

上传时间: 源代码

构建分发

guard-1.0.1-py2.py3-none-any.whl (3.7 kB 查看哈希值)

上传时间: Python 2 Python 3

由以下支持