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

Relax client.credentials-provider requirements #10604

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

morozov
Copy link

@morozov morozov commented Jun 29, 2024

As a workaround for the issue described in #10614, I tried to build a custom AWS credentials provider. I couldn't find the user-facing documentation on how do do that, so I resorted to reading the source code.

My understanding is that the class referenced by the client.credentials-provider property has to return an AwsCredentialsProvider instance from its create() method and also implement the AwsCredentialsProvider interface itself. The former makes sense, since this class effectively acts as a factory, the latter doesn't because the class in question is not a credentials provider, it's a credentials provider factory.

Even the DummyValidProvider, in order to satisfy the requirements, effectively reimplements the StaticCredentialsProvider class from the AWS SDK.

With this constraint removed, instead of having to implement both the AwsCredentialsProvider methods and the static create() method, the provider/factory could implement only the latter:

Before:

private static class DummyValidProvider implements AwsCredentialsProvider {
public static DummyValidProvider create() {
return new DummyValidProvider();
}
@Override
public AwsCredentials resolveCredentials() {
return AwsBasicCredentials.create("test-accessKeyId", "test-secretAccessKey");
}
}

After:

private static class AwsCredentialsProviderFactory {
public static AwsCredentialsProvider create() {
return StaticCredentialsProvider.create(
AwsBasicCredentials.create("test-accessKeyId", "test-secretAccessKey")
);
}
}

Note that even if/when the original issue is addressed, it would still make sense to relax these constraints to improve the developer experience.

@github-actions github-actions bot added the AWS label Jun 29, 2024
@morozov morozov force-pushed the relax-aws-credential-provider-requirements branch from 2cf0b36 to bbfb049 Compare July 2, 2024 17:21
@nastra
Copy link
Contributor

nastra commented Jul 9, 2024

@jackye1995 could you (or anyone on your team) take a look at this one please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants