Skip to content

Wire jwksUrl and introspectionUrl from vMCP inline OIDC config to runtime#4501

Merged
ChrisJBurns merged 3 commits intomainfrom
issue_4485_jwksurl-oidcconfig
Apr 2, 2026
Merged

Wire jwksUrl and introspectionUrl from vMCP inline OIDC config to runtime#4501
ChrisJBurns merged 3 commits intomainfrom
issue_4485_jwksurl-oidcconfig

Conversation

@tgrunnagle
Copy link
Copy Markdown
Contributor

Summary

The VirtualMCPServer CRD supports jwksUrl and introspectionUrl in its inline OIDC config, but the vMCP runtime path silently dropped both fields during conversion. This meant vMCP always fell back to OIDC discovery for the JWKS endpoint, which fails when the issuer does not serve /.well-known/openid-configuration or when the operator explicitly overrides these URLs. The MCPServer path already handled these fields correctly; this PR closes the gap for the vMCP path.

Closes #4485

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Dependency update
  • Documentation
  • Other (describe):

Test plan

  • Unit tests (task test)
  • E2E tests (task test-e2e)
  • Linting (task lint-fix)
  • Manual testing (describe below)

Changes

File Change
pkg/vmcp/config/config.go Add JWKSURL and IntrospectionURL fields to OIDCConfig struct with JSON/YAML tags and documentation
cmd/thv-operator/pkg/vmcpconfig/converter.go Map resolved.JWKSURL and resolved.IntrospectionURL in mapResolvedOIDCToVmcpConfig
pkg/vmcp/auth/factory/incoming.go Pass JWKSURL and IntrospectionURL to auth.TokenValidatorConfig in the auth factory
cmd/thv-operator/pkg/vmcpconfig/converter_test.go Add test case for JWKS/introspection URL wiring; update mock returns and assertions
pkg/vmcp/config/yaml_loader_test.go Add YAML round-trip test verifying both fields deserialize correctly

Does this introduce a user-facing change?

Yes. Operators can now set jwksUrl and introspectionUrl on VirtualMCPServer inline OIDC config and have those values reach the token validator at runtime. Previously these fields were accepted by the CRD but silently ignored.

Generated with Claude Code

…time

Implements changes for issue #4485:
- Add JwksUrl and IntrospectionUrl fields to vmcpconfig.OIDCConfig
- Map resolved JWKSURL/IntrospectionURL in CRD-to-vMCP converter
- Pass JWKSURL/IntrospectionURL to auth.TokenValidatorConfig in auth factory
- Add converter and YAML loader tests for the new fields
- Fix pre-existing goconst lint issue in crd_cli_roundtrip_test.go
Fixed issues from code review:
- MEDIUM: Rename Go struct fields JwksUrl -> JWKSURL and IntrospectionUrl
  -> IntrospectionURL to follow codebase acronym conventions (JSON tags
  unchanged)
- MEDIUM: Revert unrelated crd_cli_roundtrip_test.go cleanup that replaced
  "oidc" string literals with IncomingAuthTypeOIDC constant
@github-actions github-actions bot added the size/XS Extra small PR: < 100 lines changed label Apr 2, 2026
@tgrunnagle tgrunnagle marked this pull request as ready for review April 2, 2026 14:44
JAORMX
JAORMX previously approved these changes Apr 2, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.37%. Comparing base (f43e29b) to head (6f7d14a).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
pkg/vmcp/auth/factory/incoming.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4501      +/-   ##
==========================================
+ Coverage   69.30%   69.37%   +0.06%     
==========================================
  Files         502      502              
  Lines       51632    51636       +4     
==========================================
+ Hits        35785    35821      +36     
+ Misses      13082    13049      -33     
- Partials     2765     2766       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions bot added size/S Small PR: 100-299 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Apr 2, 2026
Copy link
Copy Markdown
Contributor

@jerm-dro jerm-dro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix. Worth noting this is an example of the CRD → runtime config plumbing gap that toolhive-rfcs#65 aims to address systemically — fields accepted by the CRD but silently dropped in conversion. cc @ChrisJBurns

@ChrisJBurns ChrisJBurns merged commit 6c4e023 into main Apr 2, 2026
81 of 84 checks passed
@ChrisJBurns ChrisJBurns deleted the issue_4485_jwksurl-oidcconfig branch April 2, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Small PR: 100-299 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wire jwksUrl and introspectionUrl from vMCP inline OIDC config to runtime

4 participants