@@ -35,7 +35,6 @@ export interface UserOptions {
3535 version ?: string ;
3636 username ?: string ;
3737 password ?: string ;
38- api_key ?: string ;
3938 apikey ?: string ;
4039 use_unauthenticated ?: boolean ;
4140 headers ?: HeaderOptions ;
@@ -57,7 +56,6 @@ export interface BaseServiceOptions extends UserOptions {
5756export interface Credentials {
5857 username ?: string ;
5958 password ?: string ;
60- api_key ?: string ;
6159 url ?: string ;
6260 iam_access_token ?: string ;
6361 iam_apikey ?: string ;
@@ -68,7 +66,6 @@ function hasCredentials(obj: any): boolean {
6866 return (
6967 obj &&
7068 ( ( obj . username && obj . password ) ||
71- obj . api_key ||
7269 obj . iam_access_token ||
7370 obj . iam_apikey )
7471 ) ;
@@ -122,11 +119,6 @@ export class BaseService {
122119 }
123120 const options = extend ( { } , userOptions ) ;
124121 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- }
130122 if ( options . url ) {
131123 _options . url = stripTrailingSlash ( options . url ) ;
132124 }
@@ -171,9 +163,6 @@ export class BaseService {
171163 if ( this . _options . password ) {
172164 credentials . password = this . _options . password ;
173165 }
174- if ( this . _options . api_key ) {
175- credentials . api_key = this . _options . api_key ;
176- }
177166 if ( this . _options . url ) {
178167 credentials . url = this . _options . url ;
179168 }
@@ -270,9 +259,6 @@ export class BaseService {
270259 _options = extend ( _options , options ) ;
271260 return _options ;
272261 }
273- if ( options . api_key || options . apikey ) {
274- _options . api_key = options . api_key || options . apikey ;
275- }
276262 _options . jar = request . jar ( ) ;
277263 // Get credentials from environment properties or Bluemix,
278264 // but prefer credentials provided programatically
@@ -299,8 +285,6 @@ export class BaseService {
299285 ) . toString ( 'base64' ) ;
300286 const authHeader = { Authorization : `Basic ${ encodedCredentials } ` } ;
301287 _options . headers = extend ( authHeader , _options . headers ) ;
302- } else {
303- _options . qs = extend ( { api_key : _options . api_key } , _options . qs ) ;
304288 }
305289 }
306290 }
@@ -331,7 +315,6 @@ export class BaseService {
331315 const nameWithUnderscore : string = _name . replace ( / - / g, '_' ) ;
332316 const username : string = process . env [ `${ _name } _USERNAME` ] || process . env [ `${ nameWithUnderscore } _USERNAME` ] ;
333317 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` ] ;
335318 const url : string = process . env [ `${ _name } _URL` ] || process . env [ `${ nameWithUnderscore } _URL` ] ;
336319 const iamAccessToken : string = process . env [ `${ _name } _IAM_ACCESS_TOKEN` ] || process . env [ `${ nameWithUnderscore } _IAM_ACCESS_TOKEN` ] ;
337320 const iamApiKey : string = process . env [ `${ _name } _IAM_APIKEY` ] || process . env [ `${ nameWithUnderscore } _IAM_APIKEY` ] ;
@@ -340,7 +323,6 @@ export class BaseService {
340323 return {
341324 username,
342325 password,
343- api_key : apiKey ,
344326 url,
345327 iam_access_token : iamAccessToken ,
346328 iam_apikey : iamApiKey ,
0 commit comments