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

stacklok / toolhive / 21251337866
60%

Build:
DEFAULT BRANCH: main
Ran 22 Jan 2026 02:09PM UTC
Jobs 1
Files 459
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

22 Jan 2026 02:02PM UTC coverage: 59.888% (+0.5%) from 59.424%
21251337866

push

github

web-flow
Add authorization and callback handlers for authserver (#3370)

* Add authorization and callback handlers for authserver

This patch implements the OAuth 2.0 authorization code flow handlers for the
authserver.

The authorize handler validates incoming requests via fosite,
generates cryptographic secrets for upstream correlation (state, PKCE
verifier, nonce), stores the pending authorization, and redirects clients to
the upstream identity provider.

The callback handler receives the upstream response, exchanges the
authorization code using the stored PKCE verifier, resolves the user identity
through the UserResolver which maps provider subjects to internal users,
stores the upstream tokens with session binding, and issues our own
authorization code back to the client. Both handlers use fosite's RFC 6749
compliant error responses and properly clean up state on failure.

These handlers integrate into the authserver as the core authentication entry
points, sitting between downstream clients and the upstream identity provider.
They rely on the storage layer for persisting pending authorizations, upstream
tokens, users, and provider identities.

The UserResolver provides identity mapping by maintaining a link between
upstream provider subjects and internal user IDs, enabling a single user to
potentially link multiple provider identities. The handlers connect to the
upstream OAuth2Provider interface which abstracts the specific identity
provider implementation, allowing the authserver to work with different OIDC
providers without handler changes.

* Remove unnecessary logging from authorize handler

Remove two logs that don't align with ToolHive logging guidelines:

- Remove INFO log on successful redirect to upstream IDP. Per logging
  guidelines, successful operations should be silent by default.

- Remove WARN log for missing state parameter. Since PKCE is required
  and provides equivalent CSRF protection per OAuth Security BCP
  Section 4.7.1, the stat... (continued)

281 of 334 new or added lines in 4 files covered. (84.13%)

3 existing lines in 1 file now uncovered.

36833 of 61503 relevant lines covered (59.89%)

79.89 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
14
81.08
pkg/authserver/server/handlers/authorize.go
39
79.9
pkg/authserver/server/handlers/callback.go

Uncovered Existing Lines

Lines Coverage ∆ File
3
81.35
-0.81% pkg/transport/proxy/httpsse/http_proxy.go
Jobs
ID Job ID Ran Files Coverage
1 21251337866.1 22 Jan 2026 02:09PM UTC 459
59.89
GitHub Action Run
Source Files on build 21251337866
  • Tree
  • List 459
  • Changed 4
  • Source Changed 1
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #21251337866
  • ee3a047f on github
  • Prev Build on main (#21249557530)
  • Next Build on main (#21255317209)
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