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

stacklok / toolhive / 21001866589
59%

Build:
DEFAULT BRANCH: main
Ran 14 Jan 2026 04:37PM UTC
Jobs 1
Files 443
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

14 Jan 2026 04:32PM UTC coverage: 58.658% (+0.2%) from 58.486%
21001866589

push

github

web-flow
Add generic FetchJSON HTTP utility (#3290)

Add type-safe HTTP fetch utilities with functional options pattern for
JSON API requests. Provides FetchJSON for GET requests and
FetchJSONWithForm for POST with form-encoded bodies.

Features:
- Generic type parameter for compile-time type safety
- Automatic Accept header and Content-Type validation
- Response size limiting
- Custom error handlers for domain-specific error parsing
- Secure error messages (uses status text, not response body)

OIDC Discovery:
```go
result, err := networking.FetchJSON[OIDCEndpoints](
    ctx,
    p.httpClient,
    discoveryURL,
    networking.WithErrorHandler(errorHandler),
)
```

OAuth Token Exchange:
```go
result, err := networking.FetchJSONWithForm[tokenResponse](
    ctx,
    p.httpClient,
    endpoint,
    params,
    networking.WithErrorHandler(errorHandler),
)
```

The existing FetchResourceMetadata function in pkg/auth/discovery/discovery.go
has ~60 lines of boilerplate for HTTP/JSON fetching that could be reduced to:

```go
result, err := networking.FetchJSON[auth.RFC9728AuthInfo](ctx, client, metadataURL)
if err != nil {
    return nil, err
}
if result.Data.Resource == "" {
    return nil, fmt.Errorf("metadata missing required 'resource' field")
}
return &result.Data, nil
```

Similar refactoring opportunities exist in:
- pkg/auth/oauth/oidc.go (OIDC discovery)
- pkg/auth/oauth/dynamic_registration.go (DCR responses)

77 of 79 new or added lines in 1 file covered. (97.47%)

517 existing lines in 15 files now uncovered.

34515 of 58841 relevant lines covered (58.66%)

81.85 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
97.47
pkg/networking/fetch.go

Uncovered Existing Lines

Lines Coverage ∆ File
2
67.37
12.63% pkg/secrets/keyring/keyctl_linux.go
2
84.23
-0.28% pkg/vmcp/composer/workflow_engine.go
4
80.0
0.0% pkg/container/docker/errors.go
4
78.26
0.0% pkg/container/runtime/types.go
4
96.64
0.0% pkg/workloads/types/validate.go
8
25.0
-4.44% pkg/client/manager.go
11
65.0
-13.75% pkg/client/discovery.go
14
66.67
-7.91% pkg/client/config.go
15
77.63
0.0% pkg/state/local.go
43
58.33
5.15% pkg/api/v1/groups.go
61
33.8
0.0% pkg/secrets/factory.go
66
0.0
0.0% pkg/api/v1/clients.go
81
33.06
0.0% pkg/runner/retriever/retriever.go
100
34.88
5.89% pkg/api/v1/secrets.go
102
22.19
1.78% pkg/api/v1/workloads.go
Jobs
ID Job ID Ran Files Coverage
1 21001866589.1 14 Jan 2026 04:37PM UTC 443
58.66
GitHub Action Run
Source Files on build 21001866589
  • Tree
  • List 443
  • Changed 17
  • Source Changed 10
  • Coverage Changed 17
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #21001866589
  • 061030d4 on github
  • Prev Build on main (#20998761571)
  • Next Build on main (#21004065865)
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