Files
mesh-controller/internal/inventory/migrations/0101-the-cores-credentials-the-vault-sealed.sql
T

19 lines
1.2 KiB
SQL

-- The core's own credentials as the vault sealed them to their machine (novox/hq ADR 0349 §16, issue 755).
--
-- The bus's and the provisioner's credentials travel in their machine's declaration sealed by the vault to that
-- machine, which the controller carries and cannot open. The vault seals each answer afresh, so the box the
-- controller last got is kept here and carried again while the vault's generation and the machine's key are the
-- same: a declaration that changed with every answer would be sent for ever. It is also what a send carries when
-- the vault does not answer, so the machine keeps the file it has. Kept as text, byte for byte as it was carried
-- (jsonb would reorder its keys, and the declaration with them). Sealed to the machine's key: no value.
create table core_box (
node uuid not null references node(id) on delete cascade,
module text not null,
name text not null,
generation integer not null check (generation > 0),
sealed_to text not null,
box text not null,
got_at timestamptz not null default now(),
primary key (node, module, name)
);