-
-
Notifications
You must be signed in to change notification settings - Fork 327
Support @ServiceConnection
endpoint attribute for S3Presigner
#1310
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: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ | |
import io.awspring.cloud.autoconfigure.ses.SesAutoConfiguration; | ||
import io.awspring.cloud.autoconfigure.sns.SnsAutoConfiguration; | ||
import io.awspring.cloud.autoconfigure.sqs.SqsAutoConfiguration; | ||
import java.time.Duration; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.autoconfigure.ImportAutoConfiguration; | ||
|
@@ -40,6 +41,7 @@ | |
import org.testcontainers.utility.DockerImageName; | ||
import software.amazon.awssdk.services.dynamodb.DynamoDbClient; | ||
import software.amazon.awssdk.services.s3.S3Client; | ||
import software.amazon.awssdk.services.s3.presigner.S3Presigner; | ||
import software.amazon.awssdk.services.ses.SesClient; | ||
import software.amazon.awssdk.services.sns.SnsClient; | ||
import software.amazon.awssdk.services.sqs.SqsAsyncClient; | ||
|
@@ -88,6 +90,12 @@ void configuresS3ClientWithServiceConnection(@Autowired S3Client client) { | |
assertThatCode(client::listBuckets).doesNotThrowAnyException(); | ||
} | ||
|
||
@Test | ||
void configuresS3PresignerWithServiceConnection(@Autowired S3Presigner s3Presigner) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @maciejwalkowiak @MatejNedic In this case, I attempted to use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @maciejwalkowiak @MatejNedic @tomazfernandes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @maciejwalkowiak @MatejNedic @tomazfernandes |
||
assertThatCode(() -> s3Presigner.presignGetObject(req1 -> req1.signatureDuration(Duration.ofSeconds(2)) | ||
.getObjectRequest(req2 -> req2.bucket("my-bucket").key("test").build()))).doesNotThrowAnyException(); | ||
} | ||
|
||
@Configuration(proxyBeanMethods = false) | ||
@ImportAutoConfiguration({ AwsAutoConfiguration.class, CredentialsProviderAutoConfiguration.class, | ||
RegionProviderAutoConfiguration.class, DynamoDbAutoConfiguration.class, SesAutoConfiguration.class, | ||
|
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.
Shouldn't connection details be applied with highest priority like here ?