A Pwned Passwords implementation for Django sites.
Project description
pwned-passwords-django provides helpers for working with the Pwned Passwords database from Have I Been Pwned in Django powered sites. Pwned Passwords is an extremely large database of passwords known to have been compromised through data breaches, and is useful as a tool for rejecting common or weak passwords.
There are three main components to this application:
A password validator which integrates with Django’s password-validation tools and checks the Pwned Passwords database.
A Django middleware (supporting both sync and async requests) which automatically checks certain request payloads against the Pwned Passwords database.
An API client providing direct access (both sync and async) to the Pwned Passwords database.
All three use a secure, anonymized API which never transmits any password or its full hash to any third party.
Usage
The recommended configuration is to enable both the validator and the automatic password-checking middleware. To do this, make the following changes to your Django settings.
First, add the validator to your AUTH_PASSWORD_VALIDATORS list:
AUTH_PASSWORD_VALIDATORS = [
# ... other password validators ...
{
"NAME": "pwned_passwords_django.validators.PwnedPasswordsValidator",
},
]
Then, add the middleware to your MIDDLEWARE list:
MIDDLEWARE = [
# .. other middlewares ...
"pwned_passwords_django.middleware.pwned_passwords_middleware",
]
For more details, consult the full documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pwned_passwords_django-5.1.1.tar.gz
.
File metadata
- Download URL: pwned_passwords_django-5.1.1.tar.gz
- Upload date:
- Size: 42.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90d7f5933dde15ad262bebd3ab9472cfd06d19fc0a6795466534e58f554d0f81 |
|
MD5 | b4cc3957aed4cdcd6fbfaecfdb9d7114 |
|
BLAKE2b-256 | 34c13d279acccfc1f9a76493a28bdd08b42fef2d8f0164a6bf9f3df8b1a984eb |
File details
Details for the file pwned_passwords_django-5.1.1-py3-none-any.whl
.
File metadata
- Download URL: pwned_passwords_django-5.1.1-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fea82fad910ce137a50615968a1670064799bca8cc4ad7c754564a5733348a4 |
|
MD5 | 1e4e6ada685c31cd428166115ffac0db |
|
BLAKE2b-256 | a7c6cfca6eab8acb1c3f570c8bafbe4041a3c62ec844a69dbb200dd6b53a20d0 |