From d8380f4a498bbf535026e8e84173abe559f19e89 Mon Sep 17 00:00:00 2001 From: Juan Castro Date: Wed, 12 Aug 2026 16:00:47 -0400 Subject: [PATCH] feat(permissions): replicate permission invalidations across regions --- src/backend/clients/event/types.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/backend/clients/event/types.ts b/src/backend/clients/event/types.ts index 812b8472e..530a2966b 100644 --- a/src/backend/clients/event/types.ts +++ b/src/backend/clients/event/types.ts @@ -344,6 +344,23 @@ export type EventMap = { data?: unknown; ttlSeconds?: number; }; + /** + * An actor's permission cache generation was bumped, so peer regions must + * bump their own — the counter is per-cluster, so a local bump says nothing + * to them. Carries the actor, not the value: the number only has to + * change. + */ + 'outer.permission.generationBumped': { actorUid: string }; + /** + * A flat permission entry was deleted. Grant-path flat entries carry no + * expiry, so without this a revoke never lands in a peer region whose KV + * table isn't replicated. Revoke-only: a grant that fails to replicate just + * denies there, which is the safe direction. + */ + 'outer.permission.flatInvalidated': { + holderUserId: number; + permission: string; + }; 'outer.fs.write-hash': { hash: string; uuid: string }; /** * Cache keys the KV read cache must stop serving, because the entries