@@ -53,7 +53,6 @@ const DRIVER_OPTIONS_DEFAULT = { connectWithNoPrimary: true };
53
53
*/
54
54
const PASSWORD_MAPPINGS = {
55
55
mongodb_password : 'mongodbPassword' ,
56
- kerberos_password : 'kerberosPassword' ,
57
56
ldap_password : 'ldapPassword' ,
58
57
ssl_private_key_password : 'sslPass' ,
59
58
ssh_tunnel_password : 'sshTunnelPassword' ,
@@ -221,12 +220,11 @@ assign(props, {
221
220
* @example
222
221
* const c = new Connection({
223
222
* kerberosServiceName: 'mongodb',
224
- * kerberosPassword: 'w@@f ',
225
223
* kerberosPrincipal: 'arlo/dog@krb 5.mongodb.parts',
226
224
* ns: 'kerberos'
227
225
* });
228
226
* console.log(c.driverUrl)
229
- * >>> mongodb://arlo%252Fdog%2540krb5.mongodb.parts:w%40%40f @localhost:27017/kerberos?slaveOk=true&gssapiServiceName=mongodb&authMechanism=GSSAPI
227
+ * >>> mongodb://arlo%252Fdog%2540krb5.mongodb.parts@localhost:27017/kerberos?slaveOk=true&gssapiServiceName=mongodb&authMechanism=GSSAPI
230
228
* console.log(c.driverOptions)
231
229
* >>> { db: { readPreference: 'nearest' }, replSet: { connectWithNoPrimary: true } }
232
230
*
@@ -255,14 +253,6 @@ assign(props, {
255
253
* `mongodb://#{encodeURIComponentRFC3986(this.kerberosPrincipal)}`
256
254
*/
257
255
kerberosPrincipal : { type : 'string' , default : undefined } ,
258
- /**
259
- * You can optionally include a password for a kerberos connection.
260
- * Including a password is useful on windows if you don’t have a
261
- * security domain set up.
262
- * If no password is supplied, it is expected that a valid kerberos
263
- * ticket has already been created for the principal.
264
- */
265
- kerberosPassword : { type : 'string' , default : undefined } ,
266
256
kerberosCanonicalizeHostname : { type : 'boolean' , default : false }
267
257
} ) ;
268
258
@@ -469,15 +459,9 @@ function addAuthToUrl({ url, isPasswordProtected }) {
469
459
} else if ( this . authStrategy === 'X509' && this . x509Username ) {
470
460
username = encodeURIComponentRFC3986 ( this . x509Username ) ;
471
461
authField = username ;
472
- } else if ( this . authStrategy === 'KERBEROS' && this . kerberosPassword ) {
473
- username = encodeURIComponentRFC3986 ( this . kerberosPrincipal ) ;
474
- password = isPasswordProtected
475
- ? '*****'
476
- : encodeURIComponentRFC3986 ( this . kerberosPassword ) ;
477
- authField = format ( '%s:%s' , username , password ) ;
478
462
} else if ( this . authStrategy === 'KERBEROS' ) {
479
463
username = encodeURIComponentRFC3986 ( this . kerberosPrincipal ) ;
480
- authField = format ( '%s: ' , username ) ;
464
+ authField = format ( '%s' , username ) ;
481
465
}
482
466
483
467
// The auth component comes straight after `the mongodb://`
@@ -925,15 +909,6 @@ Connection = AmpersandModel.extend({
925
909
)
926
910
) ;
927
911
}
928
- if ( attrs . kerberosPassword ) {
929
- throw new TypeError (
930
- format (
931
- 'The Kerberos \'Password\' field does not apply when ' +
932
- 'using %s for authentication.' ,
933
- attrs . authStrategy
934
- )
935
- ) ;
936
- }
937
912
} else if ( ! attrs . kerberosPrincipal ) {
938
913
throw new TypeError (
939
914
'The Kerberos \'Principal\' field is required when using \'Kerberos\' for authentication.'
@@ -1122,7 +1097,6 @@ async function createConnectionFromUrl(url) {
1122
1097
attrs . x509Username = user ;
1123
1098
} else if ( attrs . authStrategy === 'KERBEROS' ) {
1124
1099
attrs . kerberosPrincipal = user ;
1125
- attrs . kerberosPassword = password ;
1126
1100
} else if (
1127
1101
attrs . authStrategy === 'MONGODB' ||
1128
1102
attrs . authStrategy === 'SCRAM-SHA-256'
0 commit comments