Repository navigation
Description
Summary
A VirtualMCPServer with spec.incomingAuth.authzConfig.type: configMap produces a rendered vMCP config of:
incomingAuth:
type: oidc
oidc: { ... }
authz:
type: configMap # ← passed through raw from the CRDThe vmcp binary then fails validation at startup:
Configuration validation failed: invalid configuration:
- incomingAuth.authz: type must be one of: cedar, none
The binary's AuthzConfig struct only accepts type: cedar (with inline policies) or type: none — see the CRD API doc's vmcp.config.AuthzConfig. The operator's converter is expected to read the referenced ConfigMap and inline its cedar.policies + cedar.entities_json into the rendered config, as the same doc's vmcp.config.IncomingAuthConfig explicitly notes:
the operator's converter will resolve the CRD's IncomingAuth (which supports Kubernetes-native references like SecretKeyRef, ConfigMapRef, etc.) and populate this IncomingAuthConfig with the resolved values.
Reproduced on operator v0.21.0.
Expected
When authzConfig.type: configMap, the operator reads the ConfigMap at <name>/<key>, parses its {version, type: cedarv1, cedar: {policies, entities_json}} payload, and emits:
authz:
type: cedar
policies: [ ... ] # from cedar.policies
# entities_json similarly flattened if supported(Equivalent to what's produced when a user chooses authzConfig.type: inline directly.)
Actual
The operator passes type: configMap through without resolving the ConfigMap. No volume is mounted for the authz ConfigMap (unlike caBundleRef, which at least mounts its ConfigMap — see #4918 for the related gap). The vMCP binary then crashes with the validation error above, deployment goes into CrashLoopBackOff.
Minimal reproduction
apiVersion: v1
kind: ConfigMap
metadata:
name: example-authz
namespace: toolhive-system
data:
authz-config.json: |
{
"version": "1.0",
"type": "cedarv1",
"cedar": {
"policies": [
"permit(principal in THVGroup::\"engineering\", action == Action::\"call_tool\", resource);"
],
"entities_json": "[]"
}
}
---
apiVersion: toolhive.stacklok.dev/v1alpha1
kind: VirtualMCPServer
metadata:
name: example-vmcp
namespace: toolhive-system
spec:
groupRef:
name: some-group
incomingAuth:
type: oidc
oidcConfigRef:
name: some-oidc
audience: some-audience
authzConfig:
type: configMap
configMap:
name: example-authz
key: authz-config.json
outgoingAuth:
source: inline
serviceType: ClusterIPInspect the rendered config:
kubectl get configmap example-vmcp-vmcp-config -n toolhive-system \
-o jsonpath='{.data.config\.yaml}' | grep -A3 'authz:'Expected to see type: cedar with resolved policies; actually shows type: configMap.
Workaround
Use authzConfig.type: inline with the policies listed directly under spec.incomingAuth.authzConfig.inline.policies. Less readable for non-trivial policy sets.
Related
- VirtualMCPServer ignores MCPOIDCConfig.caBundleRef — CA is mounted but never read #4918 — sibling converter gap:
MCPOIDCConfig.caBundleRefis auto-mounted on the vMCP pod but never plumbed into the vMCP's config, causing OIDC discovery to fail on issuers with private CAs.
Suggest tackling both in the same vmcp-converter pass.
Context
Surfaced while building per-persona Cedar authz for the toolhive-demo-sandbox LibreChat addon. Happy to test a fix.
Activity
Add Cedar authz policies for vmcp-chat
Add Cedar authz policies for vmcp-chat
Resolve authz `ConfigMap` for `VirtualMCPServer`
Resolve authz `ConfigMap` for `VirtualMCPServer`
Resolve authz `ConfigMap` for `VirtualMCPServer`
Resolve authz `ConfigMap` for `VirtualMCPServer`
Resolve authz `ConfigMap` for `VirtualMCPServer`
Resolve authz `ConfigMap` for `VirtualMCPServer`
Resolve authz `ConfigMap` for `VirtualMCPServer`
Resolve authz `ConfigMap` for `VirtualMCPServer` (#5290)
Add Cedar authz policies for vmcp-chat
Drop the vmcp-chat operator workarounds now that both fixes shipped
Add Cedar authz policies for vmcp-chat
Drop the vmcp-chat operator workarounds now that both fixes shipped
LibreChat: Keycloak auth and role-based tool authz via a new vmcp-cha…