Commit 633ed9e
committed
Address code review feedback
Fixed issues from review of df84256 (Extract DCR resolver into
pkg/auth/dcr) for issue #5145 sub-issue 4a:
- HIGH: Stale identifier references in buildUpstreamConfigs doc comment
in pkg/authserver/runner/embeddedauthserver.go named the pre-rename
symbols (consumeResolution, applyResolutionToOAuth2Config,
resolveDCRCredentials, logDCRStepError). Updated the comment to use
the new public names (dcr.ConsumeResolution,
dcr.ApplyResolutionToOAuth2Config, dcr.ResolveCredentials,
dcr.LogStepError). Re-grepped the runner package; no other survivors.
- HIGH: pkg/auth/dcr's package doc claimed "profile-agnostic" while the
public API takes embedded-authserver types directly. Revised the
package doc comment in pkg/auth/dcr/resolver.go to call out the
current coupling explicitly and labelled the profile-agnostic framing
as a target state for sub-issue 4b rather than the current API shape.
Designing a profile-neutral input type with only one consumer in hand
would be speculative; the right design moment is when 4b lands the
CLI flow as the second consumer.
- MEDIUM: DCRStore() accessor doc comment in
pkg/authserver/runner/embeddedauthserver.go referenced the dropped
"runner-DCRCredentialStore adapter" name. Replaced with
"dcr.CredentialStore adapter".
- MEDIUM: resolveSecret is duplicated across pkg/authserver/runner
and pkg/auth/dcr. Added a parallel TestResolveSecret /
TestResolveSecretWithEnvVar suite in pkg/auth/dcr/secret_test.go
that mirrors the runner-package twin's observable contract, so any
future drift between the two copies will fail one of the two tests
at CI time. Lifting into a shared helper is deferred until 4b lands
a third call site.
- MEDIUM: Process-global singleflight was undocumented at the package
surface. Added a "Concurrency" section to the package doc comment
in pkg/auth/dcr/resolver.go. Extended the dcrFlight var doc with a
cross-consumer caveat that names the "third consumer with colliding
redirect URI" failure mode. Extracted the flight-key construction
into a new flightKeyOf(Key) string helper so the canonical key shape
is inspectable rather than buried in a string-concatenation literal.
- MEDIUM: endpointsFromMetadata dereferenced metadata without a
defensive nil check. Added the guard immediately after the fetchErr
check in pkg/auth/dcr/resolver.go::endpointsFromMetadata with an
error message that names the cross-package contract being defended.
Documented the oauthproto contract on the function's doc comment so
the assumption is visible at the call site.
Verified via task lint-fix (0 issues), task license-check (clean),
and go test -count=1 -race ./pkg/auth/dcr/... ./pkg/authserver/...
(all pass).1 parent df84256 commit 633ed9e
3 files changed
Lines changed: 190 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
17 | 41 | | |
18 | 42 | | |
19 | 43 | | |
| |||
62 | 86 | | |
63 | 87 | | |
64 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
65 | 100 | | |
66 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
67 | 113 | | |
68 | 114 | | |
69 | 115 | | |
| |||
369 | 415 | | |
370 | 416 | | |
371 | 417 | | |
372 | | - | |
373 | | - | |
374 | | - | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
375 | 421 | | |
376 | 422 | | |
377 | 423 | | |
| |||
381 | 427 | | |
382 | 428 | | |
383 | 429 | | |
384 | | - | |
385 | | - | |
| 430 | + | |
386 | 431 | | |
387 | 432 | | |
388 | 433 | | |
| |||
948 | 993 | | |
949 | 994 | | |
950 | 995 | | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
951 | 1005 | | |
952 | 1006 | | |
953 | 1007 | | |
| |||
956 | 1010 | | |
957 | 1011 | | |
958 | 1012 | | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
959 | 1018 | | |
960 | 1019 | | |
961 | 1020 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
225 | | - | |
| 224 | + | |
| 225 | + | |
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | | - | |
| 355 | + | |
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
362 | | - | |
| 361 | + | |
| 362 | + | |
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
| |||
0 commit comments