Spaces:
Running
Running
File size: 562 Bytes
89ae94f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
"""
Simplified security module for Hugging Face deployment.
Contains only the essential functions needed for HF deployment.
"""
from passlib.context import CryptContext
# Set up password hashing
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
def get_password_hash(password: str) -> str:
"""Hash a password for storage"""
return pwd_context.hash(password)
def verify_password(plain_password: str, hashed_password: str) -> bool:
"""Verify a password against a hash"""
return pwd_context.verify(plain_password, hashed_password) |