Commit e360c9e
fix(auth): resolve the OIDC-gate session hook-order-independently (D5.1) (#2345)
The oidcAuthorizeGate before-hook resolved the subject only via getSessionFromCtx,
which can return null in a global before-hook for a bearer (or non-default-cookie)
request — the bearer plugin may convert Authorization -> session AFTER this hook
runs, leaving gateUserId undefined so the gate was skipped (fail-open). Add an
explicit token resolution (bearer, or the session cookie's token part) + a
sys_session lookup, independent of plugin hook order.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent dc35cc2 commit e360c9e
1 file changed
Lines changed: 30 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
527 | 527 | | |
528 | 528 | | |
529 | 529 | | |
| 530 | + | |
530 | 531 | | |
531 | 532 | | |
532 | 533 | | |
533 | 534 | | |
534 | | - | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
535 | 564 | | |
536 | 565 | | |
537 | 566 | | |
| |||
0 commit comments