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

stacklok / toolhive / 39818120099
73%

Build:
DEFAULT BRANCH: main
Ran 22 Oct 2026 05:03PM UTC
Jobs 1
Files 968
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

22 Oct 2026 04:55PM UTC coverage: 71.562% (+0.02%) from 71.539%
39818120099

push

github

web-flow
Let embedders refuse refresh grants on dead upstreams (#6902)

* Let embedders refuse refresh grants

The embedded auth server's refresh_token grant keeps the token session,
so a client whose upstream credential is dead gets a new access token
that the bearer validator rejects again, and a client that only ever
refreshes loops. Embedders had no way to refuse that grant, and could
not tell an IdP's invalid_grant from a transient upstream failure.

Implements items 1 and 2 of #6901 (the default guard is a follow-up):
- Add Config.RefreshGrantHandlers: fosite token endpoint handlers that
  run only on the refresh_token grant, after the built-in refresh
  handler and before any tokens are issued or the refresh token rotates
- Wrap a new upstream.ErrInvalidGrant when the IdP answers a token
  request with invalid_grant and a 4xx status
- Return per-provider errors from GetAllUpstreamCredentials (failed is
  now map[string]error) so errors.Is reaches the sentinel there too

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

* Address review feedback on refresh-grant seam

- Never delegate the response phase to embedder handlers: it runs after
  the refresh token is rotated, so an error there would strand the
  client, and it would let an embedder rewrite the issued response
- On an upstream invalid_grant, re-read the row and return it if another
  replica already rotated it, so a lost cross-replica race is not
  reported as a dead credential; document the remaining window
- Document that non-OAuth handler errors answer 500, and that the
  code exchange also wraps ErrInvalidGrant

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

* Register refresh-grant handlers as one validator

fosite drops a token endpoint handler whose concrete type is already
registered, so wrapping each handler separately kept only the first.

Addresses stacklok/toolhive#6902 review comments:
- HIGH pkg/authserver/refresh_grant_handlers.go (4340715142): run all
  handlers... (continued)

76 of 76 new or added lines in 8 files covered. (100.0%)

306 existing lines in 7 files now uncovered.

88702 of 123951 relevant lines covered (71.56%)

127.49 hits per line

Coverage Regressions

Lines Coverage ∆ File
241
83.12
0.11% pkg/authserver/storage/redis.go
48
93.43
0.05% pkg/authserver/storage/memory.go
6
72.34
-6.38% pkg/secrets/keyring/keyctl_linux.go
5
85.88
0.0% pkg/authserver/storage/spiffe_decorator.go
4
63.89
-0.1% pkg/workloads/manager.go
1
98.4
0.44% pkg/authserver/storage/types.go
1
81.07
-0.12% pkg/vmcp/composer/workflow_engine.go
Jobs
ID Job ID Ran Files Coverage
1 39818120099.1 22 Oct 2026 05:03PM UTC 968
71.56
GitHub Action Run
Source Files on build 39818120099
  • Tree
  • List 968
  • Changed 16
  • Source Changed 12
  • Coverage Changed 13
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #39818120099
  • 6cbec29c on github
  • Prev Build on main (#39790843932)
  • Next Build on main (#39840999664)
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