Wire UpstreamTokenReader into vMCP incoming auth middleware#4394
Open
Wire UpstreamTokenReader into vMCP incoming auth middleware#4394
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4394 +/- ##
==========================================
+ Coverage 69.48% 69.52% +0.04%
==========================================
Files 486 487 +1
Lines 50017 50056 +39
==========================================
+ Hits 34753 34802 +49
+ Misses 12578 12576 -2
+ Partials 2686 2678 -8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
12e1fc2 to
a4b2892
Compare
8d3d9a5 to
202d8a0
Compare
a4b2892 to
e49c89e
Compare
202d8a0 to
e4d0916
Compare
e49c89e to
d17a27e
Compare
e4d0916 to
b656997
Compare
5eaa677 to
b656997
Compare
d17a27e to
2bdc632
Compare
b656997 to
86e43b4
Compare
2bdc632 to
8eebdd8
Compare
86e43b4 to
b5324f6
Compare
Bridge the Kubernetes operator API to the vMCP runtime config for the upstream_inject outgoing auth strategy. This is Phase 4 of RFC-0054. CRD changes: add ExternalAuthTypeUpstreamInject constant, UpstreamInjectSpec struct, CEL validation rules, and SubjectProviderName on TokenExchangeConfig. Converter changes: add UpstreamInjectConverter, wire SubjectProviderName in TokenExchangeConverter, and register in the converter registry. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8eebdd8 to
1d21cae
Compare
The vMCP binary created an EmbeddedAuthServer but never extracted its UpstreamTokenReader to enrich Identity with upstream provider tokens. The JWT tsid claim was present but Identity.UpstreamTokens was always nil, causing the upstream_inject strategy to fail with "upstream token not found". Thread auth.TokenValidatorOption through NewIncomingAuthMiddleware and newOIDCAuthMiddleware to GetAuthenticationMiddleware. In commands.go, build an InProcessService from the auth server's storage and refresher, pass it as WithUpstreamTokenReader. This mirrors the proxy runner pattern at pkg/runner/runner.go:250-254 and pkg/auth/middleware.go:56. Part of #4141 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
b5324f6 to
7971fa9
Compare
jerm-dro
previously approved these changes
Mar 29, 2026
jerm-dro
approved these changes
Mar 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UpstreamTokenReader to enrich Identity with upstream provider tokens.
The JWT tsid claim was present but
Identity.UpstreamTokenswas alwaysnil, causing the
upstream_injectstrategy to fail with "upstream tokennot found".
auth.TokenValidatorOptionthroughNewIncomingAuthMiddlewareandnewOIDCAuthMiddlewaretoGetAuthenticationMiddleware. Incommands.go,builds an
InProcessServicefrom the auth server's storage and refresher,and passes it as
WithUpstreamTokenReader.Part of #4141
Type of change
Test plan
task test)task lint-fix)Changes
cmd/vmcp/app/commands.gopkg/vmcp/auth/factory/incoming.goSpecial notes for reviewers
pkg/runner/runner.go:250-254andpkg/auth/middleware.go:56.🤖 Generated with Claude Code