From c12879ca45483ee74768121f39deb6cd239289ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Fri, 12 Jan 2024 08:56:37 +0100 Subject: [PATCH] Bump the .NET SDK and the .NET/ASP.NET Core dependencies --- .github/workflows/build.yml | 2 +- Directory.Build.props | 3 ++- Directory.Packages.props | 22 +++++++++---------- global.json | 4 ++-- .../Controllers/AuthorizationController.cs | 6 ++--- .../Controllers/WeatherForecastController.cs | 6 ++--- samples/Mimban/Mimban.Server/Program.cs | 4 ++-- .../Controllers/AuthorizationController.cs | 2 +- samples/Zirku/Zirku.Server/Program.cs | 4 ++-- 9 files changed, 26 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5bd632346..74c451079 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/Directory.Build.props b/Directory.Build.props index 58c25f859..b42982c06 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,8 +4,9 @@ preview - $(NoWarn);CS1591;NU5128 true + $(NoWarn);CS1591;NU5128 + NU1901;NU1902;NU1903;NU1904 true true false diff --git a/Directory.Packages.props b/Directory.Packages.props index be1f3ae83..7a2157c85 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -64,18 +64,18 @@ - - - + + + - - - - - - - - + + + + + + + + diff --git a/global.json b/global.json index fa0e6c55d..5708fa435 100644 --- a/global.json +++ b/global.json @@ -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": { diff --git a/samples/Aridka/Aridka.Server/Controllers/AuthorizationController.cs b/samples/Aridka/Aridka.Server/Controllers/AuthorizationController.cs index e9fc233dc..e1d039862 100644 --- a/samples/Aridka/Aridka.Server/Controllers/AuthorizationController.cs +++ b/samples/Aridka/Aridka.Server/Controllers/AuthorizationController.cs @@ -82,11 +82,9 @@ private static IEnumerable 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], }; } } diff --git a/samples/Balosar/Balosar.Server/Controllers/WeatherForecastController.cs b/samples/Balosar/Balosar.Server/Controllers/WeatherForecastController.cs index 1677ebc11..fb9b3ccbb 100644 --- a/samples/Balosar/Balosar.Server/Controllers/WeatherForecastController.cs +++ b/samples/Balosar/Balosar.Server/Controllers/WeatherForecastController.cs @@ -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 Get() diff --git a/samples/Mimban/Mimban.Server/Program.cs b/samples/Mimban/Mimban.Server/Program.cs index 181c1086d..7820ea3a9 100644 --- a/samples/Mimban/Mimban.Server/Program.cs +++ b/samples/Mimban/Mimban.Server/Program.cs @@ -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); @@ -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; diff --git a/samples/Weytta/Weytta.Server/Controllers/AuthorizationController.cs b/samples/Weytta/Weytta.Server/Controllers/AuthorizationController.cs index 74ff204a9..58608c706 100644 --- a/samples/Weytta/Weytta.Server/Controllers/AuthorizationController.cs +++ b/samples/Weytta/Weytta.Server/Controllers/AuthorizationController.cs @@ -80,7 +80,7 @@ public async Task 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); } diff --git a/samples/Zirku/Zirku.Server/Program.cs b/samples/Zirku/Zirku.Server/Program.cs index 6c53b8381..4caf35a2f 100644 --- a/samples/Zirku/Zirku.Server/Program.cs +++ b/samples/Zirku/Zirku.Server/Program.cs @@ -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 { [OpenIddictServerAspNetCoreConstants.Properties.Error] = Errors.InvalidRequest, @@ -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); });