Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StrategyOptionsCallback shouldn't have to pass all SAML options #838

Merged

Conversation

oliverlockwood
Copy link
Contributor

…since some can be derived from the defaults set up during initialisation of the strategy, as per the documentation at http://www.passportjs.org/packages/passport-saml/, which clearly says:

The options passed when the MultiSamlStrategy is initialized are also passed as default values to each provider. e.g. If you provide an issuer on MultiSamlStrategy, this will be also a default value for every provider. You can override these defaults by passing a new value through the getSamlOptions function.

This fixes node-saml/node-saml#246.
(I raised the issue in a different repo, as that's where the SamlConfig class resides, but it turns out the change I thought to propose is in this repo. Sorry.)

@cjbarth
Copy link
Collaborator

cjbarth commented Jan 16, 2023

Can we get some tests to make sure this behavior doesn't break in the future? Ideally a tests that throws a type error (which you should mark as such with @ts-expect-error and then a test that works as you want it to, which is currently broken.

Copy link
Collaborator

@cjbarth cjbarth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs tests.

@cjbarth
Copy link
Collaborator

cjbarth commented May 29, 2023

@oliverlockwood , I'm preparing a release soon. Would you like to work with me to get this landed for the next release?

Copy link
Collaborator

@cjbarth cjbarth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs tests.

@oliverlockwood
Copy link
Contributor Author

Hi @cjbarth, yes, I'll give this a crack. Thanks for the reminder.

@cjbarth cjbarth added needs-review Ready for a collaborator to review. bug labels Aug 19, 2023
…e some can be derived from the defaults set up during initialisation of the strategy
@oliverlockwood oliverlockwood force-pushed the fix-type-for-strategy-options-callback branch from 782d7d7 to b8d3da8 Compare October 24, 2023 11:04
Copy link
Collaborator

@cjbarth cjbarth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a test that actually exercises the fact that issuer isn't required in SamlOptionsCallback.

test/multiSamlStrategy.spec.ts Outdated Show resolved Hide resolved
Copy link

This PR is stale because is has been open for 90 days with no activity.

@github-actions github-actions bot added the stale label Jan 23, 2024
@oliverlockwood
Copy link
Contributor Author

With the "stale" reminder, I'll be honest - I haven't had time to write more extensive tests for this, and it doesn't feel like that's going to change any time soon. I'm sorry about that, but I'm just being realistic.

@cjbarth I guess you'll have to just make a decision as to whether to accept this trivial correction without UT coverage being provided, or whether you'll reject it and continue to have a mismatch between documentation and type definitions. Your call.

@github-actions github-actions bot removed the stale label Jan 26, 2024
Copy link

codecov bot commented Mar 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.42%. Comparing base (eacbbbb) to head (6491f35).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #838   +/-   ##
=======================================
  Coverage   64.42%   64.42%           
=======================================
  Files           4        4           
  Lines         149      149           
  Branches       37       37           
=======================================
  Hits           96       96           
  Misses         30       30           
  Partials       23       23           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cjbarth cjbarth merged commit 430d94e into node-saml:master Mar 26, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs-review Ready for a collaborator to review.
Projects
None yet
2 participants