@@ -16,10 +16,10 @@ export class ServiceLDAP extends Service {
16
16
type : "url"
17
17
} ,
18
18
bindDN : {
19
- needsRestart : true ,
20
19
type : "string"
21
20
} ,
22
21
entitlements : {
22
+ description : "attributes to build a entitlement query" ,
23
23
attributes : {
24
24
base : {
25
25
type : "string"
@@ -54,7 +54,7 @@ export class ServiceLDAP extends Service {
54
54
}
55
55
56
56
/**
57
- * authorize user / password
57
+ * authorize with username and password
58
58
* @param {Object } props
59
59
* @param {string } props.username
60
60
* @param {string } props.password
@@ -74,19 +74,23 @@ export class ServiceLDAP extends Service {
74
74
}
75
75
76
76
try {
77
- this . trace ( `bind ${ expand ( this . bindDN ) } ` ) ;
78
- await this . client . bind ( expand ( this . bindDN ) , password ) ;
77
+ constant bindDN = expand ( this . bindDN ) ;
78
+
79
+ this . trace ( `bind ${ bindDN } ` ) ;
80
+ await this . client . bind ( bindDN , password ) ;
79
81
80
82
const searchOptions = {
81
83
scope : this . entitlements . scope ,
82
84
filter : expand ( this . entitlements . filter ) ,
83
85
attributes : [ this . entitlements . attribute ]
84
86
} ;
85
87
86
- this . trace ( `search ${ expand ( this . entitlements . base ) } ${ JSON . stringify ( searchOptions ) } ` ) ;
88
+ const base = expand ( this . entitlements . base ) ;
89
+
90
+ this . trace ( `search ${ base } ${ JSON . stringify ( searchOptions ) } ` ) ;
87
91
88
92
const { searchEntries } = await this . client . search (
89
- expand ( this . entitlements . base ) ,
93
+ base ,
90
94
searchOptions
91
95
) ;
92
96
0 commit comments