[Backend][Refactor] Shared IObjectStore/S3 registration — dedupe per-service AmazonS3Client blocks (epic #413) #533

Closed
opened 2026-07-13 00:40:43 +00:00 by spikerj · 2 comments
Owner

Parent epic: #413. Opportunistic refactor once 2-3 more services carry S3 code.

The AmazonS3Client registration block (gated on Storage:UseS3, ForcePathStyle, ServiceURL, env creds) is duplicated inline in four Program.cs files today: UploadCoordinator:28-40, FileMovement:29-49, SecurityScanner:31-41, MetadataExtractor:37-47 — and each new migration ticket adds another copy. Extract one shared registration + a thin IObjectStore (bucket+key get/put/delete/list + TryMapKey path→key shim) into a shared project, modeled on SecurityScanner's IStagedObjectStore (the one clean abstraction). Migrate the four existing services onto it; new migrations use it from day one.

This is also the seam #413's acceptance criteria ask for: "a storage interface with a MinIO implementation" swappable for S3/Azure/GCS via config.

Parent epic: #413. **Opportunistic refactor** once 2-3 more services carry S3 code. The `AmazonS3Client` registration block (gated on `Storage:UseS3`, ForcePathStyle, ServiceURL, env creds) is duplicated inline in four Program.cs files today: UploadCoordinator:28-40, FileMovement:29-49, SecurityScanner:31-41, MetadataExtractor:37-47 — and each new migration ticket adds another copy. Extract one shared registration + a thin `IObjectStore` (bucket+key get/put/delete/list + `TryMapKey` path→key shim) into a shared project, modeled on SecurityScanner's `IStagedObjectStore` (the one clean abstraction). Migrate the four existing services onto it; new migrations use it from day one. This is also the seam #413's acceptance criteria ask for: "a storage interface with a MinIO implementation" swappable for S3/Azure/GCS via config.
Author
Owner

PR spikersoft-backend#252 (feat/533-shared-objectstore) implements this: new SpikerSoft.Storage project with IObjectStore + S3ObjectStore + shared ObjectKeys.TryMapKey shim + AddS3ObjectStore()/UseS3Storage() registration. All four services (UploadCoordinator, FileMovement, SecurityScanner, MetadataExtractor) migrated off their inline AmazonS3Client blocks; behavior/config keys unchanged. 54 tests green. New #413 migrations should use the shared seam from day one.

PR spikersoft-backend#252 (feat/533-shared-objectstore) implements this: new SpikerSoft.Storage project with IObjectStore + S3ObjectStore + shared ObjectKeys.TryMapKey shim + AddS3ObjectStore()/UseS3Storage() registration. All four services (UploadCoordinator, FileMovement, SecurityScanner, MetadataExtractor) migrated off their inline AmazonS3Client blocks; behavior/config keys unchanged. 54 tests green. New #413 migrations should use the shared seam from day one.
Author
Owner

MERGED (backend #252): SpikerSoft.Storage project + IObjectStore/S3ObjectStore/ObjectKeys + shared registrations. Seam has since grown keyed multi-bucket stores (#526), ObjectFileCache (#527) and range reads (#528). Every acceptance criterion is code-complete and in use by 10+ services — closing.

MERGED (backend #252): SpikerSoft.Storage project + IObjectStore/S3ObjectStore/ObjectKeys + shared registrations. Seam has since grown keyed multi-bucket stores (#526), ObjectFileCache (#527) and range reads (#528). Every acceptance criterion is code-complete and in use by 10+ services — closing.
Sign in to join this conversation.