Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
xquanluu committed Jun 14, 2024
1 parent 86a64ac commit e9a5e83
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions lib/get-aws-sts-token.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ const EXPIRY = 3600;

async function getAwsAuthToken(
logger, createHash, retrieveHash,
{accessKeyId, secretAccessKey, region, RoleArn}) {
{accessKeyId, secretAccessKey, region, roleArn}) {
logger = logger || noopLogger;
try {
const key = makeAwsKey(RoleArn || accessKeyId);
const key = makeAwsKey(roleArn || accessKeyId);
const obj = await retrieveHash(key);
if (obj) return {...obj, servedFromCache: true};

let data;
if (RoleArn) {
if (roleArn) {
const stsClient = new STSClient({ region });
const roleToAssume = { RoleArn, RoleSessionName: 'Jambonz_Speech', DurationSeconds: EXPIRY};
const roleToAssume = { RoleArn: roleArn, RoleSessionName: 'Jambonz_Speech', DurationSeconds: EXPIRY};
const command = new AssumeRoleCommand(roleToAssume);

data = await stsClient.send(command);
Expand Down
2 changes: 1 addition & 1 deletion lib/get-tts-voices.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const getAwsVoices = async(_client, createHash, retrieveHash, logger, credential
logger, createHash, retrieveHash,
{
region,
RoleArn: roleArn
roleArn
}),
});
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/synth-audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ const synthPolly = async(createHash, retrieveHash, logger,
logger, createHash, retrieveHash,
{
region,
RoleArn: roleArn
roleArn
}),
});
} else {
Expand Down

0 comments on commit e9a5e83

Please sign in to comment.