From 89f25d7eda08d687705ac4501073602741542b68 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Sat, 10 Dec 2022 09:20:44 -0500 Subject: [PATCH] save instance_id as part of ibm stt credential --- lib/routes/api/speech-credentials.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/routes/api/speech-credentials.js b/lib/routes/api/speech-credentials.js index c2c8aa5..e049eff 100644 --- a/lib/routes/api/speech-credentials.js +++ b/lib/routes/api/speech-credentials.js @@ -49,7 +49,8 @@ const encryptCredential = (obj) => { tts_api_key, tts_region, stt_api_key, - stt_region + stt_region, + instance_id } = obj; switch (vendor) { @@ -101,7 +102,7 @@ const encryptCredential = (obj) => { return encrypt(deepgramData); case 'ibm': - const ibmData = JSON.stringify({tts_api_key, tts_region, stt_api_key, stt_region}); + const ibmData = JSON.stringify({tts_api_key, tts_region, stt_api_key, stt_region, instance_id}); return encrypt(ibmData); default: @@ -201,6 +202,7 @@ router.get('/', async(req, res) => { obj.tts_region = o.tts_region; obj.stt_api_key = obscureKey(o.stt_api_key); obj.stt_region = o.stt_region; + obj.instance_id = o.instance_id; } return obj; })); @@ -262,6 +264,7 @@ router.get('/:sid', async(req, res) => { obj.tts_region = o.tts_region; obj.stt_api_key = obscureKey(o.stt_api_key); obj.stt_region = o.stt_region; + obj.instance_id = o.instance_id; } res.status(200).json(obj); } catch (err) { @@ -549,9 +552,9 @@ router.get('/:sid/test', async(req, res) => { } } if (cred.use_for_stt) { - const {stt_api_key, stt_region} = credential; + const {stt_api_key, stt_region, instance_id} = credential; try { - await testIbmStt(logger, {stt_region, stt_api_key}); + await testIbmStt(logger, {stt_region, stt_api_key, instance_id}); results.stt.status = 'ok'; SpeechCredential.sttTestResult(sid, true); } catch (err) {