Expand description
Signed Writes — pure logic for CREATE COLLECTION ... SIGNED_BY (...).
A collection with a non-empty signer registry rejects every INSERT that does not carry a valid Ed25519 signature produced by one of the currently-allowed signer keys. This module provides the deterministic, side-effect-free pieces of that contract:
- The reserved column names + byte widths injected on
SIGNED_BYcollections. - A
SignerRegistryholding the currently allowed keys plus an append-onlySignerHistoryEntrylog of admin mutations. - The
SignedWriteErrortaxonomy that the engine maps onto HTTP 400 / 401 responses. verify_insert— the single entry point the insert path will call to validate one row.
Issue #522 wires this into the runtime insert path, REST error mapping, and the catalog persistence of the registry. This file is intentionally self-contained so the wiring is a thin adapter on top of audited logic.
Structs§
- Insert
Signature Fields - Result of looking at the row-supplied signer + signature columns
before verification.
Nonefor either side means the caller passedNULL/ omitted column entirely. - Signer
History Entry - One entry in the append-only admin history of a signer registry.
- Signer
Registry - Mutable signer registry attached to a
SIGNED_BYcollection.
Enums§
- Signed
Write Error - Failure modes for a signed-writes INSERT. The runtime maps each variant onto an HTTP status:
- Signer
History Action - Action recorded in
SignerRegistry::history.
Constants§
- RESERVED_
SIGNATURE_ COL - Reserved column auto-added to every signed-writes collection. Holds the 64-byte raw Ed25519 signature over the canonical payload.
- RESERVED_
SIGNER_ PUBKEY_ COL - Reserved column auto-added to every signed-writes collection. Holds the 32-byte Ed25519 public key the signer used to sign the row.
- SIGNATURE_
LEN - Length of a raw Ed25519 signature, in bytes.
- SIGNER_
PUBKEY_ LEN - Length of a raw Ed25519 public key, in bytes.
Functions§
- reverify_
row - Re-verify a previously-accepted row by its stored
signer_pubkey+signature+ canonical payload. Used by integrity scans (/admin/verify-collection) — does NOT consult the registry, so rows signed by since-revoked keys still re-verify Ok. This is the property the issue calls out: - verify_
insert - Top-level insert-time verification.