serverpod_cloud_storage_s3_compat library
Base package for S3-compatible cloud storage integrations with Serverpod.
This package provides abstractions for building cloud storage integrations that work with S3-compatible APIs, including AWS S3, Google Cloud Storage (via S3 compatibility), Cloudflare R2, LocalStack, and other providers.
Key Components
Base Implementation
- S3CompatCloudStorage - Base CloudStorage implementation
Endpoint Configuration
- S3EndpointConfig - Abstract interface for endpoint URLs
- CustomEndpointConfig - Custom S3-compatible endpoint configuration
Provider-specific endpoint configs are in their respective packages:
AwsEndpointConfiginserverpod_cloud_storage_s3GcpEndpointConfiginserverpod_cloud_storage_gcpR2EndpointConfiginserverpod_cloud_storage_r2
Upload Strategy
- S3UploadStrategy - Abstract interface for upload mechanisms
- MultipartPostUploadStrategy - POST with presigned policy (AWS, GCP, LocalStack)
- PresignedPutUploadStrategy - PUT with presigned URL (Cloudflare R2)
S3 Client
- S3Client - Client for signed S3 API requests
- S3Exception - Exception for S3 API errors
Classes
- CustomEndpointConfig
- Custom S3-compatible endpoint configuration.
- MultipartPostUploadStrategy
- Upload strategy using multipart POST with presigned policy.
- Policy
- Represents an S3 presigned POST policy.
- PresignedPutUploadStrategy
- Upload strategy using PUT with presigned URLs.
- S3Client
- Client for making signed requests to S3-compatible storage APIs.
- S3CompatCloudStorage
- Base class for S3-compatible cloud storage implementations.
- S3EndpointConfig
- Configuration for S3-compatible endpoint URLs.
- S3UploadStrategy
- Strategy for uploading files to S3-compatible storage.
- SignedRequestParams
- Contains the URI and headers for a signed S3 request.
Extensions
- UriPathExtension on Uri
- Extension for appending paths to URIs.
Exceptions / Errors
- NoPermissionsException
- Exception thrown when the API returns a 403 Forbidden response.
- S3Exception
- Exception thrown when an S3-compatible API returns an error.