mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2026-07-23 12:32:06 +00:00
save instance_id as part of ibm stt credential
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user