-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change protection to JSON only so as to support AoT/trimming and use …
…of serialization options from MVC Using JSON instead of the type descriptors helps avoid losing sub-second precision for the `DateTime` and `DateTimeOffset` types. With this PR, `Protect(...)` and `Unprotect(...)` methods allow the passing of `JsonSerializerOptions` where trimming or AoT is not in use. These options are optional and when not supplied, the default JSON options configured for MVC are used. In trimming and AoT scenarios, these methods have overloads that accept `JsonTypeInfo<T>`. As a side-effect, any pre-protected tokens may fail to unprotect if `options.UseConversionInsteadOfJson` had not been set to true. The workaround for this is to create a custom implementation of `ITokenProtector<T>` to handle the cases. For tokens with a short lifetime, this may not be an issue. The protector purpose has changed from `Tingle.Tokens.v2019-12-17` to `Tingle.AspNetCore.Tokens.v2024-05-05` to ensure one can find away support older scenarios
- Loading branch information
1 parent
b851ec0
commit 4c441c1
Showing
11 changed files
with
334 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
src/Tingle.AspNetCore.Tokens/Extensions/TokenProtectorOptions.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.