Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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 @@ -150,6 +150,12 @@ public AbstractWrapper(final CredentialsProvider providerCredentialsProvider,
// sync.
// Both are required parameters when LoggingConfig (optional) is provided when
// 'RegisterType'.
// reset provider credentials back to null to avoid reusing stale credentials
this.providerCredentialsProvider.resetCredentials();
this.providerMetricsPublisher = null;
this.providerEventsLogger = null;
this.cloudWatchLogHelper = null;

if (providerCredentials != null) {
if (this.providerCredentialsProvider != null) {
this.providerCredentialsProvider.setCredentials(providerCredentials);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public void handleRequest(final InputStream inputStream, final OutputStream outp
TerminalException {
if (platformLogPublisher == null) {
platformLogPublisher = new LambdaLogPublisher(context.getLogger());
this.platformLoggerProxy.addLogPublisher(platformLogPublisher);
}
this.platformLoggerProxy.addLogPublisher(platformLogPublisher);
processRequest(inputStream, outputStream);
outputStream.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,9 @@ public interface CredentialsProvider {
* @param credentials, incoming credentials for the call that is being made
*/
void setCredentials(Credentials credentials);

/**
* set credentials back to null to avoid reusing stale creds
*/
void resetCredentials();
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,9 @@ public void setCredentials(final Credentials credentials) {
this.awsSessionCredentials = AwsSessionCredentials.create(credentials.getAccessKeyId(), credentials.getSecretAccessKey(),
credentials.getSessionToken());
}

@Override
public void resetCredentials() {
this.awsSessionCredentials = null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ public AwsSessionCredentials get() {
public void setCredentials(Credentials credentials) {

}

@Override
public void resetCredentials() {

}
};
}

Expand Down