mirror of
https://github.com/jambonz/speech-utils.git
synced 2026-02-09 02:30:09 +00:00
rename aws token from sessionToken to securityToken for consistency with AWS docs
This commit is contained in:
@@ -27,7 +27,7 @@ async function getAwsAuthToken(
|
|||||||
const credentials = {
|
const credentials = {
|
||||||
accessKeyId: data.Credentials.AccessKeyId,
|
accessKeyId: data.Credentials.AccessKeyId,
|
||||||
secretAccessKey: data.Credentials.SecretAccessKey,
|
secretAccessKey: data.Credentials.SecretAccessKey,
|
||||||
sessionToken: data.Credentials.SessionToken
|
securityToken: data.Credentials.SessionToken
|
||||||
};
|
};
|
||||||
|
|
||||||
/* expire 10 minutes before the hour, so we don't lose the use of it during a call */
|
/* expire 10 minutes before the hour, so we don't lose the use of it during a call */
|
||||||
|
|||||||
@@ -21,12 +21,12 @@ test('AWS - create and cache auth token', async(t) => {
|
|||||||
try {
|
try {
|
||||||
let obj = await getAwsAuthToken(process.env.AWS_ACCESS_KEY_ID, process.env.AWS_SECRET_ACCESS_KEY, process.env.AWS_REGION);
|
let obj = await getAwsAuthToken(process.env.AWS_ACCESS_KEY_ID, process.env.AWS_SECRET_ACCESS_KEY, process.env.AWS_REGION);
|
||||||
//console.log({obj}, 'received auth token from AWS');
|
//console.log({obj}, 'received auth token from AWS');
|
||||||
t.ok(obj.sessionToken && !obj.servedFromCache, 'successfullY generated auth token from AWS');
|
t.ok(obj.securityToken && !obj.servedFromCache, 'successfullY generated auth token from AWS');
|
||||||
|
|
||||||
await sleep(250);
|
await sleep(250);
|
||||||
obj = await getAwsAuthToken(process.env.AWS_ACCESS_KEY_ID, process.env.AWS_SECRET_ACCESS_KEY, process.env.AWS_REGION);
|
obj = await getAwsAuthToken(process.env.AWS_ACCESS_KEY_ID, process.env.AWS_SECRET_ACCESS_KEY, process.env.AWS_REGION);
|
||||||
//console.log({obj}, 'received auth token from AWS - second request');
|
//console.log({obj}, 'received auth token from AWS - second request');
|
||||||
t.ok(obj.sessionToken && obj.servedFromCache, 'successfully received access token from cache');
|
t.ok(obj.securityToken && obj.servedFromCache, 'successfully received access token from cache');
|
||||||
|
|
||||||
await client.flushall();
|
await client.flushall();
|
||||||
t.end();
|
t.end();
|
||||||
|
|||||||
Reference in New Issue
Block a user