feat(spaces): app-owned space membership store (#213) #220
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat-spacestore"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
First code step of #211 (ADR 0001). A self-contained, IdP-free store for Cairn-owned spaces.
internal/spacestore:Space{Name, Owner, Members[]}persisted as one JSON object throughinternal/statestore(age-encrypted in the backend on s3, exactly like shares/holds). API:Create,Get,SetMember(write|read, owner always write / not demotable),RemoveMember(owner not removable),Delete, plus query helpersRoleForandSpacesForUserfor the scope integration (#214) andListfor admin. Atomic write-then-commit via a clone (failed persist leaves the cache untouched). No IdP calls — works identically under local/oidc/ldap and any key custody.Tests cover CRUD, role change, owner-demote/remove guards, bad name/role/user, delete-missing,
SpacesForUser, and a persistence round-trip.Not yet wired (that's #214 scope + #216 API); this package stands alone and compiles/tests on its own.