Minor client argument fixes, and broken search response send() with no filtering option
This commit is contained in:
parent
03dad8c9a1
commit
a80758b917
|
@ -156,7 +156,7 @@ module.exports = Client;
|
|||
* @throws {TypeError} on invalid input.
|
||||
*/
|
||||
Client.prototype.bind = function(name, credentials, controls, callback, conn) {
|
||||
if (typeof(name) !== 'string')
|
||||
if (typeof(name) !== 'string' && !(name instanceof dn.DN))
|
||||
throw new TypeError('name (string) required');
|
||||
if (typeof(credentials) !== 'string')
|
||||
throw new TypeError('credentials (string) required');
|
||||
|
@ -172,7 +172,7 @@ Client.prototype.bind = function(name, credentials, controls, callback, conn) {
|
|||
var self = this;
|
||||
|
||||
var req = new BindRequest({
|
||||
name: dn.parse(name),
|
||||
name: (typeof(name) === 'string') ? dn.parse(name) : name,
|
||||
authentication: 'Simple',
|
||||
credentials: credentials,
|
||||
controls: controls
|
||||
|
@ -486,7 +486,7 @@ Client.prototype.modifyDN = function(name, newName, controls, callback) {
|
|||
* @throws {TypeError} on invalid input.
|
||||
*/
|
||||
Client.prototype.search = function(base, options, controls, callback) {
|
||||
if (typeof(base) !== 'string')
|
||||
if (typeof(base) !== 'string' && !(base instanceof dn.DN))
|
||||
throw new TypeError('base (string) required');
|
||||
if (Array.isArray(options) || (options instanceof Control)) {
|
||||
controls = options;
|
||||
|
@ -520,7 +520,7 @@ Client.prototype.search = function(base, options, controls, callback) {
|
|||
throw new TypeError('callback (function) required');
|
||||
|
||||
var req = new SearchRequest({
|
||||
baseObject: dn.parse(base),
|
||||
baseObject: typeof(base) === 'string' ? dn.parse(base) : base,
|
||||
scope: options.scope || 'base',
|
||||
filter: options.filter,
|
||||
derefAliases: Protocol.NEVER_DEREF_ALIASES,
|
||||
|
|
|
@ -63,7 +63,7 @@ SearchResponse.prototype.send = function(entry, nofiltering) {
|
|||
var _a = a.toLowerCase();
|
||||
if (!nofiltering && _a.length && _a[0] === '_') {
|
||||
delete entry.attributes[a];
|
||||
} else if (self.notAttributes.indexOf(_a) !== -1) {
|
||||
} else if (!nofiltering && self.notAttributes.indexOf(_a) !== -1) {
|
||||
delete entry.attributes[a];
|
||||
} else if (all) {
|
||||
// noop
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"name": "ldapjs",
|
||||
"homepage": "http://ldapjs.org",
|
||||
"description": "LDAP client and server APIs",
|
||||
"version": "0.2.3",
|
||||
"version": "0.2.4",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/mcavage/node-ldapjs.git"
|
||||
|
@ -13,9 +13,10 @@
|
|||
"node": ">=0.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"asn1": "~0.1.6",
|
||||
"asn1": "~0.1.7",
|
||||
"buffertools": "~1.0.3",
|
||||
"dtrace-provider": "~0.0.3",
|
||||
"nopt": "~1.0.10",
|
||||
"sprintf": "~0.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
Loading…
Reference in New Issue