Skip to content

Commit 9b68b8a

Browse files
committed
remove redundant code
1 parent dcd9cff commit 9b68b8a

File tree

2 files changed

+1
-165
lines changed

2 files changed

+1
-165
lines changed

services/speech_to_text/v1.js

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,7 @@ module.exports = function (RED) {
2525
pkg = require('../../package.json'),
2626
serviceutils = require('../../utilities/service-utils'),
2727
payloadutils = require('../../utilities/payload-utils'),
28-
iamutils = require('../../utilities/iam-utils'),
2928
sttutils = require('./stt-utils'),
30-
//AuthV1 = require('watson-developer-cloud/authorization/v1'),
31-
//AuthIAMV1 = require('ibm-cloud-sdk-core/iam-token-manager/v1'),
32-
//AuthIAMV1 = require('ibm-cloud-sdk-core/auth/iam-token-manager-v1'),
33-
//AuthIAMV1 = require('ibm-cloud-sdk-core/auth/token-managers/iam-token-manager'),
3429
{ IamTokenManager } = require('ibm-watson/auth');
3530
muteMode = true, discardMode = false, autoConnect = true,
3631
apikey = '', sApikey = '',
@@ -323,33 +318,9 @@ module.exports = function (RED) {
323318

324319
function determineTokenService(stt) {
325320
let tokenService = null;
326-
327321
if (apikey) {
328-
// console.log('API Key stuff to go here');
329-
// tokenService = new AuthV1(stt.getCredentials());
330-
// console.log('the keys that we have are ', stt.getCredentials());
331-
// let creds = {}; // stt.getCredentials();
332-
// creds.iamApikey = apikey;
333-
// console.log('Creating token with endpoint ', endpoint);
334-
// tokenService = new AuthIAMV1.IamTokenManagerV1({iamApikey : apikey, iamUrl: endpoint});
335-
336-
//tokenService = new AuthIAMV1({apikey : apikey});
337-
//tokenService = new AuthIAMV1.IamTokenManagerV1({iamApikey : apikey});
338-
//tokenService = new AuthIAMV1.IamTokenManager({apikey : apikey});
339322
tokenService = new IamTokenManager({apikey : apikey});
340-
//tokenService = new iamutils(apikey);
341-
342-
} //else {
343-
//tokenService = new AuthV1(stt.getCredentials());
344-
//}
345-
346-
// Streaming - IAM Key fudge.
347-
// Check if the token service options have the header set. If not then
348-
// create them. This will stop the function from crashing the app,
349-
// altough it will still fail authentication.
350-
//if (!tokenService._options.headers) {
351-
// tokenService._options.headers = {};
352-
//}
323+
}
353324
return tokenService;
354325
}
355326

utilities/iam-utils.js

Lines changed: 0 additions & 135 deletions
This file was deleted.

0 commit comments

Comments
 (0)