-
Notifications
You must be signed in to change notification settings - Fork 401
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
New token validation model: Simplify stack frame caching #2976
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
…e objects by using a concurrent dictionary
brentschmaltz
approved these changes
Nov 4, 2024
kellyyangsong
approved these changes
Nov 4, 2024
SummarySummary
CoverageMicrosoft.IdentityModel.Abstractions - 70.2%
Microsoft.IdentityModel.JsonWebTokens - 80%
Microsoft.IdentityModel.Logging - 74.9%
Microsoft.IdentityModel.Protocols - 88.2%
Microsoft.IdentityModel.Protocols.OpenIdConnect - 81.4%
Microsoft.IdentityModel.Protocols.SignedHttpRequest - 93.4%
Microsoft.IdentityModel.Protocols.Tests - 0%
Microsoft.IdentityModel.Protocols.WsFederation - 80.9%
Microsoft.IdentityModel.TestUtils - 87%
Microsoft.IdentityModel.Tokens - 76.3%
Microsoft.IdentityModel.Tokens.Saml - 71.1%
Microsoft.IdentityModel.Tokens.Tests - 4.6%
Microsoft.IdentityModel.Validators - 95.8%
Microsoft.IdentityModel.Xml - 79.3%
System.IdentityModel.Tokens.Jwt - 83.8%
System.IdentityModel.Tokens.Jwt.Tests - 20.1%
|
msbw2
reviewed
Nov 4, 2024
src/Microsoft.IdentityModel.Tokens/Validation/Results/Details/ValidationError.cs
Show resolved
Hide resolved
msbw2
reviewed
Nov 4, 2024
src/Microsoft.IdentityModel.Tokens/Validation/Results/Details/ValidationError.cs
Show resolved
Hide resolved
SummarySummary
CoverageMicrosoft.IdentityModel.Abstractions - 70.2%
Microsoft.IdentityModel.JsonWebTokens - 80%
Microsoft.IdentityModel.Logging - 74.9%
Microsoft.IdentityModel.Protocols - 88.2%
Microsoft.IdentityModel.Protocols.OpenIdConnect - 81.4%
Microsoft.IdentityModel.Protocols.SignedHttpRequest - 93.4%
Microsoft.IdentityModel.Protocols.Tests - 0%
Microsoft.IdentityModel.Protocols.WsFederation - 80.9%
Microsoft.IdentityModel.TestUtils - 87%
Microsoft.IdentityModel.Tokens - 76.3%
Microsoft.IdentityModel.Tokens.Saml - 71.1%
Microsoft.IdentityModel.Tokens.Tests - 4.6%
Microsoft.IdentityModel.Validators - 95.8%
Microsoft.IdentityModel.Xml - 79.3%
System.IdentityModel.Tokens.Jwt - 83.8%
System.IdentityModel.Tokens.Jwt.Tests - 20.1%
|
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.
New token validation model: Simplify stack frame caching
As part of the new validation model, we are manually capturing stack frames when returning an error in order to build the stack frame once the exception is created. In order to avoid the performance hit incurred when capturing the stack trace at runtime, we cache each stack frame and avoid creating it if it already exists.
Currently, we have around 100 stack frames between all of the possible code branches that need to be captured, named, stored, and checked. This PR attempts to simplify this process so that we memoise the stack frames in a concurrent dictionary and retrieve them when needed.
ConcurrentDictionary
to theValidationError
class to store stack frames for each error messageAddCurrentStackFrame
andGetCurrentStackFrame
to theValidationError
Part of #2711