feat(aurora-portal): object storage bff implementation (incl. type schemas, helpers and routers) #441
+6,316
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ISSUES CLOSED: 437
Object Storage BFF Implementation with Comprehensive Testing
📋 Overview
This PR implements a complete Backend-for-Frontend (BFF) layer for OpenStack Swift Object Storage, enabling the Aurora Portal to interact with Swift's object storage capabilities. The implementation includes full TypeScript type safety, comprehensive error handling, and 100% test coverage.
🎯 What's Included
Core Implementation
objectStorage.ts): Complete Zod schema definitions for all Swift operationsobjectStorageHelpers.ts): Utility functions for query params, headers, parsing, and error handlingobjectStorageRouter.ts): 19 fully-typed procedures covering all Swift operationsDocumentation
006_object_storage_bff.md): Complete API documentation with examples🚀 Features Implemented
Service Operations
getServiceInfo- Retrieve Swift service capabilities and configurationAccount Operations (4 procedures)
listContainers- List all containers with filtering and paginationgetAccountMetadata- Retrieve account-level metadataupdateAccountMetadata- Modify account metadata and temp URL keysdeleteAccount- Remove account (admin operation)Container Operations (5 procedures)
listObjects- List objects in a container with prefix/delimiter supportcreateContainer- Create new containers with metadatagetContainerMetadata- Retrieve container info and settingsupdateContainerMetadata- Modify container settings (ACLs, quotas, versioning)deleteContainer- Remove empty containersObject Operations (6 procedures)
getObject- Download object content with range supportcreateObject- Upload objects with metadata (supports ArrayBuffer, Uint8Array, base64)getObjectMetadata- Retrieve object headers without downloadingupdateObjectMetadata- Modify object metadatacopyObject- Server-side copy with cross-account supportdeleteObject- Remove objects including multipart manifestsAdvanced Features (5 procedures)
bulkDelete- Efficiently delete multiple objects in one requestcreateFolder- Create folder marker objectslistFolderContents- Browse folders with delimiter supportmoveFolder- Move entire folder hierarchiesdeleteFolder- Remove folders and all contentsgenerateTempUrl- Create time-limited pre-signed URLsTotal: 21 procedures across 19 operations
🧪 Test Coverage
Schema Tests (
objectStorage.test.ts)Helper Tests (
objectStorageHelpers.test.ts)Router Tests (
objectStorageRouter.test.ts)Summary
🏗️ Technical Implementation
Type Safety
Error Handling
Helper Functions
📝 API Examples
Upload an Object
List Folder Contents
Generate Temporary URL
Bulk Delete
🔒 Security Features
protectedProcedure📦 Dependencies
No new external dependencies required. Uses existing:
@trpc/server- tRPC frameworkzod- Runtime type validationcrypto(Node.js built-in) - HMAC for temp URLs🧹 Code Quality
🔄 Migration Notes
📚 Documentation
See
006_object_storage_bff.mdfor:🎉 Impact
This implementation provides a robust, type-safe foundation for all object storage operations in Aurora Portal. With comprehensive test coverage (207 tests) and detailed documentation, the codebase is maintainable and extensible for future Swift features.
Key Benefits
✅ Checklist