auth
auth
¶
Admin authentication: IP whitelist + bcrypt password + HMAC session cookie.
AdminAuthMiddleware
¶
Bases: BaseHTTPMiddleware
IP whitelist + session-based authentication for admin routes.
dispatch(request, call_next)
async
¶
Check IP whitelist, then session, redirect to login if needed.
Source code in pspcz_analyzer/admin/auth.py
verify_password(password)
¶
Verify password against stored bcrypt hash.
Source code in pspcz_analyzer/admin/auth.py
create_session_cookie(username)
¶
get_session_username(request)
¶
Extract and verify the admin session from request cookies.