fix(database): enforce source key immutability after TOFU initial write#3563
Open
wizardengineer wants to merge 1 commit into
Open
fix(database): enforce source key immutability after TOFU initial write#3563wizardengineer wants to merge 1 commit into
wizardengineer wants to merge 1 commit into
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
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
sources.data.public_keyor
sources.data.fingerprintdirect replacement rejection, and the
updateSources()upsert pathContext
Refs #2955.
This follows the same database-level TOFU pattern used for immutable
items.data.kindin #3173.Test plan
Notes
This draft focuses on the database-level source key immutability check. It still
uses TOFU semantics, so the first synchronized source key is trusted. It also
does not yet add a cryptographic check that
fingerprintmatchespublic_key;I kept that separate because it likely belongs in the sync/OpenPGP parsing path
rather than inside a self-contained SQLite migration.
Checklist
This change accounts for:
cryptography, export, disposable VM use, or complex UI changes)
application code
a clean test database from
main)