@@ -154,7 +154,7 @@ var ConnectView = View.extend({
154154 evt . preventDefault ( ) ;
155155 this . toggle ( 'authOpen' ) ;
156156 if ( this . authOpen ) {
157- this . authMethod = this . previousAuthMethod || 'SCRAM-SHA-1 ' ;
157+ this . authMethod = this . previousAuthMethod || 'MONGODB ' ;
158158 } else {
159159 this . authMethod = null ;
160160 }
@@ -285,7 +285,7 @@ var ConnectView = View.extend({
285285 * and accoutrement people are actually using IRL.
286286 *
287287 * metrics.trackEvent('connect success', {
288- * auth_mechanism : model.auth_mechanism ,
288+ * authentication : model.authentication ,
289289 * ssl: model.ssl
290290 * });
291291 */
@@ -309,7 +309,7 @@ var ConnectView = View.extend({
309309 * @api private
310310 */
311311 onError : function ( err , model ) {
312- // @todo (imlucas): `metrics.trackEvent('connect error', auth_mechanism + ssl boolean)`
312+ // @todo (imlucas): `metrics.trackEvent('connect error', authentication + ssl boolean)`
313313 debug ( 'showing error message' , {
314314 err : err ,
315315 model : model
@@ -362,16 +362,9 @@ var ConnectView = View.extend({
362362 onConnectionSelected : function ( model ) {
363363 // If the new model has auth, expand the auth settings container
364364 // and select the correct tab.
365- // @note (imlucas): gross, but `this.authMethod` is only used
366- // for managing auth-fields.js so make this pretty when
367- // there's more time.
368- if ( model . auth_mechanism === 'MONGODB-CR' ) {
369- this . authMethod = 'SCRAM-SHA-1' ;
370- } else {
371- this . authMethod = model . auth_mechanism ;
372- }
365+ this . authMethod = model . authentication ;
373366
374- if ( model . auth_mechanism !== null ) {
367+ if ( model . authentication !== 'NONE' ) {
375368 this . authOpen = true ;
376369 } else {
377370 this . authOpen = false ;
@@ -382,7 +375,7 @@ var ConnectView = View.extend({
382375 // so we need to get a list of what keys are currently
383376 // available to set.
384377 var keys = [ 'name' , 'port' , 'hostname' ] ;
385- if ( model . auth_mechanism ) {
378+ if ( model . authentication !== 'NONE' ) {
386379 keys . push . apply ( keys , _ . pluck ( authFields [ this . authMethod ] , 'name' ) ) ;
387380 }
388381
@@ -398,22 +391,22 @@ var ConnectView = View.extend({
398391 // @todo (imlucas): Consolidate w/ `./auth-fields.js`.
399392 var authMethods = [
400393 {
401- _id : 'SCRAM-SHA-1 ' ,
394+ _id : 'MONGODB ' ,
402395 title : 'User/Password' ,
403396 enabled : true
404397 } ,
405398 {
406- _id : 'GSSAPI ' ,
399+ _id : 'KERBEROS ' ,
407400 title : 'Kerberos' ,
408401 enabled : app . isFeatureEnabled ( 'Connect with Kerberos' )
409402 } ,
410403 {
411- _id : 'PLAIN ' ,
404+ _id : 'LDAP ' ,
412405 title : 'LDAP' ,
413406 enabled : app . isFeatureEnabled ( 'Connect with LDAP' )
414407 } ,
415408 {
416- _id : 'MONGODB- X509' ,
409+ _id : 'X509' ,
417410 title : 'X.509' ,
418411 enabled : app . isFeatureEnabled ( 'Connect with X.509' )
419412 }
0 commit comments