Skip to content

Commit

Permalink
Bump the .NET SDK and the .NET/ASP.NET Core dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinchalet committed Jan 12, 2024
1 parent 19b0666 commit 926ba13
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.100'
dotnet-version: '8.0.101'

- name: Build
run: eng\common\CIBuild.cmd -configuration Release -prepareMachine -integrationTest
Expand Down
22 changes: 11 additions & 11 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,18 @@
<!--
Note: the following references are exclusively used in the .NET 8.0 and ASP.NET Core 8.0 samples:
-->
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="8.0.1" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.1" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.1" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.UI" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.1" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.1" />
<PackageVersion Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.1" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.1" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.UI" Version="8.0.1" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
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",
"version": "8.0.101",
"allowPrerelease": true,
"rollForward": "major"
},

"tools": {
"dotnet": "8.0.100"
"dotnet": "8.0.101"
},

"msbuild-sdks": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,9 @@ private static IEnumerable<string> GetDestinations(Claim claim)

return claim.Type switch
{
Claims.Name or
Claims.Subject
=> new[] { Destinations.AccessToken, Destinations.IdentityToken },
Claims.Name or Claims.Subject => [Destinations.AccessToken, Destinations.IdentityToken],

_ => new[] { Destinations.AccessToken },
_ => [Destinations.AccessToken],
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ namespace Balosar.Server.Controllers;
[ApiController, Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries = new[]
{
private static readonly string[] Summaries =
[
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
];

[HttpGet]
public IEnumerable<WeatherForecast> Get()
Expand Down
4 changes: 2 additions & 2 deletions samples/Mimban/Mimban.Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ await manager.CreateAsync(new OpenIddictApplicationDescriptor
app.MapGet("/api", [Authorize(AuthenticationSchemes = OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme)]
(ClaimsPrincipal user) => user.Identity!.Name);

app.MapMethods("callback/login/github", new[] { HttpMethods.Get, HttpMethods.Post }, async (HttpContext context) =>
app.MapMethods("callback/login/github", [HttpMethods.Get, HttpMethods.Post], async (HttpContext context) =>
{
// Resolve the claims extracted by OpenIddict from the userinfo response returned by GitHub.
var result = await context.AuthenticateAsync(OpenIddictClientAspNetCoreDefaults.AuthenticationScheme);
Expand Down Expand Up @@ -189,7 +189,7 @@ await manager.CreateAsync(new OpenIddictApplicationDescriptor
RedirectUri = context.Request.GetEncodedUrl()
};
return Results.Challenge(properties, new[] { OpenIddictClientAspNetCoreDefaults.AuthenticationScheme });
return Results.Challenge(properties, [OpenIddictClientAspNetCoreDefaults.AuthenticationScheme]);
}
var identifier = principal.FindFirst(ClaimTypes.NameIdentifier)!.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public async Task<IActionResult> Authorize()
identity.AddClaim(new Claim(Claims.Subject, sid));

// Allow all the claims resolved from the principal to be copied to the access and identity tokens.
identity.SetDestinations(claim => new[] { Destinations.AccessToken, Destinations.IdentityToken });
identity.SetDestinations(claim => [Destinations.AccessToken, Destinations.IdentityToken]);

return SignIn(new ClaimsPrincipal(identity), OpenIddictServerAspNetCoreDefaults.AuthenticationScheme);
}
Expand Down
4 changes: 2 additions & 2 deletions samples/Zirku/Zirku.Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ await manager.CreateAsync(new OpenIddictScopeDescriptor
if (identifier is not (1 or 2))
{
return Results.Challenge(
authenticationSchemes: new[] { OpenIddictServerAspNetCoreDefaults.AuthenticationScheme },
authenticationSchemes: [OpenIddictServerAspNetCoreDefaults.AuthenticationScheme],
properties: new AuthenticationProperties(new Dictionary<string, string>
{
[OpenIddictServerAspNetCoreConstants.Properties.Error] = Errors.InvalidRequest,
Expand Down Expand Up @@ -278,7 +278,7 @@ await manager.CreateAsync(new OpenIddictScopeDescriptor
identity.SetResources(await manager.ListResourcesAsync(identity.GetScopes()).ToListAsync());
// Allow all claims to be added in the access tokens.
identity.SetDestinations(claim => new[] { Destinations.AccessToken });
identity.SetDestinations(claim => [Destinations.AccessToken]);
return Results.SignIn(new ClaimsPrincipal(identity), properties: null, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme);
});
Expand Down

0 comments on commit 926ba13

Please sign in to comment.