From 8d872ac0f832b807a295005ae61a11f0f2be8374 Mon Sep 17 00:00:00 2001 From: Jonathon Hill Date: Wed, 6 Jun 2018 17:57:42 -0400 Subject: [PATCH] Upgrade dependencies --- package.json | 27 ++++++++++++++------------- test/fixture/samlp-server.js | 17 ++++++++--------- test/fixture/wsfed-server.js | 17 ++++++++--------- test/saml11.tests.js | 2 +- test/saml20.tests.js | 2 +- test/samlp.functional.tests.js | 4 ++-- 6 files changed, 34 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index 4abb96f..63e9fee 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,8 @@ }, "main": "./lib/passport-wsfed-saml2", "dependencies": { - "cryptiles": "~0.2.2", - "ejs": "2.5.5", + "cryptiles": "^4.1.1", + "ejs": "^2.6.1", "jsonwebtoken": "~5.0.4", "passport-strategy": "^1.0.0", "uid2": "0.0.x", @@ -30,20 +30,21 @@ "xml2js": "0.1.x", "xmldom": "auth0/xmldom#v0.1.19-auth0_1", "xpath": "0.0.5", - "xtend": "~2.0.3" + "xtend": "^4.0.1" }, "devDependencies": { - "chai": "2.x.x", - "chai-passport-strategy": "1.x.x", - "cheerio": "~0.19.0", - "express": "~3.1.0", - "mocha": "~1.8.1", - "passport": "^0.3.2", - "request": "~2.14.0", - "saml": "~0.4.4", - "samlp": "~0.4.3", + "body-parser": "^1.18.3", + "chai": "^2.3.0", + "chai-passport-strategy": "^1.0.1", + "cheerio": "^0.22.0", + "express": "^4.16.3", + "mocha": "^5.2.0", + "passport": "^0.4.0", + "request": "^2.87.0", + "saml": "^0.12.4", + "samlp": "^3.4.0", "should": "~1.1.0", - "wsfed": "~0.3.5" + "wsfed": "^4.0.0" }, "engines": { "node": ">= 0.6.0" diff --git a/test/fixture/samlp-server.js b/test/fixture/samlp-server.js index c8fc337..68e6525 100644 --- a/test/fixture/samlp-server.js +++ b/test/fixture/samlp-server.js @@ -1,4 +1,5 @@ var express = require('express'); +var bodyParser = require('body-parser'); var http = require('http'); var samlp = require('samlp'); var xtend = require('xtend'); @@ -295,14 +296,12 @@ module.exports.start = function(options, callback){ var app = express(); - app.configure(function(){ - this.use(express.bodyParser()); - this.use(passport.initialize()); - this.use(passport.session()); - this.use(function(req,res,next){ - req.user = fakeUser; - next(); - }); + app.use(bodyParser.urlencoded({ extended: false })); + app.use(passport.initialize()); + app.use(passport.session()); + app.use(function(req,res,next){ + req.user = fakeUser; + next(); }); function getPostURL (audience, samlRequestDom, req, callback) { @@ -407,7 +406,7 @@ module.exports.start = function(options, callback){ app.post('/callback/samlp-with-invalid-xml', function (req, res, next) { passport.authenticate('samlp-with-utf8', { protocol: 'samlp' }, function(err, user, info) { - res.send(400, { message: err.message }); + res.status(400).send({ message: err.message }); })(req, res, next); }, function(req, res) { diff --git a/test/fixture/wsfed-server.js b/test/fixture/wsfed-server.js index 2a068ef..d299a3f 100644 --- a/test/fixture/wsfed-server.js +++ b/test/fixture/wsfed-server.js @@ -1,4 +1,5 @@ var express = require('express'); +var bodyParser = require('body-parser'); var http = require('http'); var wsfed = require('wsfed'); var xtend = require('xtend'); @@ -59,14 +60,12 @@ module.exports.start = function(options, callback){ var app = express(); - app.configure(function(){ - this.use(express.bodyParser()); - this.use(passport.initialize()); - this.use(passport.session()); - this.use(function(req,res,next){ - req.user = fakeUser; - next(); - }); + app.use(bodyParser.urlencoded({ extended: false })); + app.use(passport.initialize()); + app.use(passport.session()); + app.use(function(req,res,next){ + req.user = fakeUser; + next(); }); function getPostURL (wtrealm, wreply, req, callback) { @@ -84,7 +83,7 @@ module.exports.start = function(options, callback){ app.post('/callback/wresult-with-invalid-xml', function (req, res, next) { passport.authenticate('wsfed-saml2', function(err, user, info) { - res.send(400, { message: err.message }); + res.status(400).send({ message: err.message }); })(req, res, next); }, function(req, res) { diff --git a/test/saml11.tests.js b/test/saml11.tests.js index 4e8072b..0382976 100644 --- a/test/saml11.tests.js +++ b/test/saml11.tests.js @@ -113,7 +113,7 @@ describe('saml 1.1 assertion', function () { const saml_passport = new SamlPassport(options); const profile = saml_passport.validateSamlAssertion(signedAssertion, function(err, profile) { should.exists(err); - assert.equal('The signing certificate is invalid (PEM_read_bio_PUBKEY failed)', err.message); + assert.equal('error:0D07209B:asn1 encoding routines:ASN1_get_object:too long', err.message); done(); }); }); diff --git a/test/saml20.tests.js b/test/saml20.tests.js index 6029af0..f558536 100644 --- a/test/saml20.tests.js +++ b/test/saml20.tests.js @@ -192,7 +192,7 @@ describe('saml 2.0 assertion', function () { const saml_passport = new SamlPassport(options); const profile = saml_passport.validateSamlAssertion(signedAssertion, function(err, profile) { should.exists(err); - assert.equal('The signing certificate is invalid (PEM_read_bio_PUBKEY failed)', err.message); + assert.equal('error:0D07209B:asn1 encoding routines:ASN1_get_object:too long', err.message); done(); }); }); diff --git a/test/samlp.functional.tests.js b/test/samlp.functional.tests.js index 60b0d32..cea4cd6 100644 --- a/test/samlp.functional.tests.js +++ b/test/samlp.functional.tests.js @@ -393,8 +393,8 @@ describe('samlp (functional tests)', function () { it('should post to idp', function(){ expect(r.statusCode).to.equal(200); - expect(r.headers['content-type']).to.equal('text/html'); - expect(r.headers['content-type']).to.equal('text/html'); + expect(r.headers['content-type']).to.equal('text/html; charset=utf-8'); + expect(r.headers['content-type']).to.equal('text/html; charset=utf-8'); expect($('form').attr('action')).to.equal('http://localhost:5051/samlp'); });