Appearance
Object Storage
Gryd.IO now provides a shared object storage module through Gryd.Infrastructure.
This module centralizes cloud file operations for:
GrydAuthprofile image uploadGrydReportsfile persistence when using cloud backends- Any custom module that needs upload/download/delete/presigned URLs
Registration
Register once in your host application:
csharp
using Gryd.Infrastructure.Extensions;
builder.Services.AddGrydObjectStorage(builder.Configuration);appsettings.json
Configuration section: GrydStorage
json
{
"GrydStorage": {
"DefaultProvider": "AmazonS3",
"AmazonS3": {
"BucketName": "my-bucket",
"Region": "us-east-1",
"AccessKeyId": "",
"SecretAccessKey": "",
"DefaultPrefix": "app"
},
"GoogleCloudStorage": {
"BucketName": "my-gcs-bucket",
"CredentialsFilePath": "./secrets/gcp-service-account.json",
"DefaultPrefix": "app"
},
"AzureBlobStorage": {
"ConnectionString": "DefaultEndpointsProtocol=https;AccountName=...",
"ContainerName": "app-files",
"CreateContainerIfNotExists": true,
"DefaultPrefix": "app"
}
}
}Supported Providers
AmazonS3GoogleCloudStorageAzureBlobStorage
Main Contracts
IObjectStorageService: application-facing facadeIObjectStorageProvider: provider adapter contractIObjectStorageProviderResolver: strategy resolver by provider kind
Notes
- The module is provider-agnostic from Application layer perspective.
- New providers can be added without changing callers (OCP).
GrydAuthstill acceptsGrydAuth:Storage:AwsS3for backward compatibility, butGrydStorageis the recommended source of truth.