Skip to content

Commit 3461066

Browse files
mjudeikisclaude
andcommitted
fix(app-studio): MCP discovery honors KEDGE_HUB_INSECURE
app-studio reaches the hub's MCPServer virtual-workspace endpoint at the in-cluster service DNS (kedge-...-hub.<ns>.svc.cluster.local:9443), but the hub serves its external cert (e.g. console-dev.faros.sh) with no SAN for the internal name. Every provider — and app-studio's own GraphQL client and heartbeat — skips verification for in-cluster hub calls via KEDGE_HUB_INSECURE. The MCP path, however, was gated by a separate APP_STUDIO_MCP_INSECURE_SKIP_TLS_VERIFY flag that the Helm chart never templates, so there was no way to make MCP discovery trust the hub even when the operator set hub.insecure. Result: GraphQL worked, MCP tool discovery failed with "x509: certificate is valid for console-dev.faros.sh, not kedge-...-hub.svc.cluster.local". Make the MCP TLS-skip honor KEDGE_HUB_INSECURE in addition to its own flag, matching the other hub clients. No chart/value changes needed: prod already sets KEDGE_HUB_INSECURE=true. Also pick up the license boilerplate codegen added to the new install/apiexport_test.go. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 018b8eb commit 3461066

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

providers/app-studio/main.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,13 @@ func runServe() {
162162
msgStore,
163163
openWorkspaceStore(),
164164
os.Getenv("KEDGE_HUB_URL"),
165-
os.Getenv("APP_STUDIO_MCP_INSECURE_SKIP_TLS_VERIFY") == "true",
165+
// The MCP virtual-workspace endpoint lives on the same hub host as the
166+
// GraphQL client above, so it must honor the standard KEDGE_HUB_INSECURE
167+
// knob every provider uses for in-cluster hub TLS (the hub serves its
168+
// external cert, not one valid for the .svc.cluster.local name). Keep the
169+
// MCP-specific override too, for callers that want to scope it narrowly.
170+
os.Getenv("APP_STUDIO_MCP_INSECURE_SKIP_TLS_VERIFY") == "true" ||
171+
os.Getenv("KEDGE_HUB_INSECURE") == "true",
166172
)
167173
apiServer.SetAutoApproveAssistantActions(os.Getenv("APP_STUDIO_AUTO_APPROVE_ACTIONS") == "true")
168174
if secret := os.Getenv("APP_STUDIO_PREVIEW_TOKEN_SECRET"); secret != "" {

providers/infrastructure/install/apiexport_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
Copyright 2026 The Faros Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
117
package install
218

319
import (

0 commit comments

Comments
 (0)