Expand description
Sealing a record’s body (SPEC_USER_DATA_SYNC_LAYER §3.1). A body leaves a machine sealed with the collection’s key
at the record’s key epoch: ChaCha20-Poly1305, with the collection id, record id, version, base version and key
epoch as associated data, so a body cannot be replayed under another record, version, base or epoch, nor moved into
another collection. The seal is the Vault’s (vault::sync_seal) under this module’s associated-data prefix, so
there is one implementation. The layer treats a body as opaque bytes: the caller seals before a record is written
(sealer with log::append_local_with) and opens after one is applied (open).
The ids in the associated data are letters, digits and ._- only (at most 128 characters): a collection or record
id with anything else is refused, so no two places can have the same associated data.
Structs§
- KeyRing
- The keys a member holds for one collection, one per epoch it has been in, so it opens earlier records too.
Enums§
- Open
Error - Why a body would not open.
Constants§
- AAD_
PREFIX - The associated data’s first part for a Kanban board’s records.
Functions§
- generate_
key - A new random collection key, made on the machine that founds a collection or rotates it.
- open
- The body of a record, opened with the key its header’s epoch names. The header must be the verified one: its fields are the associated data, so a body altered, or moved to another record, version, base or epoch, fails.
- seal
bodysealed for the placeatnames, under the key the ring holds for that epoch.- sealer
- For
log::append_local_with: sealsbodyunder the ring’s key at the epoch the record will carry.