pomerium/internal
Denis Mishin b944e68232
mcp: implement connect (#5640)
## Summary

adds implementation of `/.pomerium/mcp/connect` method, that takes a
`redirect_url` parameter and would ensure the user goes thru required
redirects so that its session is hydrated with the upstream Oauth token
for the MCP server.
the `redirect_url` parameter host must match one of the _client_ mcp
routes (currently identified by the presence of `mcp:
pass_upstream_access_token: true` in the route.

## Related issues

Fix
https://linear.app/pomerium/issue/ENG-2321/mcp-support-handling-external-oauth-servers

## User Explanation

<!-- How would you explain this change to the user? If this
change doesn't create any user-facing changes, you can leave
this blank. If filled out, add the `docs` label -->

## Checklist

- [x] reference any related issues
- [x] updated unit tests
- [ ] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review
2025-06-02 17:19:34 -04:00
..
atomicutil upgrade to go v1.24 (#5562) 2025-04-02 15:53:09 -06:00
authenticateflow multi-domain login redirects (#5564) 2025-04-04 13:14:30 -07:00
autocert logging: standardize on hyphens in attribute names (#5577) 2025-04-22 10:57:19 -07:00
benchmarks upgrade to go v1.24 (#5562) 2025-04-02 15:53:09 -06:00
chanutil
contextkeys
controlplane config: use stable route ids for authorize matching and order xds responses (#5618) 2025-05-19 10:52:15 -06:00
databroker databroker: add a wait field to sync request (#5630) 2025-05-29 12:50:14 -06:00
deterministicecdsa
enabler Fix many instances of contexts and loggers not being propagated (#5340) 2024-10-25 14:50:56 -04:00
encoding
errgrouputil
events core/logging: change log.Error function (#5251) 2024-09-05 15:42:46 -06:00
fileutil remove debug log message for directories (#5560) 2025-04-02 10:17:42 -06:00
handlers Add an 'issuer' field to the /.well-known/pomerium endpoint (#5344) 2024-10-25 13:07:57 -04:00
hashutil replace xxhash with xxh3 (#5457) 2025-01-31 08:44:08 -07:00
headertemplate add support for pomerium.request.headers for set_request_headers (#5563) 2025-04-07 10:32:03 -06:00
httputil config: use stable route ids for authorize matching and order xds responses (#5618) 2025-05-19 10:52:15 -06:00
jwtutil authorize: support authenticating with idp tokens (#5484) 2025-02-18 13:02:06 -07:00
log config: use stable route ids for authorize matching and order xds responses (#5618) 2025-05-19 10:52:15 -06:00
mcp mcp: implement connect (#5640) 2025-06-02 17:19:34 -04:00
middleware New tracing system (#5388) 2025-01-21 13:26:32 -05:00
oauth21 mcp: implement connect (#5640) 2025-06-02 17:19:34 -04:00
registry upgrade to go v1.24 (#5562) 2025-04-02 15:53:09 -06:00
retry New tracing system (#5388) 2025-01-21 13:26:32 -05:00
rfc7591 chore(deps): bump the go group across 1 directory with 31 updates (#5608) 2025-05-07 10:04:03 -07:00
scheduler
sessions authorize: return 403 on invalid sessions (#5536) 2025-03-19 14:41:28 -06:00
sets core/go: use hashicorp/go-set (#5278) 2024-10-03 12:59:11 -06:00
signal
syncutil
telemetry core: more metrics (#5629) 2025-05-29 09:34:41 -06:00
testenv storage: add sync querier (#5570) 2025-04-23 10:15:48 -06:00
tests/xdserr Fix many instances of contexts and loggers not being propagated (#5340) 2024-10-25 14:50:56 -04:00
testutil chore(deps): bump the go group with 39 updates (#5559) 2025-04-04 16:26:51 -07:00
tripper
urlutil multi-domain login redirects (#5564) 2025-04-04 13:14:30 -07:00
version ci: do not include timestamp into buildmeta (#5215) 2024-08-15 10:57:10 -04:00
zero logging: standardize on hyphens in attribute names (#5577) 2025-04-22 10:57:19 -07:00