passport-ldapauth
Advanced tools
Comparing version 0.2.3 to 0.2.4
## Changes | ||
* v0.2.4 | ||
* Inherit from [passport-strategy](https://github.com/jaredhanson/passport-strategy) like `passport-local` and others do. | ||
* v0.2.3 | ||
@@ -4,0 +6,0 @@ * Documentation using the same keys as ldapjs (bindDn and bindCredentials) |
var Strategy = require('./strategy'); | ||
// Export directly from package since there is nothing else to export | ||
exports = module.exports = Strategy; | ||
// Export constructor like before for compatibility | ||
exports.Strategy = Strategy; |
@@ -6,3 +6,3 @@ "use strict"; | ||
*/ | ||
var passport = require('passport'), | ||
var passport = require('passport-strategy'), | ||
LdapAuth = require('ldapauth-fork'), | ||
@@ -9,0 +9,0 @@ util = require('util'); |
@@ -15,3 +15,3 @@ { | ||
], | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"license": { | ||
@@ -33,14 +33,12 @@ "type": "MIT", | ||
"dependencies": { | ||
"ldapauth-fork": "~2.2.17" | ||
"passport-strategy": "1.x.x", | ||
"ldapauth-fork": "~2.2.18" | ||
}, | ||
"peerDependencies": { | ||
"passport": "~0.2.0" | ||
}, | ||
"devDependencies": { | ||
"body-parser": "1.9.x", | ||
"chai": "1.9.x", | ||
"body-parser": "1.10.x", | ||
"chai": "1.10.x", | ||
"express": "4.9.x", | ||
"ldapjs": "0.7.x", | ||
"mocha": "1.21.x", | ||
"supertest": "0.14.x", | ||
"mocha": "2.1.x", | ||
"supertest": "0.15.x", | ||
"passport": "~0.2.0" | ||
@@ -47,0 +45,0 @@ }, |
@@ -21,3 +21,3 @@ # passport-ldapauth | ||
```javascript | ||
var LdapStrategy = require('passport-ldapauth').Strategy; | ||
var LdapStrategy = require('passport-ldapauth'); | ||
@@ -69,3 +69,4 @@ passport.use(new LdapStrategy({ | ||
passport = require('passport'), | ||
LdapStrategy = require('passport-ldapauth').Strategy; | ||
bodyParser = require('body-parser'), | ||
LdapStrategy = require('passport-ldapauth'); | ||
@@ -86,6 +87,5 @@ var OPTS = { | ||
app.configure(function() { | ||
app.use(express.bodyParser()); | ||
app.use(passport.initialize()); | ||
}); | ||
app.use(bodyParser.json()); | ||
app.use(bodyParser.urlencoded({extended: false})); | ||
app.use(passport.initialize()); | ||
@@ -147,3 +147,3 @@ app.post('/login', passport.authenticate('ldapauth', {session: false}), function(req, res) { | ||
var LdapStrategy = require('passport-ldapauth').Strategy; | ||
var LdapStrategy = require('passport-ldapauth'); | ||
@@ -150,0 +150,0 @@ passport.use(new LdapStrategy(getLDAPConfiguration, |
var should = require('chai').Should(), | ||
LdapStrategy = require('passport-ldapauth').Strategy, | ||
LdapStrategy = require('passport-ldapauth'), | ||
request = require('supertest'), | ||
@@ -48,2 +48,22 @@ ldapserver = require('./ldapserver'), | ||
it("should export Strategy constructor directly", function(cb) { | ||
require('passport-ldapauth').should.be.a('function'); | ||
cb(); | ||
}); | ||
it("should export Strategy constructor separately as well", function(cb) { | ||
var strategy = require('passport-ldapauth').Strategy; | ||
strategy.should.be.a('function'); | ||
(function() { | ||
new strategy(BASE_OPTS); | ||
}).should.not.throw(Error); | ||
cb(); | ||
}); | ||
it("should be named ldapauth", function(cb) { | ||
var s = new LdapStrategy(BASE_OPTS); | ||
s.name.should.equal('ldapauth'); | ||
cb(); | ||
}); | ||
it("should throw an error if no arguments are provided", function(cb) { | ||
@@ -50,0 +70,0 @@ (function() { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25770
14
518
+ Addedpassport-strategy@1.x.x
- Removedpassport@0.2.2(transitive)
- Removedpause@0.0.1(transitive)
Updatedldapauth-fork@~2.2.18