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

stacklok / toolhive / 26305298825

22 May 2026 06:33PM UTC coverage: 65.817% (-0.04%) from 65.852%
26305298825

push

github

web-flow
Consolidate authserver DCR types onto pkg/oauthproto (#5372)

* Consolidate authserver DCR types onto pkg/oauthproto

Implements changes for issue #5371:
- Add SoftwareID field to oauthproto.DynamicClientRegistrationRequest
- Delete registration.DCRRequest, registration.DCRResponse, FormatScopes
- Change ValidateDCRRequest to take *oauthproto.DynamicClientRegistrationRequest
- Change ValidateScopes to take []string instead of space-delimited string
- Update handler and tests to use oauthproto types
- Add test covering RFC 7591 array-form scope on /oauth/register

* Tighten DCR response shape and ValidateScopes docs

Addresses stacklok/toolhive#5372 review comments:
- MEDIUM pkg/oauthproto/dcr.go:127-130 (3290391806): drop omitempty on
  redirect_uris, token_endpoint_auth_method, grant_types, response_types
  so the response struct enforces RFC 7591 §3.2.1's always-echo
  requirement at the type level.
- LOW pkg/authserver/server/registration/dcr.go (3290391818): rewrite
  ValidateScopes doc comment to decouple the contract from ScopeList and
  enumerate the load-bearing behaviors (default fallback, unknown-scope
  rejection, RFC 6749 §3.3 dedup).

* Tighten DCR handler test coverage

Addresses stacklok/toolhive#5372 review comments:
- MEDIUM pkg/authserver/server/handlers/dcr_test.go (3290391811): pin the
  RFC 7591 §3.2.1 response wire form via assert.Contains on the raw body
  string ("scope":"openid offline_access"), so a regression to JSON-array
  output cannot hide behind ScopeList's dual-format UnmarshalJSON.
- LOW pkg/authserver/server/handlers/dcr_test.go (3290391825): table-drive
  TestRegisterClientHandler_ScopeAsJSONArray with three cases: happy path,
  array-form unsupported scope (expect 400 invalid_client_metadata), and
  empty array (documented behavior change: previously 400, now 201 with
  DefaultScopes).
- INFO pkg/authserver/server/handlers/dcr_test.go (3290391830): replace
  TestRegisterClientHandler_BaselineClientScopes' requestSc... (continued)

12 of 12 new or added lines in 2 files covered. (100.0%)

37 existing lines in 5 files now uncovered.

65163 of 99006 relevant lines covered (65.82%)

62.4 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

78.17
/pkg/transport/proxy/httpsse/http_proxy.go


Source Not Available

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