full-stack-fastapi-template
full-stack-fastapi-template copied to clipboard
♻️ Replace `passlib` with `pwdlib`
Replace hash library passlib by pwdlib, since passlib is not stable. Pwdlib is used by fastapi.
Related PR
https://github.com/fastapi/full-stack-fastapi-template/pull/1539
It should be very straightforward to keep bcrypt support based on to the docs @YuriiMotov shared, @4sushi 😄
You just need to update pyproject.toml:
"pwdlib[argon2,bcrypt]>=0.2.1",
And in security.py, import and configure both hashers:
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:
Sorry I was pretty busy, thanks @ceb10n for completing the PR.