This repository was archived by the owner on Oct 15, 2026. It is now read-only.
Repository navigation
Encrypted .raftbundle session sharing - #11
Merged
Merged
Conversation
Lets users export a saved session as an end-to-end-encrypted file with a
one-time passphrase, then re-import on another machine. Reuses the
PBKDF2 (600k) + AES-256-GCM primitives from cloud sync, file-shaped
envelope { v, salt, iv, ct, iterations }.
Trust surface: passphrase + bundle travel out-of-band, both halves are
needed to read it. The new safety suite asserts the export/import path
makes zero network calls and round-trips a 50-tab session bit-for-bit.
The <span role="button"> click was bubbling up to the wrapping <label>, which natively forwards activation to the contained file input — so the picker opened once from the explicit onClick and once from the label.
The label-wrapped span was producing two click activations on the underlying file input: one from the explicit onClick and one from the label's native click-forwarding. stopPropagation didn't reliably suppress the second activation. A plain button + ref.click() has a single source of truth and behaves predictably.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
CodeQL flagged the previous `crypto.getRandomValues() % N` pattern: when the 32-bit range isn't an exact multiple of N, low buckets are slightly more likely. unbiasedRandomInt rejects draws in the unfair top slice so the modulo is uniform. Rejection rate is < 1 in ~36M for our inputs.
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
.raftbundlefile. Recipient drops the file into the import panel, enters the passphrase out-of-band, and picks which tabs to bring in.cloudSync/encryption.ts. File-shaped envelope:{ v: 1, salt, iv, ct, iterations }. Zero servers, zero accounts, no auto-encryption — the user explicitly opts in per export.Trust surface
tests/safety/encrypted-bundle.test.ts) asserts export + import make zerofetch/XMLHttpRequest/WebSocketcalls.toEqualto the original.Files
src/shared/importExport/bundle.ts—exportBundle,importBundle, envelope helpers,generateBundlePassphrase(6 words + 4 digits).src/shared/importExport/parsers/raftbundle.ts— async parser entry returning the standardImportResult.src/shared/importExport/{index,types,validators}.ts— register the new format and route bundles past the auto-detect importer.src/options/components/ImportExportPanel.tsx— per-session export action, passphrase modal, decrypt + tab-picker import flow. Also fixes a pre-existing double-fire on the Choose File button.tests/safety/encrypted-bundle.test.ts— 14 tests covering the above.Test plan
pnpm typecheckcleanpnpm lintcleanpnpm test --run(759 / 759 passing).raftbundlerenamed to.jsonstill routes through the passphrase prompt (envelope sniff)Non-goals
https://claude.ai/code/session_01Kv2npptMMD2BV3y7dxjp1X
Generated by Claude Code