@@ -53,7 +53,6 @@ const DRIVER_OPTIONS_DEFAULT = { connectWithNoPrimary: true };
5353 */
5454const PASSWORD_MAPPINGS = {
5555 mongodb_password : 'mongodbPassword' ,
56- kerberos_password : 'kerberosPassword' ,
5756 ldap_password : 'ldapPassword' ,
5857 ssl_private_key_password : 'sslPass' ,
5958 ssh_tunnel_password : 'sshTunnelPassword' ,
@@ -221,12 +220,11 @@ assign(props, {
221220 * @example
222221 * const c = new Connection({
223222 * kerberosServiceName: 'mongodb',
224- * kerberosPassword: 'w@@f ',
225223 * kerberosPrincipal: 'arlo/dog@krb 5.mongodb.parts',
226224 * ns: 'kerberos'
227225 * });
228226 * 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
230228 * console.log(c.driverOptions)
231229 * >>> { db: { readPreference: 'nearest' }, replSet: { connectWithNoPrimary: true } }
232230 *
@@ -255,14 +253,6 @@ assign(props, {
255253 * `mongodb://#{encodeURIComponentRFC3986(this.kerberosPrincipal)}`
256254 */
257255 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 } ,
266256 kerberosCanonicalizeHostname : { type : 'boolean' , default : false }
267257} ) ;
268258
@@ -469,15 +459,9 @@ function addAuthToUrl({ url, isPasswordProtected }) {
469459 } else if ( this . authStrategy === 'X509' && this . x509Username ) {
470460 username = encodeURIComponentRFC3986 ( this . x509Username ) ;
471461 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 ) ;
478462 } else if ( this . authStrategy === 'KERBEROS' ) {
479463 username = encodeURIComponentRFC3986 ( this . kerberosPrincipal ) ;
480- authField = format ( '%s: ' , username ) ;
464+ authField = format ( '%s' , username ) ;
481465 }
482466
483467 // The auth component comes straight after `the mongodb://`
@@ -925,15 +909,6 @@ Connection = AmpersandModel.extend({
925909 )
926910 ) ;
927911 }
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- }
937912 } else if ( ! attrs . kerberosPrincipal ) {
938913 throw new TypeError (
939914 'The Kerberos \'Principal\' field is required when using \'Kerberos\' for authentication.'
@@ -1122,7 +1097,6 @@ async function createConnectionFromUrl(url) {
11221097 attrs . x509Username = user ;
11231098 } else if ( attrs . authStrategy === 'KERBEROS' ) {
11241099 attrs . kerberosPrincipal = user ;
1125- attrs . kerberosPassword = password ;
11261100 } else if (
11271101 attrs . authStrategy === 'MONGODB' ||
11281102 attrs . authStrategy === 'SCRAM-SHA-256'
0 commit comments