support aws speech by roleArn (#313)

* support aws speech by roleArn

* support 3 types of aws  credentials

* wip

* wip

* update speech util version
This commit is contained in:
Hoan Luu Huu
2024-05-02 18:57:22 +07:00
committed by GitHub
parent 3b47162d13
commit ce2fa392a4
6 changed files with 69 additions and 20 deletions

View File

@@ -743,6 +743,30 @@ test('speech credentials tests', async(t) => {
});
t.ok(result.statusCode === 204, 'successfully deleted speech credential');
/* add a credential for aws polly by roleArn */
result = await request.post(`/Accounts/${account_sid}/SpeechCredentials`, {
resolveWithFullResponse: true,
auth: authUser,
json: true,
body: {
vendor: 'aws',
labe: 'aws_polly_with_arn',
use_for_tts: true,
use_for_stt: false,
role_arn: 'Arn::aws::role',
aws_region: 'us-east-1'
}
});
t.ok(result.statusCode === 201, 'successfully added speech credential for AWS Polly By RoleArn');
const awsPollySid = result.body.sid;
/* delete the credential */
result = await request.delete(`/Accounts/${account_sid}/SpeechCredentials/${awsPollySid}`, {
auth: authUser,
resolveWithFullResponse: true,
});
t.ok(result.statusCode === 204, 'successfully deleted speech credential');
/* Check google supportedLanguagesAndVoices */
result = await request.get(`/Accounts/${account_sid}/SpeechCredentials/speech/supportedLanguagesAndVoices?vendor=google`, {
resolveWithFullResponse: true,