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

stacklok / toolhive / 40981886298
73%

Build:
DEFAULT BRANCH: main
Ran 30 Oct 2026 12:55AM UTC
Jobs 1
Files 987
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

30 Oct 2026 12:47AM UTC coverage: 72.114% (+0.02%) from 72.095%
40981886298

push

github

web-flow
Keep RetrieveError in failed upstream refresh errors (#6999)

* Keep RetrieveError in upstream refresh errors

formatOAuth2Error flattened every token endpoint failure except
invalid_grant into plain text, so callers of GetValidTokens and
GetAllUpstreamCredentials could not tell a provider outage from a
definitive OAuth verdict such as invalid_client, even though
pkg/auth/oautherr already classifies those responses.

Implements changes for issue #6998:
- Return an unexported wrapper whose Error() is the existing sanitized
  text and whose Unwrap() exposes both that error (keeping
  ErrGrantRejected) and a body-scrubbed copy of the RetrieveError
- Drop formatOAuth2Error's prefix parameter, which every caller set to
  the same value
- Test the oautherr predicates end to end through the refresher and
  upstreamtoken service, and pin the unchanged error text
- Document the contract on ErrRefreshFailed, the service interface and
  the auth server storage architecture doc

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

* Clarify tokenRequestError docs and test coverage

Address low-severity review notes for issue #6998: note on
formatOAuth2Error that the RetrieveError stays in the chain, say why
the chained copy keeps Response, and assert the GetValidTokens message
also excludes the response body.

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

* Narrow chained RetrieveError and harden tests

Addresses stacklok/toolhive#6999 review comments:
- MEDIUM pkg/authserver/upstream/oauth2.go (4415964810): reduce the
  chained Response to StatusCode and Status so the outgoing request and
  its credentials are unreachable
- LOW pkg/authserver/upstream/oauth2.go (4415964835): correct the type
  comment and state why it copies and why Unwrap is multi-valued
- LOW pkg/authserver/upstream/oauth2.go (4415964846): test the
  authorization code exchange path
- LOW pkg/authserver/upstream_refresh_rejection_test.go (4415964861):
  assert the RetrieveError,... (continued)

17 of 17 new or added lines in 1 file covered. (100.0%)

1 existing line in 1 file now uncovered.

91023 of 126221 relevant lines covered (72.11%)

131.29 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
94.1
0.0% pkg/authserver/storage/memory.go
Jobs
ID Job ID Ran Files Coverage
1 40981886298.1 30 Oct 2026 12:55AM UTC 987
72.11
GitHub Action Run
Source Files on build 40981886298
  • Tree
  • List 987
  • Changed 6
  • Source Changed 1
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #40981886298
  • 3224ee1c on github
  • Prev Build on main (#40967065924)
  • Next Build on main (#41027563081)
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