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

stacklok / toolhive / 28191000743
67%

Build:
DEFAULT BRANCH: main
Ran 25 Jun 2026 06:21PM UTC
Jobs 1
Files 759
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

25 Jun 2026 06:14PM UTC coverage: 67.327% (+0.07%) from 67.253%
28191000743

push

github

web-flow
Dedup upstream-token refresh on a shared refresher (#5635)

Two code paths refresh an expired upstream token for the same
(session, provider): the runtime token-swap path, which deduplicated
concurrent refreshes through a singleflight.Group, and the
authorization-chain walk, which called the refresher directly,
outside that group. The refresher was also reallocated on every call,
so the group could never have deduplicated across callers regardless.

That gap matters because most corporate IdPs rotate refresh tokens and
detect reuse. Two callers can redeem the same stored token at once:

              RT(v1) in storage
  chain-walk refresh   --read v1--+   (NOT in the singleflight group)
  runtime swap refresh --read v1--+
                                  v
  both POST RT(v1) to the IdP
        +- one rotates -> RT(v2)
        +- other replays v1 -> reuse detection -> family revoked

The IdP treats the replayed token as a breach and revokes the entire
token family, silently logging the user out of that upstream.

Construct a single shared refresher in newServer, move the
singleflight.Group (and the detached-context refresh timeout) onto it,
and have both the chain walk and the runtime path use that one
instance. Concurrent refreshes of the same (session, provider) now
collapse to a single redemption; distinct keys stay independent.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

25 of 27 new or added lines in 3 files covered. (92.59%)

9 existing lines in 4 files now uncovered.

69410 of 103094 relevant lines covered (67.33%)

65.49 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
97.37
-2.63% pkg/authserver/refresher.go

Coverage Regressions

Lines Coverage ∆ File
3
81.13
0.0% pkg/transport/proxy/httpsse/http_proxy.go
3
49.06
-0.63% pkg/transport/stdio.go
2
93.94
-6.06% pkg/foreach/foreach.go
1
97.47
-0.31% pkg/auth/upstreamtoken/service.go
Jobs
ID Job ID Ran Files Coverage
1 28191000743.1 25 Jun 2026 06:21PM UTC 759
67.33
GitHub Action Run
Source Files on build 28191000743
  • Tree
  • List 759
  • Changed 11
  • Source Changed 3
  • Coverage Changed 11
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28191000743
  • 0fad7779 on github
  • Prev Build on main (#28167529601)
  • Next Build on main (#28194256916)
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