Support S3 Compatible Blob Storage Providers#22962
Draft
Conversation
- Introduced a new property `ServiceURL` in `AwsBlobProviderConfiguration` to allow custom service URLs for S3-compatible APIs like MinIO and DigitalOcean Spaces. - Updated `AwsBlobProviderConfigurationNames` to include the new `ServiceURL` constant. - Modified `DefaultAmazonS3ClientFactory` to utilize the `ServiceURL` when creating the S3 client configuration, enabling support for custom endpoints.
…ientFactory - Created `AwsBlobProviderConfiguration_Tests` to validate ServiceURL setting and retrieval. - Implemented `DefaultAmazonS3ClientFactory_Tests` to ensure S3 client creation with and without custom ServiceURL. - Tests cover scenarios for both S3-compatible services and default AWS S3 behavior.
- Updated the AWS provider documentation to clarify support for S3-compatible storage services, including MinIO, DigitalOcean Spaces, and others. - Added details on configuring the `ServiceURL` property for S3-compatible APIs. - Included example configurations for MinIO, DigitalOcean Spaces, and Wasabi to assist users in setting up their environments.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for S3-compatible blob storage providers by introducing a custom ServiceURL configuration to the AWS provider. Key changes include:
- Adding a new ServiceURL property and corresponding constant to the AWS provider configuration.
- Updating the DefaultAmazonS3ClientFactory to construct the S3 client using a custom client configuration if ServiceURL is provided.
- Enhancing tests and documentation to cover both scenarios with and without a custom ServiceURL.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| framework/test/Volo.Abp.BlobStoring.Aws.Tests/Volo/Abp/BlobStoring/Aws/DefaultAmazonS3ClientFactory_Tests.cs | Added tests to verify S3 client creation with and without a custom ServiceURL. |
| framework/test/Volo.Abp.BlobStoring.Aws.Tests/Volo/Abp/BlobStoring/Aws/AwsBlobProviderConfiguration_Tests.cs | Introduced tests to validate setting and retrieving the ServiceURL. |
| framework/src/Volo.Abp.BlobStoring.Aws/Volo/Abp/BlobStoring/Aws/DefaultAmazonS3ClientFactory.cs | Updated S3 client factory to take advantage of the new ServiceURL configuration. |
| framework/src/Volo.Abp.BlobStoring.Aws/Volo/Abp/BlobStoring/Aws/AwsBlobProviderConfigurationNames.cs | Declared a constant for the ServiceURL configuration key. |
| framework/src/Volo.Abp.BlobStoring.Aws/Volo/Abp/BlobStoring/Aws/AwsBlobProviderConfiguration.cs | Added the ServiceURL property with appropriate documentation. |
| docs/en/framework/infrastructure/blob-storing/index.md | Updated documentation to mention S3 compatibility via ServiceURL configuration. |
| docs/en/framework/infrastructure/blob-storing/aws.md | Enhanced documentation to include detailed examples for configuring S3-compatible services. |
|
|
||
| // Assert | ||
| s3Client.ShouldNotBeNull(); | ||
| s3Client.Config.ServiceURL.ShouldBe(serviceUrl + "/"); // AWS SDK automatically appends trailing slash |
There was a problem hiding this comment.
Document the dependency on the AWS SDK's behavior of automatically appending a trailing slash to ServiceURL in both the test and relevant documentation to ensure future maintainability if SDK behavior changes.
Member
Author
|
AWS SDK v4.0 is not compatible with 3rd party S3 APIs yet due to Payload Signing and SignCheck. ( |
maliming
reviewed
Jul 17, 2025
| return new AmazonS3Client(configuration.AccessKeyId, configuration.SecretAccessKey, clientConfig); | ||
| } | ||
|
|
||
| protected virtual AmazonS3Config CreateS3ClientConfig(AwsBlobProviderConfiguration configuration, RegionEndpoint? region) |
Member
There was a problem hiding this comment.
Using the Async method will be better.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
The current AWS implementation doesn't have
ServiceURLoption! So, any S3 compatible services cannot be used over AWS client.This PR adds a simple
ServiceURLconfiguration to support S3 compatible providers.Checklist
How to test it?
-or-
-or-