Expand description
Attachment support for pages export.
Implements opt-in attachment handling for images, PDFs, and code snapshots with proper encryption, size limits, and lazy loading.
§Overview
Attachments are stored in a blobs/ directory with:
- Each blob named by its SHA-256 hash
- Blobs individually encrypted with unique nonces
- A manifest file mapping hashes to metadata
§Size Limits
- Per-file maximum: 10 MB (default)
- Total maximum: 100 MB (default, configurable)
Structs§
- Attachment
Config - Configuration for attachment processing
- Attachment
Data - Raw attachment data from a connector
- Attachment
Entry - Metadata for a processed attachment entry
- Attachment
Manifest - Manifest containing all attachment metadata
- Attachment
Processor - Attachment processor that collects and encrypts attachments
Constants§
- DEFAULT_
ALLOWED_ MIME_ TYPES - Default allowed MIME types
- DEFAULT_
MAX_ FILE_ SIZE - Default maximum size per attachment (10 MB)
- DEFAULT_
MAX_ TOTAL_ SIZE - Default maximum total size for all attachments (100 MB)
Functions§
- decrypt_
blob - Decrypt a blob given the DEK, export_id, and hash
- decrypt_
manifest - Decrypt the attachment manifest