Skip to content

Commit ebc165b

Browse files
committed
Remove the vestigial OIDC proxy enable switch
#1334 removed oidcProxy.enabled from values.yaml but left the template reading it, so it fell through to its default of false. Every OIDC variable sits behind that gate, which means a values file written to the contract this design documents renders with the whole auth block missing and the container fails at start on absent configuration. The render fixture only passed because it still carried the flag. The service has no auth_enabled field any more -- test_auth asserts that -- so nothing consumed OSMO_MCP_AUTH_ENABLED either. Authentication is not a mode, and the chart now says so: the gate, the environment variable and the flag in the fixture are gone, and the required messages name MCP rather than a proxy that could be switched off. Guarded by a render assertion that the auth block renders from a fixture carrying no enable flag, and that no enable switch is emitted.
1 parent d837b8d commit ebc165b

3 files changed

Lines changed: 14 additions & 16 deletions

File tree

deployments/charts/service/templates/mcp-service.yaml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
{{- if .Values.services.mcp.enabled }}
1818
{{- $mcp := .Values.services.mcp }}
1919
{{- $oidcProxy := $mcp.oidcProxy }}
20-
{{- $oidcProxyEnabled := $oidcProxy.enabled | default false }}
2120
{{- $imageTag := $mcp.imageTag | default .Values.global.osmoImageTag }}
2221
{{- $mcpResourceUrl := include "osmo.mcp-resource-url" . }}
2322
{{- $gatewayUrl := trimSuffix "/mcp" $mcpResourceUrl }}
@@ -34,11 +33,10 @@
3433
{{- $oidcAccessTokenRequiredScope := "" }}
3534
{{- $redisKeyPrefix := "" }}
3635
{{- $redisUrl := "" }}
37-
{{- if $oidcProxyEnabled }}
38-
{{- $oidcConfigUrl = required "services.mcp.oidcProxy.oidc.configUrl is required when the OIDC proxy is enabled" $oidcProxy.oidc.configUrl }}
39-
{{- $oidcClientId = required "services.mcp.oidcProxy.oidc.clientId is required when the OIDC proxy is enabled" $oidcProxy.oidc.clientId }}
36+
{{- $oidcConfigUrl = required "services.mcp.oidcProxy.oidc.configUrl is required when MCP is enabled" $oidcProxy.oidc.configUrl }}
37+
{{- $oidcClientId = required "services.mcp.oidcProxy.oidc.clientId is required when MCP is enabled" $oidcProxy.oidc.clientId }}
4038
{{- $oidcAccessTokenIssuer = $oidcProxy.oidc.accessTokenIssuer | default "" }}
41-
{{- $oidcAccessTokenRequiredScope = required "services.mcp.oidcProxy.oidc.accessTokenRequiredScope is required when the OIDC proxy is enabled" $oidcProxy.oidc.accessTokenRequiredScope }}
39+
{{- $oidcAccessTokenRequiredScope = required "services.mcp.oidcProxy.oidc.accessTokenRequiredScope is required when MCP is enabled" $oidcProxy.oidc.accessTokenRequiredScope }}
4240
{{- if not (regexMatch "^[A-Za-z0-9:._~-]{1,128}$" $oidcAccessTokenRequiredScope) }}
4341
{{- fail "services.mcp.oidcProxy.oidc.accessTokenRequiredScope must be one non-empty scope" }}
4442
{{- end }}
@@ -107,7 +105,6 @@
107105
{{- end }}
108106
{{- $redisScheme := ternary "rediss" "redis" .Values.services.redis.tlsEnabled }}
109107
{{- $redisUrl = printf "%s://%s:%v/%v" $redisScheme $redisHost $redisPort $oidcProxy.redis.dbNumber }}
110-
{{- end }}
111108
{{- if not (kindIs "slice" $mcp.allowedOrigins) }}
112109
{{- fail "services.mcp.allowedOrigins must be a list" }}
113110
{{- end }}
@@ -122,7 +119,6 @@
122119
"OSMO_GATEWAY_URL"
123120
"OSMO_MCP_REQUEST_TIMEOUT_SECONDS"
124121
"OSMO_MCP_ALLOWED_ORIGINS"
125-
"OSMO_MCP_AUTH_ENABLED"
126122
"OSMO_MCP_AUTH_RESOURCE_URL"
127123
"OSMO_MCP_AUTH_REDIS_URL"
128124
"OSMO_MCP_AUTH_REDIS_PASSWORD_FILE"
@@ -209,9 +205,6 @@ spec:
209205
value: {{ $requestTimeoutSeconds | quote }}
210206
- name: OSMO_MCP_ALLOWED_ORIGINS
211207
value: {{ join "," $mcp.allowedOrigins | quote }}
212-
- name: OSMO_MCP_AUTH_ENABLED
213-
value: {{ $oidcProxyEnabled | quote }}
214-
{{- if $oidcProxyEnabled }}
215208
- name: OSMO_MCP_AUTH_RESOURCE_URL
216209
value: {{ $mcpResourceUrl | quote }}
217210
- name: OSMO_MCP_AUTH_REDIS_URL
@@ -242,15 +235,14 @@ spec:
242235
value: {{ $oidcProxy.refreshTokenTtlSeconds | int | quote }}
243236
- name: OSMO_MCP_AUTH_UPSTREAM_TIMEOUT_SECONDS
244237
value: {{ $oidcProxy.upstreamTimeoutSeconds | int | quote }}
245-
{{- end }}
246238
{{- with $mcp.extraEnv }}
247239
{{- toYaml . | nindent 8 }}
248240
{{- end }}
249241
resources:
250242
{{- toYaml $mcp.resources | nindent 10 }}
251-
{{- if or (and $oidcProxyEnabled $oidcProxy.existingSecret.name) $mcp.extraVolumeMounts (and .Values.gateway.tls.enabled .Values.gateway.tls.upstreamCerts.mcp) }}
243+
{{- if or $oidcProxy.existingSecret.name $mcp.extraVolumeMounts (and .Values.gateway.tls.enabled .Values.gateway.tls.upstreamCerts.mcp) }}
252244
volumeMounts:
253-
{{- if and $oidcProxyEnabled $oidcProxy.existingSecret.name }}
245+
{{- if $oidcProxy.existingSecret.name }}
254246
- name: mcp-auth-secrets
255247
mountPath: {{ $secretMountPath }}
256248
readOnly: true
@@ -268,9 +260,9 @@ spec:
268260
{{- include "osmo.upstream-probe-yaml" (dict "probe" $mcp.readinessProbe "context" .) | nindent 10 }}
269261
startupProbe:
270262
{{- include "osmo.upstream-probe-yaml" (dict "probe" $mcp.startupProbe "context" .) | nindent 10 }}
271-
{{- if or (and $oidcProxyEnabled $oidcProxy.existingSecret.name) $mcp.extraVolumes (and .Values.gateway.tls.enabled .Values.gateway.tls.upstreamCerts.mcp) }}
263+
{{- if or $oidcProxy.existingSecret.name $mcp.extraVolumes (and .Values.gateway.tls.enabled .Values.gateway.tls.upstreamCerts.mcp) }}
272264
volumes:
273-
{{- if and $oidcProxyEnabled $oidcProxy.existingSecret.name }}
265+
{{- if $oidcProxy.existingSecret.name }}
274266
- name: mcp-auth-secrets
275267
secret:
276268
secretName: {{ $oidcProxy.existingSecret.name }}

deployments/charts/service/tests/mcp-proxy-values.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ services:
2222
allowedOrigins:
2323
- http://localhost:6274
2424
oidcProxy:
25-
enabled: true
2625
oidc:
2726
configUrl: https://login.example.com/example-tenant/v2.0/.well-known/openid-configuration
2827
clientId: example-mcp-proxy-client

deployments/charts/service/tests/render-tests.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,13 @@ grep -q "table.concat(safe_roles, ',')" <<<"$mcp_render"
132132
# Redis connection details come from services.redis; only the database is local.
133133
grep -q 'value: "rediss://redis:6379/14"' <<<"$mcp_workload"
134134

135+
# Authentication is not a mode, so nothing advertises it as one. The fixture
136+
# sets no enabled flag; the OIDC variables above must render regardless.
137+
if grep -q 'name: OSMO_MCP_AUTH_ENABLED' <<<"$mcp_workload"; then
138+
echo 'MCP still renders an auth-enabled switch' >&2
139+
exit 1
140+
fi
141+
135142
# Values the deployment derives must not reappear as deployer inputs.
136143
for derived in OSMO_MCP_AUTH_ISSUER_URL OSMO_MCP_AUTH_SCOPE \
137144
OSMO_MCP_AUTH_OIDC_ACCESS_TOKEN_AUDIENCE \

0 commit comments

Comments
 (0)