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
Semantic clustering surfaced two low-risk refactors: WASM guard
auto-detection lived in `cmd/proxy.go` instead of the WASM cache module,
and `config/validation.go` used one-line private logging wrappers that
obscured validation flow. This PR tightens cohesion in `internal/cmd`
and simplifies config validation control flow without behavior changes.
- **WASM setup cohesion (`internal/cmd`)**
- Moved `containerGuardWasmPath` and `detectGuardWasm()` from
`internal/cmd/proxy.go` to `internal/cmd/wasm_cache.go`.
- Kept `newProxyCmd()` behavior unchanged (`defaultGuard :=
detectGuardWasm()`), but colocated guard-path detection with other WASM
cache/bootstrap logic.
- **Validation flow simplification (`internal/config`)**
- Removed private wrappers:
- `logValidateServerStart`
- `logValidateServerPassed`
- `logValidateServerFailed`
- Inlined equivalent `logValidation.Printf(...)` calls at usage sites in
server/auth/containerization validation paths to make control flow
directly readable.
- **Illustrative change**
```go
// before
logValidateServerFailed(name, server.Type, "HTTP server missing url
field")
// after
logValidation.Printf("Validation failed: %s, name=%s, type=%s",
"HTTP server missing url field", name, server.Type)
```
returnrules.MissingRequired("url", "HTTP", jsonPath, "Add a 'url' field (e.g., \"https://example.com/mcp\")")
100
85
}
101
86
iflen(server.Mounts) >0 {
102
-
logValidateServerFailed(name, server.Type, "HTTP server has mounts field")
87
+
logValidation.Printf("Validation failed: %s, name=%s, type=%s", "HTTP server has mounts field", name, server.Type)
103
88
returnrules.UnsupportedField("mounts", "mounts are only supported for stdio (containerized) servers", jsonPath, "Remove the 'mounts' field from HTTP server configuration; mounts only apply to stdio servers")
104
89
}
105
90
@@ -114,17 +99,17 @@ func validateStandardServerConfig(name string, server *StdinServerConfig, jsonPa
returnrules.UnsupportedType("type", auth.Type, authPath, fmt.Sprintf("Unsupported auth type %q. Currently only \"github-oidc\" is supported", auth.Type))
189
174
}
190
175
191
176
// Fail-fast: check that required OIDC environment variables are present.
192
177
// This catches misconfigurations at config-load time rather than deferring
193
178
// the error to the first request against this server.
0 commit comments