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

stacklok / toolhive / 23553452916 / 1
64%
main: 64%

Build:
DEFAULT BRANCH: main
Ran 25 Mar 2026 05:03PM UTC
Files 579
Run time 15s
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 Mar 2026 04:57PM UTC coverage: 65.414% (+0.09%) from 65.32%
23553452916.1

push

github

web-flow
Enrich Identity with upstream tokens and simplify upstreamswap (#4355)

* Add UpstreamTokens field to Identity with redacted serialization

The auth middleware will populate upstream provider access tokens on
the Identity struct, allowing downstream middleware (upstreamswap) to
read tokens without coupling to the storage layer. MarshalJSON redacts
token values while preserving provider keys, and both nil and empty
maps are omitted via omitempty.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add UpstreamTokenReader interface and bulk token retrieval

Introduce a narrow UpstreamTokenReader interface that decouples the auth
middleware from storage internals. InProcessService.GetAllValidTokens
performs a bulk read of all upstream providers for a session, refreshing
expired tokens transparently and falling back to expired tokens when
refresh fails.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Thread UpstreamTokenReader through middleware runner and auth factory

Add GetUpstreamTokenReader to MiddlewareRunner so the auth middleware
can access the bulk token reader for identity enrichment. The runner
stores the reader as a separate field (set alongside the token service)
avoiding type assertions. GetAuthenticationMiddleware now accepts
variadic TokenValidatorOption for forward-compatible option passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Enrich Identity with upstream tokens during JWT validation

Add WithUpstreamTokenReader option to TokenValidator that loads all
upstream provider tokens from storage when a tsid claim is present
in the JWT. The enrichment happens between claimsToIdentity and
context injection, populating Identity.UpstreamTokens for downstream
middleware consumption.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Simplify upstreamswap to read from Identity.UpstreamTokens

Replace the ServiceGetter/GetValidTokens pattern with ... (continued)

51632 of 78931 relevant lines covered (65.41%)

72.84 hits per line

Source Files on job 23553452916.1
  • Tree
  • List 579
  • Changed 21
  • Source Changed 13
  • Coverage Changed 19
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 23553452916
  • 7c667732 on github
  • Prev Job for on main (#23545575683.1)
  • Next Job for on main (#23555397829.1)
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