verify_bearer_token
verify_bearer_token
Verify a Bearer token using constant-time comparison.
Parameters
credentials
FastAPI HTTPAuthorizationCredentials object containing the credentials
(token) attribute.
Returns
bool — True if the token matches the configured bearer token. Returns False
if bearer authentication is not enabled.
Example
Bearer token authentication is only available when the SecurityConfig instance
has a bearer_token attribute set (typically via config file).