fix: JWT_SECRET lazy-validiert statt beim Import
config.py: get_jwt_secret() wirft RuntimeError nur bei Nutzung, nicht beim Import. Blog-Pipeline kann importieren ohne JWT_SECRET, Monitor bleibt geschützt. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dieser Commit ist enthalten in:
@@ -13,7 +13,16 @@ STATIC_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "static")
|
||||
DB_PATH = os.path.join(DATA_DIR, "osint.db")
|
||||
|
||||
# JWT
|
||||
JWT_SECRET = os.environ.get("JWT_SECRET", "")
|
||||
_JWT_SECRET = os.environ.get("JWT_SECRET", "")
|
||||
def get_jwt_secret() -> str:
|
||||
"""Gibt JWT_SECRET zurück. Wirft RuntimeError wenn nicht gesetzt."""
|
||||
if not _JWT_SECRET:
|
||||
raise RuntimeError("JWT_SECRET Umgebungsvariable muss gesetzt sein")
|
||||
return _JWT_SECRET
|
||||
|
||||
|
||||
# Rückwärtskompatibel für direkte Imports
|
||||
JWT_SECRET = _JWT_SECRET
|
||||
JWT_ALGORITHM = "HS256"
|
||||
JWT_EXPIRE_HOURS = 24
|
||||
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren