[Improvement-18267][Remote Logging] Allow custom S3 region with endpoint#18268
Merged
Conversation
ruanwenjun
reviewed
May 15, 2026
Member
ruanwenjun
left a comment
There was a problem hiding this comment.
My concern #18267 (comment)
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the AWS authentication S3 client factory used by DolphinScheduler’s remote logging / S3 storage integrations by allowing non-AWS (custom) region strings when a custom aws.s3.endpoint is configured (e.g., MinIO), while keeping strict AWS region validation when no endpoint override is provided.
Changes:
- Use the raw configured region string as the signing region when
aws.s3.endpointis set, instead of validating viaRegions.fromName(...). - Add an explicit validation that
aws.s3.regionis non-empty when a custom endpoint is configured. - Add unit tests covering custom endpoint + custom region, invalid custom region without endpoint, and empty region with endpoint.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| dolphinscheduler-authentication/dolphinscheduler-aws-authentication/src/main/java/org/apache/dolphinscheduler/authentication/aws/AmazonS3ClientFactory.java | Adjusts S3 client creation to bypass AWS region enum validation when using a custom endpoint, and adds empty-region validation for that mode. |
| dolphinscheduler-authentication/dolphinscheduler-aws-authentication/src/test/java/org/apache/dolphinscheduler/authentication/aws/AmazonS3ClientFactoryTest.java | Adds unit tests verifying the new endpoint/region behavior and expected validation outcomes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
SbloodyS
approved these changes
May 26, 2026
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.


Was this PR generated or assisted by AI?
Yes
Purpose of the pull request
Close #18267
Allow S3-compatible storage, such as self-hosted MinIO, to use a custom region when
aws.s3.endpointis configured.Previously,
AmazonS3ClientFactoryalways calledRegions.fromName(region), which rejected non-AWS region values before building the S3 client. For custom S3 endpoints, the configured region should be used as the signing region directly.Brief change log
aws.s3.endpointis configured.Verify this pull request
This change added tests and can be verified as follows:
AmazonS3ClientFactoryTestto verify custom regions are allowed when an S3 endpoint is configured../mvnw -pl dolphinscheduler-authentication/dolphinscheduler-aws-authentication test -Dtest=AmazonS3ClientFactoryTest -DskipITs