-
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
Regression testing: Token type, replay, and lifetime validation. #2823
Conversation
{ | ||
private bool _onAddReturnValue; | ||
private bool _onFindReturnValue; | ||
public TestTokenReplayCache(bool onAddReturnValue, bool onFindReturnValue) |
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.
public TestTokenReplayCache(bool onAddReturnValue, bool onFindReturnValue) | |
public TestTokenReplayCache(bool onAddReturnValue, bool onFindReturnValue) |
_onAddReturnValue = onAddReturnValue; | ||
_onFindReturnValue = onFindReturnValue; | ||
} | ||
public bool TryAdd(string securityToken, DateTime expirationTime) |
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.
public bool TryAdd(string securityToken, DateTime expirationTime) | |
public bool TryAdd(string securityToken, DateTime expirationTime) |
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.
Few spacing issues, otherwise LGTM
@@ -13,6 +13,8 @@ | |||
using Microsoft.IdentityModel.Tokens; | |||
using Xunit; | |||
|
|||
#nullable enable | |||
|
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.
be consistent with spacing around #nullable.
Other files do not have a blank line.
@@ -102,6 +109,11 @@ public static TheoryData<JsonWebTokenHandlerValidationParametersTheoryData> Json | |||
ValidationParameters = CreateValidationParameters( | |||
Default.Issuer, [Default.Audience], Default.AsymmetricSigningKey), | |||
}, | |||
new JsonWebTokenHandlerValidationParametersTheoryData("Invalid_ValidationParametersNull") |
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.
add a new line between creation of theoryData.
@@ -23,6 +25,7 @@ public async Task ValidateTokenAsync(JsonWebTokenHandlerValidationParametersTheo | |||
var context = TestUtilities.WriteHeader($"{this}.ValidateTokenAsync", theoryData); | |||
|
|||
JsonWebTokenHandler jsonWebTokenHandler = new JsonWebTokenHandler(); | |||
jsonWebTokenHandler.SetDefaultTimesOnTokenCreation = theoryData.SetDefaultValuesOnTokenCreation; |
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.
Why do we not create the jwt when creating the theoryData?
If the goal of this test is to check that the path with TokenValidationParameters is the same as ValidationParameters, the number of tests will be large. I would suggest having separate files for each validation step. |
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.
Please split into PR's focusing on one validation step.
Closing the PR, will re-raise individual ones as I add more tests. |
Regression testing: Token type, replay, and lifetime validation.
Part of #2711