Skip to content

Commit a3f08d9

Browse files
Brooooooklynclaude
andcommitted
Cover floor 2 in proxy token state table and rewrap proxy README
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 0de615d commit a3f08d9

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎platform/packages/api/test/unit/proxy-token.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ describe('state table', () => {
160160
{ raw: null, accepted: [0, 1, 5], rejected: [], send: [0], issue: 0 },
161161
{ raw: '{"gen":0}', accepted: [0, 1, 5], rejected: [], send: [0], issue: 0 },
162162
{ raw: '{"gen":1}', accepted: [1, 2], rejected: [0], send: [1, 0], issue: 1 },
163+
{ raw: '{"gen":2}', accepted: [2, 3], rejected: [0, 1], send: [2, 1], issue: 2 },
163164
{ raw: '{"gen":3}', accepted: [3, 4], rejected: [0, 1, 2], send: [3, 2], issue: 3 },
164165
])('floor $raw', async ({ raw, accepted, rejected, send, issue }) => {
165166
const { routing } = kvStub(raw === null ? {} : { [proxyTokenStateKey(PROJECT)]: raw });

‎platform/packages/proxy/README.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,10 @@ The ROUTING key `proxy-token:{projectId}` holds the project's accept floor,
5757
least `N`. A missing key means floor 0, so the legacy token is accepted. The
5858
`projectId` must be a generated project id, and the MAC is checked before the
5959
floor is read, so an invalid token never reads KV. A floor that cannot be read
60-
or does not parse fails closed with 503 `project token state unavailable`. Each isolate caches a floor for 15 seconds
61-
and reads KV with `cacheTtl: 30`, so with KV propagation a raised floor rejects
62-
older tokens everywhere within about 105 seconds.
60+
or does not parse fails closed with 503 `project token state unavailable`. Each
61+
isolate caches a floor for 15 seconds and reads KV with `cacheTtl: 30`, so with
62+
KV propagation a raised floor rejects older tokens everywhere within about 105
63+
seconds.
6364

6465
Service-binding auth and `/email/verify-receipt` use this check. `/revalidate`
6566
forwards the token, and the API checks it against the same floor.

0 commit comments

Comments
 (0)