@@ -4,7 +4,6 @@ var fs = require('fs')
4
4
5
5
var HttpsProxyAgent = require ( 'https-proxy-agent' )
6
6
var mime = require ( 'mime' )
7
- var netrc = require ( 'netrc' )
8
7
var toCamelCase = require ( 'lodash/camelCase' )
9
8
10
9
var error = require ( './error' )
@@ -349,8 +348,8 @@ var Client = module.exports = function (config) {
349
348
this . auth = false
350
349
return
351
350
}
352
- if ( ! options . type || 'basic|oauth|client|token|integration|netrc ' . indexOf ( options . type ) === - 1 ) {
353
- throw new Error ( "Invalid authentication type, must be 'basic', 'integration', 'oauth', 'client' or 'netrc '" )
351
+ if ( ! options . type || 'basic|oauth|client|token|integration' . indexOf ( options . type ) === - 1 ) {
352
+ throw new Error ( "Invalid authentication type, must be 'basic', 'integration', 'oauth', or 'client '" )
354
353
}
355
354
if ( options . type === 'basic' && ( ! options . username || ! options . password ) ) {
356
355
throw new Error ( 'Basic authentication requires both a username and password to be set' )
@@ -720,14 +719,6 @@ var Client = module.exports = function (config) {
720
719
basic = Buffer . from ( this . auth . username + ':' + this . auth . password , 'ascii' ) . toString ( 'base64' )
721
720
headers [ 'Authorization' ] = 'Basic ' + basic
722
721
break
723
- case 'netrc' :
724
- var auth = netrc ( ) [ host ]
725
- if ( ! auth ) {
726
- throw new Error ( "~/.netrc authentication type chosen but no credentials found for '" + host + "'" )
727
- }
728
- basic = Buffer . from ( auth . login + ':' + auth . password , 'ascii' ) . toString ( 'base64' )
729
- headers [ 'Authorization' ] = 'Basic ' + basic
730
- break
731
722
default :
732
723
break
733
724
}
0 commit comments