Commit 22415f1
Remove MCP direct identity-provider mode
MCP shipped two ways to authenticate a caller: the Gateway validating a
bearer and MCP trusting injected headers, or FastMCP verifying the caller
itself. Only one can be the answer, and the published documentation
already recommended the second. This removes the first.
request_context.py loses the header trust boundary entirely: the ASGI
middleware, the per-request state, the header parsing, and the user_name
field that no consumer read. get_request_credentials collapses to the
FastMCP access token, which is now the only source of caller identity, so
identity can no longer come from a header a caller could set. The module
goes from 355 lines to 194.
auth_enabled disappears with it. Authentication is not a mode any more, so
its configuration is required rather than conditionally required, and a
deployment that cannot reach an identity provider fails at load instead of
starting up unauthenticated.
The Gateway stops synthesising what FastMCP serves: the protected-resource
route forwards unconditionally, and the local_reply_config that rewrote
the /mcp 401 challenge is gone because FastMCP emits it. services.mcp
loses authorizationServers and scopes, and oidcProxy loses its enabled
toggle, which could only ever be true.
Tests authenticate the way the service does. protocol_harness gains a
static token verifier and a service_config helper, so suites that
exercise the tool pipeline get a real auth provider instead of trusted
headers.
The smoke checks come with it, because deploying proxy mode for the first
time showed the suite failing before it reached any assertion: it
authenticates with the OSMO-issued OETF token, which FastMCP rejects.
The unauthenticated surface a client uses to bootstrap OAuth needs no
token and is now its own test -- the 401 challenge and its
resource_metadata pointer, the RFC 9728 document, that FastMCP advertises
its authorization endpoint under /mcp, and that the health endpoints the
/mcp prefix would otherwise publish return 404. The authenticated catalog
and workflow checks name OSMO_MCP_ACCESS_TOKEN, which runs them when an
identity-provider token is supplied.
Two smoke-check fixes ride along. The expected catalog was missing
osmo_list_tasks, added by #1311, so its exact-equality assertion would
have failed at 25 versus 26 had it ever run, and the two counts in the
service README were stale for the same reason. The suite also carried an
`auth` tag that the kind environment's exclude_tags dropped, so it never
ran anywhere -- which is why the staleness went unnoticed. It is tagged
by what it needs deployed now, with kind excluding `mcp` explicitly.
Two behaviours changed and are recorded rather than hidden. An
unauthenticated request is now rejected after RequestBodyLimitMiddleware
has buffered its bounded body rather than before, because FastMCP's auth
runs inside the route. And whether a follow-up request succeeds after a
cancelled one is FastMCP's to decide; verified against the pre-change tree
that an authenticated deployment already behaved this way, so this change
does not introduce it.
Removing the mode column from the deployment guide's table left three
:widths: values against two columns, and the troubleshooting table in the
getting-started guide lost a cell marker on its HTTP 403 row. Both are Sphinx
errors, so docs-build failed on this commit. Fixed here rather than later in
the stack: a PR should not leave the docs build red for the ones behind it.
The smoke-check skip message described the wrong token. FastMCP's proxy
issues its own token to the client and keeps the upstream identity-provider
token server-side, validating it by JTI lookup on each request
(oauth_proxy/proxy.py:1820-1848), so a raw identity-provider token does not
authenticate to /mcp. The message now names the token the caller actually
needs.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 190a69a commit 22415f1
24 files changed
Lines changed: 381 additions & 1308 deletions
File tree
- deployments/charts/service
- ci
- templates
- docs
- deployment_guide/advanced_config
- user_guide
- appendix/mcp
- getting_started
- src/service/mcp
- tests
- test
- oetf/data
- smoke
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
119 | | - | |
120 | 118 | | |
121 | 119 | | |
122 | 120 | | |
123 | 121 | | |
124 | 122 | | |
125 | 123 | | |
126 | | - | |
127 | 124 | | |
128 | 125 | | |
129 | 126 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | | - | |
25 | | - | |
26 | 23 | | |
27 | 24 | | |
28 | 25 | | |
29 | | - | |
30 | | - | |
| 26 | + | |
| 27 | + | |
31 | 28 | | |
32 | 29 | | |
33 | 30 | | |
| |||
102 | 99 | | |
103 | 100 | | |
104 | 101 | | |
105 | | - | |
106 | 102 | | |
107 | 103 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | 104 | | |
114 | 105 | | |
115 | 106 | | |
| |||
124 | 115 | | |
125 | 116 | | |
126 | 117 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
178 | 122 | | |
179 | 123 | | |
180 | 124 | | |
| |||
245 | 189 | | |
246 | 190 | | |
247 | 191 | | |
248 | | - | |
| 192 | + | |
249 | 193 | | |
250 | 194 | | |
251 | 195 | | |
252 | 196 | | |
253 | | - | |
| 197 | + | |
254 | 198 | | |
255 | 199 | | |
256 | 200 | | |
257 | 201 | | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | 202 | | |
264 | 203 | | |
265 | 204 | | |
| |||
Lines changed: 1 addition & 75 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 34 | + | |
38 | 35 | | |
39 | 36 | | |
40 | 37 | | |
41 | 38 | | |
42 | | - | |
43 | | - | |
44 | 39 | | |
45 | 40 | | |
46 | 41 | | |
| |||
54 | 49 | | |
55 | 50 | | |
56 | 51 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | 52 | | |
80 | 53 | | |
81 | 54 | | |
| |||
299 | 272 | | |
300 | 273 | | |
301 | 274 | | |
302 | | - | |
303 | 275 | | |
304 | 276 | | |
305 | 277 | | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | 278 | | |
324 | 279 | | |
325 | 280 | | |
| |||
471 | 426 | | |
472 | 427 | | |
473 | 428 | | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | 429 | | |
504 | 430 | | |
505 | 431 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | 180 | | |
193 | 181 | | |
194 | 182 | | |
| |||
202 | 190 | | |
203 | 191 | | |
204 | 192 | | |
205 | | - | |
206 | | - | |
207 | 193 | | |
208 | 194 | | |
209 | 195 | | |
| |||
0 commit comments