Commit 5d8229b
committed
fix(webapp): fold S2 token scope into access-token cache key
The S2 access-token cache key was `${basin}:${streamPrefix}` — purely
server-derived but not aware of the scope/ops the server hardcodes when
minting. After a scope change in code (e.g. #3644 adding `trim` to the
ops list), pre-deploy cached tokens still in Redis/L1 LRU keep getting
returned for up to 24h, surfacing as "Operation not permitted" 403s
on any operation outside the old scope.
Lifting the ops list to a module constant and folding its sorted-join
fingerprint into the cache key makes scope changes self-invalidating —
the next deploy's first call mints fresh tokens under a new key and the
stale entries TTL out without anyone busting Redis.1 parent 2f261e5 commit 5d8229b
2 files changed
Lines changed: 21 additions & 8 deletions
File tree
- .server-changes
- apps/webapp/app/services/realtime
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
Lines changed: 15 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
36 | 46 | | |
37 | 47 | | |
38 | 48 | | |
| |||
564 | 574 | | |
565 | 575 | | |
566 | 576 | | |
567 | | - | |
568 | | - | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
569 | 581 | | |
570 | 582 | | |
571 | 583 | | |
| |||
591 | 603 | | |
592 | 604 | | |
593 | 605 | | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
| 606 | + | |
600 | 607 | | |
601 | 608 | | |
602 | 609 | | |
| |||
0 commit comments