-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
♻️ Replace passlib with pwdlib
#1941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
passlib with pwdlib
YuriiMotov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@4sushi, thanks for your interest!
Since we change the hashing algorithm, this changes will be breaking for existing projects.
I think we should keep supporting Bcrypt for existing password hashes, but use Argon2 for new as it's explained in docs: https://frankie567.github.io/pwdlib/guide/#password-hashing
|
It should be very straightforward to keep You just need to update pyproject.toml: "pwdlib[argon2,bcrypt]>=0.2.1",And in from pwdlib import PasswordHash
from pwdlib.hashers.argon2 import Argon2Hasher
from pwdlib.hashers.bcrypt import BcryptHasher
password_hash = PasswordHash(
(
Argon2Hasher(),
BcryptHasher(),
)
)All tests will pass:
|
YuriiMotov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.

Replace hash library passlib by pwdlib, since passlib is not stable.
Pwdlib is used by fastapi.
Related PR
#1539