-
Notifications
You must be signed in to change notification settings - Fork 413
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
Don't always test string claims for Date Time #2622
Merged
Merged
Conversation
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
Cannot remove APIs in in these internal methods as they are friends There are serveral claim types that should never be a datetime value. This changes introduces a list of claim types that will not be tested if they are a Date Time format. This list of claim types is not exhaustive. Added test data for a test token with more claims and a benchmark using this data.
keegan-caruso
commented
Jun 3, 2024
src/Microsoft.IdentityModel.Tokens/Json/JsonSerializerPrimitives.cs
Outdated
Show resolved
Hide resolved
JoshLozensky
approved these changes
Jun 3, 2024
src/Microsoft.IdentityModel.Tokens/Json/JsonSerializerPrimitives.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.IdentityModel.Tokens/Json/JsonSerializerPrimitives.cs
Outdated
Show resolved
Hide resolved
brentschmaltz
requested changes
Jun 4, 2024
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.
Asking to add the additional header claim values.
brentschmaltz
approved these changes
Jun 11, 2024
pmaytak
reviewed
Jun 12, 2024
pmaytak
reviewed
Jun 12, 2024
src/Microsoft.IdentityModel.Tokens/Json/JsonSerializerPrimitives.cs
Outdated
Show resolved
Hide resolved
pmaytak
reviewed
Jun 12, 2024
src/Microsoft.IdentityModel.Tokens/Json/JsonSerializerPrimitives.cs
Outdated
Show resolved
Hide resolved
pmaytak
reviewed
Jun 12, 2024
pmaytak
reviewed
Jun 12, 2024
pmaytak
reviewed
Jun 12, 2024
- Reorder params in new methods - Rename KnownNonDateTimesClaimTypes to s_knownNonDateTimeClaimTypes
pmaytak
approved these changes
Jun 12, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Don't always test string claims for Date Time
Description
Cannot remove APIs in in these internal methods as they are friends
There are serveral claim types that should never
be a datetime value. This changes introduces
a list of claim types that will not be tested if they are a Date Time format.
This list of claim types is not exhaustive.
Added test data for a test token with more claims
and a benchmark using this data.
Benchmark results:
BenchmarkDotNet v0.13.12, Windows 11 (10.0.22631.3593/23H2/2023Update/SunValley3) (Hyper-V)
Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 16 logical and 8 physical cores
.NET SDK 8.0.301
[Host] : .NET 8.0.6 (8.0.624.26715), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
MediumRun : .NET 8.0.6 (8.0.624.26715), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Job=MediumRun MaxAbsoluteError=10.0000 ms IterationCount=15
LaunchCount=4 WarmupCount=10
Fixes #2615