change property names for custom speech

This commit is contained in:
Dave Horton
2023-03-02 15:28:25 -05:00
parent 4934e2a1ca
commit e573f6ab06

View File

@@ -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) {