Skip to content

auth(storage): commit operations with OperationAuth atomically #256

Open

Description

@marcus-pousette

Part of #38: persist each operation and its exact OperationAuth together, or persist neither.

Deliver

  • Authorize and sign local operations before commit through auth(web): provide opaque keys and crash-safe auth storage #251, binding the complete operation and exact OwnerGrantId from auth: implement owner grants and operation authorization #255.
  • Commit local and received operations with their verified auth atomically across Memory, native SQLite, and wa-sqlite. Reconciliation and forwarding must never sign an already-committed operation or mint/substitute its authorization.
  • Keep unauthenticated storage explicitly separate from authenticated writes; do not represent the latter with nullable or partial auth.
  • Preserve integrity and original authorization when importing history already accepted by the trusted endpoint. Later expiry/revocation does not undo that acceptance. A signature or claimed authoring time alone does not establish prior acceptance.
  • Define duplicate handling for the complete operation/auth pair. Exact replays are idempotent and stored auth is immutable. Before implementation: choose whether matching operation bytes with different auth are rejected or return the retained pair. auth(sync-server): enforce authenticated full-document sync #243 consumes this rule alongside fix: reject operation ID equivocation atomically #185's operation-content conflict checks.
  • Use one cross-backend conformance suite covering local writes, received history, duplicates/conflicts, injected prepare/authorization/retry/commit/listener failures, reopen, and crash recovery.

#243 owns PostgreSQL server admission and its transaction boundary; PostgreSQL local authoring can reuse this contract. PRs #187 and #192–#196 are source material, not merge candidates: their superseded OpAuth.proofRef model must not be restored.

Done when

Each write commits the complete operation/auth pair or neither. After failure or reopen, no partial operation or orphaned authorization exists, and every accepted operation retains its exact authorization bytes.

Activity

  1. added
    enhancement
    area:sqlite
    area:sync
    area:auth
    area:api
    on Aug 31, 2026
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

    area:apiarea:autharea:sqlitearea:syncenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions