Skip to content

Commit

Permalink
make credentials provider chain resolve synchronous. (#2456)
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanZhengYP authored Dec 26, 2018
1 parent 8db24fb commit 9a9d7e8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changes/next-release/bugfix-credentials-3d679332.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "bugfix",
"category": "credentials",
"description": "Make CredentialProviderChain coalesce resolvation synchronous"
}
4 changes: 1 addition & 3 deletions lib/credentials/credential_provider_chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ AWS.CredentialProviderChain = AWS.util.inherit(AWS.Credentials, {
function resolveNext(err, creds) {
if ((!err && creds) || index === providers.length) {
AWS.util.arrayEach(self.resolveCallbacks, function (callback) {
AWS.util.defer(function () {
callback(err, creds);
});
callback(err, creds);
});
self.resolveCallbacks.length = 0;
return;
Expand Down
12 changes: 12 additions & 0 deletions test/credential_provider_chain.spec.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9a9d7e8

Please sign in to comment.