Skip to content

Commit

Permalink
fix: better imports
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtolkien committed Jul 18, 2023
1 parent 0a48b8b commit 361c1cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fastapi_simple_security/_security_secret.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Secret dependency.
"""
import os
import secrets
import uuid
import warnings
from secrets import compare_digest
from typing import Optional

from fastapi import Security
Expand Down Expand Up @@ -71,7 +71,7 @@ async def secret_based_security(header_param: Optional[str] = Security(secret_he
)

# We simply return True if the given secret-key has the right value
if not compare_digest(header_param, secret.value):
if not secrets.compare_digest(header_param, secret.value):
raise HTTPException(
status_code=HTTP_403_FORBIDDEN,
detail="Wrong secret key. If not set through environment variable \
Expand Down

0 comments on commit 361c1cc

Please sign in to comment.