passport-saml
Advanced tools
Comparing version 1.3.3 to 1.3.4
@@ -34,4 +34,6 @@ var util = require('util'); | ||
self._saml = new saml.SAML(Object.assign({}, self._options, samlOptions)); | ||
self.constructor.super_.prototype.authenticate.call(self, req, options); | ||
var samlService = new saml.SAML(Object.assign({}, self._options, samlOptions)); | ||
var strategy = Object.assign({}, self, {_saml: samlService}); | ||
Object.setPrototypeOf(strategy, self); | ||
self.constructor.super_.prototype.authenticate.call(strategy, req, options); | ||
}); | ||
@@ -48,4 +50,6 @@ }; | ||
self._saml = new saml.SAML(Object.assign({}, self._options, samlOptions)); | ||
self.constructor.super_.prototype.logout.call(self, req, callback); | ||
var samlService = new saml.SAML(Object.assign({}, self._options, samlOptions)); | ||
var strategy = Object.assign({}, self, {_saml: samlService}); | ||
Object.setPrototypeOf(strategy, self); | ||
self.constructor.super_.prototype.logout.call(strategy, req, callback); | ||
}); | ||
@@ -66,4 +70,6 @@ }; | ||
self._saml = new saml.SAML(Object.assign({}, self._options, samlOptions)); | ||
return callback(null, self.constructor.super_.prototype.generateServiceProviderMetadata.call(self, decryptionCert, signingCert )); | ||
var samlService = new saml.SAML(Object.assign({}, self._options, samlOptions)); | ||
var strategy = Object.assign({}, self, {_saml: samlService}); | ||
Object.setPrototypeOf(strategy, self); | ||
return callback(null, self.constructor.super_.prototype.generateServiceProviderMetadata.call(strategy, decryptionCert, signingCert)); | ||
}); | ||
@@ -70,0 +76,0 @@ }; |
{ | ||
"name": "passport-saml", | ||
"version": "1.3.3", | ||
"version": "1.3.4", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -82,2 +82,5 @@ Passport-SAML | ||
> :warning: **There's a race condition [bug](https://github.com/bergie/passport-saml/issues/425) in versions < 1.3.3 which makes it vulnerable to DOS attacks**: Please use > 1.3.3 if you want to use this issue | ||
#### The profile object: | ||
@@ -84,0 +87,0 @@ |
@@ -71,2 +71,3 @@ 'use strict'; | ||
it('uses given options to setup internal saml provider', function(done) { | ||
var superAuthenticateStub = this.superAuthenticateStub; | ||
var samlOptions = { | ||
@@ -88,3 +89,5 @@ issuer: 'http://foo.issuer', | ||
fn(null, samlOptions); | ||
strategy._saml.options.should.containEql(Object.assign({}, | ||
sinon.assert.calledOnce(superAuthenticateStub) | ||
superAuthenticateStub.calledWith(Object.assign( | ||
{}, | ||
{ cacheProvider: 'mock cache provider' }, | ||
@@ -109,15 +112,15 @@ samlOptions | ||
beforeEach(function() { | ||
this.superAuthenticateStub = sinon.stub(SamlStrategy.prototype, 'logout'); | ||
this.superLogoutMock = sinon.stub(SamlStrategy.prototype, 'logout'); | ||
}); | ||
afterEach(function() { | ||
this.superAuthenticateStub.restore(); | ||
this.superLogoutMock.restore(); | ||
}); | ||
it('calls super with request and auth options', function(done) { | ||
var superAuthenticateStub = this.superAuthenticateStub; | ||
var superLogoutMock = this.superLogoutMock; | ||
function getSamlOptions (req, fn) { | ||
try { | ||
fn(); | ||
sinon.assert.calledOnce(superAuthenticateStub); | ||
sinon.assert.calledOnce(superLogoutMock); | ||
done(); | ||
@@ -154,2 +157,3 @@ } catch (err2) { | ||
it('uses given options to setup internal saml provider', function(done) { | ||
var superLogoutMock = this.superLogoutMock; | ||
var samlOptions = { | ||
@@ -171,3 +175,7 @@ issuer: 'http://foo.issuer', | ||
fn(null, samlOptions); | ||
strategy._saml.options.should.containEql(samlOptions); | ||
sinon.assert.calledOnce(superLogoutMock) | ||
superLogoutMock.calledWith(Object.assign( | ||
{}, | ||
samlOptions | ||
)); | ||
done(); | ||
@@ -174,0 +182,0 @@ } catch (err2) { |
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
474046
4907
388