pomerium/internal/oauth21
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
..
gen mcp: implement connect (#5640) 2025-06-02 17:19:34 -04:00
proto mcp: implement connect (#5640) 2025-06-02 17:19:34 -04:00
authorize.go mcp: handle and pass upstream oauth2 tokens (#5595) 2025-05-01 12:42:31 -04:00
buf.gen.yaml mcp: token: handle authorization_code request (pt1) (#5587) 2025-04-28 14:09:22 -04:00
buf.lock mcp: extend code usage (#5588) 2025-04-25 14:47:11 -04:00
buf.yaml
error.go
generate.go
parse.go
pkce.go mcp: token: handle authorization_code request (pt1) (#5587) 2025-04-28 14:09:22 -04:00
pkce_test.go mcp: token: handle authorization_code request (pt1) (#5587) 2025-04-28 14:09:22 -04:00
token.go mcp: token: handle authorization_code request (pt1) (#5587) 2025-04-28 14:09:22 -04:00
validate_client.go
validate_client_test.go
validate_token_test.go mcp: token: handle authorization_code request (pt1) (#5587) 2025-04-28 14:09:22 -04:00