Update 7project/backend/app/core/security.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Dejan Ribarovski
2025-10-23 19:14:22 +02:00
committed by GitHub
parent 584c090b80
commit eb7b2290b8

View File

@@ -3,7 +3,14 @@ import re
import jwt import jwt
from fastapi import Request from fastapi import Request
# Simple in-memory revocation store. In production, consider Redis or database. # Simple in-memory revocation store for revoked JWT tokens.
#
# Limitations:
# - All revoked tokens will be lost if the process restarts (data loss on restart).
# - Not suitable for multi-instance deployments: the revocation list is not shared between instances.
# A token revoked in one instance will not be recognized as revoked in others.
#
# For production, use a persistent and shared store (e.g., Redis or a database).
_REVOKED_TOKENS: set[str] = set() _REVOKED_TOKENS: set[str] = set()
# Bearer token regex # Bearer token regex