Skip to content

[BUG] Issuer is Now Required at Runtime But Not During Type Checking #89

@sadikinfosec

Description

@sadikinfosec

To Reproduce

I adjusted the "get Urls" test from the samlTests.spec.ts file to omit the issuer (mimicking our app's previous setup), and got a runtime error of "issuer is required" when it was run

diff --git a/test/samlTests.spec.ts b/test/samlTests.spec.ts
index 815691b..0fed2df 100644
--- a/test/samlTests.spec.ts
+++ b/test/samlTests.spec.ts
@@ -17,7 +17,7 @@ describe("SAML.js", function () {
         entryPoint: "https://exampleidp.com/path?key=value",
         logoutUrl: "https://exampleidp.com/path?key=value",
         cert: FAKE_CERT,
-        issuer: "onesaml_login",
+        // issuer: "onesaml_login",
       });
       req = {
         protocol: "https",
1) SAML.js
       get Urls
         "before each" hook for "calls callback with original query string":
     TypeError: issuer is required
      at assertRequired (src/utility.ts:2:667)
      at SAML.initialize (src/saml.ts:2:4711)
      at new SAML (src/saml.ts:2:4242)
      at Context.<anonymous> (test/samlTests.spec.ts:16:14)
      at processImmediate (internal/timers.js:464:21)

Expected behavior
The TSC should've have failed beforehand when checking types instead

Environment

  • Node.js version: v14.19.0
  • node-saml version: Tip of master branch - commit SHA: abfb20d

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions