Skip to content

Commit

Permalink
Merge pull request watson-developer-cloud#848 from watson-developer-c…
Browse files Browse the repository at this point in the history
…loud/allow-access-token-for-stt

fix: make `access_token` an allowable query parameter for websockets
  • Loading branch information
dpopp07 authored Mar 15, 2019
2 parents 900217b + a2ad09e commit 923c668
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/recognize-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ const QUERY_PARAMS_ALLOWED = [
'watson-token',
'language_customization_id',
'customization_id',
'acoustic_customization_id'
'acoustic_customization_id',
'access_token'
];

interface RecognizeStream extends Duplex {
Expand Down Expand Up @@ -97,6 +98,7 @@ class RecognizeStream extends Duplex {
* @param {String} [options.model='en-US_BroadbandModel'] - voice model to use. Microphone streaming only supports broadband models.
* @param {String} [options.url='wss://stream.watsonplatform.net/speech-to-text/api'] base URL for service
* @param {String} [options.token] - Auth token
* @param {String} [options.access_token] - IAM auth token
* @param {Object} [options.headers] - Only works in Node.js, not in browsers. Allows for custom headers to be set, including an Authorization header (preventing the need for auth tokens)
* @param {String} [options.content-type='audio/wav'] - content type of audio; can be automatically determined from file header in most cases. only wav, flac, ogg/opus, and webm are supported
* @param {Boolean} [options.interim_results=false] - Send back non-final previews of each "sentence" as it is being processed. These results are ignored in text mode.
Expand Down
4 changes: 3 additions & 1 deletion lib/synthesize-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ const QUERY_PARAMS_ALLOWED = [
'voice',
'customization_id',
'x-watson-learning-opt-out',
'x-watson-metadata'
'x-watson-metadata',
'access_token'
];

interface SynthesizeStream extends Readable {
Expand Down Expand Up @@ -75,6 +76,7 @@ class SynthesizeStream extends Readable {
* @param {String} [options.customization_id] - The customization ID (GUID) of a custom voice model that is to be used for the synthesis.
* @param {String} [options.url='wss://stream.watsonplatform.net/speech-to-text/api'] base URL for service
* @param {String} [options.watson-token] - Auth token
* @param {String} [options.access_token] - IAM auth token
* @param {Object} [options.headers] - Only works in Node.js, not in browsers. Allows for custom headers to be set, including an Authorization header (preventing the need for auth tokens)
* @param {Boolean} [options.x-watson-learning-opt-out=false] - set to true to opt-out of allowing Watson to use this request to improve it's services
* @param {String} [options.x-watson-metadata] - Associates a customer ID with data that is passed over the connection.
Expand Down

0 comments on commit 923c668

Please sign in to comment.