Repository navigation
Store membership gates and cross-owner reads; the #843 proof runs on store (#863) - #865
Merged
Merged
Conversation
…uns on store (#863) A collection declared `membership: true` lists principal ids, has no HTTP surface and is maintained by operator functions (addMember/removeMember/ listMembers) or trusted StoreExports. Transitions may require `members:`, and an owned collection may give members a read-only `readers` mount across owners. Principal and membership are checked before any record is read, so a non-member gets one 403 for existing and missing ids alike. The private-requests proof now uses store transitions and membership instead of its own SQLite code: 127 lines of application server code removed, none added. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
enabled auto-merge (squash)
September 28, 2026 21:50
This was referenced Sep 28, 2026
Merged
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #863 item 1 and completes the proof conversion that #835 asked for: "replace the ad hoc SQL rather than grow it". Permissions stay application data keyed by the auth user id, and auth gets no roles.
Design (docs/STORE.md: "Membership gates and cross-owner reads")
membership: trueplus akeymakes one record per member; key values must be valid principal ids.addMember,removeMemberandlistMembers, or trusted code withStoreExports.transitions.<name>.members: reviewers.403 membership_required), then the retry key, then the record.by: othersstill refuses the owner, even when the owner is a member.readers: {mount, members}on an owned collection gives members read-only list and get across owners, with the existing filters, sort and cursors.members,readerson a shared collection, unguarded or conflicting mounts, and incompatible options on a membership collection.Proof conversion (
proofs/private-requests)app/lib/requests.mjsand all five functions, 127 lines of application server code, 0 added. The app database binding and its grant are also gone./api/meis replaced by Better Auth'sget-session.ownerIdis no longer returned.Evidence (macOS, Node 26)
npm run verifypasses end to end on the branch rebased onto main.test:addons6,test:proof12,test:packagepassing.membership.test.ts(6 tests):Follow-ups
Filed separately:
urlcode-store membersCLIreassigndoes not rewrite membership keys🤖 Generated with Claude Code