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

stacklok / toolhive / 23027222286
64%

Build:
DEFAULT BRANCH: main
Ran 12 Mar 2026 10:41PM UTC
Jobs 1
Files 554
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

12 Mar 2026 10:37PM UTC coverage: 64.424% (+0.07%) from 64.358%
23027222286

push

github

web-flow
Make the token refresh code reusable for vMCP and testable (#4117)

* Add upstreamtoken package for upstream token lifecycle

Introduce a reusable upstreamtoken.Service interface that encapsulates
the upstream token lifecycle (read, validate expiry, refresh, dedup)
behind a single GetValidTokens call. This is designed for reuse by
vMCP, which needs the same refresh logic without depending on the
middleware layer.

InProcessService composes UpstreamTokenStorage + UpstreamTokenRefresher
with singleflight deduplication to prevent concurrent refresh attempts
from exhausting single-use refresh tokens.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Wire UpstreamTokenService into runner and middleware

Simplify the MiddlewareRunner interface from two storage-level accessors
(GetUpstreamTokenStorage, GetUpstreamTokenRefresher) to a single
service-level accessor (GetUpstreamTokenService). The upstreamswap
middleware now consumes the Service interface directly, removing its
responsibility for composing storage and refresher components.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Simplify runner startup with eager service initialization

Reorder Run() to initialize the embedded auth server before middleware
creation, eliminating the need for lazy accessor with mutex and caching
in GetUpstreamTokenService(). The service is now created eagerly and
stored as a field, making the accessor a simple field read.

Also deduplicate the createMinimalAuthServerConfig test helper, add
UpstreamTokenRefresher to the go:generate directive, and update the
middleware documentation to reflect the new interface method.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fail closed when upstream token service is unavailable

When a request carries a tsid claim (confirming it expects upstream
token injection), passing through with the original JWT would leak
the auth server token to the backend. Return 503 instead of
forwarding the request when t... (continued)

84 of 110 new or added lines in 4 files covered. (76.36%)

4 existing lines in 2 files now uncovered.

48512 of 75301 relevant lines covered (64.42%)

73.75 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
96.55
pkg/auth/upstreamtoken/service.go
24
37.65
-0.67% pkg/runner/runner.go

Uncovered Existing Lines

Lines Coverage ∆ File
2
79.79
-0.52% pkg/transport/proxy/httpsse/http_proxy.go
2
57.89
-3.51% pkg/transport/session/sse_session.go
Jobs
ID Job ID Ran Files Coverage
1 23027222286.1 12 Mar 2026 10:41PM UTC 554
64.42
GitHub Action Run
Source Files on build 23027222286
  • Tree
  • List 554
  • Changed 17
  • Source Changed 6
  • Coverage Changed 15
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #23027222286
  • 5c689111 on github
  • Prev Build on main (#23020814602)
  • Next Build on main (#23041807322)
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