Uh oh!
There was an error while loading. Please reload this page.
♻️ Replace passlib with pwdlib - #1941
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
YuriiMotov
left a comment
There was a problem hiding this comment.
@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
ceb10n
commented
Nov 16, 2025
It should be very straightforward to keep You just need to update pyproject.toml: "pwdlib[argon2,bcrypt]>=0.2.1",And in frompwdlibimportPasswordHashfrompwdlib.hashers.argon2importArgon2Hasherfrompwdlib.hashers.bcryptimportBcryptHasherpassword_hash=PasswordHash(
(
Argon2Hasher(),
BcryptHasher(),
)
)All tests will pass: ![]() |
4sushi
commented
Nov 28, 2025
Sorry I was pretty busy, thanks @ceb10n for completing the PR. |
This pull request has a merge conflict that needs to be resolved. |
tiangolo
commented
Jan 22, 2026
Thanks! This was handled here: #2104 I'll close this one now. ☕ |

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