Documents App
The documents app provides infrastructure for uploading, storing, and downloading documents across the Maybern platform.Overview
The documents app enables other apps to handle file operations consistently:- Presigned URL generation for secure uploads
- S3 storage management
- Document linking to business objects
Document Model
Document Upload Flow
1
Request upload URL
Client sends request to create document and get presigned URL.
2
Direct upload to S3
Client uploads file directly to S3 using presigned URL.
3
Link document
Client links document ID to the relevant business object.
Document Download Flow
1
Request document
Client requests document by ID.
2
Get presigned URL
Backend generates presigned download URL.
3
Download from S3
Client downloads file directly from S3.
API Endpoints
Usage Examples
Uploading a Document
Downloading a Document
Security
Presigned URLs
Presigned URLs
All S3 operations use presigned URLs:
- Time-limited (typically 15 minutes)
- Single use
- No direct S3 credentials exposed to client
Customer Isolation
Customer Isolation
Documents are scoped to customers:
- S3 keys include customer ID
- Access checks enforce customer boundaries
Content Validation
Content Validation
Documents are validated:
- File type checking
- Size limits
- Virus scanning (if configured)