Commit b49f42e
committed
[registry] Accept empty scope during token auth challenge
The distribution spec (https://distribution.github.io/distribution/spec/auth/scope/#authorization-server-use) mentions that the access token provided during auth challenge "may include a scope" which means that it's not necessary to have one either to comply with the spec.
Additionally, this is something that is already accepted by containerd which will simply log a warning when no scope is specified: https://github.com/containerd/containerd/blob/main/core/remotes/docker/auth/fetch.go#L64
To match with what containerd and the spec suggest, the commit modifies the `parse_auth` logic to accept and empty `scope` field. It also logs the same warning as containerd.1 parent e1dffec commit b49f42e
1 file changed
Lines changed: 23 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
| 440 | + | |
444 | 441 | | |
445 | 442 | | |
446 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
447 | 451 | | |
448 | 452 | | |
449 | 453 | | |
450 | | - | |
| 454 | + | |
451 | 455 | | |
452 | 456 | | |
453 | 457 | | |
| |||
1115 | 1119 | | |
1116 | 1120 | | |
1117 | 1121 | | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
1118 | 1135 | | |
1119 | 1136 | | |
1120 | 1137 | | |
1121 | 1138 | | |
1122 | 1139 | | |
1123 | | - | |
| 1140 | + | |
1124 | 1141 | | |
1125 | 1142 | | |
1126 | 1143 | | |
| |||
0 commit comments