-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add /api/speech
endpoint
#680
Conversation
Coverage Report •
|
2119904
to
4406044
Compare
I think you've just made the same comment - but maybe some co-ordination with #660. It feels like maybe this goes in first and shows how to get config? What are your thoughts? |
Actually, this PR removes the ability to fetch config from the Will update |
@cecheta so we're on the same page:
|
Sounds good, although I was going to try to remove the secret from the config response in #683 , however I don't mind if you remove it in yours since I haven't started yet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😎
* Add `/api/speech/token` endpoint * Re-introduce `/api/config` * Move env vars * Remove `AZURE_SUBSCRIPTION_ID` * Log error * Rename to `/api/speech`, remove `/api/config`
Closes #501, required by #101
Purpose
This PR adds a new
/api/speech
endpoint, which uses the Speech Key to return a short-lived token that the frontend can use to call the speech service.The frontend calls the endpoint every time the microphone button is pressed.
When using RBAC, the speech key is fetched directly from Azure as it is not present on any env var.
https://github.com/Azure-Samples/cognitive-services-speech-sdk/blob/master/samples/js/browser/README.md#token-exchange-process
The PR also refactors some of the tests/mocking in
test_app.py
,so the mocking of the env_helper is done in one place.Does this introduce a breaking change?
Pull Request Type
What kind of change does this Pull Request introduce?
How to Test
What to Check
Verify that the following are valid