Commit 9fc3dfb
authored
fix(remote): guard GetCredentialFunc against nil store (#1184)
## Summary
A `nil` `credentials.Store` passed to `GetCredentialFunc` would cause a
deferred panic inside the returned closure at authentication time,
making it hard to diagnose. This PR adds an early nil check that returns
a no-op `CredentialFunc` yielding `EmptyCredential` when `store` is
`nil`, matching the documented semantics.
Also fixes a small typo in the `buildRepositoryBlobMountURL` doc comment
(missing space).
Split out from #1115 — the other half (Ingest temp-file cleanup) is in a
separate PR.
## Test plan
- [x] Added `TestGetCredentialFunc_NilStore` to verify nil store returns
`EmptyCredential` without error
- [x] Unit tests pass (`make test`)
---------
Signed-off-by: Terry Howe <terrylhowe@gmail.com>1 parent d04d858 commit 9fc3dfb
3 files changed
Lines changed: 20 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
72 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
73 | 80 | | |
74 | 81 | | |
75 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
208 | 219 | | |
209 | 220 | | |
210 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
0 commit comments