Commit dcf859a
Agent
Add OIDC authentication to integration tests
Deploys Dex (OIDC provider) and GLAuth (LDAP) alongside CTS in the
EaaS pipeline and exercises the full mod_auth_openidc → load_openidc_user
→ get_user_info → query_ldap_groups → has_role auth stack end-to-end.
Pipeline changes (.tekton/integration-test-eaas.yaml):
- New deploy-glauth task (parallel with deploy-dex, after
provision-environment): creates a ConfigMap with a GLAuth config
defining two users (builder/readonly) and one group (cts-builders),
then deploys GLAuth on port 3893.
- New deploy-dex task (parallel with deploy-glauth): creates a ConfigMap
with a Dex config using the password connector and a static OAuth2
client (cts-integration), then deploys Dex on port 5556.
- Updated deploy-cts: runAfter now includes deploy-glauth and deploy-dex.
The cts-config ConfigMap sets AUTH_BACKEND=openidc,
AUTH_OPENIDC_USERINFO_URI, AUTH_LDAP_SERVER, AUTH_LDAP_GROUPS, ADMINS,
and ALLOWED_BUILDERS. The httpd.conf uses AuthType openid-connect with
OIDCProviderMetadataURL pointing at Dex's discovery document.
OIDCSSLValidateServer Off and OIDCOAuthSSLValidateServer Off permit
the HTTP-only Dex endpoint. Bearer token validation uses
OIDCOAuthVerifyJwksUri pointing at Dex's JWKS endpoint (http://dex:5556/keys),
which validates tokens as JWTs locally and populates OIDC_access_token
and OIDC_CLAIM_* in the WSGI environ — variables required by
load_openidc_user. The <RequireAny> block allows unauthenticated GET
requests while requiring a valid Bearer token for writes.
- Updated run-tests: installs requests alongside pytest and passes
AUTH_BACKEND=openidc so the auth tests are not skipped.
Test changes (tests/test_integration_api.py):
- AuthHTTPClient: HTTPClient subclass that injects Authorization: Bearer
on every request.
- _get_oidc_token(): obtains a real access token from Dex via the ROPC
grant.
- write_http_client fixture: returns an AuthHTTPClient (builder token)
under OIDC or a plain HTTPClient in noauth mode; used by the five
pre-existing workflow tests so they continue to pass in both modes.
- Four new test functions (skipped when AUTH_BACKEND != openidc):
test_auth_unauthenticated_write_returns_401,
test_auth_builder_can_post_compose,
test_auth_unauthorized_user_returns_403,
test_auth_get_endpoints_accessible_without_token.
Generated-By: OpenCode (google-vertex-anthropic/claude-sonnet-4-6@default)1 parent 6552ee2 commit dcf859a
2 files changed
Lines changed: 537 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
80 | 367 | | |
81 | 368 | | |
82 | 369 | | |
| |||
215 | 502 | | |
216 | 503 | | |
217 | 504 | | |
| 505 | + | |
| 506 | + | |
218 | 507 | | |
219 | 508 | | |
220 | 509 | | |
| |||
241 | 530 | | |
242 | 531 | | |
243 | 532 | | |
244 | | - | |
| 533 | + | |
245 | 534 | | |
246 | 535 | | |
247 | 536 | | |
| |||
251 | 540 | | |
252 | 541 | | |
253 | 542 | | |
254 | | - | |
| 543 | + | |
255 | 544 | | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
256 | 553 | | |
257 | 554 | | |
258 | 555 | | |
| |||
268 | 565 | | |
269 | 566 | | |
270 | 567 | | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
271 | 578 | | |
272 | 579 | | |
273 | 580 | | |
274 | 581 | | |
275 | 582 | | |
276 | 583 | | |
277 | 584 | | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
278 | 593 | | |
279 | | - | |
| 594 | + | |
280 | 595 | | |
281 | 596 | | |
282 | 597 | | |
| |||
478 | 793 | | |
479 | 794 | | |
480 | 795 | | |
481 | | - | |
| 796 | + | |
482 | 797 | | |
483 | | - | |
| 798 | + | |
484 | 799 | | |
485 | 800 | | |
486 | 801 | | |
| |||
492 | 807 | | |
493 | 808 | | |
494 | 809 | | |
495 | | - | |
| 810 | + | |
496 | 811 | | |
497 | 812 | | |
498 | 813 | | |
| |||
0 commit comments