Commit da70907
authored
[CRCR] Add multi-issuer OIDC support to jwt_helper for Buildkite (#8453)
## Summary
Adds multi-issuer OIDC support to the CRCR relay, enabling downstream
repos running on **any supported CI platform** (currently GitHub Actions
+ Buildkite) to authenticate callbacks.
### Architecture
```
ci_providers.yml (in test-infra) allowlist.yml (in pytorch/pytorch)
┌─────────────────────┐ ┌─────────────────┐
│ buildkite: │ │ L1: [...] │
│ vllm/ci: vllm/vllm│ │ L2: [...] │
│ # gitlab: │ │ L3: {device: ..} │
│ # grp/proj: o/r │ │ L4: [...] │
└────────┬────────────┘ └────────┬────────┘
│ CI_PROVIDERS_URL │ ALLOWLIST_URL
▼ ▼
┌─────────────────────────────────────────────────────────┐
│ CRCR Lambda │
│ jwt_helper.py → verify OIDC token (any issuer) │
│ allowlist.py → check repo trust level │
│ lambda_function → orchestrate │
└─────────────────────────────────────────────────────────┘
```
### Changes
| File | What |
|------|------|
| `config/ci_providers.yml` | **New** — external CI provider
pipeline-to-repo mapping, extensible per provider |
| `utils/jwt_helper.py` | Multi-issuer OIDC: detect issuer → select JWKS
→ extract repo. Loads mappings from `ci_providers.yml` via URL + Redis
cache |
| `utils/config.py` | Add optional `ci_providers_url` field |
| `utils/redis_helper.py` | Add `get_cached_ci_providers` /
`set_cached_ci_providers` with separate Redis key |
| `callback/lambda_function.py` | Call `load_ci_providers(config)`
before token verification |
| `utils/allowlist.py` | Unchanged (reverted) |
| `tests/test_jwt_helper.py` | Expanded from 5 → 17 tests |
### Onboarding a new Buildkite repo
Edit `config/ci_providers.yml` — no Lambda redeployment needed:
```yaml
buildkite:
vllm/ci: vllm-project/vllm
acme/build: acme/repo
```
### Onboarding a new CI provider (future)
1. Add the provider's JWKS endpoint to `_ISSUER_CONFIG` in
`jwt_helper.py`
2. Add an `_extract_repo_<provider>` function
3. Add a section reader in `load_ci_provider_mappings`
4. Add the provider section to `ci_providers.yml`
Closes #8326
## Test plan
- [x] All 17 unit tests pass locally
- [ ] CI passes (lintrunner, python-tests)
- [ ] Set `CI_PROVIDERS_URL` env var and deploy to staging
- [ ] Verify with a test Buildkite OIDC token1 parent 5f99905 commit da70907
7 files changed
Lines changed: 611 additions & 51 deletions
File tree
- aws/lambda/cross_repo_ci_relay
- callback
- config
- tests
- utils
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
Lines changed: 10 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | | - | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | | - | |
| 61 | + | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| 68 | + | |
66 | 69 | | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
70 | | - | |
| 73 | + | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
| |||
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
| 89 | + | |
86 | 90 | | |
87 | 91 | | |
88 | 92 | | |
89 | 93 | | |
90 | | - | |
| 94 | + | |
91 | 95 | | |
92 | | - | |
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
| |||
98 | 101 | | |
99 | 102 | | |
100 | 103 | | |
| 104 | + | |
101 | 105 | | |
102 | 106 | | |
103 | 107 | | |
104 | 108 | | |
105 | | - | |
| 109 | + | |
106 | 110 | | |
107 | 111 | | |
108 | 112 | | |
| |||
0 commit comments