Skip to content

Commit ba28fc3

Browse files
authored
Merge pull request #102 from gugan-guidanz/master
Added option to handle search timeLimit configurable
2 parents 31896b4 + d5f53dd commit ba28fc3

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Optional ldapjs options, see [ldapjs documentation](https://github.com/mcavage/n
7373
- `queueSize`
7474
- `queueTimeout`
7575
- `queueDisable`
76+
- `timeLimit`
7677

7778
## How it works
7879

lib/ldapauth.js

+11
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ function LdapAuth(opts) {
9999
socketPath: opts.socketPath,
100100
log: opts.log,
101101
timeout: opts.timeout,
102+
timeLimit: opts.timeLimit,
102103
connectTimeout: opts.connectTimeout,
103104
idleTimeout: opts.idleTimeout,
104105
reconnect: opts.reconnect,
@@ -307,6 +308,11 @@ LdapAuth.prototype._findUser = function (username, callback) {
307308

308309
var searchFilter = self.opts.searchFilter.replace(/{{username}}/g, sanitizeInput(username));
309310
var opts = { filter: searchFilter, scope: self.opts.searchScope };
311+
312+
if (self.opts.timeLimit){
313+
opts.timeLimit = self.opts.timeLimit;
314+
}
315+
310316
if (self.opts.searchAttributes) {
311317
opts.attributes = self.opts.searchAttributes;
312318
}
@@ -362,6 +368,11 @@ LdapAuth.prototype._findGroups = function (user, callback) {
362368
var searchFilter = self.opts.groupSearchFilter(user);
363369

364370
var opts = { filter: searchFilter, scope: self.opts.groupSearchScope };
371+
372+
if (self.opts.timeLimit){
373+
opts.timeLimit = self.opts.timeLimit;
374+
}
375+
365376
if (self.opts.groupSearchAttributes) {
366377
opts.attributes = self.opts.groupSearchAttributes;
367378
}

0 commit comments

Comments
 (0)