Sicherheit: Live-Aktionen nur mit aktivem Login; Seitenleiste warnt rot bei ausgeschaltetem Login

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
RubenRWU
2026-10-15 15:57:27 +02:00
parent e663b007d4
commit 8c3795ec8c
7 changed files with 28 additions and 4 deletions

View File

@@ -33,3 +33,10 @@ def describe() -> str:
def denial(tenant_id: str) -> str:
return (f"Tenant „{tenant_id}“ ist für Live-Schreibzugriffe nicht freigegeben (Env DEPLOY_ALLOWED_TENANTS = {describe()}). "
"Dry-Runs sind weiterhin möglich.")
def auth_ok() -> bool:
"""Live-Schreibzugriffe nur mit aktivem Login der Admin-Plattform (sonst wäre sie – mit Mittwald-Token im Container – für jeden offen).
Nur für lokale Experimente übersteuerbar: ALLOW_NO_AUTH_LIVE=true."""
from app.settings import AUTH_ENABLED
return AUTH_ENABLED or os.getenv("ALLOW_NO_AUTH_LIVE", "false").lower() == "true"