Skip to content

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

Draft
wants to merge 6 commits into
base: dev
Choose a base branch
from
Draft

Conversation

enisn
Copy link
Member

@enisn enisn commented May 26, 2025

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

  • I fully tested it as developer / designer and created unit / integration tests
  • I documented it (or no need to document or I will create a separate documentation issue)

How to test it?

  1. Run the tests

-or-

  1. Deploy a Minio Container on Docker and configure it with AWS client

-or-

  1. Create a CloudFlare R2 bucket on CloudFlare Dashboard and configure it with AWS client

enisn added 4 commits May 26, 2025 15:15
- 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.
@enisn enisn requested review from hikalkan and maliming May 26, 2025 12:27
@enisn enisn added the feature label May 26, 2025
@enisn enisn added this to the 10.0-preview milestone May 26, 2025
@enisn enisn requested a review from Copilot May 26, 2025 12:39
Copy link
Contributor

@Copilot Copilot AI left a 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
Copy link
Preview

Copilot AI May 26, 2025

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.

@enisn enisn marked this pull request as draft May 26, 2025 13:22
@enisn
Copy link
Member Author

enisn commented May 26, 2025

AWS SDK v4.0 is not compatible with 3rd party S3 APIs yet due to Payload Signing and SignCheck. (STREAMING-AWS4-HMAC-SHA256-PAYLOAD)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant