This commit is contained in:
Dave Horton
2023-11-30 16:16:07 -05:00
parent 29dc2f7052
commit c4dcb051be
4 changed files with 382 additions and 515 deletions

View File

@@ -89,10 +89,12 @@ class SttTask extends Task {
}
else if (vendor == 'aws') {
/* get AWS access token */
const {accessKeyId, secretAccessKey, region } = credentials;
const { servedFromCache, ...newCredentials} = await getAwsAuthToken(accessKeyId, secretAccessKey, region);
this.logger.debug({newCredentials}, `got aws security token ${servedFromCache ? 'from cache' : ''}`);
credentials = {...newCredentials, region};
const {accessKeyId, secretAccessKey, securityToken, region } = credentials;
if (!securityToken) {
const { servedFromCache, ...newCredentials} = await getAwsAuthToken(accessKeyId, secretAccessKey, region);
this.logger.debug({newCredentials}, `got aws security token ${servedFromCache ? 'from cache' : ''}`);
credentials = {...newCredentials, region};
}
}
return credentials;
}