Skip to content

Commit d007aac

Browse files
committed
separated tests into Valid and Invalid.
1 parent d392b84 commit d007aac

File tree

9 files changed

+326
-368
lines changed

9 files changed

+326
-368
lines changed

src/Microsoft.IdentityModel.Tokens.Saml/Saml/Experimental/SamlTokenUtilities.Experimental.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ private static OperationResult<SecurityKey, ValidationError> ValidateSignatureUs
266266
CallContext callContext)
267267
{
268268
bool keysTried = false;
269-
bool kidExists = !string.IsNullOrEmpty(signature?.KeyInfo?.Id);
269+
bool kidExists = signature?.KeyInfo != null;
270270

271271
IEnumerable<SecurityKey> keys = TokenUtilities.GetAllSigningKeys(configuration, validationParameters, callContext);
272272
StringBuilder exceptionStrings = null;
@@ -334,7 +334,7 @@ private static OperationResult<SecurityKey, ValidationError> ValidateSignatureUs
334334
{
335335
return new SignatureValidationError(
336336
new MessageDetail(
337-
Tokens.LogMessages.IDX10526,
337+
Tokens.LogMessages.IDX10524,
338338
LogHelper.MarkAsNonPII(signature?.KeyInfo?.Id),
339339
LogHelper.MarkAsNonPII(validationParameters.SigningKeys.Count),
340340
LogHelper.MarkAsNonPII(configuration?.SigningKeys?.Count ?? 0),

test/Microsoft.IdentityModel.JsonWebTokens.Tests/JsonWebTokenHandler.ValidateSignatureTests.cs

Lines changed: 0 additions & 223 deletions
This file was deleted.

test/Microsoft.IdentityModel.JsonWebTokens.Tests/JsonWebTokenHandler.ValidateTokenAsyncTests_e2e.cs

Lines changed: 0 additions & 102 deletions
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
namespace Microsoft.IdentityModel.JsonWebTokens.Tests
2121
{
2222
/// <summary>
23-
/// These tests validate the decryption of JWE tokens using both TokenValidationParameters and ValidationParameters.
23+
/// These tests validate the decryption of JWE's using both TokenValidationParameters and ValidationParameters.
2424
/// We want to make sure that they succeed or fail in the same way, and that the exceptions thrown are consistent.
25-
/// ValidationParameters path specific tests are written in JsonWebTokenHandlerDecryptTokenTests.
25+
/// ValidationParameters path specific tests are written in DecryptTokenTests.
2626
/// The tests in these files could be merged however it is presumed that the TokenValidationParameters will remain fixed while
2727
/// ValidationParameters scenarios will evolve in the future, so it was chosen to keep them separate.
2828
/// </summary>
29-
public class JweDecryptionTests
29+
public class JweDecryptionComparisonTests
3030
{
3131
[Theory, MemberData(nameof(InvalidDecryptionTestCases), DisableDiscoveryEnumeration = true)]
3232
public async Task InvalidDecryption(ValidateTokenTheoryData theoryData)

0 commit comments

Comments
 (0)