多路径使用其危险性的身份策略。

more.itsdangerous的Python项目详细描述


用法

importmorepathfrommore.itsdangerousimportIdentityPolicyclassApp(morepath.App):pass@App.identity_policy()defget_identity_policy():returnIdentityPolicy()@App.verify_identity()defverify_identity(identity):# trust the identity established by the identity policy (we could keep# checking if the user is really in the database here - or if it was# removed in the meantime)returnTrue

查看http://morepath.readthedocs.org/en/latest/security.html了解更多 关于morepath的安全模型 查看注释过的源代码:

https://github.com/morepath/more.itsdangerous/blob/master/more/itsdangerous/identity_policy.py

identitypolicy类是要扩展的,因为每个人都有不同的 需要。它只是提供了一种方法,使用 很危险。

开发中的使用

默认情况下,more创建的cookie是危险的 HttpOnlySecure

如果您有不同的需求,或者运行的是开发服务器,则 可能需要更改标识策略的配置:

@App.identity_policy()defget_identity_policy():# make the cookies work under http, not just httpsreturnIdentityPolicy(secure=False)

请注意,这只应用于开发。在这个时代 不想通过http传输cookies!

运行测试

安装tox并运行它:

pip install tox
tox

将测试限制为特定的python版本:

tox -e py27

约定

更危险的是尽可能接近PEP8。要测试它,请运行:

tox -e pep8

更危险的用途Semantic Versioning

生成状态

Build Status

覆盖范围

Project Coverage

最新的pypi发布

Latest PyPI Release

许可证

更多。根据修订的BSD许可证发布危险信息

更改日志

0.0.2(2016-04-18)

  • 添加与morepath 0.14+的兼容性。 [亨利·胡尔斯基]

0.0.1(2015-04-29)

  • 初次发行 [资源]

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

推荐PyPI第三方库


热门话题
java IntelliJ找不到依赖项选项卡   java向字符串数组string[]添加元素并在Junit中测试结果   如何在eclipse中获取活动java项目的名称   如何使用java在mysql中插入时间   java ArrayList更新了插入一行,但Jtable仍然没有刷新   如何在JavaSwing中命名坐标(点)   java Matcher/模式不打印   java错误地设置了arraylist   使用UsernamePasswordCredential提供程序的java列表Azure AD   java在HTTP请求中设置UTC时间   未加载事件:jquery完整日历Java集成   java Maven插件依赖项无法从内部repo解析依赖项   Maven更新重置Java版本   java如何向中添加图片。带有Apache POI XWPF的docx,但不指定其大小   Java最大函数递归