Skip to content

feat: phase 10 data portability#95

Merged
FSM1 merged 16 commits into
mainfrom
feat/phase-10-data-portability
Feb 11, 2026
Merged

feat: phase 10 data portability#95
FSM1 merged 16 commits into
mainfrom
feat/phase-10-data-portability

Conversation

@FSM1

@FSM1 FSM1 commented Feb 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Phase 10: Data Portability — vault export, standalone recovery, and export format documentation
  • Adds vault export API endpoint (POST /vault/export) and VaultExport component on the Settings page
  • Implements standalone recovery.html — a single-file, zero-dependency page that decrypts vault exports using only Web3Auth + Web Crypto
  • Defines the .cipherbox vault export format with full technical specification and test vector generation script
  • Fixes a race condition in StorageQuota where fetchQuota was called before auth was ready

Changes

10-01: Vault Export

  • vault.controller.ts / vault.service.ts — new export endpoint returning encrypted vault metadata
  • VaultExport.tsx — UI component with download trigger on Settings page
  • Regenerated API client types

10-02: Standalone Vault Recovery

  • recovery.html — self-contained recovery tool (no build step, no external deps)
  • Decrypts exported vault using Web3Auth key derivation + AES-256-GCM

10-03: Export Format Documentation

  • docs/VAULT_EXPORT_FORMAT.md — complete technical specification
  • scripts/generate-test-vectors.ts — generates test vectors for format validation

Bug fix

  • Guard fetchQuota call behind auth check to prevent race condition

Test plan

  • Export vault from Settings page and verify .cipherbox file downloads
  • Open recovery.html in a browser, import the export file, authenticate, verify files are listed
  • Run npx tsx scripts/generate-test-vectors.ts to verify test vector generation
  • Verify Settings page renders without errors

🤖 Generated with Claude Code

FSM1 and others added 9 commits February 11, 2026 01:54
Phase 10: Data Portability
- Implementation decisions documented
- Phase boundary established

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 10: Data Portability
- Standard stack identified (no new deps for export, CDN noble-*/fflate for recovery tool)
- Architecture patterns documented (API endpoint, settings UI, standalone HTML recovery)
- eciesjs v0.4.16 binary format verified from installed source (16-byte nonce, specific HKDF params)
- Pitfalls catalogued (ECIES format, HKDF salt/info, AES-GCM tag handling, IPNS gateway)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 10: Data Portability
- 3 plans in 2 waves
- Wave 1: API export + web UI (10-01), standalone recovery HTML (10-02) [parallel]
- Wave 2: Technical documentation with test vectors (10-03)
- Ready for execution

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Create VaultExportDto with format/version/exportedAt fields
- Add getExportData to VaultService with User join
- Add GET /vault/export endpoint to VaultController
- Register User entity in VaultModule
- Regenerate API client with export function

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Create VaultExport component with export button and dialog
- Reuse ConfirmDialog for security warning before export
- Download vault as cipherbox-vault-export.json via Blob URL
- Add terminal-aesthetic CSS for export section
- Integrate VaultExport into SettingsPage below LinkedMethods

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Self-contained recovery tool with embedded CSS and JavaScript
- 4-step guided walkthrough: load export, provide key, configure gateway, recover
- ECIES decrypt matching eciesjs@0.4.16 format (65-byte ephemeral PK, 16-byte nonce, 16-byte tag)
- AES-256-GCM decrypt for folder metadata (12-byte IV, hex+base64 format) and files
- IPNS resolution via public delegated routing with ipfs.io fallback
- Recursive folder traversal with per-file error handling
- Zip download preserving folder structure via fflate
- CDN imports only: @noble/curves, @noble/hashes, fflate
- Dark terminal aesthetic, responsive layout, no CipherBox server dependencies

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tasks completed: 1/1
- Standalone recovery HTML page with ECIES/AES-GCM crypto

SUMMARY: .planning/phases/10-data-portability/10-02-SUMMARY.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tasks completed: 2/2
- API export endpoint and DTO
- Web app VaultExport component on Settings page

SUMMARY: .planning/phases/10-data-portability/10-01-SUMMARY.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@FSM1 FSM1 self-assigned this Feb 11, 2026
@coderabbitai

coderabbitai Bot commented Feb 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/phase-10-data-portability

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

FSM1 and others added 5 commits February 11, 2026 02:36
- Complete specification covering export JSON schema, ECIES binary format,
  AES-256-GCM parameters, encrypted folder metadata format
- Step-by-step recovery procedure with pseudocode
- ECIES byte offsets: ephemeralPK(65) + nonce(16) + tag(16) + ciphertext(N)
- Documents 16-byte AES-GCM nonce in ECIES (non-standard, eciesjs specific)
- HKDF-SHA256 with undefined salt/info matching eciesjs@0.4.16
- IPNS resolution methods for infrastructure-independent recovery
- Security considerations and compatibility notes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 10 verified: 7/7 must-haves pass.
PORT-01, PORT-02, PORT-03 requirements complete.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@FSM1 FSM1 marked this pull request as ready for review February 11, 2026 02:16
The VaultService gained a User repository dependency in phase 10 but
the spec was never updated, causing all 31 existing tests to fail
during module compilation and vault.service.ts coverage to drop to 19%.

Adds the User repository mock to the test module and 5 tests covering
getExportData: social login, external wallet, missing user, missing
vault, and timestamp format.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@FSM1 FSM1 enabled auto-merge (squash) February 11, 2026 02:29
@FSM1 FSM1 merged commit 787d881 into main Feb 11, 2026
6 checks passed
@FSM1 FSM1 deleted the feat/phase-10-data-portability branch February 11, 2026 02:35
@FSM1 FSM1 restored the feat/phase-10-data-portability branch February 11, 2026 03:58
This was referenced Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant