-
Notifications
You must be signed in to change notification settings - Fork 0
ADR-006: WebCrypto key recovery with encrypted server backup #182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
icook
wants to merge
5
commits into
master
Choose a base branch
from
docs/180-webcrypto-key-recovery-adr
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
b8aceb4 to
5719237
Compare
Draft ADR documenting the approach for MVP key recovery: - Password-encrypted root key stored on server - Client-side decryption and WebCrypto import as non-extractable - Separation: Rust/WASM for canonicalization, WebCrypto for signing Refs #180 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Comprehensive spec covering: - Dependencies (Rust and JS) - Database schema migration - API endpoints with rate limiting - Encrypted backup binary format - Frontend architecture (Worker, IndexedDB, feature detection) - WASM canonicalization module - 6-phase implementation plan - Testing strategy with E2E examples - Security considerations and CSP - Open questions for team discussion 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
New ADR establishing ZIP215 as canonical Ed25519 verification rules: - All verification must use ZIP215 (eliminates cross-impl divergence) - Browser verification must use WASM, not WebCrypto verify() - Use ed25519-consensus crate for ZIP215 compliance Updates to ADR-006: - Cross-reference ADR-007 - Clarify verification uses WASM only - Update fallback to use WASM module Updates to impl spec: - Replace ed25519-dalek with ed25519-consensus - Expand WASM module to include sign/verify functions - Update WasmFallbackSigner to use WASM module 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Benefits over columns on accounts: - No NULLs on core accounts table (backup is optional) - Clean domain separation - Future extensibility (multiple backup methods, history) - Can relax UNIQUE constraint later for backup versioning Schema includes: - Denormalized kid for join-free recovery lookup - ON DELETE CASCADE for cleanup - UNIQUE constraints for 1:1 MVP relationship 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add encrypted backup storage infrastructure for the key recovery feature: - Create account_backups table migration with FK to accounts, unique constraints on account_id and kid, and CASCADE delete - Implement BackupRepo trait with PgBackupRepo for database operations - Add HTTP handlers for POST/GET/DELETE /auth/backup endpoints - Wire BackupRepo into main.rs as Extension layer - Add 9 integration tests covering CRUD, duplicates, and cascade delete - Update implementation spec with Phase 1 completion status The backup endpoints accept encrypted backup blobs and parse envelope metadata (version, KDF algorithm, salt) for indexing. Authentication for create/delete endpoints is deferred to a later phase. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
5719237 to
1cbc887
Compare
Contributor
📊 CI Reports
🤖 Reports auto-generated from commit 8900d01 |
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.
Summary
Key Decisions
extractable: falseCryptoKeyextractable: falseis footgun reduction, not a security boundary - Prevents accidental export but doesn't protect against XSSOpen Questions (WIP)
Test plan
Closes #180
🤖 Generated with Claude Code