Skip to content

[Request]: Per-record ownership for the store extension and CRUD screen #331

Closed

Description

@jimhoyd

Follow-up to #253 and #262.

Every caller who can reach the store mount sees and edits the whole collection. Before the CRUD screen is shown to more than one user, add per-record ownership (records belong to the authenticated user; other users cannot read or change them), designed with the auth extension. This is security-relevant and needs a design decision before implementation.

Activity

  1. added
    enhancement
    extension
    important
    on Sep 20, 2026
  2. jimhoyd commented on Sep 20, 2026

    @jimhoyd
    CollaboratorAuthor

    Recommendation: treat ownership as a generic extension contract, not a store-specific auth integration. The current ExtensionRequest has no authenticated principal, and store should not read auth cookies or auth tables directly.\n\nFirst define an opaque, validated request identity/capability handoff that an operator-installed auth extension can provide and a store extension can consume only when a collection explicitly declares an ownership policy. Then make the policy scope every list, read, update and delete operation, with tests for cross-user denial and migrations of existing unowned records. Keep unowned shared collections supported for legitimate team or public data, but do not present the CRUD screen as multi-user-safe until this contract exists.

  3. added
    in-progress
    on Sep 20, 2026
  4. jimhoyd commented on Sep 20, 2026

    @jimhoyd
    CollaboratorAuthor

    Progress: an agent has started on this; a PR will be linked here when it opens.

  5. jimhoyd commented on Sep 21, 2026

    @jimhoyd
    CollaboratorAuthor

    Decision: not built. Per-record ownership for the store is not planned. Every caller who can reach a store mount sees and edits the whole collection, so the CRUD screen is for one user or a trusted group, not for separate users.

    No change is made to the core extension contract. The request that reaches a mounted extension carries no user identity today, so ownership would need the generic contract extended, with an opaque principal set by authorize, as the recommendation above describes. That design (and the closed design PR #340) is the starting point if this is ever reopened.

    Follow-up (docs only): docs/STORE.md already says there is no per-user ownership model; state it next to the CRUD screen too, so nobody reads the screen as a multi-user surface.

    Reopen if: someone needs a multi-user CRUD screen.

  6. removed
    in-progress
    on Sep 21, 2026
  7. jimhoyd commented on Sep 25, 2026

    @jimhoyd
    CollaboratorAuthor

    Reopened (owner, 2026-09-25). The reopen condition in the decision above has been met: #529 (a composed forms→store record workflow with confirmation and edit pages) needs records scoped to their owner. Without that, record routes expose any record whose id can be guessed.

    The design starting point is unchanged from the recommendation above and the closed design PR #340:

    • Extend the generic extension contract with an opaque, validated principal that an operator-installed auth extension sets in authorize. Core stays unaware of auth.
    • Store consumes the principal only for collections that explicitly declare an ownership policy, and scopes every list, read, update and delete by it.
    • Unowned shared collections stay supported. Include a migration story for existing unowned records and tests for cross-user denial.
    • Once this lands, the CRUD screen can be described as multi-user-safe only for owned collections.

    Once this lands, #529 can proceed.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementextensionimportant

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions