Merge pull request #19602 from Bonial-International-GmbH/pjungermann/saml

chore(deps): replace `passport-saml` with `@node-saml/passport-saml`
This commit is contained in:
Fredrik Adelöw
2023-08-25 16:17:09 +02:00
committed by GitHub
4 changed files with 98 additions and 41 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-auth-backend': patch
---
Replace `passport-saml` with `@node-saml/passport-saml` (since 4.0.0).
+1 -1
View File
@@ -47,6 +47,7 @@
"@backstage/types": "workspace:^",
"@davidzemon/passport-okta-oauth": "^0.0.5",
"@google-cloud/firestore": "^6.0.0",
"@node-saml/passport-saml": "^4.0.4",
"@types/express": "^4.17.6",
"@types/passport": "^1.0.3",
"compression": "^1.7.4",
@@ -77,7 +78,6 @@
"passport-microsoft": "^1.0.0",
"passport-oauth2": "^1.6.1",
"passport-onelogin-oauth": "^0.0.1",
"passport-saml": "^3.1.2",
"uuid": "^8.0.0",
"winston": "^3.2.1",
"yn": "^4.0.0"
@@ -15,16 +15,16 @@
*/
import express from 'express';
import { SamlConfig } from 'passport-saml/lib/passport-saml/types';
import { SamlConfig } from '@node-saml/passport-saml';
import {
Strategy as SamlStrategy,
Profile as SamlProfile,
Strategy as SamlStrategy,
VerifiedCallback,
VerifyWithoutRequest,
} from 'passport-saml';
} from '@node-saml/passport-saml';
import {
executeFrameHandlerStrategy,
executeRedirectStrategy,
PassportDoneCallback,
} from '../../lib/passport';
import {
AuthProviderRouteHandlers,
@@ -62,17 +62,18 @@ export class SamlAuthProvider implements AuthProviderRouteHandlers {
this.signInResolver = options.signInResolver;
this.authHandler = options.authHandler;
this.resolverContext = options.resolverContext;
this.strategy = new SamlStrategy({ ...options }, ((
fullProfile: SamlProfile,
done: PassportDoneCallback<SamlAuthResult>,
const verifier: VerifyWithoutRequest = (
profile: SamlProfile | null,
done: VerifiedCallback,
) => {
// TODO: There's plenty more validation and profile handling to do here,
// this provider is currently only intended to validate the provider pattern
// for non-oauth auth flows.
// TODO: This flow doesn't issue an identity token that can be used to validate
// the identity of the user in other backends, which we need in some form.
done(undefined, { fullProfile });
}) as VerifyWithoutRequest);
done(null, { fullProfile: profile });
};
this.strategy = new SamlStrategy(options, verifier, verifier);
}
async start(req: express.Request, res: express.Response): Promise<void> {
+82 -31
View File
@@ -4768,6 +4768,7 @@ __metadata:
"@backstage/types": "workspace:^"
"@davidzemon/passport-okta-oauth": ^0.0.5
"@google-cloud/firestore": ^6.0.0
"@node-saml/passport-saml": ^4.0.4
"@types/body-parser": ^1.19.0
"@types/cookie-parser": ^1.4.2
"@types/express": ^4.17.6
@@ -4810,7 +4811,6 @@ __metadata:
passport-microsoft: ^1.0.0
passport-oauth2: ^1.6.1
passport-onelogin-oauth: ^0.0.1
passport-saml: ^3.1.2
supertest: ^6.1.3
uuid: ^8.0.0
winston: ^3.2.1
@@ -13451,6 +13451,39 @@ __metadata:
languageName: node
linkType: hard
"@node-saml/node-saml@npm:^4.0.4":
version: 4.0.5
resolution: "@node-saml/node-saml@npm:4.0.5"
dependencies:
"@types/debug": ^4.1.7
"@types/passport": ^1.0.11
"@types/xml-crypto": ^1.4.2
"@types/xml-encryption": ^1.2.1
"@types/xml2js": ^0.4.11
"@xmldom/xmldom": ^0.8.6
debug: ^4.3.4
xml-crypto: ^3.0.1
xml-encryption: ^3.0.2
xml2js: ^0.5.0
xmlbuilder: ^15.1.1
checksum: 7d97575111a381ef2d0f16e1fc85ae3f84322ccba06dcb0594b00cf598e429658f45e479b78836943f69f249c08a8593e5168404acf7f1ed659ead53ceef465e
languageName: node
linkType: hard
"@node-saml/passport-saml@npm:^4.0.4":
version: 4.0.4
resolution: "@node-saml/passport-saml@npm:4.0.4"
dependencies:
"@node-saml/node-saml": ^4.0.4
"@types/express": ^4.17.14
"@types/passport": ^1.0.11
"@types/passport-strategy": ^0.2.35
passport: ^0.6.0
passport-strategy: ^1.0.0
checksum: 75178669d7d47038c33bb0602454cb5030fc9b3ecdcae9163a35cef436bc6c22e68e57d06213e0118ff1cb0dcd2f2fa25112672ebe4cbad90578df21bec67fce
languageName: node
linkType: hard
"@nodelib/fs.scandir@npm:2.1.5":
version: 2.1.5
resolution: "@nodelib/fs.scandir@npm:2.1.5"
@@ -17278,7 +17311,7 @@ __metadata:
languageName: node
linkType: hard
"@types/express@npm:*, @types/express@npm:^4.17.13, @types/express@npm:^4.17.17, @types/express@npm:^4.17.6":
"@types/express@npm:*, @types/express@npm:^4.17.13, @types/express@npm:^4.17.14, @types/express@npm:^4.17.17, @types/express@npm:^4.17.6":
version: 4.17.17
resolution: "@types/express@npm:4.17.17"
dependencies:
@@ -17971,7 +18004,7 @@ __metadata:
languageName: node
linkType: hard
"@types/passport@npm:*, @types/passport@npm:^1.0.3":
"@types/passport@npm:*, @types/passport@npm:^1.0.11, @types/passport@npm:^1.0.3":
version: 1.0.12
resolution: "@types/passport@npm:1.0.12"
dependencies:
@@ -18612,7 +18645,26 @@ __metadata:
languageName: node
linkType: hard
"@types/xml2js@npm:*, @types/xml2js@npm:^0.4.7":
"@types/xml-crypto@npm:^1.4.2":
version: 1.4.2
resolution: "@types/xml-crypto@npm:1.4.2"
dependencies:
"@types/node": "*"
xpath: 0.0.27
checksum: 8fe8fc709ba070c46249800105301a533eb95e1a7a696986e4ac753aed1d238a826bce2b1e0d2548559e03f4e57bee27e26df69417766814bc0dd6a9bf2a1763
languageName: node
linkType: hard
"@types/xml-encryption@npm:^1.2.1":
version: 1.2.1
resolution: "@types/xml-encryption@npm:1.2.1"
dependencies:
"@types/node": "*"
checksum: abfc6d779e1674c268258296e9c03b307cb80383c5d598c0cda1ad75dc901b8d4104b5818990086b08bac199dbe7374706913a29c58cf614a741847f912854f1
languageName: node
linkType: hard
"@types/xml2js@npm:*, @types/xml2js@npm:^0.4.11, @types/xml2js@npm:^0.4.7":
version: 0.4.11
resolution: "@types/xml2js@npm:0.4.11"
dependencies:
@@ -19151,13 +19203,20 @@ __metadata:
languageName: node
linkType: hard
"@xmldom/xmldom@npm:^0.7.0, @xmldom/xmldom@npm:^0.7.5, @xmldom/xmldom@npm:^0.7.6":
"@xmldom/xmldom@npm:^0.7.5":
version: 0.7.9
resolution: "@xmldom/xmldom@npm:0.7.9"
checksum: 66e37b7800132f891b885b2eceeeebc53f60b69789da10276f1584256b963d79a28c7ae2071bc53a9cd842d9b03554c761b2701fe8036d6052f26bcd0ae8f2bb
languageName: node
linkType: hard
"@xmldom/xmldom@npm:^0.8.5, @xmldom/xmldom@npm:^0.8.6, @xmldom/xmldom@npm:^0.8.8":
version: 0.8.10
resolution: "@xmldom/xmldom@npm:0.8.10"
checksum: 4c136aec31fb3b49aaa53b6fcbfe524d02a1dc0d8e17ee35bd3bf35e9ce1344560481cd1efd086ad1a4821541482528672306d5e37cdbd187f33d7fadd3e2cf0
languageName: node
linkType: hard
"@xobotyi/scrollbar-width@npm:^1.9.5":
version: 1.9.5
resolution: "@xobotyi/scrollbar-width@npm:1.9.5"
@@ -34987,21 +35046,6 @@ __metadata:
languageName: node
linkType: hard
"passport-saml@npm:^3.1.2":
version: 3.2.4
resolution: "passport-saml@npm:3.2.4"
dependencies:
"@xmldom/xmldom": ^0.7.6
debug: ^4.3.2
passport-strategy: ^1.0.0
xml-crypto: ^2.1.3
xml-encryption: ^2.0.0
xml2js: ^0.4.23
xmlbuilder: ^15.1.1
checksum: 8e885af4d44c2d862b2ea0d051ab2a36bc6f9a70e62f90daf7ce4eefd126ac2ab4d5fc070693eba05f5e1be248af23fa018611bbfa7fad31708371f387f5dd77
languageName: node
linkType: hard
"passport-strategy@npm:1.x.x, passport-strategy@npm:^1.0.0":
version: 1.0.0
resolution: "passport-strategy@npm:1.0.0"
@@ -43090,24 +43134,24 @@ __metadata:
languageName: node
linkType: hard
"xml-crypto@npm:^2.1.3":
version: 2.1.3
resolution: "xml-crypto@npm:2.1.3"
"xml-crypto@npm:^3.0.1":
version: 3.2.0
resolution: "xml-crypto@npm:3.2.0"
dependencies:
"@xmldom/xmldom": ^0.7.0
"@xmldom/xmldom": ^0.8.8
xpath: 0.0.32
checksum: 04273568b4ed3d1422b7e93ae7c5e8e14180e9d377038a5767ef6af4d1da2ec766f3a476f4cf0140ecedb93036dac63e563f60d9bb249c5a344d77c93c07ff87
checksum: 6c4974a7518307ea006dcfc1405f61c6738b45574b4d9d1e62f53b602bfcf894d34017f99d618f26f67c40a5e6d78e6228116ded2768b2ca5b2df5c8bf7774b7
languageName: node
linkType: hard
"xml-encryption@npm:^2.0.0":
version: 2.0.0
resolution: "xml-encryption@npm:2.0.0"
"xml-encryption@npm:^3.0.2":
version: 3.0.2
resolution: "xml-encryption@npm:3.0.2"
dependencies:
"@xmldom/xmldom": ^0.7.0
"@xmldom/xmldom": ^0.8.5
escape-html: ^1.0.3
xpath: 0.0.32
checksum: a454445704c5e3aa3f992128c413c02f3c00c346cb0d63b01beae4b6a341cfc0a52a0219ccec47dcce250e336ba7b09d95909913b1f199ca43604961a00a1995
checksum: aac1b987d5de5becfc747c88c3a656c00799a153ab541078b875a69e1ac1f1c2f29bf85f22eab6a78382dc2919f79401a916cc392aba7994475919e0695893eb
languageName: node
linkType: hard
@@ -43125,7 +43169,7 @@ __metadata:
languageName: node
linkType: hard
"xml2js@npm:^0.4.11, xml2js@npm:^0.4.19, xml2js@npm:^0.4.23":
"xml2js@npm:^0.4.11, xml2js@npm:^0.4.19":
version: 0.4.23
resolution: "xml2js@npm:0.4.23"
dependencies:
@@ -43190,6 +43234,13 @@ __metadata:
languageName: node
linkType: hard
"xpath@npm:0.0.27":
version: 0.0.27
resolution: "xpath@npm:0.0.27"
checksum: 51f45d211a9a552a8f6a12a474061e89bafb07e0aecd4bad18a557411feb975919c158e1a66e4ea0542198c6ed442481d9f709c625cca57b97aaedeaeded902e
languageName: node
linkType: hard
"xpath@npm:0.0.32":
version: 0.0.32
resolution: "xpath@npm:0.0.32"