From e4b3da7361caeaee0608dfdeb1a1605b7917e9c9 Mon Sep 17 00:00:00 2001 From: Andrii Kostenko Date: Thu, 4 Feb 2021 12:44:27 +0200 Subject: [PATCH 1/3] Update readme on using multiSamlStrategy passport-saml/multiSamlStrategy.js is something I'd like to remove: 1. it contains nothing, just import 2. it is outside of the source root and tsc/other tools don't include this file 3. old import depends on internal structure of the project 4. it uses module-level export For now let's keep the file for compatibility, but let's update README so new people will not use the old way --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3cfb6a7b..92dfdc0d 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ The examples utilize the [Feide OpenIdp identity provider](https://openidp.feide The SAML identity provider will redirect you to the URL provided by the `path` configuration. ```javascript -var SamlStrategy = require('passport-saml').Strategy; +const SamlStrategy = require('passport-saml').Strategy; [...] passport.use(new SamlStrategy( @@ -48,7 +48,7 @@ passport.use(new SamlStrategy( You can pass a `getSamlOptions` parameter to `MultiSamlStrategy` which will be called before the SAML flows. Passport-SAML will pass in the request object so you can decide which configuation is appropriate. ```javascript -var MultiSamlStrategy = require('passport-saml/multiSamlStrategy'); +const { MultiSamlStrategy } = require('passport-saml'); [...] passport.use(new MultiSamlStrategy( From 46c6df1e13459b38d269308689430cfebfc9fa78 Mon Sep 17 00:00:00 2001 From: "andrii@short.io" Date: Sun, 7 Feb 2021 14:27:01 +0000 Subject: [PATCH 2/3] remove multisaml strategy in the old location --- multiSamlStrategy.d.ts | 2 -- multiSamlStrategy.js | 2 -- 2 files changed, 4 deletions(-) delete mode 100644 multiSamlStrategy.d.ts delete mode 100644 multiSamlStrategy.js diff --git a/multiSamlStrategy.d.ts b/multiSamlStrategy.d.ts deleted file mode 100644 index 888696c5..00000000 --- a/multiSamlStrategy.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as MultiSAMLStrategy from "./lib/passport-saml/multiSamlStrategy"; -export = MultiSAMLStrategy; diff --git a/multiSamlStrategy.js b/multiSamlStrategy.js deleted file mode 100644 index d0abf8fd..00000000 --- a/multiSamlStrategy.js +++ /dev/null @@ -1,2 +0,0 @@ -const MultiSamlStrategy = require("./lib/passport-saml/multiSamlStrategy.js"); -module.exports = MultiSamlStrategy; From 6182ddefc9d7bd65643c73ba3eca763eee0d0bf2 Mon Sep 17 00:00:00 2001 From: "andrii@short.io" Date: Sun, 7 Feb 2021 14:32:03 +0000 Subject: [PATCH 3/3] update tests to use multisamlstrategy.js from the correct place --- test/multiSamlStrategy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/multiSamlStrategy.js b/test/multiSamlStrategy.js index 84d54f21..eb5896b1 100644 --- a/test/multiSamlStrategy.js +++ b/test/multiSamlStrategy.js @@ -3,7 +3,7 @@ var sinon = require("sinon"); var should = require("should"); var SamlStrategy = require("../lib/passport-saml/index.js").Strategy; -var MultiSamlStrategy = require("../multiSamlStrategy"); +var MultiSamlStrategy = require("../lib/passport-saml/multiSamlStrategy"); function verify() {}