Merge pull request 'fix: use constant-time comparison for bearer token validation (#8)' (#56) from ai/paper-dynasty-database#8 into next-release

Reviewed-on: #56
This commit is contained in:
cal 2026-03-05 03:44:13 +00:00
commit 9711f63da5

View File

@ -1,4 +1,5 @@
import datetime
import hmac
import logging
import os
@ -24,7 +25,7 @@ if os.environ.get("TESTING") == "True":
def valid_token(token):
return token == AUTH_TOKEN
return hmac.compare_digest(token, AUTH_TOKEN)
def int_timestamp(datetime_obj: datetime) -> int: