Skip to content

reset provider creds on every invocation #401

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public abstract class AbstractWrapper<ResourceT, CallbackT, ConfigurationT> {
// provider... prefix indicates credential provided by resource owner
protected final CredentialsProvider providerCredentialsProvider;

protected final CloudWatchProvider providerCloudWatchProvider;
protected final CloudWatchLogsProvider cloudWatchLogsProvider;
protected CloudWatchProvider providerCloudWatchProvider;
protected CloudWatchLogsProvider cloudWatchLogsProvider;
protected final SchemaValidator validator;
protected final TypeReference<HandlerRequest<ResourceT, CallbackT, ConfigurationT>> typeReference;

Expand Down Expand Up @@ -151,10 +151,14 @@ public AbstractWrapper(final CredentialsProvider providerCredentialsProvider,
// Both are required parameters when LoggingConfig (optional) is provided when
// 'RegisterType'.
if (providerCredentials != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the only concern i think is, if we want to reset it to null, we will not allow it right?

I can see three scenarios and curios on the third one

  1. initially it was null, second request we got a non null provider credential we refresh it - it will work
  2. initially it was non-null provider-credential, second request we got a new non-null provider credential - it will work for this case too
  3. initially it was non-null provider-credenial, second request we got a null provider credential - We will still use the old one?


if (this.providerCredentialsProvider != null) {
this.providerCredentialsProvider.setCredentials(providerCredentials);
}

this.providerCloudWatchProvider = new CloudWatchProvider(this.providerCredentialsProvider, HTTP_CLIENT);
this.cloudWatchLogsProvider = new CloudWatchLogsProvider(this.providerCredentialsProvider, HTTP_CLIENT);

if (this.providerMetricsPublisher == null) {
this.providerMetricsPublisher = new MetricsPublisherImpl(this.providerCloudWatchProvider, this.loggerProxy,
resourceType);
Expand Down