• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pomerium / pomerium / 22776581569
46%

Build:
DEFAULT BRANCH: main
Ran 06 Mar 2026 06:43PM UTC
Jobs 1
Files 687
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 Mar 2026 06:28PM UTC coverage: 45.2% (+0.1%) from 45.058%
22776581569

push

github

web-flow
mcp: add controlplane wiring and upstream OAuth callback handler (#6172)

## Summary

Wire `UpstreamAuthHandler` into the controlplane and implement the
`ClientOAuthCallback` handler that completes upstream OAuth flows.

When ext_proc intercepts a 401 from an upstream MCP server, it stores
`PendingUpstreamAuth` state and kicks off an OAuth flow.
`ClientOAuthCallback` receives the redirect back from the upstream AS,
exchanges the auth code for tokens, stores the `UpstreamMCPToken`, and
completes the flow via one of two paths depending on how the flow was
initiated:

- **Reactive** (ext_proc 401-intercept) — redirects to the original
upstream URL
- **Proactive** (MCP authorize flow) — issues a Pomerium auth code back
to the
  MCP client via `AuthorizationResponse()`

See `internal/mcp/DESIGN.md` → "Callback Completion Paths" for details.

## Related issues

- ENG-3593
- ENG-3594

## User Explanation

No user-facing changes. This wires up internal infrastructure for MCP
upstream
OAuth flows.

## Checklist

- [x] reference any related issues
- [x] updated unit tests
- [ ] add appropriate label (`enhancement`)
- [ ] ready for review

139 of 179 new or added lines in 3 files covered. (77.65%)

17 existing lines in 7 files now uncovered.

34338 of 75969 relevant lines covered (45.2%)

116.28 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
5
58.13
-0.41% internal/controlplane/server.go
16
0.0
0.0% internal/mcp/handler.go
19
87.58
internal/mcp/handler_client_oauth_callback.go

Uncovered Existing Lines

Lines Coverage ∆ File
1
75.41
0.0% pkg/storage/postgres/registry.go
2
69.92
-0.3% internal/databroker/server_backend.go
2
94.55
3.64% pkg/fanout/receive.go
2
83.51
-0.43% pkg/ssh/auth.go
2
84.24
-0.64% pkg/ssh/channel.go
4
85.78
-1.96% config/config_source.go
4
74.26
-0.89% internal/databroker/config_source.go
Jobs
ID Job ID Ran Files Coverage
1 22776581569.1 06 Mar 2026 06:43PM UTC 687
45.2
GitHub Action Run
Source Files on build 22776581569
  • Tree
  • List 687
  • Changed 16
  • Source Changed 3
  • Coverage Changed 15
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #22776581569
  • a452f250 on github
  • Prev Build on main (#22773785335)
  • Next Build on main (#22778489335)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc