Skip to content
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

Fix deprecation upgrade code for speech credentials #2824

Merged
merged 7 commits into from
Jan 17, 2020

Conversation

compulim
Copy link
Contributor

@compulim compulim commented Jan 16, 2020

Fixes #2822.

Changelog Entry

Fixed

  • Fixes #2822. Fixed credentials should return authorizationToken and subscriptionKey as string and allow empty LUIS reference grammar ID, by @compulim in PR #2824

Description

The change introduced in #2759 has a deprecation upgrade code. But the deprecation upgrade code was broken.

The deprecation upgrade code should turns authorization token and subscription key, into the format of credentials = async () => ({ authorizationToken: '...', region: 'westus2' }) (or subscriptionKey).

The deprecation upgrade code should handle these types of authorization token and subscription key:

  • String
  • Promise that resolves into a string
  • Function that returns a string
  • Promise function that returns a string

This PR also update to use .eslintignore.

Specific Changes

  • Updated createCognitiveServicesSpeechServicesPonyfillFactory.js
    • For deprecation upgrade, build the credentials so that it will return a () => Promise<{ authorizationToken: string, region: string }>
    • If LUIS reference grammar ID is not supplied, it will send an empty array, instead of luis/undefined-PRODUCTION
  • Added .eslintignore

  • Testing Added

Copy link
Contributor

@corinagum corinagum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@corinagum corinagum merged commit 0b0708f into microsoft:master Jan 17, 2020
@compulim compulim mentioned this pull request Mar 5, 2020
40 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Speech should accept authorizationToken in string format
2 participants