New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

passport-ldapauth

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

passport-ldapauth - npm Package Compare versions

Comparing version 0.2.6 to 0.3.0

2

CHANGES.md
## Changes
* v0.3.0
* [#10](https://github.com/vesse/passport-ldapauth/issues/10) - Add support for fetching groups. While this is really coming from [ldapauth-fork](https://github.com/vesse/node-ldapauth-fork), updated the minor version of this library as well to draw attention to new features.
* v0.2.5

@@ -4,0 +6,0 @@ * [#21](https://github.com/vesse/passport-ldapauth/issues/21) - Handle `constraintViolationError` as a login failure instead of an error.

8

package.json

@@ -17,3 +17,3 @@ {

],
"version": "0.2.6",
"version": "0.3.0",
"license": {

@@ -36,7 +36,7 @@ "type": "MIT",

"passport-strategy": "1.x.x",
"ldapauth-fork": "~2.2.18"
"ldapauth-fork": "~2.3.0"
},
"devDependencies": {
"body-parser": "1.10.x",
"chai": "1.10.x",
"body-parser": "1.12.x",
"chai": "2.1.x",
"express": "4.9.x",

@@ -43,0 +43,0 @@ "ldapjs": "0.7.x",

@@ -46,4 +46,17 @@ var ldap = require('ldapjs');

server.search(SUFFIX, authorize, function(req, res, next) {
if (req.filter.value == 'valid') {
if (req.filter.attribute === 'uid' && req.filter.value === 'valid') {
res.send(db['valid']);
} else if (req.filter.attribute === 'member' && req.filter.value === db.valid.dn) {
res.send({
dn: 'cn=Group 1, ou=passport-ldapauth',
attributes: {
name: 'Group 1'
}
});
res.send({
dn: 'cn=Group 2, ou=passport-ldapauth',
attributes: {
name: 'Group 2'
}
});
}

@@ -50,0 +63,0 @@ res.end();

@@ -231,3 +231,3 @@ var should = require('chai').Should(),

});
describe("with options as function returning dynamic sets", function() {

@@ -287,2 +287,32 @@ var OPTS = JSON.parse(JSON.stringify(BASE_OPTS));

});
describe("with group fetch settings defined", function() {
var OPTS = JSON.parse(JSON.stringify(BASE_OPTS));
OPTS.server.groupSearchBase = 'ou=passport-ldapauth';
OPTS.server.groupSearchScope = 'sub';
OPTS.server.groupSearchFilter = '(member={{dn}})';
it("should return groups for user", function(cb) {
start_servers(OPTS, BASE_TEST_OPTS)(function() {
var req = {body: {username: 'valid', password: 'valid'}},
s = new LdapStrategy(OPTS, function(user, done) {
req.should.have.keys('body');
req.body.should.have.keys(['username', 'password']);
done(null, user);
});
s.success = function(user) {
should.exist(user);
user.uid.should.equal('valid');
user._groups.length.should.equal(2);
user._groups[0].name.should.equal('Group 1');
user._groups[1].name.should.equal('Group 2');
cb();
};
s.authenticate(req);
});
});
});
});
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