Documentation
¶
Overview ¶
Package headerforward provides the HTTP round-tripper that injects per-backend forwarded headers (plaintext + secret-resolved) onto outbound requests. It is consumed by both the capability-discovery HTTP client (pkg/vmcp/client) and the per-session HTTP client (pkg/vmcp/session/internal/backend).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildHeaderForwardTripper ¶
func BuildHeaderForwardTripper( ctx context.Context, base http.RoundTripper, cfg *vmcp.HeaderForwardConfig, provider secrets.Provider, backendName string, ) (http.RoundTripper, error)
BuildHeaderForwardTripper constructs a headerForwardRoundTripper for the backend's pre-resolved HeaderForwardConfig. Returns base unchanged when no header injection is configured or the effective header set is empty.
Used by both the vMCP backend client (startup capability discovery) and the per-session backend connector (long-lived MCP traffic). Exported so the session backend in pkg/vmcp/session/internal/backend can share the same transport-chain wiring.
Fails loudly (constructor validation, per go-style.md) when a secret identifier cannot be resolved through the provider, so a misconfigured backend surfaces at pod startup — not as a silent missing-header on every request.
Restricted header names (matching pkg/transport/middleware.RestrictedHeaders) are rejected to prevent Host, Content-Length, Authorization, hop-by-hop, and X-Forwarded-* spoofing via user-supplied config.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package wirefmt is the shared wire-format contract for headerForward data shipped from the operator to the vMCP runtime via pod env vars.
|
Package wirefmt is the shared wire-format contract for headerForward data shipped from the operator to the vMCP runtime via pod env vars. |