Repository navigation
Commit 956cfe9
committed
feat(auth): add workspace-scoped authorization (Phase 2)
Implement RFC 0011 Phase 2 authorization enforcement:
- Add proto-level AuthorizationRule annotations on every RPC method
- Replace #[rpc_authz] proc macro with DescriptorPool-based runtime
resolution of per-method auth mode, workspace role, and global role
- Add authorize_workspace() as the single authorization entry point
for all workspace-scoped handlers, enforcing membership and role
- Wire workspace authorization checks into all handler call sites
(sandbox, provider, policy, inference, workspace management)
- Add require_platform_admin() for cross-workspace operations
- Add authorize_sandbox_workspace() for data-plane operations
- Add privilege escalation guard on workspace member role assignment
- Add Keycloak OIDC test infrastructure with admin/user/user-b
identities and audience mappers
- Add comprehensive e2e coverage: Python workspace_authz_test with
~40 parametrized non-member rejection cases, Rust PKCE cross-workspace
isolation tests, and workspace admin scenario tests
Signed-off-by: Derek Carr <decarr@redhat.com>1 parent e9ac0ee commit 956cfe9
36 files changed
Lines changed: 5172 additions & 1097 deletions
File tree
- crates
- openshell-cli
- src
- tests
- openshell-server
- src
- auth
- grpc
- e2e
- python/oidc
- rust
- tests
- support
- proto
- scripts
- tasks
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2026 | 2026 | | |
2027 | 2027 | | |
2028 | 2028 | | |
2029 | | - | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
2030 | 2036 | | |
2031 | 2037 | | |
2032 | 2038 | | |
2033 | | - | |
| 2039 | + | |
2034 | 2040 | | |
2035 | 2041 | | |
2036 | 2042 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
182 | 183 | | |
183 | 184 | | |
184 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
185 | 189 | | |
186 | 190 | | |
187 | 191 | | |
| |||
1208 | 1212 | | |
1209 | 1213 | | |
1210 | 1214 | | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
1211 | 1249 | | |
1212 | 1250 | | |
1213 | 1251 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
| |||
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
65 | 70 | | |
66 | 71 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
| |||
180 | 182 | | |
181 | 183 | | |
182 | 184 | | |
183 | | - | |
| 185 | + | |
184 | 186 | | |
185 | 187 | | |
186 | 188 | | |
187 | 189 | | |
188 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
189 | 196 | | |
190 | 197 | | |
191 | 198 | | |
192 | 199 | | |
193 | 200 | | |
194 | | - | |
195 | | - | |
| 201 | + | |
| 202 | + | |
196 | 203 | | |
197 | 204 | | |
198 | 205 | | |
199 | 206 | | |
200 | 207 | | |
201 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
202 | 230 | | |
203 | 231 | | |
204 | 232 | | |
| |||
253 | 281 | | |
254 | 282 | | |
255 | 283 | | |
256 | | - | |
| 284 | + | |
257 | 285 | | |
258 | 286 | | |
259 | 287 | | |
| |||
408 | 436 | | |
409 | 437 | | |
410 | 438 | | |
411 | | - | |
| 439 | + | |
412 | 440 | | |
413 | 441 | | |
414 | 442 | | |
| |||
417 | 445 | | |
418 | 446 | | |
419 | 447 | | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
430 | 466 | | |
| 467 | + | |
431 | 468 | | |
432 | 469 | | |
433 | 470 | | |
| |||
438 | 475 | | |
439 | 476 | | |
440 | 477 | | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | 478 | | |
452 | 479 | | |
453 | 480 | | |
| |||
493 | 520 | | |
494 | 521 | | |
495 | 522 | | |
496 | | - | |
| 523 | + | |
497 | 524 | | |
498 | 525 | | |
499 | 526 | | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
500 | 533 | | |
501 | 534 | | |
502 | 535 | | |
| |||
507 | 540 | | |
508 | 541 | | |
509 | 542 | | |
510 | | - | |
| 543 | + | |
511 | 544 | | |
512 | 545 | | |
513 | 546 | | |
| |||
0 commit comments