Commit 9ba4d2f
authored
feat: wire shared MCP OAuth stores in unified binary with integration tests (#2160)
Create shared ConsentCodeStore (BFF) and OIDCStateStore (MCP) instances at
startup and pass them to both the BFF consent handler and MCP OIDC handler.
This enables the full consent-based OAuth 2.1 flow when running in unified
binary mode.
- Add oauthwiring package as public factory for MCP OAuth components
(avoids importing internal/auth from cmd/meridian)
- Add MCPOAuthEndpoints struct and WithMCPOAuthEndpoints ServerOption to
mount /oauth/*, /.well-known/oauth-authorization-server, and
/oauth/register on the gateway
- Add wireMCPOAuth in wire_gateway.go with adapter types bridging
gateway.ConsentCodeStore <-> mcpauth.ConsentCodeConsumer and
mcpauth.OIDCStateStore <-> gateway.OIDCStatePeeker
- Add Server.Handler() for test access to the HTTP mux
- Add 6 integration tests covering full approve flow, deny flow,
PKCE integrity, tenant isolation, metadata endpoint, and dynamic
client registration
Co-authored-by: Ben Coombs <bjcoombs@users.noreply.github.com>1 parent 9df8ccf commit 9ba4d2f
6 files changed
Lines changed: 796 additions & 0 deletions
File tree
- cmd/meridian
- services
- api-gateway
- mcp-server/oauthwiring
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
332 | 338 | | |
333 | 339 | | |
334 | 340 | | |
| |||
0 commit comments