-
Notifications
You must be signed in to change notification settings - Fork 472
Made ctor of ValidationParameters public #480
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
Made ctor of ValidationParameters public #480
Conversation
…compile errors for the examples on the main page and prevents them from being used (https://github.com/jwt-dotnet/jwt#turning-off-parts-of-token-validation, https://github.com/jwt-dotnet/jwt#or-using-the-fluent-builder-api-4). Making the constructor public makes them valid. It's possible to use the "With" method and the "Default" or "None" properties, but it is cumbersome.
Hi! Tanks for not just reporting the issue but offering to fix it right away. I appreciate it. Would it be better though to update the sample rather than the code? The ctor was intentionally made private so the fluent style code like this would be used instead: ValidationParameters.None
.With(p => p.ValidateSignature = true)
.With!p => p.TimeMargin = 100); Whether it's cumbersome, I think it's a matter of taste. I'm not defending it, as it was a contribution by another user. But what I admit that it's pretty inefficient, creates a bunch of allocations for very little benefits. Thinking more about it, I now recollect that the main reason to make it this was that Can you please make few more changes:
|
Will do! That makes sense to me! Thanks for the information as well, that makes more sense now. I appreciate your consideration. |
…, also added tests to ensure that they are being set and updated correctly
Done and done :). Thank you for allowing me to contribute to your project. I made the requested changes. I'm happy to make any other changes if you see anything that you'd like to be different. |
Awesome! I took the liberty to make a couple of cosmetic changes. Approved, will merge once the PR validation finishes. Thanks for the contribution! Please do more :) |
Published to NuGet as 10.1.1 |
The constructor for ValidationParameters was private, which produces compile errors for the examples on the main page and prevents them from being used (https://github.com/jwt-dotnet/jwt#turning-off-parts-of-token-validation, https://github.com/jwt-dotnet/jwt#or-using-the-fluent-builder-api-4). Making the constructor public makes them valid. It's possible to use the "With" method and the "Default" or "None" properties, but it is cumbersome.