Skip to content
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

S3Presigner not considering @ServiceConnection endpoint #1289

Open
i96751414 opened this issue Dec 2, 2024 · 2 comments · May be fixed by #1310
Open

S3Presigner not considering @ServiceConnection endpoint #1289

i96751414 opened this issue Dec 2, 2024 · 2 comments · May be fixed by #1310

Comments

@i96751414
Copy link

Hi!

Considering the below code:

@Bean
@ConditionalOnMissingBean
S3Presigner s3Presigner(S3Properties properties, AwsProperties awsProperties,
AwsCredentialsProvider credentialsProvider, AwsRegionProvider regionProvider,
ObjectProvider<AwsConnectionDetails> connectionDetails) {
S3Presigner.Builder builder = S3Presigner.builder().serviceConfiguration(properties.toS3Configuration())
.credentialsProvider(credentialsProvider).region(AwsClientBuilderConfigurer.resolveRegion(properties,
connectionDetails.getIfAvailable(), regionProvider));
if (properties.getEndpoint() != null) {
builder.endpointOverride(properties.getEndpoint());
}
else if (awsProperties.getEndpoint() != null) {
builder.endpointOverride(awsProperties.getEndpoint());
}
Optional.ofNullable(awsProperties.getFipsEnabled()).ifPresent(builder::fipsEnabled);
Optional.ofNullable(awsProperties.getDualstackEnabled()).ifPresent(builder::dualstackEnabled);
return builder.build();
}

It seems S3Presigner is not being built considering the endpoint coming from ObjectProvider<AwsConnectionDetails> connectionDetails. As such, using @ServiceConnection is not possible as the endpoint is not set accordingly.

@maciejwalkowiak
Copy link
Contributor

Thanks for reporting. Would you like to submit a fix?

@i96751414
Copy link
Author

Sure, I will do :)

kunalvarpe added a commit to kunalvarpe/spring-cloud-aws that referenced this issue Dec 21, 2024
@kunalvarpe kunalvarpe linked a pull request Dec 21, 2024 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants