feat(agent-proxy): add a websocket substitution surface - #7581
feat(agent-proxy): add a websocket substitution surface#7581saifsmailbox98 wants to merge 2 commits into
Conversation
Some services expect a credential in the first message after a WebSocket opens rather than in the handshake. The proxy can now substitute inside outbound frames, so those services need a surface to select. - Add 'websocket' to ProxiedServiceSubstitutionSurface in the backend and frontend enums, and to the surface picker. No migration: the column is a plain text array. - Document what the surface does and does not cover, including that compression is declined on connections using it.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
💬 Discussion in Slack: #pr-review-infisical-7581-feat-agent-proxy-add-a-websocket-substitution-surface Posted by Review Police — reviews, comments, new commits, and CI failures will stream into this channel. |
|
| Filename | Overview |
|---|---|
| backend/src/ee/services/proxied-service/proxied-service-enums.ts | Adds the websocket enum value accepted by the existing native-enum validation and text-array persistence path. |
| frontend/src/hooks/api/proxiedServices/enums.ts | Mirrors the backend websocket substitution-surface value for frontend API types. |
| frontend/src/components/proxied-services/forms/SurfaceSelect.tsx | Adds an exhaustive, title-cased label for selecting WebSocket message substitution. |
| docs/documentation/platform/agent-proxy/proxied-services.mdx | Documents outbound WebSocket substitution and limits, but includes avoidable proxy implementation details. |
| docs/documentation/platform/agent-proxy/standalone-agent-proxy.mdx | Advertises ws:// credential brokering without warning that credentials are transmitted over cleartext. |
| docs/documentation/platform/agent-proxy/local-agent-proxy.mdx | Adds a concise cross-reference to the WebSocket documentation. |
| backend/src/lib/api-docs/constants.ts | Adds websocket to the documented substitution-surface values and clarifies that it applies after upgrade. |
Reviews (1): Last reviewed commit: "feat(agent-proxy): add a websocket subst..." | Re-trigger Greptile
- Drop the internals (frame parsing, proxy memory, why compressed frames are unreadable) and state the limits as behaviour instead, per the style guide. - Document that the proxy swaps a reflected credential back to the placeholder, which the CLI now does on the return path. - Recommend wss:// for any WebSocket carrying a credential, since a credential applied to a plain ws:// connection travels unencrypted.
Context
Adds
websocketas a proxied-service substitution surface, for real-time services that expect the credential in the first message after the connection opens rather than in the handshake. Handshake credentials are already covered by the existingheader/path/querysurfaces, since an upgrade request is an ordinary HTTP request.No migration:
substitutionSurfacesis a plain text array with no DB-level enum, so the ZodnativeEnumis the only gate. Telemetry picks the value up for free through the existingsubstitutionSurfacesproperty onProxied Service Created.Frontend: added to the surface picker as "WebSocket Message".
SURFACE_LABELSis exhaustive over the enum, so this was required rather than optional.Docs: a WebSockets section on Proxied Services covering where a credential can sit, that the proxy swaps a reflected credential back to the placeholder, and what is forwarded unchanged (binary, split, oversized). Also notes that compression is declined on connections using this surface, and recommends
wss://for anything carrying a credential. Standalone Proxy and Local Proxy previously implied WebSockets were unsupported and now point at it.Companion CLI PR: Infisical/cli#356
Screenshots
Steps to verify the change
Type
Checklist
type(scope): short description(scope is optional, e.g.,fix: prevent crash on syncorfix(api): handle null response).