Repository navigation
The encrypted export holds each entry's earlier secrets, and importing it brings them back - #222
Merged
Merged
Conversation
…g it brings them back
… says whose; earlier files keep their names; imports count earlier secrets
bashhack
force-pushed
the
export-history
branch
from
October 21, 2026 02:41
82ba4b3 to
134f0c3
Compare
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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 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.
Stacked on #221 (it retargets to main once that merges).
Backups keep an entry's earlier secrets (its history), and so does sync; the encrypted export, the way to move a vault by hand, dropped them. Now it doesn't:
Earlier(k, reading)is an entry's earlier secrets, the newest first, with when each was replaced; each read is recorded in the audit log ("History: version N, to export"), as reading an earlier secret is.ExportEntrygainshistory(replaced_at,secret, encoded as the entry's secret is: base64 for a file). Only the encrypted export fills it (ExportOptions.History); JSON and CSV leave earlier secrets out, so a plain export exposes no more than the current secrets.seshexport.Entriesgives them to the importer asEarlier, whichSaveImportedalready keeps (withinhistory.keep), as for Bitwarden and KeePass. An earlier secret that won't decode skips the entry, saying why.historyis optional: v0.1.1's exports have none and import as before (internal/compat's v0.1.1 export, now read through the same pathsesh importuses), and v0.1.1 reading a new export ignores the field (its decoder takes unknown fields) and imports the current secrets, rather than refusing the file. Once this ships, its release addsinternal/compat/testdata/<version>/with an export that has history, as AGENTS.md says.TestImport_SeshKeepsHistory): a password's two earlier secrets and a file's binary earlier content come back, with their times; a plain JSON export holds none.seshexportdecodes history, a file's from base64, and skips an entry whose history won't decode. Each of these fails with its part undone: no history in the encrypted export, file history not base64, the import dropping it, a plain export getting it.