-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Support S3 Compatible Blob Storage Providers #22962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Copilot uses AI. Check for mistakes.
AWS SDK v4.0 is not compatible with 3rd party S3 APIs yet due to Payload Signing and SignCheck. ( |
Description
The current AWS implementation doesn't have
ServiceURL
option! So, any S3 compatible services cannot be used over AWS client.This PR adds a simple
ServiceURL
configuration to support S3 compatible providers.Checklist
How to test it?
-or-
-or-