-
-
Notifications
You must be signed in to change notification settings - Fork 595
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
Validator: raise exception when no constraint is given #351
Conversation
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 is quite a good point, thanks for contributing :)
Would you please also update the documentation to have it mentioning that behaviour and add NoConstraintsGiven
as a @throws
to both methods (interface)?
Everything done, expect the |
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 is quite good, thanks again!
I'll just rebase the branch to organise the history and have a more descriptive message (and have the mandatory signed commits).
Not raising any warnings for this scenario might give confidence that everything is working, where in fact they aren't. This makes it required for users to pass at least a constraint, making things more explicit and removing the possibility of confusion.
Ensuring nobody will ever miss this.
Hi, today I expected a token to fail, but the assertion made as described in https://lcobucci-jwt.readthedocs.io/en/latest/validating-tokens/ didn't raise any error.
After a while I found no build-in Constraint is provided (and that's ok for me), but also no error is raised when this happen.
I'm scared that many users would fall into my mistake, a pretty dangerous mistake!