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

stacklok / toolhive / 34387984340
71%

Build:
DEFAULT BRANCH: main
Ran 09 Sep 2026 06:24PM UTC
Jobs 1
Files 914
Run time 3min
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

09 Sep 2026 06:16PM UTC coverage: 70.398% (+0.01%) from 70.388%
34387984340

push

github

web-flow
Guard rotating refresh-token writes with compare-and-swap (#6548)

* Guard refresh-token writes with compare-and-swap

Two Connector Gateway replicas sharing the same Redis-backed
UpstreamTokenStorage can redeem and persist the same single-use,
rotating refresh token concurrently. The in-process singleflight
group only deduplicates refreshes within one process, and
StoreUpstreamTokens is an unconditional overwrite, so the losing
replica's write can silently clobber the winner's already-rotated
token and dead-end the refresh chain.

Add UpstreamTokenStorage.CompareAndSwapUpstreamTokens, conditioned on
the refresh token currently stored matching the value the caller just
redeemed with. The refresher now writes through it instead of
StoreUpstreamTokens: a losing write fails with ErrConcurrentRefresh
instead of overwriting, and the refresher re-reads the row to hand
back the winning replica's tokens (or a clear error if no usable
winner exists) rather than retrying an already-dead redemption.

* Address review: dedupe CAS script, richer errors, more tests

- Unify storeUpstreamTokensScript and casUpstreamTokensScript's
  write/index Lua body into one shared constant instead of a
  hand-duplicated copy, so the two scripts cannot silently drift.
- Include the re-read error in resolveConcurrentRefreshConflict's log
  and returned error instead of discarding it.
- Fix a stale comment still naming StoreUpstreamTokens on a path that
  now writes through CompareAndSwapUpstreamTokens.
- Add a timeout guard to the concurrent Redis CAS test's WaitGroup,
  matching this file's existing pattern.
- Add coverage: empty-expected-value CAS against an already-populated
  row (both backends), the "re-read succeeds but still expired"
  conflict-resolution branch, and session-index/TTL/user-reverse-index
  assertions on a successful Redis CAS write.
- Update docs/arch/11-auth-server-storage.md's "Refresh Coordination
  Scope" section, which stated no cross-process CAS guaran... (continued)

108 of 120 new or added lines in 4 files covered. (90.0%)

16 existing lines in 6 files now uncovered.

80244 of 113987 relevant lines covered (70.4%)

93.3 hits per line

Uncovered Changes

Lines Coverage ∆ File
8
52.57
-1.35% pkg/authserver/storage/mocks/mock_storage.go
4
83.0
0.14% pkg/authserver/storage/redis.go

Coverage Regressions

Lines Coverage ∆ File
8
52.57
-1.35% pkg/authserver/storage/mocks/mock_storage.go
2
68.8
-0.85% pkg/ignore/processor.go
2
72.94
-0.29% pkg/transport/proxy/streamable/streamable_proxy.go
2
50.66
-0.53% pkg/transport/stdio.go
1
94.86
0.04% pkg/authserver/storage/memory.go
1
81.07
-0.12% pkg/vmcp/composer/workflow_engine.go
Jobs
ID Job ID Ran Files Coverage
1 34387984340.1 09 Sep 2026 06:24PM UTC 914
70.4
GitHub Action Run
Source Files on build 34387984340
  • Tree
  • List 914
  • Changed 12
  • Source Changed 5
  • Coverage Changed 12
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #34387984340
  • f3caffb9 on github
  • Prev Build on main (#34378260864)
  • Next Build on main (#34392424390)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc