You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, claim validation is a simple check that the claim exists in the decrypted token and the decrypted value matches the provided value. The API needs to be extended to allow the user to provide their own validation closure in order to support more complex validation scenarios.
The text was updated successfully, but these errors were encountered:
- add: Added an optional closure argument to the validate_claim method.
To be used to allow the user to provide custom validation logic for a
particular claim
- add: Added logic in the parse method to run custom validation closures
if one is specified. This means claim validators will verify the
claim exists and verify the value matches what is expected. If a
custom closure is provided, the validator first checks the claim
exists and then the value is provided to the closure for further
validation by the end user.
- add: PasetoTokenParseError::InvalidClaimValueType(String) for claim
values we try to convert to an invalid type
- add: PasetoTokenParseError::CustomClaimValidation for claims which
fail in user provided custom validation closures
- add: Implement Default trait on all reserved claims so that they can
be passed into custom validation closures
- add: Implement From(&str) for CustomClaim so that they can be passed
into custom validation closures which always ignore passed in values
when adding the claim to the validator
- chore: closes#1
Currently, claim validation is a simple check that the claim exists in the decrypted token and the decrypted value matches the provided value. The API needs to be extended to allow the user to provide their own validation closure in order to support more complex validation scenarios.
The text was updated successfully, but these errors were encountered: