Skip to main content

Module attachments

Module attachments 

Source
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§

AttachmentConfig
Configuration for attachment processing
AttachmentData
Raw attachment data from a connector
AttachmentEntry
Metadata for a processed attachment entry
AttachmentManifest
Manifest containing all attachment metadata
AttachmentProcessor
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