crates/protocols/src/swift/README.md
Swift-compatible object storage API implementation for RustFS.
This implementation provides Phase 1 Swift API support (~25% of full Swift API):
Not yet implemented:
Swift API is opt-in and must be explicitly enabled.
Build with Swift support:
cargo build --features swift
Or enable all protocol features:
cargo build --features full
Note: Swift is NOT enabled by default to avoid unexpected API surface changes in existing deployments.
Swift API uses Keystone for authentication. Configure the following environment variables:
| Variable | Description |
|---|---|
RUSTFS_KEYSTONE_URL | Keystone authentication endpoint URL |
RUSTFS_KEYSTONE_ADMIN_TENANT | Admin tenant/project name |
RUSTFS_KEYSTONE_ADMIN_USER | Admin username |
RUSTFS_KEYSTONE_ADMIN_PASSWORD | Admin password |
Swift API endpoints follow the pattern: /v1/AUTH_{project_id}/...
GET /v1/AUTH_{project} - List containersHEAD /v1/AUTH_{project} - Get account metadata (not yet implemented)POST /v1/AUTH_{project} - Update account metadata (not yet implemented)PUT /v1/AUTH_{project}/{container} - Create containerGET /v1/AUTH_{project}/{container} - List objectsHEAD /v1/AUTH_{project}/{container} - Get container metadataPOST /v1/AUTH_{project}/{container} - Update container metadataDELETE /v1/AUTH_{project}/{container} - Delete containerPUT /v1/AUTH_{project}/{container}/{object} - Upload objectGET /v1/AUTH_{project}/{container}/{object} - Download objectHEAD /v1/AUTH_{project}/{container}/{object} - Get object metadataPOST /v1/AUTH_{project}/{container}/{object} - Update object metadataDELETE /v1/AUTH_{project}/{container}/{object} - Delete objectCOPY /v1/AUTH_{project}/{container}/{object} - Server-side copyThe Swift API is implemented as a Tower service layer (SwiftService) that wraps the S3 service:
HTTP Request
│
▼
┌───────────────┐
│ SwiftService │ ← Routes /v1/AUTH_* requests
└───────┬───────┘
│
┌────┴────┐
│ │
▼ ▼
Swift S3 Service
Handler (fallback)
Swift containers are mapped to S3 buckets with a secure hash prefix:
Swift: /v1/AUTH_abc123/mycontainer
↓
S3 Bucket: {sha256(abc123)[0:16]}-mycontainer
This ensures:
See the docs/ directory for detailed documentation:
SWIFT_API.md - Complete API referenceTESTING_GUIDE.md - Manual testing proceduresCOMPLETION_ANALYSIS.md - Protocol coverage trackingCOPY_IMPLEMENTATION.md - Server-side copy documentationRANGE_REQUESTS.md - Range request implementation detailsApache License 2.0