Builder for `Validation`?
Would you be open to a builder pattern for the Validation struct? Right now, I'm using it like so:
jsonwebtoken::decode(
token,
&DecodingKey::from_secret(config.jwt_secret),
{
let mut validation = Validation::default();
validation.validate_exp = false;
validation.validate_nbf = false;
&validation
}
);
Would be nice to have a builder pattern for validaton that we can use declaratively
I'd be happy to put a PR for this if you're open to it
I don't really want a builder for it no
Got it. How about a mutable function to set those variables? Similar to set_audience and set_issuer? That way we can do Validation::default().should_validate_exp(bool)
Isn't that a builder?
Yes, but without using a new struct for it. Shouldn't increase the compile times in any way, and also follows the existing convention