Skip to content

Commit

Permalink
fix: disable s3 multipart upload when using anonymous access
Browse files Browse the repository at this point in the history
Multipart upload is not supported by the s3 sdk when using anonymous
access.

Signed-off-by: Gustav Grusell <[email protected]>
  • Loading branch information
grusell committed Jan 13, 2025
1 parent 568e1ad commit 9808c23
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class S3RemoteFilesConfiguration {
fun s3Client(s3Region: Region, s3Properties: S3Properties) = S3AsyncClient.builder()
.region(s3Region)
.crossRegionAccessEnabled(true)
.multipartEnabled(true)
.multipartEnabled(!s3Properties.anonymousAccess) // Multipart upload requires credentials
.serviceConfiguration(
S3Configuration.builder()
.pathStyleAccessEnabled(true)
Expand Down Expand Up @@ -71,6 +71,11 @@ class S3RemoteFilesConfiguration {
fun s3UriConverter(s3Properties: S3Properties, s3Region: Region) = S3UriConverter(s3Properties, s3Region)

@Bean
fun s3RemoteFileHandler(s3Client: S3AsyncClient, s3Presigner: S3Presigner, s3Properties: S3Properties, s3UriConverter: S3UriConverter) =
fun s3RemoteFileHandler(
s3Client: S3AsyncClient,
s3Presigner: S3Presigner,
s3Properties: S3Properties,
s3UriConverter: S3UriConverter
) =
S3RemoteFileHandler(s3Client, s3Presigner, s3Properties, s3UriConverter)
}

0 comments on commit 9808c23

Please sign in to comment.