From 371ea9d8742cba39ca1ae06a04245eeef8b563f0 Mon Sep 17 00:00:00 2001 From: Matt Kangas Date: Wed, 18 Nov 2015 14:17:58 -0500 Subject: [PATCH 1/3] INT-856 Move X509 to last position in AuthenticationOptionCollection --- src/connect/authentication.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/connect/authentication.js b/src/connect/authentication.js index 19414c0e317..fbb22899643 100644 --- a/src/connect/authentication.js +++ b/src/connect/authentication.js @@ -129,6 +129,6 @@ module.exports = new AuthenticationOptionCollection([ NONE, MONGODB, KERBEROS, - X509, - LDAP + LDAP, + X509 ]); From b9169172cae644ebfa23c6438304d24b57eea8e9 Mon Sep 17 00:00:00 2001 From: Matt Kangas Date: Wed, 18 Nov 2015 14:36:16 -0500 Subject: [PATCH 2/3] INT-856 filter X509 from AuthenticationOptionCollection when disabled --- src/connect/authentication.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/connect/authentication.js b/src/connect/authentication.js index fbb22899643..3ebe4f71906 100644 --- a/src/connect/authentication.js +++ b/src/connect/authentication.js @@ -7,6 +7,7 @@ var AuthenticationOptionCollection = require('./models/authentication-option-col var InputView = require('./input-view'); var inputTemplate = require('./input-default.jade'); +var _ = require('lodash'); var NONE = { _id: 'NONE', @@ -88,7 +89,7 @@ var X509 = { title: 'X.509', // @todo (imlucas) Fix `app.isFeatureEnabled` is not a function. // enabled: app.isFeatureEnabled('Connect with X.509'), - enabled: true, + enabled: false, fields: [ new InputView({ template: inputTemplate, @@ -125,10 +126,12 @@ var LDAP = { ] }; -module.exports = new AuthenticationOptionCollection([ +var allAuthModes = [ NONE, MONGODB, KERBEROS, LDAP, X509 -]); +]; + +module.exports = new AuthenticationOptionCollection(_.filter(allAuthModes, 'enabled')); From 1853829d391c37e304b418f0564ee1bd3f177096 Mon Sep 17 00:00:00 2001 From: Matt Kangas Date: Wed, 18 Nov 2015 14:38:51 -0500 Subject: [PATCH 3/3] :style: move X509 definition down in file to match selection UI --- src/connect/authentication.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/connect/authentication.js b/src/connect/authentication.js index 3ebe4f71906..5f24fa12cf0 100644 --- a/src/connect/authentication.js +++ b/src/connect/authentication.js @@ -84,23 +84,6 @@ var KERBEROS = { ] }; -var X509 = { - _id: 'X509', - title: 'X.509', - // @todo (imlucas) Fix `app.isFeatureEnabled` is not a function. - // enabled: app.isFeatureEnabled('Connect with X.509'), - enabled: false, - fields: [ - new InputView({ - template: inputTemplate, - name: 'x509_username', - label: 'Username', - placeholder: '', - required: true - }) - ] -}; - var LDAP = { _id: 'LDAP', title: 'LDAP', @@ -126,6 +109,23 @@ var LDAP = { ] }; +var X509 = { + _id: 'X509', + title: 'X.509', + // @todo (imlucas) Fix `app.isFeatureEnabled` is not a function. + // enabled: app.isFeatureEnabled('Connect with X.509'), + enabled: false, + fields: [ + new InputView({ + template: inputTemplate, + name: 'x509_username', + label: 'Username', + placeholder: '', + required: true + }) + ] +}; + var allAuthModes = [ NONE, MONGODB,