aeat.adapters.persistence.storage.attachment module¶
Encrypted SQL-backed content-addressed attachment store implementation.
Concrete adapter-layer implementation of the
AttachmentStoreProtocol. The
domain declares the protocol; this module provides the implementation that
reads/writes encrypted attachment blobs and manifests through the
SecureObjectRepository persistence
substrate. Blob rows are framed byte payloads governed by
adapters.persistence.storage.ATTACHMENT_BLOB_NAMESPACE; manifest
rows wrap Attachment payloads in
Envelope records governed by
adapters.persistence.storage.ATTACHMENT_MANIFEST_NAMESPACE.
Sensitivity rationale: attachment blobs and manifests are content-addressed
byte objects (invoice PDFs, bank statements, supporting documents) that are
FINANCIAL regardless of the modelo that triggered the upload. Attachments are
not modelo-scoped - a single blob may be referenced from multiple modelos and
filing revisions. The ModeloDefinition.output_sensitivity field governs
model output artefacts; attachment storage is an independent content-
addressed substrate and its sensitivity class is irreducibly FINANCIAL.
- class AttachmentStore(**data)[source]¶
Bases:
BaseModelEncrypted SQL-backed content-addressed attachment store.
Implements
AttachmentStoreProtocolby storing raw document bytes under their SHA-256 digest inadapters.persistence.storage.ATTACHMENT_BLOB_NAMESPACEand encryptedAttachmentmanifests inadapters.persistence.storage.ATTACHMENT_MANIFEST_NAMESPACE. Both namespaces are profile-local FINANCIAL custody surfaces; theSecureObjectRepositoryencrypts the stored rows and HMAC-digests the object keys.- Parameters:
objects (SecureObjectRepository | None)
- objects: SecureObjectRepository | None¶
- manifest_path(attachment_id)[source]¶
Return a logical object marker for
attachment_id.- Return type:
Path- Parameters:
attachment_id (str)
- write_manifest(attachment)[source]¶
Persist
attachmentas an encrypted manifest envelope.- Return type:
- Parameters:
attachment (Attachment)
- load_manifest(attachment_id)[source]¶
Load and validate the
Attachmentmanifest envelope.- Return type:
- Parameters:
attachment_id (str)
- iter_manifests()[source]¶
Iterate over every
Attachmentmanifest in sorted attachment-id order.- Return type: