Commit c7cbc92
committed
Close what the second CLI review found
A repository request that triggered inline device auth retried with the
API key set, and repository requests read repo_key, so the retry went
out unauthenticated and 401ed again. It re-resolves repository auth
after authenticating. with_repo also executed once and never acted on a
401 from a token it had already resolved, so a token the server rejects
as expired was never refreshed or re-exchanged; it retries once with
renewed credentials.
A transport failure during a refresh was reported as an expired session
and dropped the stored token, so a DNS blip printed that the session had
expired and downgraded the rest of the run to anonymous. Only a refusal
from the server clears the token now.
with_repo documented auth_inline as defaulting to false and then took
true on the 401 path, so a private package could open an interactive
device flow against the caller's stated default.
One transport error while polling ended a device authorization the user
was minutes into. Polling continues until the device code expires.
A malformed verification URI crashed the CLI, because the URL check
threw where its caller expected a return value.
The refresh token sentinel had two owners: an absent one was undefined
in one place and absent in another, and undefined reached persistence,
where Elixir stored it as a refresh token. The grant is normalized once.
has_refresh_token was derived three ways in one module, and the source
member of the auth context was written on eight paths and read nowhere.1 parent eb5508a commit c7cbc92
5 files changed
Lines changed: 528 additions & 137 deletions
File tree
- src
- test
- support
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
186 | | - | |
187 | | - | |
| 185 | + | |
188 | 186 | | |
189 | | - | |
190 | | - | |
| 187 | + | |
191 | 188 | | |
192 | | - | |
| 189 | + | |
| 190 | + | |
193 | 191 | | |
194 | 192 | | |
195 | 193 | | |
| |||
203 | 201 | | |
204 | 202 | | |
205 | 203 | | |
206 | | - | |
207 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
208 | 210 | | |
209 | 211 | | |
210 | 212 | | |
| |||
391 | 393 | | |
392 | 394 | | |
393 | 395 | | |
394 | | - | |
395 | | - | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
396 | 399 | | |
397 | | - | |
398 | | - | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
399 | 409 | | |
400 | 410 | | |
401 | 411 | | |
402 | | - | |
| 412 | + | |
403 | 413 | | |
404 | | - | |
| 414 | + | |
405 | 415 | | |
406 | | - | |
| 416 | + | |
407 | 417 | | |
408 | 418 | | |
409 | 419 | | |
| |||
414 | 424 | | |
415 | 425 | | |
416 | 426 | | |
417 | | - | |
418 | | - | |
419 | | - | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
420 | 430 | | |
421 | | - | |
422 | | - | |
423 | | - | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
424 | 434 | | |
425 | 435 | | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
426 | 444 | | |
427 | 445 | | |
428 | 446 | | |
| |||
0 commit comments