File tree Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ var kerberos_password = new InputView({
78
78
* Define fields for each auth method here
79
79
*/
80
80
module . exports = {
81
+ NONE : [ ] ,
81
82
MONGODB : [
82
83
mongodb_username ,
83
84
mongodb_password ,
@@ -89,5 +90,5 @@ module.exports = {
89
90
kerberos_password
90
91
] ,
91
92
X509 : [ ] ,
92
- PLAIN : [ ]
93
+ LDAP : [ ]
93
94
} ;
Original file line number Diff line number Diff line change @@ -31,7 +31,14 @@ var ConnectView = View.extend({
31
31
form : 'object' ,
32
32
authMethod : {
33
33
type : 'string' ,
34
- default : null
34
+ default : 'NONE' ,
35
+ values : [
36
+ 'NONE' ,
37
+ 'MONGODB' ,
38
+ 'KERBEROS' ,
39
+ 'X509' ,
40
+ 'LDAP'
41
+ ]
35
42
} ,
36
43
previousAuthMethod : {
37
44
type : 'string' ,
@@ -156,7 +163,7 @@ var ConnectView = View.extend({
156
163
if ( this . authOpen ) {
157
164
this . authMethod = this . previousAuthMethod || 'MONGODB' ;
158
165
} else {
159
- this . authMethod = null ;
166
+ this . authMethod = 'NONE' ;
160
167
}
161
168
} ,
162
169
/**
@@ -198,14 +205,14 @@ var ConnectView = View.extend({
198
205
this . reset ( ) ;
199
206
this . form . connection_id = '' ;
200
207
this . form . reset ( ) ;
201
- this . authMethod = null ;
208
+ this . authMethod = 'NONE' ;
202
209
this . authOpen = false ;
203
210
} ,
204
211
onConnectionDestroyed : function ( ) {
205
212
this . reset ( ) ;
206
213
this . form . connection_id = '' ;
207
214
this . form . reset ( ) ;
208
- this . authMethod = null ;
215
+ this . authMethod = 'NONE' ;
209
216
this . authOpen = false ;
210
217
} ,
211
218
@@ -362,6 +369,7 @@ var ConnectView = View.extend({
362
369
onConnectionSelected : function ( model ) {
363
370
// If the new model has auth, expand the auth settings container
364
371
// and select the correct tab.
372
+ model . authentication = model . authentication || 'NONE' ;
365
373
this . authMethod = model . authentication ;
366
374
367
375
if ( model . authentication !== 'NONE' ) {
Original file line number Diff line number Diff line change @@ -26,15 +26,15 @@ module.exports = Connection.extend({
26
26
test : function ( done ) {
27
27
var model = this ;
28
28
debug ( 'Testing connection to `%j`...' , this ) ;
29
- client . test ( app . endpoint , this , function ( err ) {
29
+ client . test ( app . endpoint , model . serialize ( { all : true } ) , function ( err ) {
30
30
if ( err ) {
31
31
bugsnag . notify ( err , 'connection test failed' ) ;
32
32
return done ( err ) ;
33
33
}
34
34
35
35
debug ( 'test worked!' ) ;
36
36
debug ( 'making sure we can get collection list...' ) ;
37
- client ( app . endpoint , this ) . instance ( function ( err , res ) {
37
+ client ( app . endpoint , model . serialize ( { all : true } ) ) . instance ( function ( err , res ) {
38
38
if ( ! err ) {
39
39
debug ( 'woot. all gravy! able to see %s collections' , res . collections . length ) ;
40
40
done ( null , model ) ;
You can’t perform that action at this time.
0 commit comments