Skip to content

Fix deprecation upgrade code for speech credentials#2824

Merged
corinagum merged 7 commits intomicrosoft:masterfrom
compulim:fix-2822
Jan 17, 2020
Merged

Fix deprecation upgrade code for speech credentials#2824
corinagum merged 7 commits intomicrosoft:masterfrom
compulim:fix-2822

Conversation

@compulim
Copy link
Copy Markdown
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
Copy Markdown
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