Spaces:
Running
Running
Hermes Agent commited on
Commit Β·
abf91f2
1
Parent(s): a85b3d9
fix(gateway): un-hijack Open WebUI /api/v1/auths and /api/v1/users routes to enable login
Browse files- gateway/main.py +0 -4
- gateway/omniroute.py +0 -4
gateway/main.py
CHANGED
|
@@ -115,16 +115,12 @@ async def route_catch_all(path: str, request: Request):
|
|
| 115 |
"/api/settings",
|
| 116 |
"/api/monitoring",
|
| 117 |
"/api/combos",
|
| 118 |
-
"/api/auth",
|
| 119 |
-
"/api/models",
|
| 120 |
"/api/keys",
|
| 121 |
"/api/stats",
|
| 122 |
"/api/health",
|
| 123 |
"/api/system",
|
| 124 |
"/api/logs",
|
| 125 |
-
"/api/users",
|
| 126 |
"/api/vector",
|
| 127 |
-
"/api/chats",
|
| 128 |
"/api/tokens",
|
| 129 |
"/api/cloud-",
|
| 130 |
"/api/arena",
|
|
|
|
| 115 |
"/api/settings",
|
| 116 |
"/api/monitoring",
|
| 117 |
"/api/combos",
|
|
|
|
|
|
|
| 118 |
"/api/keys",
|
| 119 |
"/api/stats",
|
| 120 |
"/api/health",
|
| 121 |
"/api/system",
|
| 122 |
"/api/logs",
|
|
|
|
| 123 |
"/api/vector",
|
|
|
|
| 124 |
"/api/tokens",
|
| 125 |
"/api/cloud-",
|
| 126 |
"/api/arena",
|
gateway/omniroute.py
CHANGED
|
@@ -128,8 +128,6 @@ async def omniroute_oauth(request: Request, path: str = ""):
|
|
| 128 |
# ββ OpenAI API Endpoint Routing (20128) βββββββββββββββββββββββββββββββββββββ
|
| 129 |
@router.api_route("/v1", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
|
| 130 |
@router.api_route("/v1/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
|
| 131 |
-
@router.api_route("/api/v1", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
|
| 132 |
-
@router.api_route("/api/v1/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
|
| 133 |
async def omniroute_v1_api(request: Request, path: str = ""):
|
| 134 |
if path in ("openapi.json", "openapi.json/"):
|
| 135 |
return JSONResponse({
|
|
@@ -162,8 +160,6 @@ async def omniroute_v1_api(request: Request, path: str = ""):
|
|
| 162 |
|
| 163 |
@router.api_route("/v1beta", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
|
| 164 |
@router.api_route("/v1beta/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
|
| 165 |
-
@router.api_route("/api/v1beta", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
|
| 166 |
-
@router.api_route("/api/v1beta/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
|
| 167 |
async def omniroute_v1beta_api(request: Request, path: str = ""):
|
| 168 |
target = f"http://127.0.0.1:{OMNIROUTE_PORT}/v1beta/{path}" if path else f"http://127.0.0.1:{OMNIROUTE_PORT}/v1beta"
|
| 169 |
return await handle_omniroute_proxy(target, request, default_prefix="/omniroute")
|
|
|
|
| 128 |
# ββ OpenAI API Endpoint Routing (20128) βββββββββββββββββββββββββββββββββββββ
|
| 129 |
@router.api_route("/v1", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
|
| 130 |
@router.api_route("/v1/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
|
|
|
|
|
|
|
| 131 |
async def omniroute_v1_api(request: Request, path: str = ""):
|
| 132 |
if path in ("openapi.json", "openapi.json/"):
|
| 133 |
return JSONResponse({
|
|
|
|
| 160 |
|
| 161 |
@router.api_route("/v1beta", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
|
| 162 |
@router.api_route("/v1beta/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
|
|
|
|
|
|
|
| 163 |
async def omniroute_v1beta_api(request: Request, path: str = ""):
|
| 164 |
target = f"http://127.0.0.1:{OMNIROUTE_PORT}/v1beta/{path}" if path else f"http://127.0.0.1:{OMNIROUTE_PORT}/v1beta"
|
| 165 |
return await handle_omniroute_proxy(target, request, default_prefix="/omniroute")
|