Increase Usage of Warnings Across Response Parsing #32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As I mentioned in #31, the InvalidTime warning was being thrown in response to one NotOnOrAfter problem, and an error was being thrown in response to another one. I think those two should be consistent, and I've done a slight refactor so that they can both throw the warning.
My particular use case, and why I think they should be warnings as opposed to errors, is that I'm using the assertion itself to store session at the SP. This means that I'd like to be able to choose when to respect those NotOnOrAfter times (when I first see an assertion) and when to ignore them (when they're stored as session, so I use SessionNotOnOrAfter instead).
In general, I think the design of all SAML-aware parsing functions being able to set warnings if they need to is an improvement, since it'll make future requests similar to this one much easier to implement.
Note that this change doesn't affect the basic use case of parsing an assertion with RetrieveAssertionInfo, since a responsible user would already be checking the warning if they cared about the time.