Skip to main content

Type Alias: RewrapStopReason

RewrapStopReason = Exclude<KeyWrapErrorCode, "unwrap_failed"> | "verify_failed" | "interrupted"

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

Why a batch stopped before it wrote anything.

  • A KeyWrapErrorCode is custody's own answer about a row. custody_unavailable means the token could not be asked, and the same call will work later. Every other code needs an operator before a retry can change anything: unknown_kek (no custody here holds the key a row names), custody_refused, invalid_key_id, invalid_key. unwrap_failed is never a stop: it is a verdict on one stored value, and that row is skipped and reported instead.
  • verify_failed: the token wrapped a key and then did not give the same key back. Nothing was overwritten. The module is not fit to hold the key encryption key.
  • interrupted: the caller's signal fired between two rows.