@@ -154,7 +154,7 @@ var ConnectView = View.extend({
154
154
evt . preventDefault ( ) ;
155
155
this . toggle ( 'authOpen' ) ;
156
156
if ( this . authOpen ) {
157
- this . authMethod = this . previousAuthMethod || 'SCRAM-SHA-1 ' ;
157
+ this . authMethod = this . previousAuthMethod || 'MONGODB ' ;
158
158
} else {
159
159
this . authMethod = null ;
160
160
}
@@ -285,7 +285,7 @@ var ConnectView = View.extend({
285
285
* and accoutrement people are actually using IRL.
286
286
*
287
287
* metrics.trackEvent('connect success', {
288
- * auth_mechanism : model.auth_mechanism ,
288
+ * authentication : model.authentication ,
289
289
* ssl: model.ssl
290
290
* });
291
291
*/
@@ -309,7 +309,7 @@ var ConnectView = View.extend({
309
309
* @api private
310
310
*/
311
311
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)`
313
313
debug ( 'showing error message' , {
314
314
err : err ,
315
315
model : model
@@ -362,16 +362,9 @@ var ConnectView = View.extend({
362
362
onConnectionSelected : function ( model ) {
363
363
// If the new model has auth, expand the auth settings container
364
364
// 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 ;
373
366
374
- if ( model . auth_mechanism !== null ) {
367
+ if ( model . authentication !== 'NONE' ) {
375
368
this . authOpen = true ;
376
369
} else {
377
370
this . authOpen = false ;
@@ -382,7 +375,7 @@ var ConnectView = View.extend({
382
375
// so we need to get a list of what keys are currently
383
376
// available to set.
384
377
var keys = [ 'name' , 'port' , 'hostname' ] ;
385
- if ( model . auth_mechanism ) {
378
+ if ( model . authentication !== 'NONE' ) {
386
379
keys . push . apply ( keys , _ . pluck ( authFields [ this . authMethod ] , 'name' ) ) ;
387
380
}
388
381
@@ -398,22 +391,22 @@ var ConnectView = View.extend({
398
391
// @todo (imlucas): Consolidate w/ `./auth-fields.js`.
399
392
var authMethods = [
400
393
{
401
- _id : 'SCRAM-SHA-1 ' ,
394
+ _id : 'MONGODB ' ,
402
395
title : 'User/Password' ,
403
396
enabled : true
404
397
} ,
405
398
{
406
- _id : 'GSSAPI ' ,
399
+ _id : 'KERBEROS ' ,
407
400
title : 'Kerberos' ,
408
401
enabled : app . isFeatureEnabled ( 'Connect with Kerberos' )
409
402
} ,
410
403
{
411
- _id : 'PLAIN ' ,
404
+ _id : 'LDAP ' ,
412
405
title : 'LDAP' ,
413
406
enabled : app . isFeatureEnabled ( 'Connect with LDAP' )
414
407
} ,
415
408
{
416
- _id : 'MONGODB- X509' ,
409
+ _id : 'X509' ,
417
410
title : 'X.509' ,
418
411
enabled : app . isFeatureEnabled ( 'Connect with X.509' )
419
412
}
0 commit comments