Commit 457dfab
committed
feat(edge): org-membership — every membership write and privileged read now requires the actor's signature
Adds apps/expo/supabase/functions/org-membership/index.ts as the sole
write path for org membership once 20260801_account_membership_lockdown.sql
applies: create/revoke/accept/decline invites, leave, remove_member,
update_account, plus the three plan-amended actions (create_account,
list_invites, has_pending_invite) that replace the withdrawn RPCs.
Every request is a signed message verified via EOA recovery falling
back to ERC-1271/6492 (viem, mirroring delete-user-account's proven
shape) before any authorization or write runs — the verified signer,
never a payload wallet, drives every check. hashPayload mirrors
apps/web/src/lib/org-membership/message.ts byte-for-byte (ordinal key
sort, not localeCompare).
Extends OrgAction in message.ts with the three amended actions.1 parent 49fc490 commit 457dfab
2 files changed
Lines changed: 713 additions & 1 deletion
0 commit comments