Fix: verify_ws_origin async + await callers
Check Cross-Plugin Imports / check (push) Has been cancelled

- auth.py: verify_ws_origin is now async def
- kommunikation/routes.py: await verify_ws_origin
- ai_ui_control/routes.py: await verify_ws_origin
This commit is contained in:
Agent Zero
2026-08-04 11:41:18 +02:00
parent 7d3007b6c4
commit 51c9b467b2
7 changed files with 672 additions and 528 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ def hash_token(token: str) -> str:
return hashlib.sha256(token.encode()).hexdigest()
def verify_ws_origin(websocket) -> bool:
async def verify_ws_origin(websocket) -> bool:
"""Verify that the WebSocket upgrade request comes from an allowed origin.
Checks the Origin header against the configured CORS origins.
+1 -1
View File
@@ -209,7 +209,7 @@ async def ai_ui_control_ws(websocket: WebSocket):
from app.core.service_container import get_container
settings = get_settings()
if not verify_ws_origin(websocket):
if not await verify_ws_origin(websocket):
await websocket.close(code=4003, reason="Origin not allowed")
return
+1 -1
View File
@@ -477,7 +477,7 @@ async def websocket_endpoint(
from app.core.auth import get_session_data, get_redis, verify_ws_origin
settings = get_settings()
if not verify_ws_origin(websocket):
if not await verify_ws_origin(websocket):
await websocket.close(code=4003, reason="Origin not allowed")
return