Permalink
Browse files

Reset credentials expired state on successful refresh

  • Loading branch information...
1 parent f79f677 commit 9dc16b1b2e178378ff90fe0cf3fdd04844a288e2 @lsegal lsegal committed Mar 19, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/config.js
View
@@ -418,6 +418,7 @@ AWS.Credentials = inherit({
* @see get
*/
refresh: function refresh(callback) {
+ this.expired = false;
callback();
}
});
@@ -477,6 +478,7 @@ AWS.FileSystemCredentials = inherit(AWS.Credentials, {
if (!this.accessKeyId || !this.secretAccessKey) {
throw new Error('Credentials not set in ' + this.filename);
}
+ this.expired = false;
callback();
} catch (err) {
callback(err);
@@ -561,6 +563,7 @@ AWS.EnvironmentCredentials = inherit(AWS.Credentials, {
}
}
+ this.expired = false;
AWS.Credentials.apply(this, values);
callback();
}
@@ -605,6 +608,7 @@ AWS.EC2MetadataCredentials = inherit(AWS.Credentials, {
if (err) {
self.serviceError = err;
} else {
+ self.expired = false;
self.metadata = creds;
self.accessKeyId = creds.AccessKeyId;
self.secretAccessKey = creds.SecretAccessKey;

0 comments on commit 9dc16b1

Please sign in to comment.