Commit ef94194
committed
test(gateway): full inbound OAuth E2E proves auth-enabled flow is intact
Adds a real end-to-end test of the AUTH-REQUIRED path so we can guarantee the
"disable auth" feature never silently regresses real OAuth. It drives the
actual production handlers over HTTP against a gateway with inbound auth
required + a JWT secret configured:
DCR register → authorize (consent page, request_id) → consent approve
(redirect with code) → token exchange (PKCE S256) → authenticated /mcp
handshake returns 200; the same handshake with no token returns 401.
To mount the flow in a self-contained harness, expose the OAuth handlers
(oauth_register/authorize/token/consent_approve) from the server module, the
same way the discovery handlers were already exposed for tests.
Together with the disabled-side coverage (anonymous real handshake + list_tools,
discovery 404 incl. the RFC 9728 /mcp sub-path), both auth modes are now proven
end to end.
Claude-Session: https://claude.ai/code/session_01Baan9JmzR43uxxRUh7CAMF
Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>1 parent e73933a commit ef94194
5 files changed
Lines changed: 363 additions & 3 deletions
File tree
- crates/mcpmux-gateway/src/server
- tests/rust
- tests/streamable_http
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
49 | 54 | | |
50 | 55 | | |
51 | 56 | | |
| |||
0 commit comments