INNER CODE UNIT · Python

auth_middleware

evolution-foundation/evo-nexus · dashboard/backend/app.py:783

def auth_middleware():
    path = request.path

    # Static assets and frontend
    if not path.startswith("/api/") and not path.startswith("/ws/"):
        return None

    # WebSocket — auth checked inside the handler
    if path.startswith("/ws/"):
        return None

    # Public API paths (exact match or prefix match for docs/webhooks/shares)
    if (
        path in PUBLIC_PATHS
        or path.startswith("/api/docs")
        or path.startswith("/api/triggers/webhook/")
        or (path.startswith("/api/shares/") and "/view" in path)
        or path.startswith("/api/knowledge/v1/")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…