aws / aws/aws-sdk-java-v2

SdkPresigner.Builder has a set of methods common with AwsClientBuilder but no common hierarchy

Open
#2,448 2 comments 0 reactions 0 assignees View on GitHub
feature-request needs-discussion p2
Dominant language
Java
Stars
2.6k
Forks
1k
Avg merge
2d 9h
Merged PRs (30d)
51

Description

## Describe the Feature

At the moment SdkPresigner.Builder has 3 builder methods which are
```
Builder region(Region region);
Builder credentialsProvider(AwsCredentialsProvider credentialsProvider);
Builder endpointOverride(URI endpointOverride);
```

The same 3 methods exist within SdkClientBuilder (endpointOverride is inherited from SdkClientBuilder), however these methods belong to different hierarchies.

## Is your Feature Request related to a problem?
For me as a developer there are different kinds of deployments
1. Start application locally pointing to localstack (static region, anonymous credentials, endpoint overridden to localhost:port
2. Start application locally pointing to stack in AWS cloud (static region, static credentials, no endpoint override)
3. Start application in AWS (automatic region, automatic credentials from default chain, no endpoint override)

So for having a Presigner and a Client I'd have to have twice as much code doing just the same (providing configuration to AWS SDK constructs)

## Proposed Solution
introduce 3 interfaces
```
public interface EndpointOverrideAware, T> {
B endpointOverride(URI endpointOverride);
}

public interface CredentialsProviderAware, T> {
B credentialsProvider(AwsCredentialsProvider credentialsProvider);
}

public interface RegionAware, T> {
B region(Region region);
}
```

and inherit both SdkPresigner.Builder and SdkClientBuilder from these interfaces.

- [v] I may be able to implement this feature request

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.