add user password hasher and depebdency

This commit is contained in:
2024-04-01 01:12:01 +03:00
parent 7eaa082b41
commit 4e6aee8c3a
22 changed files with 310 additions and 366 deletions

View File

View File

@@ -0,0 +1,13 @@
from passlib.handlers.pbkdf2 import pbkdf2_sha256
from api.application.protocols.password_hasher import PasswordHasher
class Pbkdf2PasswordHasher(PasswordHasher):
@staticmethod
def hash_password(password: str) -> str:
return pbkdf2_sha256.hash(password)
@staticmethod
def verify_password(password: str, hashed_password: str) -> bool:
return pbkdf2_sha256.verify(password, hashed_password)