From 07421d830eed3fa8f02e5889c5e69eec0e68019e Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Thu, 2 Mar 2023 15:28:25 -0500 Subject: [PATCH] change property names for custom speech --- lib/routes/api/speech-credentials.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/routes/api/speech-credentials.js b/lib/routes/api/speech-credentials.js index 2e5f1e9..3b072d2 100644 --- a/lib/routes/api/speech-credentials.js +++ b/lib/routes/api/speech-credentials.js @@ -54,6 +54,8 @@ const encryptCredential = (obj) => { stt_region, riva_server_uri, instance_id, + custom_stt_url, + custom_tts_url, auth_token = '' } = obj; @@ -121,7 +123,7 @@ const encryptCredential = (obj) => { default: if (vendor.startsWith('custom:')) { - const customData = JSON.stringify({auth_token}); + const customData = JSON.stringify({auth_token, custom_stt_url, custom_tts_url}); return encrypt(customData); } else assert(false, `invalid or missing vendor: ${vendor}`); @@ -237,7 +239,9 @@ router.get('/', async(req, res) => { } else if (obj.vendor.startsWith('custom:')) { const o = JSON.parse(decrypt(credential)); - return {...obj, ...o}; + obj.auth_token = obscureKey(o.auth_token); + obj.custom_stt_url = o.custom_stt_url; + obj.custom_tts_url = o.custom_tts_url; } return obj; })); @@ -307,6 +311,8 @@ router.get('/:sid', async(req, res) => { else if (obj.vendor.startsWith('custom:')) { const o = JSON.parse(decrypt(credential)); obj.auth_token = obscureKey(o.auth_token); + obj.custom_stt_url = o.custom_stt_url; + obj.custom_tts_url = o.custom_tts_url; } res.status(200).json(obj); } catch (err) {