-
Notifications
You must be signed in to change notification settings - Fork 475
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
Fixes #180: Signature validation will error if empty signature is pro… #182
Conversation
There might be some discussion as to whether or not the cert property should be required. This pull request seems to address the main concern, without enforcing a breaking api change. |
I agree about the problem, but not about the solution. It could be helpful to validate that However this issue is a programmer error that could be caught earlier. So:
|
Definitely makes sense, and thank you for the feedback. As error handling in the initialize / constructor function would be a first, I would argue throwing an error would be a breaking API change and would likely merit a major version increase. The above PR should be backwards compatible, which is why the validation occurs in the I would also prefer an error message along the lines of "cert: private key must not be empty". For the above PR, I was assuming that some may be incorrectly passing this error directly back to the client Any thoughts to the above? I'd be glad to make the suggested changes if you do think they merit a major version bump. |
In this case, it seems more like we would be fixing a "Garbage-In Garbage Out" bug. In what context would setting Your refinements to the error message seem fine. For context, until recently we had 4 to 6 places in the code that returned the same "Invalid Signature" error, which was maddening to debug. Now all those places return unique error messages instead. I don't want to optimize for developers are passing programmer-errors back to users. In my view, code that sets "cert" to empty string without validating it should not making to production. Even if a developer is getting the 'cert' value dynamically, they have a responsibility to validate it and not blindly assuming it's OK. |
Got it. Sounds good I will move the validation to the |
@andrsnn I see this is the last outstanding PR that is tagged for our 1.0 release. Do you think you'll be able to clean it up so it can make that release? |
@cjbarth Thank you for the reminder! I will look at wrapping up these changes this coming weekend. |
This has been merged locally: https://github.com/bergie/passport-saml/commits/master So, closing this issue. Thanks for the contribution. |
…vided