Skip to main content

Interface: RewrapOptions<DB>

Defined in: packages/persistence/src/personal/subject-keys.ts:123

Options for SubjectKeys.rewrap.

Type Parameters​

DB​

DB = unknown

The module's tables, as the transaction handed to record is typed.

Properties​

after?​

readonly optional after?: string

Defined in: packages/persistence/src/personal/subject-keys.ts:132

Take keys after this subject id: the cursor of the batch before.


limit?​

readonly optional limit?: number

Defined in: packages/persistence/src/personal/subject-keys.ts:134

How many keys to take, 1 to REWRAP_BATCH_MAX. Default REWRAP_BATCH_SIZE.


reader?​

readonly optional reader?: Pick<KeyWrap, "unwrap">

Defined in: packages/persistence/src/personal/subject-keys.ts:130

Unwraps a stored key under the key encryption key its row names. Default: the instance's own KeyWrap, which is enough when every row was wrapped by the custody that is active now. The re-wrap from software to hardware passes one that also reads soft: ids.


record?​

readonly optional record?: (tx, rewrapped) => Promise<void>

Defined in: packages/persistence/src/personal/subject-keys.ts:148

Writes the batch's audit records, in the transaction that stores the batch, so the keys move and the trail says so together or not at all (AuditClient.record for each entry). It is called once, after the updates, with one entry for each source key the batch moved a key from or found a damaged key under, counted from the rows that actually changed. A batch whose only content is damaged keys still calls it, with count: 0, in a transaction that holds nothing else: a key that will not open belongs in the trail, not only in the log. It is not called for a stopped batch, an empty read, or a batch whose every key had changed under it and none was damaged. It must not call a port, and a throw rolls the batch back.

Parameters​

tx​

PlatformTransaction<DB>

rewrapped​

readonly RewrappedSource[]

Returns​

Promise<void>


signal?​

readonly optional signal?: AbortSignal

Defined in: packages/persistence/src/personal/subject-keys.ts:136

Checked between two rows. Once aborted the batch stops as interrupted and writes nothing.