Skip to content

VirtualMCPServer doesn't resolve authzConfig.configMap — vMCP rejects 'type: configMap' at startup #4919

Closed

Description

@danbarr

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 CRD

The 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: ClusterIP

Inspect 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

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

  1. added
    bug
    kubernetes
    vmcp
    on Apr 17, 2026
  2. self-assigned this
    on May 13, 2026
  3. added 7 commits that reference this issue on May 15, 2026
    bf2fafb
    7895464
    f8c1696
    12defec
    354c220
    78d655f
    35f8452
  4. added a commit that references this issue on May 22, 2026
    9a28521
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

authorizationbugkubernetesoperatorvmcp

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions