Open
Conversation
32b1680 to
6b98d1c
Compare
SummarySummary
CoverageMicrosoft.IdentityModel.JsonWebTokens - 80.3%
|
SummarySummary
CoverageMicrosoft.IdentityModel.JsonWebTokens - 80.3%
|
6b98d1c to
07fc02f
Compare
SummarySummary
CoverageMicrosoft.IdentityModel.JsonWebTokens - 80.3%
|
pmaytak
reviewed
Aug 7, 2025
...soft.IdentityModel.Tokens/Experimental/Validation/Results/Details/IdentityModelStackFrame.cs
Show resolved
Hide resolved
src/Microsoft.IdentityModel.Tokens/Experimental/Validation/Results/Details/ValidationError.cs
Show resolved
Hide resolved
src/Microsoft.IdentityModel.Tokens/Experimental/Validation/Results/Details/ValidationError.cs
Outdated
Show resolved
Hide resolved
| if (!ValidationError.TryGetStackFrame(out stackFrame)) | ||
| stackFrame = ValidationError.GetAsyncStackFrame(new StackFrame(0, true)); | ||
|
|
||
| return result.Error!.AddStackFrame(stackFrame ?? new StackFrame(0, true)); |
Collaborator
There was a problem hiding this comment.
stackFrame is never null in these cases - either TryGetStackFrame or GetAsyncStackFrame returns one frame.
Contributor
Author
There was a problem hiding this comment.
@pmaytak you are correct, i understand we can mark the class that if Succeeded is false then Error cannot be null.
Do you know how to do that?
src/Microsoft.IdentityModel.Tokens/Experimental/Validation/Results/Details/ValidationError.cs
Show resolved
Hide resolved
test/Microsoft.IdentityModel.Tokens.Tests/Validation/IssuerValidationResultTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.IdentityModel.Tokens.Tests/Validation/IssuerValidationResultTests.cs
Outdated
Show resolved
Hide resolved
6d51e80 to
d392b84
Compare
SummarySummary
CoverageMicrosoft.IdentityModel.JsonWebTokens - 80.3%
|
SummarySummary
CoverageMicrosoft.IdentityModel.JsonWebTokens - 80.3%
|
SummarySummary
CoverageMicrosoft.IdentityModel.JsonWebTokens - 80.3%
|
d007aac to
48399d6
Compare
SummarySummary
CoverageMicrosoft.IdentityModel.JsonWebTokens - 80.3%
|
48399d6 to
eedc9b5
Compare
SummarySummary
CoverageMicrosoft.IdentityModel.JsonWebTokens - 80.3%
|
997f90b to
6d6e62d
Compare
SummarySummary
CoverageMicrosoft.IdentityModel.JsonWebTokens - 80.3%
|
8fcd048 to
e96f2b8
Compare
SummarySummary
CoverageMicrosoft.IdentityModel.JsonWebTokens - 80.3%
|
SummarySummary
CoverageMicrosoft.IdentityModel.JsonWebTokens - 80.3%
|
e96f2b8 to
da6eac3
Compare
SummarySummary
CoverageMicrosoft.IdentityModel.JsonWebTokens - 80.3%
|
144c59b to
af557be
Compare
SummarySummary
CoverageMicrosoft.IdentityModel.JsonWebTokens - 80.3%
|
6b6d6d3 to
8dee83c
Compare
SummarySummary
CoverageMicrosoft.IdentityModel.JsonWebTokens - 80.3%
|
SummarySummary
CoverageMicrosoft.IdentityModel.JsonWebTokens - 80.3%
|
8dee83c to
694c3c3
Compare
SummarySummary
CoverageMicrosoft.IdentityModel.JsonWebTokens - 80.3%
|
SummarySummary
CoverageMicrosoft.IdentityModel.JsonWebTokens - 80.3%
|
src/Microsoft.IdentityModel.JsonWebTokens/Experimental/JsonWebTokenHandler.ValidateSignature.cs
Show resolved
Hide resolved
src/Microsoft.IdentityModel.JsonWebTokens/Experimental/JsonWebTokenHandler.ValidateSignature.cs
Outdated
Show resolved
Hide resolved
| if (!ValidationError.TryGetStackFrame(key, out stackFrame)) | ||
| stackFrame = ValidationError.GetAsyncStackFrame(key, new StackFrame(0, true)); | ||
|
|
||
| return readResult.Error!.AddStackFrame(stackFrame!); |
Contributor
There was a problem hiding this comment.
If !Succeeded, Error is guaranteed to be not null, yes?
Do we need to add a NotNull annotation ValidationResult similar to what OperationResult had? Or adjust null analysis settings for net FW?
Contributor
Author
There was a problem hiding this comment.
@keegan-caruso I will try NotNull annotation first.
...osoft.IdentityModel.JsonWebTokens/Experimental/JsonWebTokenHandler.ValidateToken.Internal.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.IdentityModel.Tokens.Saml/Saml/Experimental/SamlSecurityTokenHandler.ReadToken.cs
Show resolved
Hide resolved
| { | ||
| using (var reader = XmlDictionaryReader.CreateTextReader(Encoding.UTF8.GetBytes(token), XmlDictionaryReaderQuotas.Max)) | ||
| { | ||
| return ReadSamlToken(reader); |
src/Microsoft.IdentityModel.Tokens.Saml/Saml/Experimental/SamlTokenUtilities.Experimental.cs
Show resolved
Hide resolved
src/Microsoft.IdentityModel.Tokens.Saml/Saml/Experimental/SamlTokenUtilities.Experimental.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.IdentityModel.Tokens.Saml/Saml/Experimental/SamlTokenUtilities.Experimental.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.IdentityModel.Tokens.Saml/Saml/Experimental/SamlTokenUtilities.Experimental.cs
Show resolved
Hide resolved
...icrosoft.IdentityModel.Tokens.Saml/Saml2/Experimental/Saml2SecurityTokenHandler.ReadToken.cs
Show resolved
Hide resolved
| return ValidationError.NullParameter( | ||
| nameof(token), | ||
| ValidationError.GetCurrentStackFrame()); | ||
| stackFrame!); |
Contributor
There was a problem hiding this comment.
This can't be null, do we need the suppression?
...soft.IdentityModel.Tokens/Experimental/Validation/Results/Details/IdentityModelStackFrame.cs
Outdated
Show resolved
Hide resolved
...soft.IdentityModel.Tokens/Experimental/Validation/Results/Details/IdentityModelStackFrame.cs
Outdated
Show resolved
Hide resolved
...soft.IdentityModel.Tokens/Experimental/Validation/Results/Details/IdentityModelStackFrame.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.IdentityModel.Tokens/Experimental/Validation/Results/Details/ValidationError.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.IdentityModel.Tokens/Experimental/Validation/Results/Details/ValidationError.cs
Outdated
Show resolved
Hide resolved
SummarySummary
CoverageMicrosoft.IdentityModel.JsonWebTokens - 80.3%
|
Address PR comments
f6b4b7c to
8ea735e
Compare
SummarySummary
CoverageMicrosoft.IdentityModel.JsonWebTokens - 80.3%
|
This file contains hidden or 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
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.
This is a follow up to the draft PR for obtaining StackFrames in async and lamda call graphs.
This model uses additional code in async methods, throughout the entire method, even though it is reported that it is needed only after the await. This is just for consistency. Methods that are not in an async method use the original model.
The idea is to generate a 'key' that maps to the StackFrame we want, look for the StackFrame, if found use it, otherwise create a StackFrame and cache it.
We could have assigned 'guids' instead of composing keys and maintained some type of searchable organization, but that seemed like too much work with little value.
This PR also: