@@ -14,8 +14,8 @@ let clientKrb = null;
14
14
const DEFAULT_NAMESPACE = 'No Namespace' ;
15
15
16
16
module . exports = {
17
- connect : function ( connectionInfo , logger , cb , app ) {
18
- const kerberos = app . require ( 'kerberos' ) ;
17
+ connect : async function ( connectionInfo , logger , cb , app ) {
18
+ const kerberos = await app . require ( 'kerberos' ) ;
19
19
logger . log ( 'info' , connectionInfo , 'Connection information' , connectionInfo . hiddenKeys ) ;
20
20
21
21
let options = setAuthData (
@@ -29,7 +29,7 @@ module.exports = {
29
29
if ( ! clientKrb && options . krb5 ) {
30
30
logger . log (
31
31
'info' ,
32
- Object . assign ( { } , options . krb5 , { platform : process . platform } ) ,
32
+ { ... options . krb5 , platform : process . platform } ,
33
33
'Kerberos options' ,
34
34
connectionInfo . hiddenKeys ,
35
35
) ;
@@ -57,10 +57,10 @@ module.exports = {
57
57
}
58
58
} ,
59
59
60
- testConnection : function ( connectionInfo , logger , cb , app ) {
60
+ testConnection : async function ( connectionInfo , logger , cb , app ) {
61
61
logger . clear ( ) ;
62
62
63
- this . connect (
63
+ await this . connect (
64
64
connectionInfo ,
65
65
logger ,
66
66
err => {
@@ -81,10 +81,10 @@ module.exports = {
81
81
) ;
82
82
} ,
83
83
84
- getDbCollectionsNames : function ( connectionInfo , logger , cb , app ) {
84
+ getDbCollectionsNames : async function ( connectionInfo , logger , cb , app ) {
85
85
logger . clear ( ) ;
86
86
87
- this . connect (
87
+ await this . connect (
88
88
connectionInfo ,
89
89
logger ,
90
90
err => {
@@ -606,7 +606,7 @@ function handleVersion(version, versions) {
606
606
}
607
607
608
608
function setAuthData ( options , connectionInfo ) {
609
- let authParams = { } ;
609
+ const authParams = { } ;
610
610
611
611
if ( connectionInfo . auth === 'kerberos' ) {
612
612
authParams . krb5 = {
@@ -616,9 +616,10 @@ function setAuthData(options, connectionInfo) {
616
616
} ;
617
617
}
618
618
619
- options = Object . assign ( options , authParams ) ;
620
-
621
- return options ;
619
+ return {
620
+ ...options ,
621
+ ...authParams ,
622
+ } ;
622
623
}
623
624
624
625
const handleResponse = response => {
0 commit comments