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

pomerium / pomerium / 24740199847
45%

Build:
DEFAULT BRANCH: main
Ran 21 Apr 2026 07:01PM UTC
Jobs 1
Files 696
Run time 1min
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

21 Apr 2026 06:44PM UTC coverage: 45.684% (+0.07%) from 45.619%
24740199847

push

github

web-flow
mcp: refresh expired upstream token before forcing reauth (#6282)

## Summary

`/.pomerium/mcp/authorize` and `/.pomerium/mcp/connect` forced a full
interactive OAuth flow whenever the cached `UpstreamMCPToken` was past
its expiry, even when a valid `refresh_token` was on hand. Now attempt a
silent refresh first; on permanent failure drop the stale token and fall
through as before.

## Related issues


[ENG-3927](https://linear.app/pomerium/issue/ENG-3927/mcp-authorize-handler-doesnt-refresh-expired-upstreammcptoken-triggers)

## User Explanation

MCP clients no longer get bounced through a full upstream OAuth consent
page once a day when their cached access token expires; a fresh token is
fetched silently from the upstream's `token_endpoint`.

## Checklist

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

79 of 110 new or added lines in 3 files covered. (71.82%)

28 existing lines in 7 files now uncovered.

35553 of 77823 relevant lines covered (45.68%)

114.87 hits per line

Uncovered Changes

Lines Coverage ∆ File
13
70.33
1.45% internal/mcp/upstream_auth.go
9
52.25
0.2% internal/mcp/handler_authorization.go
9
47.47
11.24% internal/mcp/handler_connect.go

Coverage Regressions

Lines Coverage ∆ File
9
80.34
0.0% pkg/ssh/manager.go
8
91.72
-1.79% pkg/ssh/policy_index_inmemory.go
4
74.26
-1.18% internal/databroker/config_source.go
2
92.78
-1.11% internal/fileutil/watcher.go
2
79.15
-0.77% internal/recording/server.go
2
95.83
-2.08% pkg/identity/manager/schedulers.go
1
75.41
0.0% pkg/storage/postgres/registry.go
Jobs
ID Job ID Ran Files Coverage
1 24740199847.1 21 Apr 2026 07:01PM UTC 696
45.68
GitHub Action Run
Source Files on build 24740199847
  • Tree
  • List 696
  • Changed 13
  • Source Changed 4
  • Coverage Changed 13
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24740199847
  • 599b7d13 on github
  • Prev Build on main (#24736983345)
  • Next Build on main (#24800708842)
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