Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion humane_proxy/api/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from __future__ import annotations

import csv
import hmac
import io
import json
import logging
Expand Down Expand Up @@ -60,7 +61,7 @@ def _require_admin(
"environment variable to enable it."
),
)
if credentials is None or credentials.credentials != admin_key:
if credentials is None or not hmac.compare_digest(credentials.credentials, admin_key):
raise HTTPException(
status_code=401,
detail="Invalid or missing Bearer token.",
Expand Down
Loading