Test / admin /auth.py
Hfzune's picture
Create admin/auth.py
02bf3fb verified
Raw History Blame Contribute Delete
272 Bytes
import logging
log = logging.getLogger("admin.auth")
def check_admin_password(supplied: str, expected: str) -> bool:
if not supplied or not expected:
return False
# constant-time compare
import hmac
return hmac.compare_digest(supplied, expected)