Download admin/auth.py from Hfzune/Test: direct link, hf CLI and curl.
- Browser
- Download file 272 Bytes
-
https://huggingface.co/spaces/Hfzune/Test/resolve/main/admin/auth.py
- Command line
-
hf download hf://spaces/Hfzune/Test/admin/auth.py
-
curl -L -o auth.py https://huggingface.co/spaces/Hfzune/Test/resolve/main/admin/auth.py
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) |