You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(direct_proxy): address review feedback for security and consistency
- call_tool: add feature-flag gate (settings.mcpgateway_direct_proxy_enabled)
matching list_tools/list_resources/read_resource
- call_tool: return error on proxy failure instead of falling through to
cache mode (fail-closed)
- call_tool: sanitize error message to avoid leaking exception details
- read_resource: return empty string directly on access denial instead of
raising HTTPException that gets swallowed by outer handler
- read_resource: remove _meta from session.read_resource() call (MCP SDK
only accepts uri parameter)
- GatewayCreate: change gateway_mode from Optional[str] to str with
before-validator defaulting None to 'cache' (prevents DB integrity error)
- admin: expose direct_proxy_timeout in Connection Timeouts section
- list_tools docstring: fix refresh_strategy -> gateway_mode
- Fix jq test assertions to match TextContent return type
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Copy file name to clipboardExpand all lines: mcpgateway/schemas.py
+14-3Lines changed: 14 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -2549,9 +2549,20 @@ class GatewayCreate(BaseModel):
2549
2549
refresh_interval_seconds: Optional[int] =Field(None, ge=60, description="Per-gateway refresh interval in seconds (minimum 60); uses global default if not set")
2550
2550
2551
2551
# Gateway mode configuration
2552
-
gateway_mode: Optional[str] =Field(
2553
-
default="cache", description="Gateway mode: 'cache' (database caching, default) or 'direct_proxy' (pass-through mode with no caching)", pattern="^(cache|direct_proxy)$"
2554
-
)
2552
+
gateway_mode: str=Field(default="cache", description="Gateway mode: 'cache' (database caching, default) or 'direct_proxy' (pass-through mode with no caching)", pattern="^(cache|direct_proxy)$")
0 commit comments