一个django密码验证器,它检查troy hunt的pwned密码api,以查看密码以前是否涉及重大安全漏洞。

django-pwned-passwords的Python项目详细描述


https://badge.fury.io/py/django-pwned-passwords.svghttps://travis-ci.org/jamiecounsell/django-pwned-passwords.svg?branch=masterhttps://codecov.io/gh/jamiecounsell/django-pwned-passwords/branch/master/graph/badge.svg

django pwned password s是一个django密码验证器,它检查troy hunt的pwned passwords api,以查看密码之前是否涉及重大安全漏洞。

注意:此应用程序当前将用户的哈希密码的一部分发送给第三方。在使用此应用程序之前,您应该了解它对您的影响。

文档

完整的文档位于https://django-pwned-passwords.readthedocs.io

要求

  • Django[1.9,2.1]
  • Python2.7,[3.5,3.6,3.7]

快速启动

安装django pwned密码:

pip install django-pwned-passwords

将其添加到已安装的应用程序中

INSTALLED_APPS=(...'django_pwned_passwords',...)

添加django pwned passwords的pwnedpasswordvalidator:

AUTH_PASSWORD_VALIDATORS=[...{'NAME':'django_pwned_passwords.password_validation.PWNEDPasswordValidator'}]

功能

如果pwned passwords api 检测其数据集中的密码。注意,api的速率非常有限, 所以有一个超时(PWNED_VALIDATOR_TIMEOUT)。

如果PWNED_VALIDATOR_FAIL_SAFE是真的,那么除了api之外的任何东西都会识别出错误的密码 将通过,包括超时。如果PWNED_VALIDATOR_FAIL_SAFE为false,则 此外,一个好的密码将失败并引发validationerror。

设置

SettingDescriptionDefault
^{}The timeout in seconds. The validator will not wait longer than this for a response from the API.^{}
^{}If the API fails to get a valid response, should we fail safe and allow the password through?^{}
^{}The URL for the API in a string format.^{}
^{}The error message for an invalid password.^{}
^{}The error message when the API fails. Note: this will only display if ^{} is False.^{}
^{}The help text for this password validator.^{}
^{}The minimum number of breaches needed to raise an error^{}

速率限制

历史上,对api的请求速率是有限的。然而,新的基于k-匿名模型的api没有这样的速率限制。

运行测试

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

学分

用于呈现此包的工具:

历史记录

请参见github版本

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

推荐PyPI第三方库


热门话题
java嵌套循环打印一个数字,旁边有相同数量的星号   java JodReports替代方案   java如何将模型类parcelable对象从片段传递到活动?   java JCS缓存删除功能不删除特定元素   如何打开。Java的dll文件。   java在这种情况下如何选择聚合根?   java从CellEditorListener获取编辑的TreeNode   Java到web服务和mysql   从openssl ec在Java中创建公钥时出现加密无效密钥异常   Java数组:添加多个数组的元素时忽略空数组   java在初始化后向fragment发送数据   JButtons的java数组正在返回void   若联接列不包含特定值,则java JPA条件生成器仅返回实体   java ActionBar问题:NPE   java Portlet是被广泛使用还是非常罕见?