Commit 43a5f15
feat: add authz support for GitHub teams (#4139)
* feat: fetch github teams for oidc groups claim
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
* feat: enable GitHub team membership inclusion in access control groups
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
* feat(auth): paginate org/team groups and tolerate missing read:org scope
- apply the same optional-scope strategy to org lookup: paginate org pages and
treat 403 Forbidden as non-fatal
- keep non-403 org/team API errors as hard failures
- preserve provider-returned casing for org/team-derived group values
- add anonymized debug logging (counts/page metadata only)
- extend tests for org pagination, org 403 optional behavior, team pagination,
team 403 optional behavior, and team 5xx hard-fail behavior
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
* test(auth): align GitHub user info test names and org-forbidden assertion
- rename two Convey blocks so names match the mocked failing API call
- assert org-forbidden case does not include "MyOrg" (real org group) instead
of "testOrg"
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
* test(auth): keep org login casing consistent in paginated teams mock
Use MyOrg consistently across mocked /user/orgs and /user/teams payloads in the
same success scenario, and align expected team-derived group assertions.
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
* test(auth): align ListOrgs-forbidden teams casing with case-sensitive group checks
Use MyOrg in the mocked /user/teams payload for the ListOrgs-forbidden
scenario and assert MyOrg/infra accordingly to keep test casing semantics
consistent.
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
* test(auth): use consistent MyOrg casing in teams-forbidden assertion
Align negative team-group assertion with MyOrg casing used by org mocks and
other case-sensitive authz group checks.
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
* docs(auth): align GitHub teams example casing with login-derived groups
Use consistent org casing in the README example (myorg -> myorg/infra) to
reflect that group strings follow GitHub login values and are not lowercased by
zot.
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
* docs(auth): clarify GitHub group casing is preserved
Document that org/team group strings use GitHub login/slug casing as-is (no
normalization), so policy entries must match exact case.
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
* fix(auth): improve GitHub ListEmails failure logging
Log the underlying error and use an operation-accurate message when
client.Users.ListEmails fails in GetGithubUserInfo.
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
---------
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
Co-authored-by: Kevin Andrews <kevin@nforced.uk>1 parent 55b6822 commit 43a5f15
3 files changed
Lines changed: 267 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
| 418 | + | |
418 | 419 | | |
419 | 420 | | |
420 | 421 | | |
| |||
441 | 442 | | |
442 | 443 | | |
443 | 444 | | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
444 | 468 | | |
445 | 469 | | |
446 | 470 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1061 | 1061 | | |
1062 | 1062 | | |
1063 | 1063 | | |
1064 | | - | |
| 1064 | + | |
1065 | 1065 | | |
1066 | 1066 | | |
1067 | 1067 | | |
| |||
1076 | 1076 | | |
1077 | 1077 | | |
1078 | 1078 | | |
1079 | | - | |
1080 | | - | |
1081 | | - | |
| 1079 | + | |
| 1080 | + | |
1082 | 1081 | | |
1083 | | - | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
1084 | 1120 | | |
1085 | 1121 | | |
1086 | | - | |
1087 | | - | |
1088 | | - | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
1089 | 1158 | | |
1090 | 1159 | | |
| 1160 | + | |
| 1161 | + | |
1091 | 1162 | | |
1092 | 1163 | | |
1093 | 1164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13007 | 13007 | | |
13008 | 13008 | | |
13009 | 13009 | | |
13010 | | - | |
| 13010 | + | |
13011 | 13011 | | |
13012 | | - | |
| 13012 | + | |
| 13013 | + | |
| 13014 | + | |
| 13015 | + | |
| 13016 | + | |
| 13017 | + | |
| 13018 | + | |
| 13019 | + | |
| 13020 | + | |
| 13021 | + | |
| 13022 | + | |
| 13023 | + | |
| 13024 | + | |
| 13025 | + | |
| 13026 | + | |
| 13027 | + | |
| 13028 | + | |
| 13029 | + | |
| 13030 | + | |
| 13031 | + | |
| 13032 | + | |
| 13033 | + | |
| 13034 | + | |
| 13035 | + | |
| 13036 | + | |
| 13037 | + | |
| 13038 | + | |
| 13039 | + | |
| 13040 | + | |
| 13041 | + | |
| 13042 | + | |
| 13043 | + | |
| 13044 | + | |
| 13045 | + | |
| 13046 | + | |
| 13047 | + | |
| 13048 | + | |
| 13049 | + | |
| 13050 | + | |
| 13051 | + | |
| 13052 | + | |
| 13053 | + | |
| 13054 | + | |
| 13055 | + | |
| 13056 | + | |
| 13057 | + | |
| 13058 | + | |
| 13059 | + | |
| 13060 | + | |
| 13061 | + | |
| 13062 | + | |
| 13063 | + | |
| 13064 | + | |
| 13065 | + | |
| 13066 | + | |
| 13067 | + | |
| 13068 | + | |
| 13069 | + | |
| 13070 | + | |
| 13071 | + | |
| 13072 | + | |
| 13073 | + | |
| 13074 | + | |
| 13075 | + | |
| 13076 | + | |
| 13077 | + | |
| 13078 | + | |
| 13079 | + | |
| 13080 | + | |
| 13081 | + | |
| 13082 | + | |
13013 | 13083 | | |
13014 | | - | |
| 13084 | + | |
| 13085 | + | |
13015 | 13086 | | |
13016 | 13087 | | |
13017 | 13088 | | |
| 13089 | + | |
| 13090 | + | |
| 13091 | + | |
| 13092 | + | |
| 13093 | + | |
| 13094 | + | |
| 13095 | + | |
| 13096 | + | |
| 13097 | + | |
| 13098 | + | |
| 13099 | + | |
| 13100 | + | |
| 13101 | + | |
| 13102 | + | |
| 13103 | + | |
| 13104 | + | |
| 13105 | + | |
| 13106 | + | |
| 13107 | + | |
| 13108 | + | |
13018 | 13109 | | |
13019 | 13110 | | |
13020 | 13111 | | |
13021 | 13112 | | |
13022 | | - | |
| 13113 | + | |
13023 | 13114 | | |
| 13115 | + | |
| 13116 | + | |
| 13117 | + | |
13024 | 13118 | | |
13025 | 13119 | | |
13026 | | - | |
| 13120 | + | |
13027 | 13121 | | |
13028 | | - | |
| 13122 | + | |
13029 | 13123 | | |
| 13124 | + | |
| 13125 | + | |
| 13126 | + | |
| 13127 | + | |
| 13128 | + | |
| 13129 | + | |
| 13130 | + | |
| 13131 | + | |
| 13132 | + | |
13030 | 13133 | | |
13031 | 13134 | | |
13032 | 13135 | | |
| |||
13043 | 13146 | | |
13044 | 13147 | | |
13045 | 13148 | | |
13046 | | - | |
| 13149 | + | |
13047 | 13150 | | |
13048 | 13151 | | |
13049 | 13152 | | |
| |||
13054 | 13157 | | |
13055 | 13158 | | |
13056 | 13159 | | |
| 13160 | + | |
| 13161 | + | |
| 13162 | + | |
| 13163 | + | |
| 13164 | + | |
| 13165 | + | |
| 13166 | + | |
| 13167 | + | |
13057 | 13168 | | |
| 13169 | + | |
| 13170 | + | |
| 13171 | + | |
| 13172 | + | |
| 13173 | + | |
| 13174 | + | |
| 13175 | + | |
| 13176 | + | |
| 13177 | + | |
| 13178 | + | |
| 13179 | + | |
| 13180 | + | |
| 13181 | + | |
| 13182 | + | |
| 13183 | + | |
| 13184 | + | |
| 13185 | + | |
| 13186 | + | |
| 13187 | + | |
| 13188 | + | |
| 13189 | + | |
| 13190 | + | |
| 13191 | + | |
| 13192 | + | |
| 13193 | + | |
| 13194 | + | |
| 13195 | + | |
| 13196 | + | |
| 13197 | + | |
| 13198 | + | |
| 13199 | + | |
| 13200 | + | |
| 13201 | + | |
| 13202 | + | |
| 13203 | + | |
13058 | 13204 | | |
| 13205 | + | |
| 13206 | + | |
| 13207 | + | |
| 13208 | + | |
| 13209 | + | |
| 13210 | + | |
| 13211 | + | |
| 13212 | + | |
| 13213 | + | |
| 13214 | + | |
| 13215 | + | |
13059 | 13216 | | |
13060 | 13217 | | |
13061 | 13218 | | |
| |||
0 commit comments