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

Added X509 certificate to KeyInfo X509Data, if passed through options #36

Merged
merged 40 commits into from Feb 14, 2024

Conversation

ganesha289
Copy link
Contributor

Description

As per issue - https://github.com/node-saml/passport-saml/issues/585 - X509Certificate is not getting added to KeyInfo of AuthnRequest.
Added fix for this issue. If signingCert (service provider's certificate) parameter is passed in options, then X509Certificate will be added to AuthnRequest.

Checklist:

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 looks reasonable, but it needs a README update and a test.

@ganesha289
Copy link
Contributor Author

This looks reasonable, but it needs a README update and a test.

Updated PR with the changes.. Can you please review again..

@ganesha289 ganesha289 closed this Jan 16, 2022
@ganesha289 ganesha289 reopened this Jan 16, 2022
@ganesha289
Copy link
Contributor Author

@cjbarth, Updated the PR, please review

@cjbarth
Copy link
Collaborator

cjbarth commented Jan 17, 2022

I won't be able to get to it until later this week at the earliest.

@ganesha289
Copy link
Contributor Author

I won't be able to get to it until later this week at the earliest.

@cjbarth, Can you please help with this PR..

@cjbarth
Copy link
Collaborator

cjbarth commented Jan 31, 2022

I have been without my computer for more than a month and only just got it back... long story, but it has put me out of the loop, and I need to catch back up. Lots of node-saml stuff is on my to-do list.

@markstos
Copy link
Contributor

markstos commented Feb 2, 2022

I have been without my computer for more than a month and only just got it back... long story, but it has put me out of the loop, and I need to catch back up. Lots of node-saml stuff is on my to-do list.

Yikes! Welcome back.

@cjbarth
Copy link
Collaborator

cjbarth commented Feb 3, 2022

@ganesha289 please fix the build before I review.

@ganesha289 ganesha289 force-pushed the add-x509certificate-to-keyinfo branch from 472a8e6 to a228f49 Compare February 6, 2022 12:57
@ganesha289
Copy link
Contributor Author

@ganesha289 please fix the build before I review.

@cjbarth ,

I am getting same build errors for master code too.

Initially it fails for "prettier-check" script,
image

When I run "prettier-format" script, that issue get resolved, but with so many file modifications,
image

After fixing "prettier-check" issue, 9 unit tests failing,
image
image

One more issue I see is Code scanning result -> CodeQL, but that is failing for existing function crypto.ts -> removeCertPEMHeaderAndFooter

Can you please help..

@ganesha289
Copy link
Contributor Author

@ganesha289 please fix the build before I review.

@cjbarth ,

I am getting same build errors for master code too.

Initially it fails for "prettier-check" script, image

When I run "prettier-format" script, that issue get resolved, but with so many file modifications, image

After fixing "prettier-check" issue, 9 unit tests failing, image image

One more issue I see is Code scanning result -> CodeQL, but that is failing for existing function crypto.ts -> removeCertPEMHeaderAndFooter

Can you please help..

@cjbarth, I'm facing same issue with master code.. Can you please help..

@barryhagan
Copy link
Contributor

@ganesha289 Please see the PR I made against your branch, this will fix the formatting issues and provide tests for this code change. https://github.com/ganesha289/node-saml/pull/1/files

I'm guessing you didn't have prettier using the correct config file and that caused line ending changes in test files.

@ganesha289
Copy link
Contributor Author

@ganesha289 Please see the PR I made against your branch, this will fix the formatting issues and provide tests for this code change. https://github.com/ganesha289/node-saml/pull/1/files

I'm guessing you didn't have prettier using the correct config file and that caused line ending changes in test files.

@barryhagan , Thank you very much for fixing the formatting issues and adding test cases. I have approved the PR.. Merging is enabled now.. Should I proceed with merging the PR..?

@barryhagan
Copy link
Contributor

@barryhagan , Thank you very much for fixing the formatting issues and adding test cases. I have approved the PR.. Merging is enabled now.. Should I proceed with merging the PR..?

Yes, that should get your PR ready for review.

@ganesha289
Copy link
Contributor Author

@barryhagan , Thank you very much for fixing the formatting issues and adding test cases. I have approved the PR.. Merging is enabled now.. Should I proceed with merging the PR..?

Yes, that should get your PR ready for review.

@barryhagan , @cjbarth , Thank you for the help in issue resolution. I have merged PR - ganesha289#1 - in to this one.. Please review..

@ganesha289
Copy link
Contributor Author

@cjbarth / @barryhagan, Can you please help with the review..?

@barryhagan
Copy link
Contributor

@cjbarth / @barryhagan, Can you please help with the review..?

sorry @ganesha289, wish I could help, but I'm not a maintainer of this project.

@cjbarth
Copy link
Collaborator

cjbarth commented Sep 10, 2022

@ghsyeung , I believe the value of sending multiple certs would be so that the IdP would know both certs so it will work before and after the rotation. However, I have no need of this feature, so I don't want to be insistent.

I'm not a stake-holder on this, so I don't want slow things down, however, it does seem reasonable to add this support via node-saml/xml-crypto#249. Basically, the direction there is that we shouldn't be expanding FileKeyInfo, we should be using something different like StringKeyInfo. If a PR showed up at that project adding that support to fill this need, along with tests, I'll gladly approve it and update this project to make use of it.

If the PR is rejected, then I'll gladly take a PR against this project per xml-crypto's README which showed how to roll-your-own KeyInfoProvider class.

You'll not at the discussion in node-saml/xml-crypto#249 that there is no suite of tests for the FileKeyInfo. Since I don't know exactly what is needed, I'd be happy just to see tests that enforce the current behavior and we can take it from there if it doesn't work. Even better would be documentation that shows what the resultant XML should look like so we can have tests that match that.

@cjbarth
Copy link
Collaborator

cjbarth commented Sep 21, 2022

@ganesha289 I'm really close to a 4.0 release, this is the last outstanding PR. Do you think you'll have time to address this in the near future so as to not hold up a 4.0 release longer than necessary?

@cjbarth
Copy link
Collaborator

cjbarth commented May 27, 2023

@ganesha289 I'm preparing a v5 release. Would you like to work with me to get this landed for that release?

@ganesha289
Copy link
Contributor Author

@ganesha289 I'm preparing a v5 release. Would you like to work with me to get this landed for that release?

Sure @cjbarth

@cjbarth
Copy link
Collaborator

cjbarth commented May 29, 2023

@ganesha289 , did you want to start by fixing the merge conflicts and then have a look at the https://github.com/node-saml/xml-crypto project and see if we can't use some of the new features there to add this feature there and use it here. Now that we have both projects in the same organization, we can put the code where it belongs very easily.

@cjbarth
Copy link
Collaborator

cjbarth commented Feb 3, 2024

@ganesha289 , can you give this another look over to see if, after the merge, things look good for you?

@cjbarth cjbarth added the documentation Improvements or additions to documentation label Feb 14, 2024
@cjbarth cjbarth merged commit 60b497d into node-saml:master Feb 14, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants