Background
pkg/vmcpconfig/converter.go has two TODOs covering the configMap-sourced authz path on VirtualMCPServer:
converter.go:192 — TODO: Load policies from ConfigMap if Type is "configMap"
converter.go:210 — TODO: load primaryUpstreamProvider from configMap
Today, both TODOs mean a VirtualMCPServer with spec.incomingAuth.authzConfig.type: configMap silently produces a vMCP runtime that has no Cedar middleware installed (the factory at pkg/vmcp/auth/factory/incoming.go:88 requires len(cfg.Authz.Policies) > 0). And there is no way for configMap users to override the auto-selected primary upstream provider, because that field lives on InlineAuthzConfig only.
Tasks
Discovered via
Acceptance criteria
- A
VirtualMCPServer with authzConfig.type: configMap and a valid policy ConfigMap deploys with Cedar middleware installed and policies enforced.
- Bad/missing configMaps fail at admission with a clear status condition (parallel to MCPRemoteProxy).
- ConfigMap users can pin a primary upstream provider via the schema decision above.
Background
pkg/vmcpconfig/converter.gohas two TODOs covering the configMap-sourced authz path onVirtualMCPServer:converter.go:192—TODO: Load policies from ConfigMap if Type is "configMap"converter.go:210—TODO: load primaryUpstreamProvider from configMapToday, both TODOs mean a
VirtualMCPServerwithspec.incomingAuth.authzConfig.type: configMapsilently produces a vMCP runtime that has no Cedar middleware installed (the factory atpkg/vmcp/auth/factory/incoming.go:88requireslen(cfg.Authz.Policies) > 0). And there is no way for configMap users to override the auto-selected primary upstream provider, because that field lives onInlineAuthzConfigonly.Tasks
cmd/thv-operator/pkg/controllerutil/) that reads + parses the policy ConfigMap. The MCPServer/runner path (AddAuthzConfigOptions) and the vMCP converter should both call it. The loader should return policies + any primary-upstream-provider configuration.Type == \"configMap\", call the loader, populateincoming.Authz.Policies(andPrimaryUpstreamProviderif applicable). Fail closed on missing/malformed/empty configMap.primaryUpstreamProviderlives for configMap users:PrimaryUpstreamProviderfromInlineAuthzConfigtoAuthzConfigRefso it lives on the spec and is source-agnostic. Validator stays simple. Recommended.ConditionReasonAuthzConfigMapNotFoundtovirtualmcpserver_types.go(already exists onMCPRemoteProxyatmcpremoteproxy_types.go:336).AuthzConfigRef.ExplicitPrimaryUpstreamProvider()once the schema decision lands.Discovered via
Acceptance criteria
VirtualMCPServerwithauthzConfig.type: configMapand a valid policy ConfigMap deploys with Cedar middleware installed and policies enforced.