Repository navigation
Enforce complete, versioned master key rotation - #24
pantharshit007 wants to merge 1 commit into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
pantharshit007
left a comment
There was a problem hiding this comment.
Independent sub-agent review of ce857b9: no actionable findings.
Reviewed the issue #19 acceptance criteria against transaction validation, initial setup restrictions, master-key and recovery-ciphertext write paths, frontend snapshot handling, and project-creation revision capture. The complete-project checks, unchanged salts, and revision guards cover stale rotations and both orderings of the creation/rotation race.
Validation: the reviewer independently ran bun test test/master-key-rotation.test.ts — 16 tests passed, 0 failed, 46 assertions.
Review scope: source inspection and local Convex tests; no deployed or authenticated browser validation. No inline comments were added because the review identified no concrete bugs.
Master key rotation could accept an incomplete project list or changed project salts, leaving recovery data incompatible with the new key. Rotation now validates the current master key revision, exactly one update per owned project, unchanged salts, and the previous recovery ciphertext before atomically saving all rewraps and advancing the revision.
Settings reads a consistent rotation snapshot and re-verifies the current key before encryption. Empty rotations use the same mutation; direct master key writes are restricted to initial setup without projects. Project creation checks the revision used for encryption, closing the opposite race where a stale creation arrives after rotation. Legacy configurations start at revision zero.
Adds Convex mutation regression tests and a real crypto round trip covering recovery and variable decryption. Bumps the package to 0.0.19 and documents the concurrency constraints.
Validation:
bun test: 19 passing tests, including simultaneous rotations, creation race orderings, malformed/stale snapshots, unchanged data after rejection, and recovery after rotation.bun run tsc: passed (adds the missingbun-typesdevelopment dependency already referenced by tsconfig).bun run build: passed.bun run check: blocked by existing formatting issues in 51 repository files.The new mutation arguments are required: stale clients fail safely and must refresh. No production deployment or authenticated browser session was used; backend tests run with convex-test.
Closes #19