@@ -35,7 +35,6 @@ export interface UserOptions {
35
35
version ?: string ;
36
36
username ?: string ;
37
37
password ?: string ;
38
- api_key ?: string ;
39
38
apikey ?: string ;
40
39
use_unauthenticated ?: boolean ;
41
40
headers ?: HeaderOptions ;
@@ -57,7 +56,6 @@ export interface BaseServiceOptions extends UserOptions {
57
56
export interface Credentials {
58
57
username ?: string ;
59
58
password ?: string ;
60
- api_key ?: string ;
61
59
url ?: string ;
62
60
iam_access_token ?: string ;
63
61
iam_apikey ?: string ;
@@ -68,7 +66,6 @@ function hasCredentials(obj: any): boolean {
68
66
return (
69
67
obj &&
70
68
( ( obj . username && obj . password ) ||
71
- obj . api_key ||
72
69
obj . iam_access_token ||
73
70
obj . iam_apikey )
74
71
) ;
@@ -122,11 +119,6 @@ export class BaseService {
122
119
}
123
120
const options = extend ( { } , userOptions ) ;
124
121
const _options = this . initCredentials ( options ) ;
125
- // If url is not specified, visual recognition requires gateway-a for CF instances
126
- // https://github.ibm.com/Watson/developer-experience/issues/4589
127
- if ( _options && this . name === 'watson_vision_combined' && ! _options . url && _options . api_key && ! _options . iam_apikey ) {
128
- _options . url = 'https://gateway-a.watsonplatform.net/visual-recognition/api' ;
129
- }
130
122
if ( options . url ) {
131
123
_options . url = stripTrailingSlash ( options . url ) ;
132
124
}
@@ -171,9 +163,6 @@ export class BaseService {
171
163
if ( this . _options . password ) {
172
164
credentials . password = this . _options . password ;
173
165
}
174
- if ( this . _options . api_key ) {
175
- credentials . api_key = this . _options . api_key ;
176
- }
177
166
if ( this . _options . url ) {
178
167
credentials . url = this . _options . url ;
179
168
}
@@ -270,9 +259,6 @@ export class BaseService {
270
259
_options = extend ( _options , options ) ;
271
260
return _options ;
272
261
}
273
- if ( options . api_key || options . apikey ) {
274
- _options . api_key = options . api_key || options . apikey ;
275
- }
276
262
_options . jar = request . jar ( ) ;
277
263
// Get credentials from environment properties or Bluemix,
278
264
// but prefer credentials provided programatically
@@ -299,8 +285,6 @@ export class BaseService {
299
285
) . toString ( 'base64' ) ;
300
286
const authHeader = { Authorization : `Basic ${ encodedCredentials } ` } ;
301
287
_options . headers = extend ( authHeader , _options . headers ) ;
302
- } else {
303
- _options . qs = extend ( { api_key : _options . api_key } , _options . qs ) ;
304
288
}
305
289
}
306
290
}
@@ -331,7 +315,6 @@ export class BaseService {
331
315
const nameWithUnderscore : string = _name . replace ( / - / g, '_' ) ;
332
316
const username : string = process . env [ `${ _name } _USERNAME` ] || process . env [ `${ nameWithUnderscore } _USERNAME` ] ;
333
317
const password : string = process . env [ `${ _name } _PASSWORD` ] || process . env [ `${ nameWithUnderscore } _PASSWORD` ] ;
334
- const apiKey : string = process . env [ `${ _name } _API_KEY` ] || process . env [ `${ nameWithUnderscore } _API_KEY` ] ;
335
318
const url : string = process . env [ `${ _name } _URL` ] || process . env [ `${ nameWithUnderscore } _URL` ] ;
336
319
const iamAccessToken : string = process . env [ `${ _name } _IAM_ACCESS_TOKEN` ] || process . env [ `${ nameWithUnderscore } _IAM_ACCESS_TOKEN` ] ;
337
320
const iamApiKey : string = process . env [ `${ _name } _IAM_APIKEY` ] || process . env [ `${ nameWithUnderscore } _IAM_APIKEY` ] ;
@@ -340,7 +323,6 @@ export class BaseService {
340
323
return {
341
324
username,
342
325
password,
343
- api_key : apiKey ,
344
326
url,
345
327
iam_access_token : iamAccessToken ,
346
328
iam_apikey : iamApiKey ,
0 commit comments