Skip to content
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

Restore PopKeyResolvingTests.GetPopKeysFromJkuAsync #2947

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ public static TheoryData<ResolvePopKeyTheoryData> ResolvePopKeyFromJkuKidTheoryD
}
}

[Theory(Skip = "flaky"), MemberData(nameof(GetPopKeysFromJkuAsyncTheoryData), DisableDiscoveryEnumeration = true)]
[Theory, MemberData(nameof(GetPopKeysFromJkuAsyncTheoryData), DisableDiscoveryEnumeration = true)]
public async Task GetPopKeysFromJkuAsync(ResolvePopKeyTheoryData theoryData)
{
var context = TestUtilities.WriteHeader($"{this}.GetPopKeysFromJkuAsync", theoryData);
Expand Down Expand Up @@ -771,36 +771,32 @@ public static TheoryData<ResolvePopKeyTheoryData> GetPopKeysFromJkuAsyncTheoryDa
{
return new TheoryData<ResolvePopKeyTheoryData>
{
new ResolvePopKeyTheoryData
new ResolvePopKeyTheoryData("InvalidJkuUrlNull")
{
First = true,
JkuSetUrl = null,
ExpectedException = ExpectedException.ArgumentNullException(),
TestId = "InvalidJkuUrlNull",
},
new ResolvePopKeyTheoryData
new ResolvePopKeyTheoryData("InvalidJkuUrlEmptyString")
{
JkuSetUrl = string.Empty,
ExpectedException = ExpectedException.ArgumentNullException(),
TestId = "InvalidJkuUrlEmptyString",
},
new ResolvePopKeyTheoryData
new ResolvePopKeyTheoryData("InvalidHttpsRequired")
{
JkuSetUrl = "http://www.contoso.com",
ExpectedException = new ExpectedException(typeof(SignedHttpRequestInvalidPopKeyException), "IDX23006"),
TestId = "InvalidHttpsRequired",
},
new ResolvePopKeyTheoryData
new ResolvePopKeyTheoryData("InvalidNoContentReturned")
{
JkuSetUrl = "https://www.contoso.com",
SignedHttpRequestValidationParameters = new SignedHttpRequestValidationParameters()
{
HttpClientProvider = () => HttpResponseMessageUtils.SetupHttpClientThatReturns(string.Empty),
},
ExpectedException = new ExpectedException(typeof(SignedHttpRequestInvalidPopKeyException), "IDX23022", null, true),
TestId = "InvalidNoContentReturned",
},
new ResolvePopKeyTheoryData
new ResolvePopKeyTheoryData("InvalidHttpNoContentReturned")
{
JkuSetUrl = "http://www.contoso.com",
SignedHttpRequestValidationParameters = new SignedHttpRequestValidationParameters()
Expand All @@ -809,48 +805,42 @@ public static TheoryData<ResolvePopKeyTheoryData> GetPopKeysFromJkuAsyncTheoryDa
HttpClientProvider = () => HttpResponseMessageUtils.SetupHttpClientThatReturns(string.Empty),
},
ExpectedException = new ExpectedException(typeof(SignedHttpRequestInvalidPopKeyException), "IDX23022", null, true),
TestId = "InvalidHttpNoContentReturned",
},
// TODO - find out why test is timing out in the AzureDevOps build, appears to be unrelated to the caching changes
kllysng marked this conversation as resolved.
Show resolved Hide resolved
//new ResolvePopKeyTheoryData
//{
// JkuSetUrl = "http://www.contoso.com",
// SignedHttpRequestValidationParameters = new SignedHttpRequestValidationParameters()
// {
// RequireHttpsForJkuResourceRetrieval = false,
// },
// ExpectedException = new ExpectedException(typeof(SignedHttpRequestInvalidPopKeyException), "IDX23022", typeof(ArgumentException)),
// TestId = "Valid0KeysReturnedLive",
//},
new ResolvePopKeyTheoryData
},
new ResolvePopKeyTheoryData("Valid0KeysReturnedLive")
{
JkuSetUrl = "http://www.contoso.com",
SignedHttpRequestValidationParameters = new SignedHttpRequestValidationParameters()
{
RequireHttpsForJkuResourceRetrieval = false,
},
ExpectedException = new ExpectedException(typeof(SignedHttpRequestInvalidPopKeyException), "IDX23022", typeof(ArgumentException)),
},
new ResolvePopKeyTheoryData("Valid0KeysReturned")
{
JkuSetUrl = "https://www.contoso.com",
SignedHttpRequestValidationParameters = new SignedHttpRequestValidationParameters()
{
HttpClientProvider = () => HttpResponseMessageUtils.SetupHttpClientThatReturns("{\"test\": 1}"),
},
ExpectedNumberOfPopKeysReturned = 0,
TestId = "Valid0KeysReturned",
},
new ResolvePopKeyTheoryData
new ResolvePopKeyTheoryData("Valid2KeysReturned")
{
JkuSetUrl = "https://www.contoso.com",
SignedHttpRequestValidationParameters = new SignedHttpRequestValidationParameters()
{
HttpClientProvider = () => HttpResponseMessageUtils.SetupHttpClientThatReturns(DataSets.JsonWebKeySetString1),
},
ExpectedNumberOfPopKeysReturned = 2,
TestId = "Valid2KeysReturned",
},
new ResolvePopKeyTheoryData
new ResolvePopKeyTheoryData("Valid3KeysReturned")
{
JkuSetUrl = "https://www.contoso.com",
SignedHttpRequestValidationParameters = new SignedHttpRequestValidationParameters()
{
HttpClientProvider = () => HttpResponseMessageUtils.SetupHttpClientThatReturns(DataSets.JsonWebKeySetECCString),
},
ExpectedNumberOfPopKeysReturned = 3,
TestId = "Valid3KeysReturned",
},
};
}
Expand Down
Loading