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

stacklok / toolhive / 25745160312

12 May 2026 03:39PM UTC coverage: 65.169% (+0.003%) from 65.166%
25745160312

push

github

web-flow
Extract DCR resolver into pkg/auth/dcr (#5198)

* Extract DCR resolver into pkg/auth/dcr

Sub-issue 4a of #5145. Creates the shared pkg/auth/dcr package and
migrates the embedded authserver to consume it. The CLI flow
migration (pkg/auth/discovery::PerformOAuthFlow) is left to
sub-issue 4b (#5219) so this slice stays under the project's
PR-size limit.

Files moved (renamed via git mv so the diff shows as renames, not
deletions + additions):

  pkg/authserver/runner/dcr.go              -> pkg/auth/dcr/resolver.go
  pkg/authserver/runner/dcr_store.go        -> pkg/auth/dcr/store.go
  pkg/authserver/runner/dcr_test.go         -> pkg/auth/dcr/resolver_test.go
  pkg/authserver/runner/dcr_store_test.go   -> pkg/auth/dcr/store_test.go
  pkg/authserver/runner/dcr_testhelpers_test.go -> pkg/auth/dcr/testhelpers_test.go

Public API surface (renamed from runner-package internals because
they now cross a package boundary):

  Resolution            (was DCRResolution)
  Key                   (was DCRKey, alias to storage.DCRKey unchanged)
  CredentialStore       (was the package-private dcrResolutionCache)
  ResolveCredentials    (was resolveDCRCredentials)
  NeedsDCR              (was needsDCR)
  ConsumeResolution     (was consumeResolution)
  ApplyResolutionToOAuth2Config (was applyResolutionToOAuth2Config)
  LogStepError          (was logDCRStepError)
  NewInMemoryStore      (new convenience constructor wrapping
                         storage.NewMemoryStorage; mirrors the pattern
                         the per-test newMemoryDCRStore helpers use)
  NewStorageBackedStore (was the package-private newStorageBackedStore)
  SanitizeErrorForLog   (was sanitizeErrorForLog; promoted to
                         exported because the deferred-cleanup log
                         path in pkg/authserver/runner needs it)

Names follow the pkg/auth/dcr.* form so the linter's stuttering
check (revive: dcr.DCRResolution would stutter) passes and the
surface reads as ordinary... (continued)

62 of 73 new or added lines in 3 files covered. (84.93%)

2 existing lines in 1 file now uncovered.

64292 of 98654 relevant lines covered (65.17%)

62.6 hits per line

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

89.11
/pkg/authserver/runner/embeddedauthserver.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