Letting the instance id rotate the cookie let its holder (the cache, or
whoever learns the id) swap in another account's session, which the
owner's logout would not stop. Now mint makes two things: the instance,
and a header store (lib's MapStoreDo, shaped ("cookie", { keyShape:
"cookie", valueShape: M.string() })). The instance id is authority to
use the cookie; the store id, for the account owner, to rotate (PUT
/store/<storeId>/cookie, or WebAppFactory.store) or revoke (DELETE).
Instances read the store's read-only view at every send, via init's new
headerStore.
This replaces the in-instance cookie store and its migration: instances
minted earlier keep their cookie in init.headers, untouched, and simply
cannot rotate. The MapStoreDo class arrives as wrangler migration v2
(additive).
Generated-by: Claude Opus 5.5
17 lines
468 B
JSON
17 lines
468 B
JSON
{
|
|
"$schema": "node_modules/wrangler/config-schema.json",
|
|
"name": "webapp",
|
|
"main": "src/index.ts",
|
|
"compatibility_date": "2026-09-29",
|
|
"observability": { "enabled": true },
|
|
"durable_objects": {
|
|
"bindings": [
|
|
{ "name": "WEBAPP_DO", "class_name": "WebAppDo" },
|
|
{ "name": "MAP_STORE_DO", "class_name": "MapStoreDo" }
|
|
]
|
|
},
|
|
"migrations": [
|
|
{ "tag": "v1", "new_sqlite_classes": ["WebAppDo"] },
|
|
{ "tag": "v2", "new_sqlite_classes": ["MapStoreDo"] }
|
|
]
|
|
} |