Allow simple client bind with empty credentials
Fix mcavage/node-ldapjs#254
This commit is contained in:
parent
773a1c6fd2
commit
19f2c16783
|
@ -28,6 +28,7 @@
|
|||
- Add options for format preservation
|
||||
- Removed `spaced()` and `rndSpaced` from DN API
|
||||
- Fix parent/child rules regarding empty DNs
|
||||
- #254 Allow simple client bind with empty credentials
|
||||
|
||||
## 0.7.1
|
||||
|
||||
|
|
|
@ -465,7 +465,7 @@ Client.prototype.bind = function bind(name,
|
|||
_bypass) {
|
||||
if (typeof (name) !== 'string' && !(name instanceof dn.DN))
|
||||
throw new TypeError('name (string) required');
|
||||
assert.string(credentials, 'credentials');
|
||||
assert.optionalString(credentials, 'credentials');
|
||||
if (typeof (controls) === 'function') {
|
||||
callback = controls;
|
||||
controls = [];
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
"Yunong Xiao <yunong@joyent.com>",
|
||||
"Denis Vuyka <denis.vuyka@gmail.com>",
|
||||
"Pedro Palazón <kusorbox@gmail.com>",
|
||||
"Patrick Mooney <patrick.f.mooney@gmail.com>"
|
||||
"Patrick Mooney <patrick.f.mooney@gmail.com>",
|
||||
"Matt Simerson <matt@tnpi.net>"
|
||||
],
|
||||
"name": "ldapjs",
|
||||
"homepage": "http://ldapjs.org",
|
||||
|
|
|
@ -274,6 +274,14 @@ test('simple bind success', function (t) {
|
|||
});
|
||||
});
|
||||
|
||||
test('simple anonymous bind (empty credentials)', function (t) {
|
||||
client.bind('', '', function (err, res) {
|
||||
t.ifError(err);
|
||||
t.ok(res);
|
||||
t.equal(res.status, 0);
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
|
||||
test('auto-bind bad credentials', function (t) {
|
||||
var clt = ldap.createClient({
|
||||
|
|
Loading…
Reference in New Issue