Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ldapjs

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ldapjs - npm Package Compare versions

Comparing version 0.1.8 to 0.1.9

1

docs/index.md

@@ -83,3 +83,2 @@ ---

* Referrals
* LDIF

@@ -86,0 +85,0 @@ * Aliases

8

lib/attribute.js

@@ -91,8 +91,6 @@ // Copyright 2011 Mark Cavage, Inc. All rights reserved.

ber.writeString(this.type);
if (this.vals && this.vals.length) {
ber.startSequence(Protocol.LBER_SET);
ber.writeStringArray(this.vals);
ber.endSequence();
}
ber.startSequence(Protocol.LBER_SET);
ber.writeStringArray(this.vals && this.vals.length ? this.vals : []);
ber.endSequence();
ber.endSequence();

@@ -99,0 +97,0 @@ return ber;

@@ -29,3 +29,3 @@ // Copyright 2011 Mark Cavage, Inc. All rights reserved.

Object.keys(obj).forEach(function(k) {
self[k] = obj[k];
self[k.toLowerCase()] = obj[k];
});

@@ -70,3 +70,3 @@ }

trim();
rdn[attr] = value;
rdn[attr.toLowerCase()] = value;
if (cur >= len || name[cur] !== '+')

@@ -73,0 +73,0 @@ break;

@@ -46,3 +46,11 @@ // Copyright 2011 Mark Cavage, Inc. All rights reserved.

self.attributes.forEach(function(a) {
obj[a.type] = a.vals.length > 1 ? a.vals.slice() : a.vals[0];
if (a.vals && a.vals.length) {
if (a.vals.length > 1) {
obj[a.type] = a.vals.slice();
} else {
obj[a.type] = a.vals[0];
}
} else {
obj[a.type] = [];
}
});

@@ -49,0 +57,0 @@ return obj;

@@ -244,3 +244,5 @@ // Copyright 2011 Mark Cavage, Inc. All rights reserved.

this.log = options.log4js.getLogger('Server');
this.log4js = options.log4js;
this.log = this.log4js.getLogger('Server');
var log = this.log;

@@ -247,0 +249,0 @@

@@ -6,3 +6,3 @@ {

"description": "LDAP client and server APIs",
"version": "0.1.8",
"version": "0.1.9",
"repository": {

@@ -9,0 +9,0 @@ "type": "git",

@@ -98,2 +98,14 @@ // Copyright 2011 Mark Cavage, Inc. All rights reserved.

server.search('dc=empty', function(req, res, next) {
res.send({
dn: 'dc=empty',
attributes: {
member: [],
'member;range=0-1': ['cn=user1, dc=empty','cn=user2, dc=empty']
}
});
res.end();
return next();
});
server.unbind(function(req, res, next) {

@@ -385,2 +397,30 @@ res.end();

test('search empty attribute', function(t) {
client.search('dc=empty', '(objectclass=*)', function(err, res) {
t.ifError(err);
t.ok(res);
var gotEntry = 0;
res.on('searchEntry', function(entry) {
var obj = entry.toObject();
t.equal('dc=empty', obj.dn);
t.ok(obj.member);
t.equal(obj.member.length, 0);
t.ok(obj['member;range=0-1']);
t.ok(obj['member;range=0-1'].length);
gotEntry++;
});
res.on('error', function(err) {
t.fail(err);
});
res.on('end', function(res) {
t.ok(res);
t.ok(res instanceof ldap.SearchResponse);
t.equal(res.status, 0);
t.equal(gotEntry, 1);
t.end();
});
});
});
test('shutdown', function(t) {

@@ -387,0 +427,0 @@ client.unbind(function() {

@@ -126,1 +126,9 @@ // Copyright 2011 Mark Cavage, Inc. All rights reserved.

});
test('case insensitive attribute names GH-20', function(t) {
var dn1 = dn.parse('CN=foo, dc=bar');
t.ok(dn1.equals('cn=foo, dc=bar'));
t.ok(dn1.equals(dn.parse('cn=foo, DC=bar')));
t.end();
});

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc