Commit 711e323
committed
Auto merge of #11661 - arlosi:no-error-for-auth-required, r=Eh2406
Do not error for `auth-required: true` without `-Z sparse-registry`
Registries that include `auth-required: true` in their `config.json` currently hit the following error on stable:
```
authenticated registries require `-Z registry-auth`
```
This situation makes it difficult for a registry to optionally offer the `auth-required: true` feature, since it forces users on to the nightly toolchain.
This PR changes the behavior to ignore the `auth-required: true` field of `config.json` without `-Z registry-auth`.
The downside to this change is that it makes it harder to discover why a registry isn't working, since the user will get an HTTP 401 error from the server, rather than a message from Cargo suggesting adding `-Z registry-auth`.
r? `@Eh2406`File tree
3 files changed
+30
-18
lines changed- src/cargo/sources/registry
- tests/testsuite
3 files changed
+30
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | 337 | | |
345 | 338 | | |
346 | 339 | | |
| |||
486 | 479 | | |
487 | 480 | | |
488 | 481 | | |
489 | | - | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
490 | 485 | | |
491 | 486 | | |
492 | 487 | | |
| |||
542 | 537 | | |
543 | 538 | | |
544 | 539 | | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
545 | 544 | | |
546 | 545 | | |
547 | 546 | | |
| |||
587 | 586 | | |
588 | 587 | | |
589 | 588 | | |
590 | | - | |
591 | 589 | | |
592 | 590 | | |
593 | 591 | | |
| |||
660 | 658 | | |
661 | 659 | | |
662 | 660 | | |
663 | | - | |
664 | | - | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
665 | 665 | | |
666 | 666 | | |
667 | 667 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
253 | 251 | | |
254 | 252 | | |
255 | 253 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
50 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
51 | 65 | | |
52 | 66 | | |
53 | 67 | | |
| |||
0 commit comments