Commit 66fff4a
Implement discovered mode for vMCP authentication (#2747)
Add runtime authentication discovery for VirtualMCPServer, enabling vMCP
to automatically discover and apply authentication configurations from
backend MCPServer ExternalAuthConfigRefs.
Changes:
- Add DiscoverAndResolveAuth() function in converters package to fetch
and convert MCPExternalAuthConfig to auth strategy metadata with
dynamic secret resolution from Kubernetes
- Implement discoverAuthConfig() in k8s workload discoverer to populate
backend AuthStrategy and AuthMetadata fields from ExternalAuthConfigRef
- Add applyAuthConfigToBackend() method in aggregator discoverer to
decide which auth to use based on source mode (discovered/mixed/inline)
- Add comprehensive unit tests for auth discovery scenarios (token
exchange, header injection, no auth, error cases)
- Add e2e test validating discovered auth with real MCP requests,
tool aggregation, and tool calls through VirtualMCPServer
The discovered mode allows backends with heterogeneous authentication
(OAuth 2.0 token exchange, API key header injection, or no auth) to
coexist in the same group, with vMCP automatically discovering and
applying the appropriate auth to each backend request.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: taskbot <[email protected]>1 parent f657a07 commit 66fff4a
File tree
6 files changed
+1748
-16
lines changed- pkg/vmcp
- aggregator
- auth/converters
- workloads
- test/e2e/thv-operator/virtualmcp
6 files changed
+1748
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 136 | + | |
| 137 | + | |
147 | 138 | | |
148 | 139 | | |
149 | 140 | | |
150 | 141 | | |
151 | 142 | | |
152 | 143 | | |
153 | 144 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | 145 | | |
158 | 146 | | |
159 | 147 | | |
| |||
165 | 153 | | |
166 | 154 | | |
167 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
0 commit comments