Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Data

Summary: the tables the server keeps, the signed objects that clients exchange, and the local files of the CLI.
Key terms: log entry, record, wrap, envelope, public keys, project access, rotation required, profile, audit, Batch, Commit.
Related: Flows · Interfaces · Spec §14.2

The server stores three kinds of data. Signed objects (log entries and secret records) are stored as JSON text, exactly as the client sent them, so every reader can verify the signatures. Encrypted keys (wraps and device envelopes) are opaque bytes that only their recipient can open. Index tables (project access, latest versions, rotation marks) let the server answer and enforce rules without reading any secret. Account tables come from auth-chad, with the prefix auth_, in the same database.

The picture as text
erDiagram
    projects ||--o{ log_entries : "seq 1..head"
    projects ||--o{ wraps : "env, epoch, recipient"
    projects ||--o{ records : "env, secret, version"
    projects ||--o{ secrets : "latest version per secret"
    projects ||--o{ project_access : "who can see it"
    projects ||--o{ rotation_required : "envs waiting"
    profiles ||--o{ device_envelopes : "user devices"
    public_keys ||--o{ log_entries : "pinned by fingerprint"

The tables

Projects

TableOne row isNotes
projectsA projectThe ID and the current log head (head), which serializes appends
log_entriesOne signed log entryPrimary key (project, seq); the entry JSON with its signature
public_keysA public key pairKeyed by fingerprint, so a client can verify entries of past members
wrapsAn environment key sealed to one member or machine(project, env, epoch, kind, recipient); 80 bytes of HPKE output
recordsOne signed version of one secret(project, env, secret, version); the record JSON
secretsThe latest version of a secretWith name_hmac, unique per environment, deleted secrets included
project_accessA user or machine that can see a projectDerived from the log; answers 404 for everyone else
rotation_requiredAn environment that waits for a rotationWrites to it are refused until an owner rotates

People and devices

TableOne row isNotes
profilesWhat this application knows about a userDisplay name, identity fingerprint, admin flag
device_envelopesA user’s identity key sealed to one user device112 bytes; deleted when the device is revoked
auditAn audit eventTime, actor, device, IP address, action, project, environment, secret, number. No names or values
auth_*Accounts, passkeys, sessions, tokens, devices, invites, eventsauth-chad’s tables; see auth-chad’s data page

The SQLite schema is in crates/store-sqlite/src/schema.sql. PostgreSQL has the same tables in the secrets schema.

Signed objects

A log entry changes access. Its signature covers the JCS form of the entry, and its hash links to the previous entry.

{
  "project_id": "prj_…", "seq": 12, "prev_hash": "…",
  "type": "member_add",
  "body": { "user_id": "usr_…", "identity_fpr": "…", "role": "writer" },
  "author": "usr_…", "created_at": "2026-11-23T20:14:00Z", "sig": "…"
}
Entry typeChangesAuthor
genesisCreates the project and binds its ID to the creatorAny user
member_add, member_role, member_removeMembers and rolesOwner; a member may remove itself
member_rekeyA member’s identity keyThe member, signed with the old key
env_create, env_rename, env_deleteEnvironmentsOwner
device_grant, device_ungrantMachine access to one environmentOwner
rotateA new epoch, with the key commitmentOwner
project_renameThe project nameOwner

A record is one version of one secret. The name and the value are encrypted separately, so a client can list names without downloading values.

FieldReadable by the serverPurpose
project_id, env_id, secret_id, version, epochYesWhere the record belongs and which key opens it
name_hmacYes, as a hashFinds a secret by name without revealing the name
name_nonce, name_ciphertextNoThe encrypted name
nonce, ciphertextNoThe encrypted value; empty for a delete
log_seqYesThe log head the writer verified; fixes the writer’s role
prev_record_hashYesChains the versions of one secret
writer, created_at, sigYesWho wrote it, when, and the signature

Types in the server

TypeHoldsCreated by
PrincipalA user or a device, as the actor or recipient of somethingThe HTTP layer, from auth-chad’s proof
Callerauth-chad’s Authenticated proof and the client addresssecrets-server-http, per request
ActorThe principal, its device and its address, for the audit logApp, from a Caller
CommitOne project’s change: entries, wraps, records, access changes, rotations, audit rowsA use case in App
BatchOne transaction: project commits, auth-chad writes, a profile, device envelopes, rotation marksA use case, or an auth-chad hook
WrapAn environment key sealed to one principalClients; checked by policy
ProfileDisplay name, fingerprint, admin flagSignup
AuditEventOne audit rowApp

ProjectStore::commit stores a whole Batch, or nothing. A signup, a device approval or a rotation is therefore one transaction across auth-chad’s tables and this application’s tables.

Local state of the CLI

FileContents
$XDG_CONFIG_HOME/secrets-chad/config.tomlDefault host; per host, the issuer and the device ID
…/state/<issuer-hash>/pins.jsonPinned fingerprints, verified log heads, highest seen versions
…/devices/<device-id>.keyThe device key, mode 0600 in a 0700 folder
.secrets.toml in a projectHost, project ID, environment ID, required names. No secret; commit it

The CLI keeps no copy of secret values or environment keys on disk.

Where the details are

  • Records, names and values: spec §5.6 and crates/core/src/record.rs.
  • Log entries: spec §6 and crates/core/src/log.rs.
  • Storage requirements and both backends: spec §14.2.
  • The audit log: spec §10.3.