blob_content_key_targets API Postgres table
Declared in packages/api-shared/src/schema/blobContentKeys.ts
Description
Each row stores the blob content key wrapped for one active attachment target: a binding, the document that owns that binding, and one linked container KEK reached through that document's current link-set manifest. The target fields hash to the parent epoch row's targetHash; wrappedKey and wrappingMetadata are encrypted material needed by clients.
Indexes:
(blobContentKeyEpochId, bundleTargetHash, bindingId, documentId, containerId)is unique so an epoch has at most one envelope for each binding/document/container target.
Columns
iduuid- primary key
- not null
- default gen_random_uuid()
Surrogate database primary key. Domain identity is
(blobContentKeyEpochId, bundleTargetHash, bindingId, documentId, containerId).blob_content_key_epoch_iduuid- not null
- references blob_content_key_epochs (
id)
Parent blob content-key epoch row.
bundle_target_hashtext- not null
Immutable target-set identity; older sets remain retained.
binding_iduuid- not null
Active attachment binding that makes this blob reachable.
document_iduuid- not null
Document containing the attachment binding.
container_iduuid- not null
Linked container recipient for this target.
container_manifest_hashtext- not null
Current container access manifest hash used when deriving the target.
container_key_epoch_idtext- not null
Container KEK epoch id that wraps this blob content key.
container_key_epochinteger- not null
Numeric container KEK epoch corresponding to
containerKeyEpochId.wrapped_keytext- not null
Blob content key encrypted/wrapped for the container KEK.
wrapping_metadatajsonb- not null
Canonical metadata needed by the client to unwrap
wrappedKey; current clients use suitetearleads.blob.content-key-wrap.ml-kem-1024-aes-256-gcm-container-kekwith a canonical 1,568-byte ML-KEM-1024kemCipherTextencapsulated to the target container's signedcontainerKeyPublicKey. The wrap's HKDF info and AES-GCM authenticated data bind the suite, blob id, content-key epoch, target container epoch, and container public-key fingerprint, so it opens for no other blob, epoch, or target; bindings of the same blob share the key.
Keys and constraints
Indexes
blob_content_key_targets_epoch_binding_container_idx(blob_content_key_epoch_id, bundle_target_hash, binding_id, document_id, container_id)- unique