From 1758e9b2087632ceee1d2456aaa5898209d739f3 Mon Sep 17 00:00:00 2001 From: Chris Barth Date: Tue, 15 Nov 2022 16:52:03 -0500 Subject: [PATCH 1/4] Clean up types --- src/index.ts | 2 +- src/multiSamlStrategy.ts | 2 +- src/strategy.ts | 2 +- src/types.ts | 2 +- test/multiSamlStrategy.spec.ts | 58 +++++++++++++++++++--------------- test/strategy.spec.ts | 21 ++++++------ test/types.ts | 2 -- 7 files changed, 45 insertions(+), 44 deletions(-) diff --git a/src/index.ts b/src/index.ts index 9cb460d5..83429542 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,7 +8,7 @@ import type { MultiStrategyConfig, } from "./types"; -export * from "@node-saml/node-saml"; +export { Profile, SAML, SamlConfig } from "@node-saml/node-saml"; export { AbstractStrategy, diff --git a/src/multiSamlStrategy.ts b/src/multiSamlStrategy.ts index fedabe9f..8910d441 100644 --- a/src/multiSamlStrategy.ts +++ b/src/multiSamlStrategy.ts @@ -7,7 +7,7 @@ import { VerifyWithoutRequest, VerifyWithRequest, } from "./types"; -import { SAML, SamlConfig } from "@node-saml/node-saml"; +import { SAML, SamlConfig } from "."; export class MultiSamlStrategy extends AbstractStrategy { static readonly newSamlProviderOnConstruct = false; diff --git a/src/strategy.ts b/src/strategy.ts index 018a6f51..466769d9 100644 --- a/src/strategy.ts +++ b/src/strategy.ts @@ -256,7 +256,7 @@ export abstract class AbstractStrategy extends PassportStrategy { redirect(url: string, status?: number): void { super.redirect(url, status); } - success(user: any, info?: any): void { + success(user: unknown, info?: unknown): void { super.success(user, info); } } diff --git a/src/types.ts b/src/types.ts index 94455695..efcf3593 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,6 +1,6 @@ import type * as express from "express"; import * as passport from "passport"; -import { Profile, SamlConfig } from "@node-saml/node-saml"; +import { Profile, SamlConfig } from "."; export interface AuthenticateOptions extends passport.AuthenticateOptions { samlFallback?: "login-request" | "logout-request"; diff --git a/test/multiSamlStrategy.spec.ts b/test/multiSamlStrategy.spec.ts index 81ede76c..e80466a9 100644 --- a/test/multiSamlStrategy.spec.ts +++ b/test/multiSamlStrategy.spec.ts @@ -5,7 +5,7 @@ import * as sinon from "sinon"; import { expect } from "chai"; import { MultiSamlStrategy, SAML, AbstractStrategy, SamlConfig } from "../src"; import { MultiStrategyConfig, RequestWithUser, StrategyOptionsCallback } from "../src/types"; -import assert = require("assert"); +import * as assert from "assert"; import { FAKE_CERT } from "./types"; const noop = () => undefined; @@ -55,7 +55,8 @@ describe("MultiSamlStrategy()", function () { noop, noop ); - strategy.authenticate("random" as any, "random" as any); + // @ts-expect-error + strategy.authenticate("random", "random"); }); it("passes options on to saml strategy", function (done) { @@ -64,7 +65,7 @@ describe("MultiSamlStrategy()", function () { getSamlOptions: function (req: express.Request, fn: StrategyOptionsCallback) { try { fn(null, { cert: FAKE_CERT, issuer: "onesaml_login" }); - expect(strategy._passReqToCallback!).to.equal(true); + expect(strategy._passReqToCallback).to.equal(true); done(); } catch (err2) { done(err2); @@ -73,7 +74,8 @@ describe("MultiSamlStrategy()", function () { }; const strategy = new MultiSamlStrategy(passportOptions, noop, noop); - strategy.authenticate("random" as any, "random" as any); + // @ts-expect-error + strategy.authenticate("random", "random"); }); it("uses given options to setup internal saml provider", function (done) { @@ -104,11 +106,13 @@ describe("MultiSamlStrategy()", function () { } const strategy = new MultiSamlStrategy( - { getSamlOptions, cacheProvider: "mock cache provider" as any }, + // @ts-expect-error + { getSamlOptions, cacheProvider: "mock cache provider" }, noop, noop ); - strategy.authenticate("random" as any, "random" as any); + // @ts-expect-error + strategy.authenticate("random", "random"); }); }); @@ -172,7 +176,8 @@ describe("MultiSamlStrategy()", function () { } const strategy = new MultiSamlStrategy({ getSamlOptions }, noop, noop); - strategy.logout("random" as any, "random" as any); + // @ts-expect-error + strategy.logout("random", "random"); }); it("passes options on to saml strategy", function (done) { @@ -181,7 +186,7 @@ describe("MultiSamlStrategy()", function () { getSamlOptions: function (req: express.Request, fn: StrategyOptionsCallback) { try { fn(null, { cert: FAKE_CERT, issuer: "onesaml_login" }); - expect(strategy._passReqToCallback!).to.equal(true); + expect(strategy._passReqToCallback).to.equal(true); done(); } catch (err2) { done(err2); @@ -190,7 +195,8 @@ describe("MultiSamlStrategy()", function () { }; const strategy = new MultiSamlStrategy(passportOptions, noop, noop); - strategy.logout("random" as any, "random" as any); + // @ts-expect-error + strategy.logout("random", "random"); }); it("uses given options to setup internal saml provider", function (done) { @@ -220,7 +226,8 @@ describe("MultiSamlStrategy()", function () { } const strategy = new MultiSamlStrategy({ getSamlOptions }, noop, noop); - strategy.logout("random" as any, sinon.spy()); + // @ts-expect-error + strategy.logout("random", sinon.spy()); }); }); @@ -250,7 +257,8 @@ describe("MultiSamlStrategy()", function () { } const strategy = new MultiSamlStrategy({ getSamlOptions }, noop, noop); - strategy.generateServiceProviderMetadata("foo" as any, "bar", "baz", noop); + // @ts-expect-error + strategy.generateServiceProviderMetadata("foo", "bar", "baz", noop); }); it("passes options on to saml strategy", function (done) { @@ -260,7 +268,7 @@ describe("MultiSamlStrategy()", function () { getSamlOptions: function (req: express.Request, fn: StrategyOptionsCallback) { try { fn(null, { cert: FAKE_CERT, issuer: "onesaml_login" }); - expect(strategy._passReqToCallback!).to.equal(true); + expect(strategy._passReqToCallback).to.equal(true); done(); } catch (err2) { done(err2); @@ -269,7 +277,8 @@ describe("MultiSamlStrategy()", function () { }; const strategy = new MultiSamlStrategy(passportOptions, noop, noop); - strategy.generateServiceProviderMetadata("foo" as any, "bar", "baz", noop); + // @ts-expect-error + strategy.generateServiceProviderMetadata("foo", "bar", "baz", noop); }); it("should pass error to callback function", function (done) { @@ -280,19 +289,15 @@ describe("MultiSamlStrategy()", function () { }; const strategy = new MultiSamlStrategy(passportOptions, noop, noop); - strategy.generateServiceProviderMetadata( - "foo" as any, - "bar", - "baz", - function (error, result) { - try { - expect(error?.message).to.equal("My error"); - done(); - } catch (err2) { - done(err2); - } + // @ts-expect-error + strategy.generateServiceProviderMetadata("foo", "bar", "baz", function (error) { + try { + expect(error?.message).to.equal("My error"); + done(); + } catch (err2) { + done(err2); } - ); + }); }); it("should pass result to callback function", function (done) { @@ -304,7 +309,8 @@ describe("MultiSamlStrategy()", function () { const strategy = new MultiSamlStrategy(passportOptions, noop, noop); strategy.generateServiceProviderMetadata( - "foo" as any, + // @ts-expect-error + "foo", "bar", "baz", function (error, result) { diff --git a/test/strategy.spec.ts b/test/strategy.spec.ts index cc834a9b..9d3f5694 100644 --- a/test/strategy.spec.ts +++ b/test/strategy.spec.ts @@ -304,10 +304,13 @@ describe("Strategy()", function () { }); it("should call through to get logout URL", function () { - // @ts-ignore - new SamlStrategy({ cert: FAKE_CERT, issuer: "onesaml_login" }, noop, noop).logout({ - query: "", - }); + new SamlStrategy({ cert: FAKE_CERT, issuer: "onesaml_login" }, noop, noop).logout( + { + // @ts-expect-error + query: "", + }, + noop + ); sinon.assert.calledOnce(getLogoutUrlAsyncStub); }); }); @@ -328,17 +331,11 @@ describe("Strategy()", function () { it("should call through to generate metadata", function () { const samlConfig: SamlConfig = { cert: FAKE_CERT, issuer: "onesaml_login" }; - const signonVerify: VerifyWithoutRequest = function ( - _profile: Profile | null, - cb: VerifiedCallback - ): void { + const signonVerify: VerifyWithoutRequest = function (): void { throw Error("This shouldn't be called to generate metadata"); }; - const logoutVerify: VerifyWithoutRequest = function ( - _profile: Profile | null, - cb: VerifiedCallback - ): void { + const logoutVerify: VerifyWithoutRequest = function (): void { throw Error("This shouldn't be called to generate metadata"); }; new SamlStrategy(samlConfig, signonVerify, logoutVerify).generateServiceProviderMetadata(""); diff --git a/test/types.ts b/test/types.ts index 6941418a..633487f8 100644 --- a/test/types.ts +++ b/test/types.ts @@ -1,5 +1,3 @@ -import { SamlConfig } from "../src"; - // a certificate which is re-used by several tests export const TEST_CERT = "MIIEFzCCAv+gAwIBAgIUFJsUjPM7AmWvNtEvULSHlTTMiLQwDQYJKoZIhvcNAQEFBQAwWDELMAkGA1UEBhMCVVMxETAPBgNVBAoMCFN1YnNwYWNlMRUwEwYDVQQLDAxPbmVMb2dpbiBJZFAxHzAdBgNVBAMMFk9uZUxvZ2luIEFjY291bnQgNDIzNDkwHhcNMTQwNTEzMTgwNjEyWhcNMTkwNTE0MTgwNjEyWjBYMQswCQYDVQQGEwJVUzERMA8GA1UECgwIU3Vic3BhY2UxFTATBgNVBAsMDE9uZUxvZ2luIElkUDEfMB0GA1UEAwwWT25lTG9naW4gQWNjb3VudCA0MjM0OTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKrAzJdY9FzFLt5blArJfPzgi87EnFGlTfcV5T1TUDwLBlDkY/0ZGKnMOpf3D7ie2C4pPFOImOogcM5kpDDL7qxTXZ1ewXVyjBdMu29NG2C6NzWeQTUMUji01EcHkC8o+Pts8ANiNOYcjxEeyhEyzJKgEizblYzMMKzdrOET6QuqWo3C83K+5+5dsjDn1ooKGRwj3HvgsYcFrQl9NojgQFjoobwsiE/7A+OJhLpBcy/nSVgnoJaMfrO+JsnukZPztbntLvOl56+Vra0N8n5NAYhaSayPiv/ayhjVgjfXd1tjMVTOiDknUOwizZuJ1Y3QH94vUtBgp0WBpBSs/xMyTs8CAwEAAaOB2DCB1TAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBRQO4WpM5fWwxib49WTuJkfYDbxODCBlQYDVR0jBIGNMIGKgBRQO4WpM5fWwxib49WTuJkfYDbxOKFcpFowWDELMAkGA1UEBhMCVVMxETAPBgNVBAoMCFN1YnNwYWNlMRUwEwYDVQQLDAxPbmVMb2dpbiBJZFAxHzAdBgNVBAMMFk9uZUxvZ2luIEFjY291bnQgNDIzNDmCFBSbFIzzOwJlrzbRL1C0h5U0zIi0MA4GA1UdDwEB/wQEAwIHgDANBgkqhkiG9w0BAQUFAAOCAQEACdDAAoaZFCEY5pmfwbKuKrXtO5iE8lWtiCPjCZEUuT6bXRNcqrdnuV/EAfX9WQoXjalPi0eM78zKmbvRGSTUHwWw49RHjFfeJUKvHNeNnFgTXDjEPNhMvh69kHm453lFRmB+kk6yjtXRZaQEwS8Uuo2Ot+krgNbl6oTBZJ0AHH1MtZECDloms1Km7zsK8wAi5i8TVIKkVr5b2VlhrLgFMvzZ5ViAxIMGB6w47yY4QGQB/5Q8ya9hBs9vkn+wubA+yr4j14JXZ7blVKDSTYva65Ea+PqHyrp+Wnmnbw2ObS7iWexiTy1jD3G0R2avDBFjM8Fj5DbfufsE1b0U10RTtg=="; From 9e8a5d578522e9fa7e5b45d99d8a025e3cf74038 Mon Sep 17 00:00:00 2001 From: Chris Barth Date: Tue, 22 Nov 2022 09:50:43 -0500 Subject: [PATCH 2/4] Re-export all node-saml exports. --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 83429542..9cb460d5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,7 +8,7 @@ import type { MultiStrategyConfig, } from "./types"; -export { Profile, SAML, SamlConfig } from "@node-saml/node-saml"; +export * from "@node-saml/node-saml"; export { AbstractStrategy, From 043cca83c2e9ba55495d42e127ecfd3488c14b06 Mon Sep 17 00:00:00 2001 From: Chris Barth Date: Tue, 22 Nov 2022 09:48:41 -0500 Subject: [PATCH 3/4] wip --- src/index.ts | 2 ++ src/multiSamlStrategy.ts | 3 ++- src/strategy.ts | 3 ++- src/types.ts | 5 ++++- test/multiSamlStrategy.spec.ts | 11 ++++++++--- test/strategy.spec.ts | 4 ++-- 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/index.ts b/src/index.ts index 9cb460d5..fe31a813 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,6 +6,7 @@ import type { VerifyWithRequest, VerifyWithoutRequest, MultiStrategyConfig, + SamlConfig, } from "./types"; export * from "@node-saml/node-saml"; @@ -18,4 +19,5 @@ export { VerifyWithRequest, VerifyWithoutRequest, MultiStrategyConfig, + SamlConfig, }; diff --git a/src/multiSamlStrategy.ts b/src/multiSamlStrategy.ts index 8910d441..8cc4e817 100644 --- a/src/multiSamlStrategy.ts +++ b/src/multiSamlStrategy.ts @@ -4,10 +4,11 @@ import { AuthenticateOptions, MultiStrategyConfig, RequestWithUser, + SamlConfig, VerifyWithoutRequest, VerifyWithRequest, } from "./types"; -import { SAML, SamlConfig } from "."; +import { SAML } from "."; export class MultiSamlStrategy extends AbstractStrategy { static readonly newSamlProviderOnConstruct = false; diff --git a/src/strategy.ts b/src/strategy.ts index 466769d9..fdb89c28 100644 --- a/src/strategy.ts +++ b/src/strategy.ts @@ -1,7 +1,8 @@ import { Strategy as PassportStrategy } from "passport-strategy"; import { strict as assert } from "assert"; import * as url from "url"; -import { Profile, SAML, SamlConfig } from "."; +import { Profile, SAML } from "."; +import { SamlConfig } from "./types"; import { AuthenticateOptions, RequestWithUser, diff --git a/src/types.ts b/src/types.ts index efcf3593..415fd33d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,6 +1,7 @@ import type * as express from "express"; import * as passport from "passport"; -import { Profile, SamlConfig } from "."; +import { Profile } from "."; +import { SamlConfig as NodeSamlConfig } from "@node-saml/node-saml"; export interface AuthenticateOptions extends passport.AuthenticateOptions { samlFallback?: "login-request" | "logout-request"; @@ -37,6 +38,8 @@ export type VerifyWithRequest = ( export type VerifyWithoutRequest = (profile: Profile | null, done: VerifiedCallback) => void; +export type SamlConfig = NodeSamlConfig & StrategyOptions; + export type StrategyOptionsCallback = (err: Error | null, samlOptions?: SamlConfig) => void; interface BaseMultiStrategyConfig { diff --git a/test/multiSamlStrategy.spec.ts b/test/multiSamlStrategy.spec.ts index e80466a9..b2d5531d 100644 --- a/test/multiSamlStrategy.spec.ts +++ b/test/multiSamlStrategy.spec.ts @@ -3,9 +3,14 @@ import * as express from "express"; import { Strategy } from "passport-strategy"; import * as sinon from "sinon"; import { expect } from "chai"; -import { MultiSamlStrategy, SAML, AbstractStrategy, SamlConfig } from "../src"; -import { MultiStrategyConfig, RequestWithUser, StrategyOptionsCallback } from "../src/types"; -import * as assert from "assert"; +import { MultiSamlStrategy, SAML, AbstractStrategy } from "../src"; +import { + MultiStrategyConfig, + RequestWithUser, + StrategyOptionsCallback, + SamlConfig, +} from "../src/types"; +import assert = require("assert"); import { FAKE_CERT } from "./types"; const noop = () => undefined; diff --git a/test/strategy.spec.ts b/test/strategy.spec.ts index 9d3f5694..fb46e548 100644 --- a/test/strategy.spec.ts +++ b/test/strategy.spec.ts @@ -3,8 +3,8 @@ import type * as express from "express"; import { expect } from "chai"; import * as sinon from "sinon"; -import { Profile, SAML, SamlConfig, Strategy as SamlStrategy } from "../src"; -import { RequestWithUser, VerifiedCallback, VerifyWithoutRequest } from "../src/types"; +import { Profile, SAML, Strategy as SamlStrategy } from "../src"; +import { RequestWithUser, VerifiedCallback, VerifyWithoutRequest, SamlConfig } from "../src/types"; import { FAKE_CERT } from "./types"; const noop = () => undefined; From cd6be9620d71a6ad469594556d7b704f57391260 Mon Sep 17 00:00:00 2001 From: Chris Barth Date: Tue, 22 Nov 2022 11:56:15 -0500 Subject: [PATCH 4/4] Update type imports/exports from `node-saml` --- src/index.ts | 4 ++-- src/multiSamlStrategy.ts | 6 +++--- src/strategy.ts | 8 ++++---- src/types.ts | 11 ++++++----- test/multiSamlStrategy.spec.ts | 10 +++++----- test/strategy.spec.ts | 9 +++++++-- 6 files changed, 27 insertions(+), 21 deletions(-) diff --git a/src/index.ts b/src/index.ts index fe31a813..8df11b1a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,7 +6,7 @@ import type { VerifyWithRequest, VerifyWithoutRequest, MultiStrategyConfig, - SamlConfig, + PassportSamlConfig, } from "./types"; export * from "@node-saml/node-saml"; @@ -19,5 +19,5 @@ export { VerifyWithRequest, VerifyWithoutRequest, MultiStrategyConfig, - SamlConfig, + PassportSamlConfig, }; diff --git a/src/multiSamlStrategy.ts b/src/multiSamlStrategy.ts index 8cc4e817..09fc8756 100644 --- a/src/multiSamlStrategy.ts +++ b/src/multiSamlStrategy.ts @@ -4,7 +4,7 @@ import { AuthenticateOptions, MultiStrategyConfig, RequestWithUser, - SamlConfig, + PassportSamlConfig, VerifyWithoutRequest, VerifyWithRequest, } from "./types"; @@ -12,7 +12,7 @@ import { SAML } from "."; export class MultiSamlStrategy extends AbstractStrategy { static readonly newSamlProviderOnConstruct = false; - _options: SamlConfig & MultiStrategyConfig; + _options: PassportSamlConfig & MultiStrategyConfig; constructor( options: MultiStrategyConfig, @@ -34,7 +34,7 @@ export class MultiSamlStrategy extends AbstractStrategy { // and there are defaults for all `strategy`-required options. const samlConfig = { ...options, - } as SamlConfig & MultiStrategyConfig; + } as PassportSamlConfig & MultiStrategyConfig; super(samlConfig, signonVerify, logoutVerify); this._options = samlConfig; diff --git a/src/strategy.ts b/src/strategy.ts index fdb89c28..c54a93af 100644 --- a/src/strategy.ts +++ b/src/strategy.ts @@ -2,7 +2,7 @@ import { Strategy as PassportStrategy } from "passport-strategy"; import { strict as assert } from "assert"; import * as url from "url"; import { Profile, SAML } from "."; -import { SamlConfig } from "./types"; +import { PassportSamlConfig } from "./types"; import { AuthenticateOptions, RequestWithUser, @@ -22,16 +22,16 @@ export abstract class AbstractStrategy extends PassportStrategy { _passReqToCallback?: boolean; constructor( - options: SamlConfig, + options: PassportSamlConfig, signonVerify: VerifyWithRequest, logoutVerify: VerifyWithRequest ); constructor( - options: SamlConfig, + options: PassportSamlConfig, signonVerify: VerifyWithoutRequest, logoutVerify: VerifyWithoutRequest ); - constructor(options: SamlConfig, signonVerify: never, logoutVerify: never) { + constructor(options: PassportSamlConfig, signonVerify: never, logoutVerify: never) { super(); if (typeof options === "function") { throw new Error("Mandatory SAML options missing"); diff --git a/src/types.ts b/src/types.ts index 415fd33d..c66735f4 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,7 +1,6 @@ import type * as express from "express"; import * as passport from "passport"; -import { Profile } from "."; -import { SamlConfig as NodeSamlConfig } from "@node-saml/node-saml"; +import { Profile, SamlConfig } from "."; export interface AuthenticateOptions extends passport.AuthenticateOptions { samlFallback?: "login-request" | "logout-request"; @@ -38,15 +37,17 @@ export type VerifyWithRequest = ( export type VerifyWithoutRequest = (profile: Profile | null, done: VerifiedCallback) => void; -export type SamlConfig = NodeSamlConfig & StrategyOptions; +export type PassportSamlConfig = SamlConfig & StrategyOptions; -export type StrategyOptionsCallback = (err: Error | null, samlOptions?: SamlConfig) => void; +export type StrategyOptionsCallback = (err: Error | null, samlOptions?: PassportSamlConfig) => void; interface BaseMultiStrategyConfig { getSamlOptions(req: express.Request, callback: StrategyOptionsCallback): void; } -export type MultiStrategyConfig = Partial & StrategyOptions & BaseMultiStrategyConfig; +export type MultiStrategyConfig = Partial & + StrategyOptions & + BaseMultiStrategyConfig; export class ErrorWithXmlStatus extends Error { constructor(message: string, public readonly xmlStatus: string) { diff --git a/test/multiSamlStrategy.spec.ts b/test/multiSamlStrategy.spec.ts index b2d5531d..0949f655 100644 --- a/test/multiSamlStrategy.spec.ts +++ b/test/multiSamlStrategy.spec.ts @@ -8,16 +8,16 @@ import { MultiStrategyConfig, RequestWithUser, StrategyOptionsCallback, - SamlConfig, + PassportSamlConfig, } from "../src/types"; -import assert = require("assert"); +import * as assert from "assert"; import { FAKE_CERT } from "./types"; const noop = () => undefined; describe("MultiSamlStrategy()", function () { it("extends passport Strategy", function () { - function getSamlOptions(): SamlConfig { + function getSamlOptions(): PassportSamlConfig { return { cert: FAKE_CERT, issuer: "onesaml_login" }; } const strategy = new MultiSamlStrategy({ getSamlOptions }, noop, noop); @@ -85,7 +85,7 @@ describe("MultiSamlStrategy()", function () { it("uses given options to setup internal saml provider", function (done) { const superAuthenticateStub = this.superAuthenticateStub; - const samlOptions: SamlConfig = { + const samlOptions: PassportSamlConfig = { issuer: "http://foo.issuer", callbackUrl: "http://foo.callback", cert: "deadbeef", @@ -206,7 +206,7 @@ describe("MultiSamlStrategy()", function () { it("uses given options to setup internal saml provider", function (done) { const superLogoutMock = this.superLogoutMock; - const samlOptions: SamlConfig = { + const samlOptions: PassportSamlConfig = { issuer: "http://foo.issuer", callbackUrl: "http://foo.callback", authnRequestBinding: "HTTP-POST", diff --git a/test/strategy.spec.ts b/test/strategy.spec.ts index fb46e548..f18003e5 100644 --- a/test/strategy.spec.ts +++ b/test/strategy.spec.ts @@ -4,7 +4,12 @@ import type * as express from "express"; import { expect } from "chai"; import * as sinon from "sinon"; import { Profile, SAML, Strategy as SamlStrategy } from "../src"; -import { RequestWithUser, VerifiedCallback, VerifyWithoutRequest, SamlConfig } from "../src/types"; +import { + RequestWithUser, + VerifiedCallback, + VerifyWithoutRequest, + PassportSamlConfig, +} from "../src/types"; import { FAKE_CERT } from "./types"; const noop = () => undefined; @@ -330,7 +335,7 @@ describe("Strategy()", function () { }); it("should call through to generate metadata", function () { - const samlConfig: SamlConfig = { cert: FAKE_CERT, issuer: "onesaml_login" }; + const samlConfig: PassportSamlConfig = { cert: FAKE_CERT, issuer: "onesaml_login" }; const signonVerify: VerifyWithoutRequest = function (): void { throw Error("This shouldn't be called to generate metadata"); };