-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add validation test, including a failing example #52
Conversation
fd5db35
to
71fcd42
Compare
71fcd42
to
37079c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for moving this out! That does make it easier to review, although ironically I did already have pending review comments for this part of #45 🙈 so I have copied my relevant comments from there over to the review here. Sorry that other review has been taking much longer than I anticipated.
package.yaml
Outdated
@@ -50,7 +50,7 @@ library: | |||
|
|||
tests: | |||
parser: | |||
main: Parser.hs | |||
main: parser.hs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because GHC complains that the module name should be Parser
, while I want this to be Main
. That's probably because the tests directory now contains more than one file.
CHANGELOG.md
Outdated
@@ -1,5 +1,7 @@ | |||
# Changelog for `wai-saml2` | |||
|
|||
- Added `validation` test ([#52](https://github.com/mbg/wai-saml2/pull/52) by [@fumieval](https://github.com/fumieval)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change probably doesn't need to be in the changelog, but I don't feel strongly either way. So happy for you to leave it in if you want.
5903c00
to
69f937a
Compare
I wonder why the tests fail on stack-lts-19 or older... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like you omitted an expectFail
in your most recent commit, which I think leads to the test failures now. The real question is why the tests for LTS 20 don't fail 😕
c8ea0ac
to
ded1e75
Compare
This change fixes the test failures on mbg/wai-saml2#52 . It turns out that the use of `unsafeAsCString` causes `nsPrefixes` to be effectively empty most of the time (yes, it is __non-deterministic__!) I confirmed that the tests above with this patch pass on lts-19.33 or older. I suggest to release the fix in an urgent manner.
I figured out the cause of the test failures, and fixed it in mbg/c14n#3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for figuring out and fixing the issue over in the c14n
library that fixed the tests here. This mostly looks good now, just two minor niggles that would be good to sort out before merging this.
fd1f24d
to
0fe2152
Compare
0fe2152
to
178a5fb
Compare
178a5fb
to
8ba5c5c
Compare
8ba5c5c
to
5cd6d94
Compare
@mbg Friendly reminder that this is ready for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about that! I must have missed that this was ready for another review; you can always hit the icon next to my username in the list of reviewers as well to re-request a review if you need to.
I think this looks good to merge as is now. Thanks for your work on finding and fixing the bug in c14n
, and teasing these tests out into their own PR.
Summary
This PR adds a new test,
validation
, that tries to validate concrete examples ofSAMLResponse
s. It contains a couple of samples that wai-saml2 can't handle at the moment.Most code is extracted from #45
Checklist
@since
annotations.