Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit 19f2c16

Browse files
msimersonpfmooney
authored andcommitted
Allow simple client bind with empty credentials
Fix #254
1 parent 773a1c6 commit 19f2c16

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
- Add options for format preservation
2929
- Removed `spaced()` and `rndSpaced` from DN API
3030
- Fix parent/child rules regarding empty DNs
31+
- #254 Allow simple client bind with empty credentials
3132

3233
## 0.7.1
3334

lib/client/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ Client.prototype.bind = function bind(name,
465465
_bypass) {
466466
if (typeof (name) !== 'string' && !(name instanceof dn.DN))
467467
throw new TypeError('name (string) required');
468-
assert.string(credentials, 'credentials');
468+
assert.optionalString(credentials, 'credentials');
469469
if (typeof (controls) === 'function') {
470470
callback = controls;
471471
controls = [];

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"Yunong Xiao <[email protected]>",
99
"Denis Vuyka <[email protected]>",
1010
"Pedro Palazón <[email protected]>",
11-
"Patrick Mooney <[email protected]>"
11+
"Patrick Mooney <[email protected]>",
12+
"Matt Simerson <[email protected]>"
1213
],
1314
"name": "ldapjs",
1415
"homepage": "http://ldapjs.org",

test/client.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,14 @@ test('simple bind success', function (t) {
274274
});
275275
});
276276

277+
test('simple anonymous bind (empty credentials)', function (t) {
278+
client.bind('', '', function (err, res) {
279+
t.ifError(err);
280+
t.ok(res);
281+
t.equal(res.status, 0);
282+
t.end();
283+
});
284+
});
277285

278286
test('auto-bind bad credentials', function (t) {
279287
var clt = ldap.createClient({

0 commit comments

Comments
 (0)