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

stacklok / toolhive / 25694465932
66%

Build:
DEFAULT BRANCH: main
Ran 11 May 2026 08:15PM UTC
Jobs 1
Files 725
Run time 2min
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

11 May 2026 08:09PM UTC coverage: 64.986% (-0.01%) from 65.0%
25694465932

push

github

web-flow
Delegate tokenexchange HTTP plumbing to pkg/oauthproto (#5226)

Now that pkg/oauthproto owns request construction, body draining, size
limiting, and RFC 6749 token-response parsing, tokenexchange no longer
needs its own copies. Route exchangeToken through
oauthproto.NewFormRequest + oauthproto.DoTokenRequest and drop the
in-package helpers plus the now-unused imports (encoding/json, io,
log/slog, strconv, time).

exchange.go changes:

- Delete createTokenExchangeRequest, executeTokenExchangeRequest,
  parseTokenExchangeResponse, validateResponseStatus, the local
  response struct, and the local maxResponseBodySize constant.
  exchangeToken collapses to three calls: buildFormData,
  oauthproto.NewFormRequest, oauthproto.DoTokenRequest.

- Preserve RFC 8693 Section 2.2.1 at the call site.
  oauthproto.ParseTokenResponse is deliberately permissive about
  token_type (x/oauth2 library parity, Google historically omits it),
  so tokenSource.Token() still enforces both token_type and
  issued_token_type for RFC 8693 compliance. The redundant
  AccessToken-empty check is gone; oauthproto.ParseTokenResponse emits
  "oauth: token response missing access_token (RFC 6749 Section 5.1)"
  centrally.

- Rename buildTokenExchangeFormData to buildFormData now that the
  package context makes the TokenExchange prefix redundant.

- The SubjectTokenType mutation (c.SubjectTokenType = normalized) is
  preserved — pkg/vmcp and pkg/runner read the field post-Validate —
  and pinned by a new TestExchangeConfig_Validate_NormalizesSubjectTokenType
  regression test covering short forms, already-normalized URNs, and
  empty.

Test changes:

- Replace the in-file testResponse struct and responseBuilder helper
  with oauthtest.ResponseBuilder from pkg/oauthproto/oauthtest. The
  shared builder was introduced in the first commit of this series
  specifically so tokenexchange and the upcoming jwtbearer grant stop
  drifting; keeping a local duplicate defeated the point. Same
  tre... (continued)

18 of 19 new or added lines in 1 file covered. (94.74%)

100 existing lines in 7 files now uncovered.

63968 of 98434 relevant lines covered (64.99%)

62.61 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
86.93
-1.54% pkg/auth/tokenexchange/exchange.go

Coverage Regressions

Lines Coverage ∆ File
61
72.18
0.26% pkg/vmcp/client/client.go
12
75.09
-4.33% pkg/client/config.go
12
67.9
-14.81% pkg/client/discovery.go
8
23.56
0.57% pkg/client/manager.go
4
94.03
0.28% pkg/vmcp/errors.go
2
73.63
-0.64% pkg/runner/config.go
1
86.93
-1.54% pkg/auth/tokenexchange/exchange.go
Jobs
ID Job ID Ran Files Coverage
1 25694465932.1 11 May 2026 08:15PM UTC 725
64.99
GitHub Action Run
Source Files on build 25694465932
  • Tree
  • List 725
  • Changed 10
  • Source Changed 3
  • Coverage Changed 10
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #25694465932
  • 41b2f004 on github
  • Prev Build on main (#25684324467)
  • Next Build on main (#25695101161)
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