Skip to content

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

Open
@L00kian

Description

@L00kian

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<B extends EndpointOverrideAware<T>, T> {
  B endpointOverride(URI endpointOverride);
}

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

public interface RegionAware<B extends RegionAware <T>, 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestA feature should be added or improved.needs-discussionThis issue/PR requires more discussion with community.p2This is a standard priority issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions