Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
969f48c
Update to ASP.NET Core 8 preview 3
martincostello Apr 16, 2023
be51cdf
Merge branch 'dev' into dev-v8
martincostello May 16, 2023
b3634b8
Remove TODO
martincostello May 16, 2023
f75002c
Update to ASP.NET Core 8 preview 4
martincostello May 16, 2023
40bfea3
Update to ASP.NET Core 8 preview 5
martincostello Jun 14, 2023
e389e7d
Update exception types (#784)
martincostello Jun 15, 2023
c7eb754
Merge branch 'dev' into dev-v8
martincostello Jun 19, 2023
4cd4ee7
Update to ASP.NET Core 8 preview 6
martincostello Jul 11, 2023
61e4165
Merge branch 'dev' into dev-v8
martincostello Aug 7, 2023
1a20061
Update to ASP.NET Core 8 preview 7
martincostello Aug 8, 2023
d86e1d5
Merge branch 'dev' into dev-v8
martincostello Aug 15, 2023
8b25479
Fix JumpCloud for .NET 8
martincostello Aug 15, 2023
872582c
Merge branch 'dev' into dev-v8
martincostello Aug 17, 2023
d9b218d
Update to ASP.NET Core 8 RC 1 (#801)
martincostello Sep 12, 2023
54962db
Remove obsolete members
martincostello Oct 1, 2023
3246aad
Use C# 12 features (#806)
martincostello Oct 2, 2023
5b940db
Use collection literals
martincostello Oct 2, 2023
837fa59
Update arcade (#805)
martincostello Oct 4, 2023
bdc6fbd
Update to ASP.NET Core 8 RC 2 (#810)
martincostello Oct 10, 2023
681afa0
Bump Microsoft.IdentityModel.Protocols.OpenIdConnect
martincostello Oct 17, 2023
492d96b
Bump JetBrains.Annotations
martincostello Nov 9, 2023
cedd813
AoT support
martincostello Nov 9, 2023
e46b08b
Fix flaky test
martincostello Nov 9, 2023
515ada5
Fix duplicated query parameters for VSO/AzDo (#814)
martincostello Nov 12, 2023
8dfccb3
Use unified BattleNet server (#813)
martincostello Nov 14, 2023
5b8528d
Update to .NET 8.0 RTM
martincostello Nov 14, 2023
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
Prev Previous commit
Next Next commit
Update to ASP.NET Core 8 preview 7
- Update to preview 7 of ASP.NET Core 8.
- Suppress `CA1863` warnings to use `CompositeFormat`.
- Use `JsonDocument.ParseAsync()` where relevant.
  • Loading branch information
martincostello committed Aug 8, 2023
commit 1a20061d58c2c19fb75403a02e04dea36f1a2b95
6 changes: 3 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<PackageVersion Include="JetBrains.Annotations" Version="2022.1.0" />
<PackageVersion Include="JustEat.HttpClientInterception" Version="3.1.2" />
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="8.0.0-preview.6.23329.11" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0-preview.6.23329.11" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="8.0.0-preview.6.23329.11" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="8.0.0-preview.7.23375.9" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0-preview.7.23375.9" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="8.0.0-preview.7.23375.9" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="6.16.0" />
<PackageVersion Include="Moq" Version="4.18.2" />
<PackageVersion Include="Shouldly" Version="4.1.0" />
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
-->
<PackageValidationBaselineVersion Condition="'$(PackageValidationBaselineVersion)' == ''">7.0.0</PackageValidationBaselineVersion>
<PreReleaseVersionLabel>preview</PreReleaseVersionLabel>
<PreReleaseVersionIteration>6</PreReleaseVersionIteration>
<PreReleaseVersionIteration>7</PreReleaseVersionIteration>
<PreReleaseBrandingLabel>Preview $(PreReleaseVersionIteration)</PreReleaseBrandingLabel>
<StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">false</StabilizePackageVersion>
<DotNetFinalVersionKind Condition="'$(StabilizePackageVersion)' == 'true'">release</DotNetFinalVersionKind>
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"sdk": {
"version": "8.0.100-preview.6.23330.14",
"version": "8.0.100-preview.7.23376.3",
"allowPrerelease": true,
"rollForward": "major"
},

"tools": {
"dotnet": "8.0.100-preview.6.23330.14"
"dotnet": "8.0.100-preview.7.23376.3"
},

"msbuild-sdks": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ protected override async Task<OAuthTokenResponse> ExchangeCodeAsync([NotNull] OA
}

using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
using var document = JsonDocument.Parse(stream);
using var document = await JsonDocument.ParseAsync(stream);

var mainElement = document.RootElement.GetProperty("alipay_system_oauth_token_response");
if (!ValidateReturnCode(mainElement, out var code))
Expand Down Expand Up @@ -120,7 +120,7 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
}

using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
using var document = JsonDocument.Parse(stream);
using var document = await JsonDocument.ParseAsync(stream);
var rootElement = document.RootElement;

if (!rootElement.TryGetProperty("alipay_user_info_share_response", out JsonElement mainElement))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public AmoCrmAuthenticationOptions()
ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "id");
}

#pragma warning disable CA1863
/// <summary>
/// Gets or sets the amoCRM account name.
/// </summary>
Expand All @@ -48,4 +49,5 @@ public string Account
UserInformationEndpoint = string.Format(CultureInfo.InvariantCulture, AmoCrmAuthenticationDefaults.UserInformationEndpointFormat, value);
}
}
#pragma warning restore CA1863
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected override async Task<OAuthTokenResponse> ExchangeCodeAsync([NotNull] OA
}

using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
var payload = JsonDocument.Parse(stream);
var payload = await JsonDocument.ParseAsync(stream);
return OAuthTokenResponse.Success(payload);
}

Expand Down
2 changes: 2 additions & 0 deletions src/AspNet.Security.OAuth.Okta/OktaAuthenticationDefaults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public static class OktaAuthenticationDefaults
/// </summary>
public static readonly string UserInformationEndpointPathFormat = "/oauth2/{0}/v1/userinfo";

#pragma warning disable CA1863
/// <summary>
/// Default path to use for <see cref="OAuthOptions.AuthorizationEndpoint"/>.
/// </summary>
Expand All @@ -67,4 +68,5 @@ public static class OktaAuthenticationDefaults
/// Default path to use for <see cref="OAuthOptions.UserInformationEndpoint"/>.
/// </summary>
public static readonly string UserInformationEndpointPath = string.Format(CultureInfo.InvariantCulture, UserInformationEndpointPathFormat, DefaultAuthorizationServer);
#pragma warning disable CA1863
}
6 changes: 3 additions & 3 deletions src/AspNet.Security.OAuth.QQ/QQAuthenticationHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
}

using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
using var payload = JsonDocument.Parse(stream);
using var payload = await JsonDocument.ParseAsync(stream);

var status = payload.RootElement.GetProperty("ret").GetInt32();

Expand Down Expand Up @@ -109,7 +109,7 @@ protected override async Task<OAuthTokenResponse> ExchangeCodeAsync([NotNull] OA
}

using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
var payload = JsonDocument.Parse(stream);
var payload = await JsonDocument.ParseAsync(stream);

return OAuthTokenResponse.Success(payload);
}
Expand Down Expand Up @@ -139,7 +139,7 @@ protected override async Task<OAuthTokenResponse> ExchangeCodeAsync([NotNull] OA
}

using var stream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
using JsonDocument payload = JsonDocument.Parse(stream);
using var payload = await JsonDocument.ParseAsync(stream);

var payloadRoot = payload.RootElement;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
[NotNull] AuthenticationProperties properties,
[NotNull] OAuthTokenResponse tokens)
{
#pragma warning disable CA1863
var uri = string.Format(
CultureInfo.InvariantCulture,
ShopifyAuthenticationDefaults.UserInformationEndpointFormat,
properties.Items[ShopifyAuthenticationDefaults.ShopNameAuthenticationProperty]);
#pragma warning restore CA1863

using var request = new HttpRequestMessage(HttpMethod.Get, uri);
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
// UserInfo endpoint must support multiple subdomains, i.e. sod, sod1, online, online1, online2, ...
// - subdomain only becomes known from id token
// Example WebApi Url https://sod.superoffice.com/Cust12345/api/
#pragma warning disable CA1863
var userInfoEndpoint = string.Format(CultureInfo.InvariantCulture, SuperOfficeAuthenticationConstants.FormatStrings.UserInfoEndpoint, webApiUrl);
#pragma warning restore CA1863

// Get the SuperOffice user principal.
using var request = new HttpRequestMessage(HttpMethod.Get, userInfoEndpoint);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ private void UpdateEndpoints()
{
string env = GetEnvironment();

#pragma warning disable CA1863
AuthorizationEndpoint = string.Format(CultureInfo.InvariantCulture,
FormatStrings.AuthorizeEndpoint,
env);
Expand All @@ -167,5 +168,6 @@ private void UpdateEndpoints()
Authority = string.Format(CultureInfo.InvariantCulture,
FormatStrings.Authority,
env);
#pragma warning restore CA1863
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TargetFrameworks>$(DefaultNetCoreTargetFramework)</TargetFrameworks>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<NoWarn>$(NoWarn);CA1054;CA1055;CA1707;CA1861;CA2227;CA5404</NoWarn>
<NoWarn>$(NoWarn);CA1054;CA1055;CA1707;CA1861;CA1863;CA2227;CA5404</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static void Publicly_Visible_Parameters_Have_Null_Annotations()
testedMethods.ShouldBeGreaterThan(0);
}

private static IList<AssemblyName> GetProviderAssemblyNames()
private static AssemblyName[] GetProviderAssemblyNames()
{
var thisType = typeof(StaticAnalysisTests);

Expand All @@ -72,7 +72,7 @@ private static IList<AssemblyName> GetProviderAssemblyNames()
return assemblies;
}

private static IList<Type> GetPublicTypes(IEnumerable<AssemblyName> assemblyNames)
private static Type[] GetPublicTypes(IEnumerable<AssemblyName> assemblyNames)
{
var types = assemblyNames
.Select((p) => AssemblyLoadContext.Default.LoadFromAssemblyName(p))
Expand All @@ -85,7 +85,7 @@ private static IList<Type> GetPublicTypes(IEnumerable<AssemblyName> assemblyName
return types;
}

private static IList<MethodBase> GetPublicOrProtectedConstructorsOrMethods(Type type)
private static MethodBase[] GetPublicOrProtectedConstructorsOrMethods(Type type)
{
var constructors = type
.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic)
Expand Down