update getAwsAuthToken use parameters in an object (#784)

* update getAwsAuthToken use parameters in an object

* wip

* update speech utils
This commit is contained in:
Hoan Luu Huu
2024-06-15 19:11:31 +07:00
committed by GitHub
parent f5cbd26c9f
commit 0baa080a1e
3 changed files with 14 additions and 10 deletions

View File

@@ -196,8 +196,12 @@ class SttTask extends Task {
credentials = {...credentials, access_token, stt_region};
} else if (['aws', 'polly'].includes(vendor) && credentials.roleArn) {
/* get aws access token */
const {roleArn} = credentials;
const {accessKeyId, secretAccessKey, sessionToken, servedFromCache} = await getAwsAuthToken(roleArn);
const {roleArn, region} = credentials;
const {accessKeyId, secretAccessKey, sessionToken, servedFromCache} =
await getAwsAuthToken({
region,
roleArn
});
this.logger.debug({roleArn}, `got aws access token ${servedFromCache ? 'from cache' : ''}`);
credentials = {...credentials, accessKeyId, secretAccessKey, sessionToken};
} else if (vendor === 'verbio' && credentials.client_id && credentials.client_secret) {

14
package-lock.json generated
View File

@@ -15,7 +15,7 @@
"@jambonz/http-health-check": "^0.0.1",
"@jambonz/mw-registrar": "^0.2.7",
"@jambonz/realtimedb-helpers": "^0.8.8",
"@jambonz/speech-utils": "^0.1.7",
"@jambonz/speech-utils": "^0.1.11",
"@jambonz/stats-collector": "^0.1.10",
"@jambonz/time-series": "^0.2.8",
"@jambonz/verb-specifications": "^0.0.72",
@@ -2322,9 +2322,9 @@
}
},
"node_modules/@jambonz/speech-utils": {
"version": "0.1.9",
"resolved": "https://registry.npmjs.org/@jambonz/speech-utils/-/speech-utils-0.1.9.tgz",
"integrity": "sha512-9YIv8i5fyYtzUiAc637DhzOggPeOcolP9VRswc9Gwodux3ORKh7mSMsTwy/HxS81PFoev3FCyzzWuToer0NF1w==",
"version": "0.1.11",
"resolved": "https://registry.npmjs.org/@jambonz/speech-utils/-/speech-utils-0.1.11.tgz",
"integrity": "sha512-VgljBLUF871adib/3yWpzd7kv26ioxiLVkAIxm94CSk9WeZuzX1lVcE2SohojW3mjCYdYY6+B8FRyzlTD+en3g==",
"dependencies": {
"@aws-sdk/client-polly": "^3.496.0",
"@aws-sdk/client-sts": "^3.496.0",
@@ -11954,9 +11954,9 @@
}
},
"@jambonz/speech-utils": {
"version": "0.1.9",
"resolved": "https://registry.npmjs.org/@jambonz/speech-utils/-/speech-utils-0.1.9.tgz",
"integrity": "sha512-9YIv8i5fyYtzUiAc637DhzOggPeOcolP9VRswc9Gwodux3ORKh7mSMsTwy/HxS81PFoev3FCyzzWuToer0NF1w==",
"version": "0.1.11",
"resolved": "https://registry.npmjs.org/@jambonz/speech-utils/-/speech-utils-0.1.11.tgz",
"integrity": "sha512-VgljBLUF871adib/3yWpzd7kv26ioxiLVkAIxm94CSk9WeZuzX1lVcE2SohojW3mjCYdYY6+B8FRyzlTD+en3g==",
"requires": {
"@aws-sdk/client-polly": "^3.496.0",
"@aws-sdk/client-sts": "^3.496.0",

View File

@@ -31,7 +31,7 @@
"@jambonz/http-health-check": "^0.0.1",
"@jambonz/mw-registrar": "^0.2.7",
"@jambonz/realtimedb-helpers": "^0.8.8",
"@jambonz/speech-utils": "^0.1.7",
"@jambonz/speech-utils": "^0.1.11",
"@jambonz/stats-collector": "^0.1.10",
"@jambonz/time-series": "^0.2.8",
"@jambonz/verb-specifications": "^0.0.72",