feat(privacy): every synced payload sealed and opened through one envelope (ADR 0019)
- `ContentKeys` opens the person's data keys (`content_key`) with their account's keys on the device, an anonymous person's device keys made as their data first opens; it makes a private studyset's key and the personal key. Without the account's keys nothing opens and nothing new is private (D8). - `PayloadEnvelope` is the one place payloads are sealed and opened, each for its table, row and column, so a payload moved to another row never opens; one that doesn't open is `Locked`, never half-read. - `Privacy` gives each gateway the key of the row's tree (its top-level studyset's), and rewrites a tree under another key, or readable, in place (`rekeyTree`). - The studyset, card, note, learning path, path answer and PDF gateways seal with their tree's key and open what they read: a new top-level studyset is private where the device holds the keys, a new one inside a tree takes its privacy, and one moved into another tree is rewritten under that tree's key. Tags and settings are sealed with the personal key; a tag or settings row that doesn't open here is left out, so nothing folds or deletes it. A studyset whose key doesn't open shows as locked (`Studyset.isLocked`); other rows that don't open read as blank. - Every payload codec round-trips sealed, and refuses another row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
905bb9abf2
commit
64fdfa091d
1 changed files with 1693 additions and 151 deletions
|
|
@ -41,7 +41,7 @@ void main() {
|
|||
expect(other.has('studyset-1'), isTrue);
|
||||
expect(other.unseal(sealed, context: context), plain);
|
||||
expect(sealed.keyId, 'studyset-1');
|
||||
expect(sealed.payload, isNot(contains(plain.first)));
|
||||
expect(String.fromCharCodes(sealed.payload), isNot(contains('front')));
|
||||
});
|
||||
|
||||
test("another account's device opens neither the key nor what it "
|
||||
|
|
|
|||
Loading…
Reference in a new issue