Commit e418e35
fix: exempt healthz and CORS preflight from MCP auth middleware
SRE Agent connector shows perpetual 'Connecting' because:
- GET /healthz returns 401 (no unauthenticated health endpoint)
- OPTIONS /mcp returns 401 (CORS preflight blocked by auth)
Added three middleware layers stacked in correct order:
1. Health wrapper: serves /healthz, /health, /ready without auth
2. CORS middleware: handles OPTIONS preflight with proper headers
3. Auth middleware: validates bearer token on all other requests
Middleware order: health → CORS → auth → rate-limit ensures
health probes and preflight pass while POST /mcp stays secured.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent ae4dda7 commit e418e35
1 file changed
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
355 | 397 | | |
356 | 398 | | |
357 | 399 | | |
| |||
376 | 418 | | |
377 | 419 | | |
378 | 420 | | |
| 421 | + | |
| 422 | + | |
379 | 423 | | |
380 | 424 | | |
381 | 425 | | |
| |||
0 commit comments