From 50f1a072b39979d301d41d04b22085afdd705da9 Mon Sep 17 00:00:00 2001 From: Duende Bot Date: Wed, 1 Apr 2026 08:22:06 +0000 Subject: [PATCH] Publish - 2026-04-01 08:20:45 UTC --- .gitignore | 3 +- Directory.Build.props | 2 +- Directory.Packages.props | 2 +- aspnetcore-authentication-jwtbearer/build.cs | 26 ---- ...AspNetCore.Authentication.JwtBearer.csproj | 1 - ...ntext.cs => DPoPProofValidationContext.cs} | 0 ...Result.cs => DPoPProofValidationResult.cs} | 0 .../DPoP/DPoPProofValidator.cs | 2 +- ...Core.Authentication.JwtBearer.Tests.csproj | 1 - .../DPoP/ConcurrentTokenValidationTests.cs | 115 ++++++++++++++++++ .../test/Directory.Build.props | 12 ++ bff/build.cs | 29 ----- ...osts.Bff.Blazor.PerComponent.Client.csproj | 1 - .../Hosts.Bff.Blazor.PerComponent.csproj | 1 - ...Hosts.Bff.Blazor.WebAssembly.Client.csproj | 1 - .../Hosts.Bff.Blazor.WebAssembly.csproj | 1 - bff/hosts/Hosts.AppHost/Hosts.AppHost.csproj | 1 - .../Hosts.Bff.DPoP/Hosts.Bff.DPoP.csproj | 1 - bff/hosts/Hosts.Bff.EF/Hosts.Bff.EF.csproj | 1 + .../Hosts.Bff.InMemory.csproj | 1 - .../Hosts.Bff.MultiFrontend.csproj | 1 - .../Hosts.Bff.Performance.csproj | 1 - .../Hosts.IdentityServer.csproj | 1 + .../Hosts.ServiceDefaults.csproj | 1 - .../Hosts.RemoteApi.DPoP.csproj | 1 + .../Hosts.RemoteApi.Isolated.csproj | 1 + .../Hosts.RemoteApi/Hosts.RemoteApi.csproj | 1 + bff/migrations/Directory.Build.props | 1 + .../Bff.Benchmarks/Bff.Benchmarks.csproj | 1 - .../Bff.Performance/Bff.Performance.csproj | 1 - .../Bff.Blazor.Client.csproj | 1 - bff/src/Bff.Blazor/Bff.Blazor.csproj | 1 - bff/src/Directory.Build.props | 1 - .../src/BffLocalApi/BffLocalApi.csproj | 1 + bff/test/Bff.Tests/Bff.Tests.csproj | 1 - bff/test/Directory.Build.props | 32 ++++- bff/test/Hosts.Tests/Hosts.Tests.csproj | 1 - conformance-report/build.cs | 26 ---- .../Services/OAuth21Assessor.cs | 9 +- conformance-report/src/Directory.Build.props | 1 - conformance-report/test/Directory.Build.props | 3 - docs-mcp/build.cs | 21 ---- docs-mcp/src/Directory.Build.props | 1 - .../aspire/AppHosts/All/All.csproj | 1 - .../aspire/AppHosts/Dev/Dev.csproj | 1 - .../ServiceDefaults/ServiceDefaults.csproj | 1 - identity-server/build.cs | 32 ----- identity-server/clients/Directory.Build.props | 1 + .../Host.AspNetIdentity10.csproj | 1 - .../Host.EntityFramework10.csproj | 1 - .../hosts/Main10/Host.Main10.csproj | 1 - .../hosts/Shared/Host.Shared.csproj | 1 - .../AspNetIdentity/UI.AspNetIdentity.csproj | 1 - .../EntityFramework/UI.EntityFramework.csproj | 1 - identity-server/hosts/UI/Main/UI.Main.csproj | 1 - .../migrations/Directory.Build.props | 1 + identity-server/perf/Directory.Build.props | 1 + identity-server/src/Directory.Build.props | 1 + .../Stores/PersistedGrantStore.cs | 4 +- .../LocalApiAuthenticationHandler.cs | 2 +- .../DefaultSessionManagementService.cs | 5 +- .../InMemory/InMemoryPersistedGrantStore.cs | 4 +- ...ntext.cs => DPoPProofValidationContext.cs} | 2 +- .../Default/DefaultDPoPProofValidator.cs | 26 ++-- .../PushedAuthorizationRequestValidator.cs | 2 +- .../Default/TokenRequestValidator.cs | 2 +- .../Validation/IDPoPProofValidator.cs | 2 +- ...Result.cs => DPoPProofValidationResult.cs} | 2 +- .../PersistedGrantFilterExtensions.cs | 4 +- .../Storage/Stores/PersistedGrantFilter.cs | 4 +- identity-server/test/Directory.Build.props | 34 ++++++ .../Endpoints/Token/DPoPTokenEndpointTests.cs | 2 +- .../Validation/DPoPProofValidatorTests.cs | 2 +- ignore-this/src/Directory.Build.props | 1 - ignore-this/src/IgnoreThis/IgnoreThis.csproj | 1 - ignore-this/test/Directory.Build.props | 3 - products.slnx | 22 ++-- .../ShouldlyExtensions.csproj | 1 - .../Xunit.Playwright/Xunit.Playwright.csproj | 1 - src.props | 42 +++---- templates/build/build.csproj | 1 - templates/templates.csproj | 1 + test.props | 62 +--------- 83 files changed, 267 insertions(+), 321 deletions(-) delete mode 100644 aspnetcore-authentication-jwtbearer/build.cs rename aspnetcore-authentication-jwtbearer/src/AspNetCore.Authentication.JwtBearer/DPoP/{DPoPProofValidatonContext.cs => DPoPProofValidationContext.cs} (100%) rename aspnetcore-authentication-jwtbearer/src/AspNetCore.Authentication.JwtBearer/DPoP/{DPoPProofValidatonResult.cs => DPoPProofValidationResult.cs} (100%) create mode 100644 aspnetcore-authentication-jwtbearer/test/AspNetCore.Authentication.JwtBearer.Tests/DPoP/ConcurrentTokenValidationTests.cs delete mode 100644 bff/build.cs delete mode 100644 conformance-report/build.cs delete mode 100644 docs-mcp/build.cs delete mode 100644 identity-server/build.cs rename identity-server/src/IdentityServer/Validation/Contexts/{DPoPProofValidatonContext.cs => DPoPProofValidationContext.cs} (98%) rename identity-server/src/IdentityServer/Validation/Models/{DPoPProofValidatonResult.cs => DPoPProofValidationResult.cs} (96%) diff --git a/.gitignore b/.gitignore index 4ef916bfa..8ca708e45 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ x86/ bld/ [Bb]in/ [Oo]bj/ +[Tt]emp/ # Visual Studio 2015 cache/options directory .vs/ @@ -176,7 +177,7 @@ Logging.g.cs LoggerMessage.g.cs PublicTopLevelProgram.Generated.g.cs RegexGenerator.g.cs -**/Generated/ +**/Generated/Microsoft.CodeAnalysis.Razor.Compiler/ # Backup & report files from converting an old project file # to a newer Visual Studio version. Backup files are not needed, diff --git a/Directory.Build.props b/Directory.Build.props index bf0870fe1..e35d7d54a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -13,7 +13,7 @@ enable false true - + enable net10.0 diff --git a/Directory.Packages.props b/Directory.Packages.props index fc11ac06c..7ba895698 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -101,7 +101,7 @@ - + diff --git a/aspnetcore-authentication-jwtbearer/build.cs b/aspnetcore-authentication-jwtbearer/build.cs deleted file mode 100644 index b94cac453..000000000 --- a/aspnetcore-authentication-jwtbearer/build.cs +++ /dev/null @@ -1,26 +0,0 @@ -#:project ../.github/build/BuildHelpers.csproj - -using BuildHelpers; -using static Bullseye.Targets; - -var repoRoot = Repo.FindRoot(); - -Targets.Shared(repoRoot, "aspnetcore-authentication-jwtbearer/aspnetcore-authentication-jwtbearer.slnf"); - -const string TestsAspNetCoreAuthenticationJwtBearerTests = "tests-asp-net-core-authentication-jwt-bearer-tests"; - -Targets.Test(TestsAspNetCoreAuthenticationJwtBearerTests, "aspnetcore-authentication-jwtbearer/test/AspNetCore.Authentication.JwtBearer.Tests", repoRoot); - -Target(SharedTargets.Default, [ - SharedTargets.CheckSolutions, - SharedTargets.CheckUnusedPackages, - SharedTargets.CheckSortedRefs, - SharedTargets.CheckSortedSlnf, - SharedTargets.VerifyFormatting, - SharedTargets.Clean, - SharedTargets.VerifyNoChanges, - SharedTargets.DotnetDevCerts, - TestsAspNetCoreAuthenticationJwtBearerTests -]); - -await RunTargetsAndExitAsync(args); diff --git a/aspnetcore-authentication-jwtbearer/src/AspNetCore.Authentication.JwtBearer/AspNetCore.Authentication.JwtBearer.csproj b/aspnetcore-authentication-jwtbearer/src/AspNetCore.Authentication.JwtBearer/AspNetCore.Authentication.JwtBearer.csproj index 6c03bc636..88ee46ee0 100644 --- a/aspnetcore-authentication-jwtbearer/src/AspNetCore.Authentication.JwtBearer/AspNetCore.Authentication.JwtBearer.csproj +++ b/aspnetcore-authentication-jwtbearer/src/AspNetCore.Authentication.JwtBearer/AspNetCore.Authentication.JwtBearer.csproj @@ -1,7 +1,6 @@ net10.0 - enable Duende.AspNetCore.Authentication.JwtBearer Duende.AspNetCore.Authentication.JwtBearer diff --git a/aspnetcore-authentication-jwtbearer/src/AspNetCore.Authentication.JwtBearer/DPoP/DPoPProofValidatonContext.cs b/aspnetcore-authentication-jwtbearer/src/AspNetCore.Authentication.JwtBearer/DPoP/DPoPProofValidationContext.cs similarity index 100% rename from aspnetcore-authentication-jwtbearer/src/AspNetCore.Authentication.JwtBearer/DPoP/DPoPProofValidatonContext.cs rename to aspnetcore-authentication-jwtbearer/src/AspNetCore.Authentication.JwtBearer/DPoP/DPoPProofValidationContext.cs diff --git a/aspnetcore-authentication-jwtbearer/src/AspNetCore.Authentication.JwtBearer/DPoP/DPoPProofValidatonResult.cs b/aspnetcore-authentication-jwtbearer/src/AspNetCore.Authentication.JwtBearer/DPoP/DPoPProofValidationResult.cs similarity index 100% rename from aspnetcore-authentication-jwtbearer/src/AspNetCore.Authentication.JwtBearer/DPoP/DPoPProofValidatonResult.cs rename to aspnetcore-authentication-jwtbearer/src/AspNetCore.Authentication.JwtBearer/DPoP/DPoPProofValidationResult.cs diff --git a/aspnetcore-authentication-jwtbearer/src/AspNetCore.Authentication.JwtBearer/DPoP/DPoPProofValidator.cs b/aspnetcore-authentication-jwtbearer/src/AspNetCore.Authentication.JwtBearer/DPoP/DPoPProofValidator.cs index 579f9850c..9852ca215 100644 --- a/aspnetcore-authentication-jwtbearer/src/AspNetCore.Authentication.JwtBearer/DPoP/DPoPProofValidator.cs +++ b/aspnetcore-authentication-jwtbearer/src/AspNetCore.Authentication.JwtBearer/DPoP/DPoPProofValidator.cs @@ -226,7 +226,7 @@ internal class DPoPProofValidator : IDPoPProofValidator try { - var tvp = context.Options.ProofTokenValidationParameters; + var tvp = context.Options.ProofTokenValidationParameters.Clone(); tvp.IssuerSigningKey = new JsonWebKey(result.JsonWebKey); var handler = new JsonWebTokenHandler(); diff --git a/aspnetcore-authentication-jwtbearer/test/AspNetCore.Authentication.JwtBearer.Tests/AspNetCore.Authentication.JwtBearer.Tests.csproj b/aspnetcore-authentication-jwtbearer/test/AspNetCore.Authentication.JwtBearer.Tests/AspNetCore.Authentication.JwtBearer.Tests.csproj index 2753d17bc..26013b5bc 100644 --- a/aspnetcore-authentication-jwtbearer/test/AspNetCore.Authentication.JwtBearer.Tests/AspNetCore.Authentication.JwtBearer.Tests.csproj +++ b/aspnetcore-authentication-jwtbearer/test/AspNetCore.Authentication.JwtBearer.Tests/AspNetCore.Authentication.JwtBearer.Tests.csproj @@ -1,7 +1,6 @@ net10.0 - enable Duende.AspNetCore.Authentication.JwtBearer.Tests Duende.AspNetCore.Authentication.JwtBearer true diff --git a/aspnetcore-authentication-jwtbearer/test/AspNetCore.Authentication.JwtBearer.Tests/DPoP/ConcurrentTokenValidationTests.cs b/aspnetcore-authentication-jwtbearer/test/AspNetCore.Authentication.JwtBearer.Tests/DPoP/ConcurrentTokenValidationTests.cs new file mode 100644 index 000000000..411107d3a --- /dev/null +++ b/aspnetcore-authentication-jwtbearer/test/AspNetCore.Authentication.JwtBearer.Tests/DPoP/ConcurrentTokenValidationTests.cs @@ -0,0 +1,115 @@ +// Copyright (c) Duende Software. All rights reserved. +// See LICENSE in the project root for license information. + +using System.Security.Claims; +using System.Security.Cryptography; +using System.Text.Json; +using Duende.IdentityModel; +using Microsoft.IdentityModel.JsonWebTokens; +using Microsoft.IdentityModel.Tokens; + +namespace Duende.AspNetCore.Authentication.JwtBearer.DPoP; + +/// +/// Regression tests for GitHub issue #1667: concurrent DPoP proof validation +/// must not corrupt the shared TokenValidationParameters.IssuerSigningKey. +/// +public sealed class ConcurrentTokenValidationTests : DPoPProofValidatorTestBase +{ + [Fact] + public async Task ConcurrentValidationsWithDifferentKeysShouldAllSucceed() + { + // Arrange – generate distinct RSA key pairs to simulate different DPoP clients + const int keyCount = 10; + const int requestsPerKey = 20; + + var keys = Enumerable.Range(0, keyCount) + .Select(_ => GenerateRsaKeyPair()) + .ToList(); + + // Build (context, result) pairs – each uses a proof token signed by a different key + var validations = keys.SelectMany(key => + Enumerable.Range(0, requestsPerKey).Select(_ => + { + var proofToken = CreateDPoPProofTokenForKey(key.PrivateJwk, key.PublicJwkPayload); + var result = new DPoPProofValidationResult(); + var context = Context with { ProofToken = proofToken }; + + // Pre-populate the JWK on the result, as ValidateJwk normally does + ProofValidator.ValidateJwk(context, result); + + return (Context: context, Result: result); + })) + .ToList(); + + // Act – run all validations concurrently against the shared Options. + // Use a gate to ensure all tasks start simultaneously on the thread pool, + // maximizing overlap to expose any race conditions. + using var gate = new ManualResetEventSlim(false); + + var tasks = validations.Select(v => Task.Run(async () => + { + gate.Wait(); + await ProofValidator.ValidateToken(v.Context, v.Result); + return v.Result; + })).ToArray(); + + gate.Set(); + + var results = await Task.WhenAll(tasks); + + // Assert – every validation must succeed; any failure indicates a race condition + var failures = results.Where(r => r.IsError).ToList(); + failures.Count.ShouldBe(0, + $"{failures.Count}/{results.Length} validations failed. " + + $"First error: {failures.FirstOrDefault()?.ErrorDescription}"); + } + + private static (string PrivateJwk, Dictionary PublicJwkPayload) GenerateRsaKeyPair() + { + using var rsa = RSA.Create(2048); + var parameters = rsa.ExportParameters(includePrivateParameters: true); + + var privateJwkJson = JsonSerializer.Serialize(new + { + kty = "RSA", + n = Base64UrlEncoder.Encode(parameters.Modulus!), + e = Base64UrlEncoder.Encode(parameters.Exponent!), + d = Base64UrlEncoder.Encode(parameters.D!), + p = Base64UrlEncoder.Encode(parameters.P!), + q = Base64UrlEncoder.Encode(parameters.Q!), + dp = Base64UrlEncoder.Encode(parameters.DP!), + dq = Base64UrlEncoder.Encode(parameters.DQ!), + qi = Base64UrlEncoder.Encode(parameters.InverseQ!) + }); + + var publicJwkPayload = new Dictionary + { + ["kty"] = "RSA", + ["n"] = Base64UrlEncoder.Encode(parameters.Modulus!), + ["e"] = Base64UrlEncoder.Encode(parameters.Exponent!) + }; + + return (privateJwkJson, publicJwkPayload); + } + + private static string CreateDPoPProofTokenForKey( + string privateJwkJson, + Dictionary publicJwkPayload) + { + var handler = new JsonWebTokenHandler(); + var signingKey = new JsonWebKey(privateJwkJson); + var descriptor = new SecurityTokenDescriptor + { + TokenType = "dpop+jwt", + IssuedAt = DateTime.UtcNow, + AdditionalHeaderClaims = new Dictionary + { + { JwtClaimTypes.JsonWebKey, publicJwkPayload } + }, + Subject = new ClaimsIdentity(), + SigningCredentials = new SigningCredentials(signingKey, SecurityAlgorithms.RsaSha256) + }; + return handler.CreateToken(descriptor); + } +} diff --git a/aspnetcore-authentication-jwtbearer/test/Directory.Build.props b/aspnetcore-authentication-jwtbearer/test/Directory.Build.props index 8178f7eeb..5191c88cd 100644 --- a/aspnetcore-authentication-jwtbearer/test/Directory.Build.props +++ b/aspnetcore-authentication-jwtbearer/test/Directory.Build.props @@ -2,4 +2,16 @@ + + + $(NoWarn);CA1051 + $(NoWarn);CA1305 + $(NoWarn);CA1310 + $(NoWarn);CA1707 + $(NoWarn);CA1805 + $(NoWarn);CA1822 + $(NoWarn);CA1852 + $(NoWarn);CA1866 + $(NoWarn);CA2201 + diff --git a/bff/build.cs b/bff/build.cs deleted file mode 100644 index 8da08210d..000000000 --- a/bff/build.cs +++ /dev/null @@ -1,29 +0,0 @@ -#:project ../.github/build/BuildHelpers.csproj - -using BuildHelpers; -using static Bullseye.Targets; - -var repoRoot = Repo.FindRoot(); - -Targets.Shared(repoRoot, "bff/bff.slnf"); - -const string TestsBffTests = "tests-bff-tests"; -const string TestsHostsTests = "tests-hosts-tests"; - -Targets.Test(TestsBffTests, "bff/test/Bff.Tests", repoRoot); -Targets.Test(TestsHostsTests, "bff/test/Hosts.Tests", repoRoot); - -Target(SharedTargets.Default, [ - SharedTargets.CheckSolutions, - SharedTargets.CheckUnusedPackages, - SharedTargets.CheckSortedRefs, - SharedTargets.CheckSortedSlnf, - SharedTargets.VerifyFormatting, - SharedTargets.Clean, - SharedTargets.VerifyNoChanges, - SharedTargets.DotnetDevCerts, - TestsBffTests, - TestsHostsTests -]); - -await RunTargetsAndExitAsync(args); diff --git a/bff/hosts/Blazor/PerComponent/Hosts.Bff.Blazor.PerComponent.Client/Hosts.Bff.Blazor.PerComponent.Client.csproj b/bff/hosts/Blazor/PerComponent/Hosts.Bff.Blazor.PerComponent.Client/Hosts.Bff.Blazor.PerComponent.Client.csproj index a251fdb04..4dbf3c46d 100644 --- a/bff/hosts/Blazor/PerComponent/Hosts.Bff.Blazor.PerComponent.Client/Hosts.Bff.Blazor.PerComponent.Client.csproj +++ b/bff/hosts/Blazor/PerComponent/Hosts.Bff.Blazor.PerComponent.Client/Hosts.Bff.Blazor.PerComponent.Client.csproj @@ -2,7 +2,6 @@ net10.0 - enable true Default diff --git a/bff/hosts/Blazor/PerComponent/Hosts.Bff.Blazor.PerComponent/Hosts.Bff.Blazor.PerComponent.csproj b/bff/hosts/Blazor/PerComponent/Hosts.Bff.Blazor.PerComponent/Hosts.Bff.Blazor.PerComponent.csproj index 216d067e1..53e068dc5 100644 --- a/bff/hosts/Blazor/PerComponent/Hosts.Bff.Blazor.PerComponent/Hosts.Bff.Blazor.PerComponent.csproj +++ b/bff/hosts/Blazor/PerComponent/Hosts.Bff.Blazor.PerComponent/Hosts.Bff.Blazor.PerComponent.csproj @@ -2,7 +2,6 @@ net10.0 - enable diff --git a/bff/hosts/Blazor/WebAssembly/Hosts.Bff.Blazor.WebAssembly.Client/Hosts.Bff.Blazor.WebAssembly.Client.csproj b/bff/hosts/Blazor/WebAssembly/Hosts.Bff.Blazor.WebAssembly.Client/Hosts.Bff.Blazor.WebAssembly.Client.csproj index 7bbf1ebea..42b128bfa 100644 --- a/bff/hosts/Blazor/WebAssembly/Hosts.Bff.Blazor.WebAssembly.Client/Hosts.Bff.Blazor.WebAssembly.Client.csproj +++ b/bff/hosts/Blazor/WebAssembly/Hosts.Bff.Blazor.WebAssembly.Client/Hosts.Bff.Blazor.WebAssembly.Client.csproj @@ -2,7 +2,6 @@ net10.0 - enable true Default diff --git a/bff/hosts/Blazor/WebAssembly/Hosts.Bff.Blazor.WebAssembly/Hosts.Bff.Blazor.WebAssembly.csproj b/bff/hosts/Blazor/WebAssembly/Hosts.Bff.Blazor.WebAssembly/Hosts.Bff.Blazor.WebAssembly.csproj index 5e63ea2e3..feb83e0f2 100644 --- a/bff/hosts/Blazor/WebAssembly/Hosts.Bff.Blazor.WebAssembly/Hosts.Bff.Blazor.WebAssembly.csproj +++ b/bff/hosts/Blazor/WebAssembly/Hosts.Bff.Blazor.WebAssembly/Hosts.Bff.Blazor.WebAssembly.csproj @@ -2,7 +2,6 @@ net10.0 - enable diff --git a/bff/hosts/Hosts.AppHost/Hosts.AppHost.csproj b/bff/hosts/Hosts.AppHost/Hosts.AppHost.csproj index fad88a23c..101e5239c 100644 --- a/bff/hosts/Hosts.AppHost/Hosts.AppHost.csproj +++ b/bff/hosts/Hosts.AppHost/Hosts.AppHost.csproj @@ -2,7 +2,6 @@ Exe - enable true 616547e2-3a28-4c9d-8685-f4ac02581162 diff --git a/bff/hosts/Hosts.Bff.DPoP/Hosts.Bff.DPoP.csproj b/bff/hosts/Hosts.Bff.DPoP/Hosts.Bff.DPoP.csproj index d2fe546aa..c2216563d 100644 --- a/bff/hosts/Hosts.Bff.DPoP/Hosts.Bff.DPoP.csproj +++ b/bff/hosts/Hosts.Bff.DPoP/Hosts.Bff.DPoP.csproj @@ -3,7 +3,6 @@ net10.0 Bff.DPoP - enable diff --git a/bff/hosts/Hosts.Bff.EF/Hosts.Bff.EF.csproj b/bff/hosts/Hosts.Bff.EF/Hosts.Bff.EF.csproj index 95671fede..5ade47a4d 100644 --- a/bff/hosts/Hosts.Bff.EF/Hosts.Bff.EF.csproj +++ b/bff/hosts/Hosts.Bff.EF/Hosts.Bff.EF.csproj @@ -2,6 +2,7 @@ net10.0 Bff.EF + disable diff --git a/bff/hosts/Hosts.Bff.InMemory/Hosts.Bff.InMemory.csproj b/bff/hosts/Hosts.Bff.InMemory/Hosts.Bff.InMemory.csproj index e60fd0d8f..d12a82ba1 100644 --- a/bff/hosts/Hosts.Bff.InMemory/Hosts.Bff.InMemory.csproj +++ b/bff/hosts/Hosts.Bff.InMemory/Hosts.Bff.InMemory.csproj @@ -3,7 +3,6 @@ net10.0 Bff - enable diff --git a/bff/hosts/Hosts.Bff.MultiFrontend/Hosts.Bff.MultiFrontend.csproj b/bff/hosts/Hosts.Bff.MultiFrontend/Hosts.Bff.MultiFrontend.csproj index 4148bd33c..68dae67c0 100644 --- a/bff/hosts/Hosts.Bff.MultiFrontend/Hosts.Bff.MultiFrontend.csproj +++ b/bff/hosts/Hosts.Bff.MultiFrontend/Hosts.Bff.MultiFrontend.csproj @@ -2,7 +2,6 @@ net10.0 - enable enable diff --git a/bff/hosts/Hosts.Bff.Performance/Hosts.Bff.Performance.csproj b/bff/hosts/Hosts.Bff.Performance/Hosts.Bff.Performance.csproj index da2ec451d..4fb9628d6 100644 --- a/bff/hosts/Hosts.Bff.Performance/Hosts.Bff.Performance.csproj +++ b/bff/hosts/Hosts.Bff.Performance/Hosts.Bff.Performance.csproj @@ -1,7 +1,6 @@ net10.0 - enable enable diff --git a/bff/hosts/Hosts.IdentityServer/Hosts.IdentityServer.csproj b/bff/hosts/Hosts.IdentityServer/Hosts.IdentityServer.csproj index 27ef68f35..d2fb3b345 100644 --- a/bff/hosts/Hosts.IdentityServer/Hosts.IdentityServer.csproj +++ b/bff/hosts/Hosts.IdentityServer/Hosts.IdentityServer.csproj @@ -2,6 +2,7 @@ net10.0 enable + disable $(NoWarn);IDE0130 diff --git a/bff/hosts/Hosts.ServiceDefaults/Hosts.ServiceDefaults.csproj b/bff/hosts/Hosts.ServiceDefaults/Hosts.ServiceDefaults.csproj index c7c8da7fd..330420c00 100644 --- a/bff/hosts/Hosts.ServiceDefaults/Hosts.ServiceDefaults.csproj +++ b/bff/hosts/Hosts.ServiceDefaults/Hosts.ServiceDefaults.csproj @@ -2,7 +2,6 @@ net10.0 - enable true diff --git a/bff/hosts/RemoteApis/Hosts.RemoteApi.DPoP/Hosts.RemoteApi.DPoP.csproj b/bff/hosts/RemoteApis/Hosts.RemoteApi.DPoP/Hosts.RemoteApi.DPoP.csproj index 596ffe9fd..2fff758fb 100644 --- a/bff/hosts/RemoteApis/Hosts.RemoteApi.DPoP/Hosts.RemoteApi.DPoP.csproj +++ b/bff/hosts/RemoteApis/Hosts.RemoteApi.DPoP/Hosts.RemoteApi.DPoP.csproj @@ -1,6 +1,7 @@ net10.0 + disable diff --git a/bff/hosts/RemoteApis/Hosts.RemoteApi.Isolated/Hosts.RemoteApi.Isolated.csproj b/bff/hosts/RemoteApis/Hosts.RemoteApi.Isolated/Hosts.RemoteApi.Isolated.csproj index 20be48762..b6287e787 100644 --- a/bff/hosts/RemoteApis/Hosts.RemoteApi.Isolated/Hosts.RemoteApi.Isolated.csproj +++ b/bff/hosts/RemoteApis/Hosts.RemoteApi.Isolated/Hosts.RemoteApi.Isolated.csproj @@ -1,6 +1,7 @@ net10.0 + disable diff --git a/bff/hosts/RemoteApis/Hosts.RemoteApi/Hosts.RemoteApi.csproj b/bff/hosts/RemoteApis/Hosts.RemoteApi/Hosts.RemoteApi.csproj index 14975ae35..c3c92b0bb 100644 --- a/bff/hosts/RemoteApis/Hosts.RemoteApi/Hosts.RemoteApi.csproj +++ b/bff/hosts/RemoteApis/Hosts.RemoteApi/Hosts.RemoteApi.csproj @@ -2,6 +2,7 @@ net10.0 + disable diff --git a/bff/migrations/Directory.Build.props b/bff/migrations/Directory.Build.props index 388739594..0b9a61a3a 100644 --- a/bff/migrations/Directory.Build.props +++ b/bff/migrations/Directory.Build.props @@ -5,5 +5,6 @@ $(AssemblyName) Duende.$(MSBuildProjectName) false + disable diff --git a/bff/performance/Bff.Benchmarks/Bff.Benchmarks.csproj b/bff/performance/Bff.Benchmarks/Bff.Benchmarks.csproj index e17ae92cc..df2e8b198 100644 --- a/bff/performance/Bff.Benchmarks/Bff.Benchmarks.csproj +++ b/bff/performance/Bff.Benchmarks/Bff.Benchmarks.csproj @@ -3,7 +3,6 @@ net10.0 Exe enable - enable false diff --git a/bff/performance/Bff.Performance/Bff.Performance.csproj b/bff/performance/Bff.Performance/Bff.Performance.csproj index 3129998e2..106e15b7d 100644 --- a/bff/performance/Bff.Performance/Bff.Performance.csproj +++ b/bff/performance/Bff.Performance/Bff.Performance.csproj @@ -4,7 +4,6 @@ net10.0 Exe enable - enable diff --git a/bff/src/Bff.Blazor.Client/Bff.Blazor.Client.csproj b/bff/src/Bff.Blazor.Client/Bff.Blazor.Client.csproj index 47efa59f7..75a33bf8a 100644 --- a/bff/src/Bff.Blazor.Client/Bff.Blazor.Client.csproj +++ b/bff/src/Bff.Blazor.Client/Bff.Blazor.Client.csproj @@ -1,7 +1,6 @@ net10.0 - enable true Duende.BFF.Blazor.Client diff --git a/bff/src/Bff.Blazor/Bff.Blazor.csproj b/bff/src/Bff.Blazor/Bff.Blazor.csproj index 56576ed71..b59ee9fbb 100644 --- a/bff/src/Bff.Blazor/Bff.Blazor.csproj +++ b/bff/src/Bff.Blazor/Bff.Blazor.csproj @@ -2,7 +2,6 @@ net10.0 - enable true Duende.BFF.Blazor diff --git a/bff/src/Directory.Build.props b/bff/src/Directory.Build.props index 1fa333316..5ffff4a4f 100644 --- a/bff/src/Directory.Build.props +++ b/bff/src/Directory.Build.props @@ -5,7 +5,6 @@ - enable OAuth 2.0;OpenID Connect;Security;BFF;IdentityServer;ASP.NET Core;SPA;Blazor Duende BFF bff- diff --git a/bff/templates/src/BffLocalApi/BffLocalApi.csproj b/bff/templates/src/BffLocalApi/BffLocalApi.csproj index aa6757fb4..49d3cc0a0 100644 --- a/bff/templates/src/BffLocalApi/BffLocalApi.csproj +++ b/bff/templates/src/BffLocalApi/BffLocalApi.csproj @@ -2,6 +2,7 @@ net10.0 enable + disable diff --git a/bff/test/Bff.Tests/Bff.Tests.csproj b/bff/test/Bff.Tests/Bff.Tests.csproj index 4870f96cb..1cc79da6e 100644 --- a/bff/test/Bff.Tests/Bff.Tests.csproj +++ b/bff/test/Bff.Tests/Bff.Tests.csproj @@ -2,7 +2,6 @@ net10.0 $(NoWarn);IDE0130 - enable True diff --git a/bff/test/Directory.Build.props b/bff/test/Directory.Build.props index f9dc2ea41..66f181f48 100644 --- a/bff/test/Directory.Build.props +++ b/bff/test/Directory.Build.props @@ -5,11 +5,33 @@ Duende.$(MSBuildProjectName) $(AssemblyName) - - $(NoWarn);RS0026 - - - $(NoWarn);RS0027 + + $(NoWarn);RS0026 + $(NoWarn);RS0027 + $(NoWarn);CA1000 + $(NoWarn);CA1001 + $(NoWarn);CA1051 + $(NoWarn);CA1304 + $(NoWarn);CA1305 + $(NoWarn);CA1310 + $(NoWarn);CA1311 + $(NoWarn);CA1707 + $(NoWarn);CA1711 + $(NoWarn);CA1725 + $(NoWarn);CA1805 + $(NoWarn);CA1816 + $(NoWarn);CA1822 + $(NoWarn);CA1829 + $(NoWarn);CA1848 + $(NoWarn);CA1852 + $(NoWarn);CA1859 + $(NoWarn);CA1860 + $(NoWarn);CA1861 + $(NoWarn);CA1866 + $(NoWarn);CA1869 + $(NoWarn);CA2016 + $(NoWarn);CA2201 + $(NoWarn);CA2254 diff --git a/bff/test/Hosts.Tests/Hosts.Tests.csproj b/bff/test/Hosts.Tests/Hosts.Tests.csproj index c347c7f29..9ac513081 100644 --- a/bff/test/Hosts.Tests/Hosts.Tests.csproj +++ b/bff/test/Hosts.Tests/Hosts.Tests.csproj @@ -1,7 +1,6 @@ net10.0 - enable false Debug;Release;Debug_ncrunch Hosts.Tests diff --git a/conformance-report/build.cs b/conformance-report/build.cs deleted file mode 100644 index 7269f621b..000000000 --- a/conformance-report/build.cs +++ /dev/null @@ -1,26 +0,0 @@ -#:project ../.github/build/BuildHelpers.csproj - -using BuildHelpers; -using static Bullseye.Targets; - -var repoRoot = Repo.FindRoot(); - -Targets.Shared(repoRoot, "conformance-report/conformance-report.slnf"); - -const string TestsConformanceReportTests = "tests-conformance-report-tests"; - -Targets.Test(TestsConformanceReportTests, "conformance-report/test/ConformanceReport.Tests", repoRoot); - -Target(SharedTargets.Default, [ - SharedTargets.CheckSolutions, - SharedTargets.CheckUnusedPackages, - SharedTargets.CheckSortedRefs, - SharedTargets.CheckSortedSlnf, - SharedTargets.VerifyFormatting, - SharedTargets.Clean, - SharedTargets.VerifyNoChanges, - SharedTargets.DotnetDevCerts, - TestsConformanceReportTests -]); - -await RunTargetsAndExitAsync(args); diff --git a/conformance-report/src/ConformanceReport/Services/OAuth21Assessor.cs b/conformance-report/src/ConformanceReport/Services/OAuth21Assessor.cs index d9469ee69..bb86a4c03 100644 --- a/conformance-report/src/ConformanceReport/Services/OAuth21Assessor.cs +++ b/conformance-report/src/ConformanceReport/Services/OAuth21Assessor.cs @@ -122,8 +122,6 @@ internal class OAuth21Assessor(ConformanceReportServerOptions options) return findings; } - #region Server-Level Assessments - private Finding AssessParAvailability() { var parEnabled = options.PushedAuthorizationEndpointEnabled; @@ -240,10 +238,6 @@ internal class OAuth21Assessor(ConformanceReportServerOptions options) Recommendation = options.UseHttp303Redirects ? null : "Set UseHttp303Redirects = true in IdentityServerOptions." }; - #endregion - - #region Client-Level Assessments - private static Finding AssessAllowedGrantTypes(ConformanceReportClient client) { var allowedGrants = new HashSet @@ -654,5 +648,4 @@ internal class OAuth21Assessor(ConformanceReportServerOptions options) }; } - #endregion -} +} \ No newline at end of file diff --git a/conformance-report/src/Directory.Build.props b/conformance-report/src/Directory.Build.props index 803971578..492733bcb 100644 --- a/conformance-report/src/Directory.Build.props +++ b/conformance-report/src/Directory.Build.props @@ -2,7 +2,6 @@ - enable Duende.ConformanceReport.$(MSBuildProjectName) Duende.ConformanceReport.$(MSBuildProjectName) Duende.ConformanceReport diff --git a/conformance-report/test/Directory.Build.props b/conformance-report/test/Directory.Build.props index 689890199..5371b278d 100644 --- a/conformance-report/test/Directory.Build.props +++ b/conformance-report/test/Directory.Build.props @@ -1,7 +1,4 @@ - - enable - diff --git a/docs-mcp/build.cs b/docs-mcp/build.cs deleted file mode 100644 index 9ee9f71e7..000000000 --- a/docs-mcp/build.cs +++ /dev/null @@ -1,21 +0,0 @@ -#:project ../.github/build/BuildHelpers.csproj - -using BuildHelpers; -using static Bullseye.Targets; - -var repoRoot = Repo.FindRoot(); - -Targets.Shared(repoRoot, "docs-mcp/docs-mcp.slnf"); - -Target(SharedTargets.Default, [ - SharedTargets.CheckSolutions, - SharedTargets.CheckUnusedPackages, - SharedTargets.CheckSortedRefs, - SharedTargets.CheckSortedSlnf, - SharedTargets.VerifyFormatting, - SharedTargets.Clean, - SharedTargets.VerifyNoChanges, - SharedTargets.DotnetDevCerts -]); - -await RunTargetsAndExitAsync(args); diff --git a/docs-mcp/src/Directory.Build.props b/docs-mcp/src/Directory.Build.props index 690b48359..bb1a26472 100644 --- a/docs-mcp/src/Directory.Build.props +++ b/docs-mcp/src/Directory.Build.props @@ -9,6 +9,5 @@ Duende Documentation MCP Server dmcp- 1.0 - enable diff --git a/identity-server/aspire/AppHosts/All/All.csproj b/identity-server/aspire/AppHosts/All/All.csproj index 18d5a9098..b59d0d171 100644 --- a/identity-server/aspire/AppHosts/All/All.csproj +++ b/identity-server/aspire/AppHosts/All/All.csproj @@ -2,7 +2,6 @@ Exe - enable true b86a3528-3d86-4514-b57f-9839f472ef31 diff --git a/identity-server/aspire/AppHosts/Dev/Dev.csproj b/identity-server/aspire/AppHosts/Dev/Dev.csproj index 8c54eca2f..6b5082d02 100644 --- a/identity-server/aspire/AppHosts/Dev/Dev.csproj +++ b/identity-server/aspire/AppHosts/Dev/Dev.csproj @@ -2,7 +2,6 @@ Exe - enable true diff --git a/identity-server/aspire/ServiceDefaults/ServiceDefaults.csproj b/identity-server/aspire/ServiceDefaults/ServiceDefaults.csproj index 0c0e1e443..5008c34c3 100644 --- a/identity-server/aspire/ServiceDefaults/ServiceDefaults.csproj +++ b/identity-server/aspire/ServiceDefaults/ServiceDefaults.csproj @@ -1,7 +1,6 @@ - enable true diff --git a/identity-server/build.cs b/identity-server/build.cs deleted file mode 100644 index 304bfeb47..000000000 --- a/identity-server/build.cs +++ /dev/null @@ -1,32 +0,0 @@ -#:project ../.github/build/BuildHelpers.csproj - -using BuildHelpers; -using static Bullseye.Targets; - -var repoRoot = Repo.FindRoot(); - -Targets.Shared(repoRoot, "identity-server/identity-server.slnf"); - -const string TestsIdentityServerUnitTests = "tests-identity-server-unit-tests"; -const string TestsIdentityServerIntegrationTests = "tests-identity-server-integration-tests"; -const string TestsIdentityServerEndToEndTests = "tests-identity-server-end-to-end-tests"; - -Targets.Test(TestsIdentityServerUnitTests, "identity-server/test/IdentityServer.UnitTests", repoRoot); -Targets.Test(TestsIdentityServerIntegrationTests, "identity-server/test/IdentityServer.IntegrationTests", repoRoot); -Targets.Test(TestsIdentityServerEndToEndTests, "identity-server/test/IdentityServer.EndToEndTests", repoRoot); - -Target(SharedTargets.Default, [ - SharedTargets.CheckSolutions, - SharedTargets.CheckUnusedPackages, - SharedTargets.CheckSortedRefs, - SharedTargets.CheckSortedSlnf, - SharedTargets.VerifyFormatting, - SharedTargets.Clean, - SharedTargets.VerifyNoChanges, - SharedTargets.DotnetDevCerts, - TestsIdentityServerUnitTests, - TestsIdentityServerIntegrationTests, - TestsIdentityServerEndToEndTests -]); - -await RunTargetsAndExitAsync(args); diff --git a/identity-server/clients/Directory.Build.props b/identity-server/clients/Directory.Build.props index 8a89ceed6..a3b32caa0 100644 --- a/identity-server/clients/Directory.Build.props +++ b/identity-server/clients/Directory.Build.props @@ -4,5 +4,6 @@ None true false + disable diff --git a/identity-server/hosts/AspNetIdentity10/Host.AspNetIdentity10.csproj b/identity-server/hosts/AspNetIdentity10/Host.AspNetIdentity10.csproj index 97c68e120..52a182485 100644 --- a/identity-server/hosts/AspNetIdentity10/Host.AspNetIdentity10.csproj +++ b/identity-server/hosts/AspNetIdentity10/Host.AspNetIdentity10.csproj @@ -2,7 +2,6 @@ IdentityServerHost - enable diff --git a/identity-server/hosts/EntityFramework10/Host.EntityFramework10.csproj b/identity-server/hosts/EntityFramework10/Host.EntityFramework10.csproj index b2e6fbd19..51a8ca264 100644 --- a/identity-server/hosts/EntityFramework10/Host.EntityFramework10.csproj +++ b/identity-server/hosts/EntityFramework10/Host.EntityFramework10.csproj @@ -2,7 +2,6 @@ IdentityServerHost - enable true enable diff --git a/identity-server/hosts/Main10/Host.Main10.csproj b/identity-server/hosts/Main10/Host.Main10.csproj index fc0a473d2..7838f5c45 100644 --- a/identity-server/hosts/Main10/Host.Main10.csproj +++ b/identity-server/hosts/Main10/Host.Main10.csproj @@ -4,7 +4,6 @@ InProcess IdentityServerHost e60c119c-8b86-4016-9d44-80e25948dbba - enable diff --git a/identity-server/hosts/Shared/Host.Shared.csproj b/identity-server/hosts/Shared/Host.Shared.csproj index 70b673fe4..dbf90e32f 100644 --- a/identity-server/hosts/Shared/Host.Shared.csproj +++ b/identity-server/hosts/Shared/Host.Shared.csproj @@ -3,7 +3,6 @@ net10.0 enable - enable Duende.IdentityServer.Hosts.Shared false diff --git a/identity-server/hosts/UI/AspNetIdentity/UI.AspNetIdentity.csproj b/identity-server/hosts/UI/AspNetIdentity/UI.AspNetIdentity.csproj index 477996f30..dd986e832 100644 --- a/identity-server/hosts/UI/AspNetIdentity/UI.AspNetIdentity.csproj +++ b/identity-server/hosts/UI/AspNetIdentity/UI.AspNetIdentity.csproj @@ -2,7 +2,6 @@ net10.0 - enable enable true Duende.IdentityServer.UI.AspNetIdentity diff --git a/identity-server/hosts/UI/EntityFramework/UI.EntityFramework.csproj b/identity-server/hosts/UI/EntityFramework/UI.EntityFramework.csproj index 6bb558761..f00ffc298 100644 --- a/identity-server/hosts/UI/EntityFramework/UI.EntityFramework.csproj +++ b/identity-server/hosts/UI/EntityFramework/UI.EntityFramework.csproj @@ -2,7 +2,6 @@ net10.0 - enable enable true Duende.IdentityServer.UI.EntityFramework diff --git a/identity-server/hosts/UI/Main/UI.Main.csproj b/identity-server/hosts/UI/Main/UI.Main.csproj index 6ffa043f6..3806f061e 100644 --- a/identity-server/hosts/UI/Main/UI.Main.csproj +++ b/identity-server/hosts/UI/Main/UI.Main.csproj @@ -2,7 +2,6 @@ net10.0 - enable enable true Duende.IdentityServer.UI diff --git a/identity-server/migrations/Directory.Build.props b/identity-server/migrations/Directory.Build.props index 8a89ceed6..a3b32caa0 100644 --- a/identity-server/migrations/Directory.Build.props +++ b/identity-server/migrations/Directory.Build.props @@ -4,5 +4,6 @@ None true false + disable diff --git a/identity-server/perf/Directory.Build.props b/identity-server/perf/Directory.Build.props index de7b79c33..ba993305d 100644 --- a/identity-server/perf/Directory.Build.props +++ b/identity-server/perf/Directory.Build.props @@ -2,5 +2,6 @@ None + disable diff --git a/identity-server/src/Directory.Build.props b/identity-server/src/Directory.Build.props index 0bb39d74c..56dd0c82c 100644 --- a/identity-server/src/Directory.Build.props +++ b/identity-server/src/Directory.Build.props @@ -9,6 +9,7 @@ is- 8.0 true + disable $(NoWarn);CA1002;CA1008;CA1031;CA1051;CA1054;CA1055;CA1056;CA1062;CA1716;CA1724;CA1725;CA1727;CA1819;CA1848;CA1851;CA2201;CA2208;CA2227;CA2234 diff --git a/identity-server/src/EntityFramework.Storage/Stores/PersistedGrantStore.cs b/identity-server/src/EntityFramework.Storage/Stores/PersistedGrantStore.cs index 319288614..e7abaa863 100644 --- a/identity-server/src/EntityFramework.Storage/Stores/PersistedGrantStore.cs +++ b/identity-server/src/EntityFramework.Storage/Stores/PersistedGrantStore.cs @@ -159,7 +159,7 @@ public class PersistedGrantStore : Duende.IdentityServer.Stores.IPersistedGrantS private static IQueryable Filter(IQueryable query, PersistedGrantFilter filter) { - if (filter.ClientIds != null) + if (filter.ClientIds.Count > 0) { var ids = filter.ClientIds.ToList(); if (!string.IsNullOrWhiteSpace(filter.ClientId)) @@ -182,7 +182,7 @@ public class PersistedGrantStore : Duende.IdentityServer.Stores.IPersistedGrantS query = query.Where(x => x.SubjectId == filter.SubjectId); } - if (filter.Types != null) + if (filter.Types.Count > 0) { var types = filter.Types.ToList(); if (!string.IsNullOrWhiteSpace(filter.Type)) diff --git a/identity-server/src/IdentityServer/Hosting/LocalApiAuthentication/LocalApiAuthenticationHandler.cs b/identity-server/src/IdentityServer/Hosting/LocalApiAuthentication/LocalApiAuthenticationHandler.cs index 9d8301a91..2c871938b 100644 --- a/identity-server/src/IdentityServer/Hosting/LocalApiAuthentication/LocalApiAuthenticationHandler.cs +++ b/identity-server/src/IdentityServer/Hosting/LocalApiAuthentication/LocalApiAuthenticationHandler.cs @@ -119,7 +119,7 @@ public class LocalApiAuthenticationHandler : AuthenticationHandler 0) { var ids = filter.ClientIds.ToList(); if (!string.IsNullOrWhiteSpace(filter.ClientId)) @@ -106,7 +106,7 @@ public class InMemoryPersistedGrantStore : IPersistedGrantStore query = query.Where(x => x.SubjectId == filter.SubjectId); } - if (filter.Types != null) + if (filter.Types.Count > 0) { var types = filter.Types.ToList(); if (!string.IsNullOrWhiteSpace(filter.Type)) diff --git a/identity-server/src/IdentityServer/Validation/Contexts/DPoPProofValidatonContext.cs b/identity-server/src/IdentityServer/Validation/Contexts/DPoPProofValidationContext.cs similarity index 98% rename from identity-server/src/IdentityServer/Validation/Contexts/DPoPProofValidatonContext.cs rename to identity-server/src/IdentityServer/Validation/Contexts/DPoPProofValidationContext.cs index 9348beda9..c1cde28cd 100644 --- a/identity-server/src/IdentityServer/Validation/Contexts/DPoPProofValidatonContext.cs +++ b/identity-server/src/IdentityServer/Validation/Contexts/DPoPProofValidationContext.cs @@ -12,7 +12,7 @@ namespace Duende.IdentityServer.Validation; /// /// Models the context for validaing DPoP proof tokens. /// -public class DPoPProofValidatonContext +public class DPoPProofValidationContext { /// /// Enum setting to control validation for the DPoP proof token expiration. diff --git a/identity-server/src/IdentityServer/Validation/Default/DefaultDPoPProofValidator.cs b/identity-server/src/IdentityServer/Validation/Default/DefaultDPoPProofValidator.cs index c5eac04d0..fda201373 100644 --- a/identity-server/src/IdentityServer/Validation/Default/DefaultDPoPProofValidator.cs +++ b/identity-server/src/IdentityServer/Validation/Default/DefaultDPoPProofValidator.cs @@ -69,9 +69,9 @@ public class DefaultDPoPProofValidator : IDPoPProofValidator } /// - public async Task ValidateAsync(DPoPProofValidatonContext context, Ct ct) + public async Task ValidateAsync(DPoPProofValidationContext context, Ct ct) { - var result = new DPoPProofValidatonResult() { IsError = false }; + var result = new DPoPProofValidationResult() { IsError = false }; try { @@ -120,7 +120,7 @@ public class DefaultDPoPProofValidator : IDPoPProofValidator /// /// Validates the header. /// - protected virtual Task ValidateHeaderAsync(DPoPProofValidatonContext context, DPoPProofValidatonResult result) + protected virtual Task ValidateHeaderAsync(DPoPProofValidationContext context, DPoPProofValidationResult result) { JsonWebToken token; var handler = new JsonWebTokenHandler(); @@ -242,7 +242,7 @@ public class DefaultDPoPProofValidator : IDPoPProofValidator /// /// Validates the signature. /// - protected virtual async Task ValidateSignatureAsync(DPoPProofValidatonContext context, DPoPProofValidatonResult result) + protected virtual async Task ValidateSignatureAsync(DPoPProofValidationContext context, DPoPProofValidationResult result) { Microsoft.IdentityModel.Tokens.TokenValidationResult tokenValidationResult; @@ -284,7 +284,7 @@ public class DefaultDPoPProofValidator : IDPoPProofValidator /// /// Validates the payload. /// - protected virtual async Task ValidatePayloadAsync(DPoPProofValidatonContext context, DPoPProofValidatonResult result, Ct ct) + protected virtual async Task ValidatePayloadAsync(DPoPProofValidationContext context, DPoPProofValidationResult result, Ct ct) { if (context.ValidateAccessToken) { @@ -379,9 +379,9 @@ public class DefaultDPoPProofValidator : IDPoPProofValidator } /// - /// Validates is the token has been replayed. + /// Validates if the token has been replayed. /// - protected virtual async Task ValidateReplayAsync(DPoPProofValidatonContext context, DPoPProofValidatonResult result, Ct ct) + protected virtual async Task ValidateReplayAsync(DPoPProofValidationContext context, DPoPProofValidationResult result, Ct ct) { if (await ReplayCache.ExistsAsync(ReplayCachePurpose, result.TokenId, ct)) { @@ -416,7 +416,7 @@ public class DefaultDPoPProofValidator : IDPoPProofValidator /// /// Validates the freshness. /// - protected virtual async Task ValidateFreshnessAsync(DPoPProofValidatonContext context, DPoPProofValidatonResult result) + protected virtual async Task ValidateFreshnessAsync(DPoPProofValidationContext context, DPoPProofValidationResult result) { var validateIat = (context.ExpirationValidationMode & DPoPTokenExpirationValidationMode.Iat) == DPoPTokenExpirationValidationMode.Iat; if (validateIat) @@ -442,7 +442,7 @@ public class DefaultDPoPProofValidator : IDPoPProofValidator /// /// Validates the freshness of the iat value. /// - protected virtual Task ValidateIatAsync(DPoPProofValidatonContext context, DPoPProofValidatonResult result) + protected virtual Task ValidateIatAsync(DPoPProofValidationContext context, DPoPProofValidationResult result) { if (IsExpired(context, result, context.ClientClockSkew, result.IssuedAt.Value)) { @@ -457,7 +457,7 @@ public class DefaultDPoPProofValidator : IDPoPProofValidator /// /// Validates the freshness of the nonce value. /// - protected virtual async Task ValidateNonceAsync(DPoPProofValidatonContext context, DPoPProofValidatonResult result) + protected virtual async Task ValidateNonceAsync(DPoPProofValidationContext context, DPoPProofValidationResult result) { if (result.Nonce.IsMissing()) { @@ -496,7 +496,7 @@ public class DefaultDPoPProofValidator : IDPoPProofValidator /// Creates a nonce value to return to the client. /// /// - protected virtual string CreateNonce(DPoPProofValidatonContext context, DPoPProofValidatonResult result) + protected virtual string CreateNonce(DPoPProofValidationContext context, DPoPProofValidationResult result) { var now = TimeProvider.GetUtcNow().ToUnixTimeSeconds(); return DataProtector.Protect(now.ToString(CultureInfo.InvariantCulture)); @@ -506,7 +506,7 @@ public class DefaultDPoPProofValidator : IDPoPProofValidator /// Reads the time the nonce was created. /// /// - protected virtual ValueTask GetUnixTimeFromNonceAsync(DPoPProofValidatonContext context, DPoPProofValidatonResult result) + protected virtual ValueTask GetUnixTimeFromNonceAsync(DPoPProofValidationContext context, DPoPProofValidationResult result) { try { @@ -528,7 +528,7 @@ public class DefaultDPoPProofValidator : IDPoPProofValidator /// Validates the expiration of the DPoP proof. /// Returns true if the time is beyond the allowed limits, false otherwise. /// - protected virtual bool IsExpired(DPoPProofValidatonContext context, DPoPProofValidatonResult result, TimeSpan clockSkew, long issuedAtTime) + protected virtual bool IsExpired(DPoPProofValidationContext context, DPoPProofValidationResult result, TimeSpan clockSkew, long issuedAtTime) { var now = TimeProvider.GetUtcNow().ToUnixTimeSeconds(); var start = now + (int)clockSkew.TotalSeconds; diff --git a/identity-server/src/IdentityServer/Validation/Default/PushedAuthorizationRequestValidator.cs b/identity-server/src/IdentityServer/Validation/Default/PushedAuthorizationRequestValidator.cs index 0bcc4c230..578721e69 100644 --- a/identity-server/src/IdentityServer/Validation/Default/PushedAuthorizationRequestValidator.cs +++ b/identity-server/src/IdentityServer/Validation/Default/PushedAuthorizationRequestValidator.cs @@ -87,7 +87,7 @@ internal class PushedAuthorizationRequestValidator( // validate proof token var parUrl = context.ClientCertificate == null ? serverUrls.BaseUrl.EnsureTrailingSlash() + ProtocolRoutePaths.PushedAuthorization : mtlsEndpointGenerator.GetMtlsEndpointPath(ProtocolRoutePaths.PushedAuthorization); - var dpopContext = new DPoPProofValidatonContext + var dpopContext = new DPoPProofValidationContext { ProofToken = context.DPoPProofToken, ExpirationValidationMode = context.Client.DPoPValidationMode, diff --git a/identity-server/src/IdentityServer/Validation/Default/TokenRequestValidator.cs b/identity-server/src/IdentityServer/Validation/Default/TokenRequestValidator.cs index 2f587f26d..fe6af2d23 100644 --- a/identity-server/src/IdentityServer/Validation/Default/TokenRequestValidator.cs +++ b/identity-server/src/IdentityServer/Validation/Default/TokenRequestValidator.cs @@ -253,7 +253,7 @@ internal class TokenRequestValidator : ITokenRequestValidator } var tokenUrl = context.ClientCertificate == null ? _serverUrls.BaseUrl.EnsureTrailingSlash() + ProtocolRoutePaths.Token : _mtlsEndpointGenerator.GetMtlsEndpointPath(ProtocolRoutePaths.Token); - var dpopContext = new DPoPProofValidatonContext + var dpopContext = new DPoPProofValidationContext { ExpirationValidationMode = _validatedRequest.Client.DPoPValidationMode, ClientClockSkew = _validatedRequest.Client.DPoPClockSkew, diff --git a/identity-server/src/IdentityServer/Validation/IDPoPProofValidator.cs b/identity-server/src/IdentityServer/Validation/IDPoPProofValidator.cs index 12749d1fb..155e7d3e0 100644 --- a/identity-server/src/IdentityServer/Validation/IDPoPProofValidator.cs +++ b/identity-server/src/IdentityServer/Validation/IDPoPProofValidator.cs @@ -16,5 +16,5 @@ public interface IDPoPProofValidator /// /// The validation context. /// The cancellation token. - Task ValidateAsync(DPoPProofValidatonContext context, Ct ct); + Task ValidateAsync(DPoPProofValidationContext context, Ct ct); } diff --git a/identity-server/src/IdentityServer/Validation/Models/DPoPProofValidatonResult.cs b/identity-server/src/IdentityServer/Validation/Models/DPoPProofValidationResult.cs similarity index 96% rename from identity-server/src/IdentityServer/Validation/Models/DPoPProofValidatonResult.cs rename to identity-server/src/IdentityServer/Validation/Models/DPoPProofValidationResult.cs index 14564714f..c03a28100 100644 --- a/identity-server/src/IdentityServer/Validation/Models/DPoPProofValidatonResult.cs +++ b/identity-server/src/IdentityServer/Validation/Models/DPoPProofValidationResult.cs @@ -9,7 +9,7 @@ namespace Duende.IdentityServer.Validation; /// /// Models the result of DPoP proof validation. /// -public class DPoPProofValidatonResult : ValidationResult +public class DPoPProofValidationResult : ValidationResult { /// /// The serialized JWK from the validated DPoP proof token. diff --git a/identity-server/src/Storage/Extensions/PersistedGrantFilterExtensions.cs b/identity-server/src/Storage/Extensions/PersistedGrantFilterExtensions.cs index 2f1401e03..ff9b592b6 100644 --- a/identity-server/src/Storage/Extensions/PersistedGrantFilterExtensions.cs +++ b/identity-server/src/Storage/Extensions/PersistedGrantFilterExtensions.cs @@ -20,11 +20,11 @@ public static class PersistedGrantFilterExtensions ArgumentNullException.ThrowIfNull(filter); if (string.IsNullOrWhiteSpace(filter.ClientId) && - filter.ClientIds == null && + filter.ClientIds.Count == 0 && string.IsNullOrWhiteSpace(filter.SessionId) && string.IsNullOrWhiteSpace(filter.SubjectId) && string.IsNullOrWhiteSpace(filter.Type) && - filter.Types == null) + filter.Types.Count == 0) { throw new ArgumentException("No filter values set.", nameof(filter)); } diff --git a/identity-server/src/Storage/Stores/PersistedGrantFilter.cs b/identity-server/src/Storage/Stores/PersistedGrantFilter.cs index 2b91d2d83..ecb91235e 100644 --- a/identity-server/src/Storage/Stores/PersistedGrantFilter.cs +++ b/identity-server/src/Storage/Stores/PersistedGrantFilter.cs @@ -31,7 +31,7 @@ public class PersistedGrantFilter /// /// Client ids the grant was issued to. /// - public IReadOnlyCollection? ClientIds { get; set; } + public IReadOnlyCollection ClientIds { get; set; } = []; /// /// The type of grant. @@ -41,5 +41,5 @@ public class PersistedGrantFilter /// /// The types of grants. /// - public IReadOnlyCollection? Types { get; set; } + public IReadOnlyCollection Types { get; set; } = []; } diff --git a/identity-server/test/Directory.Build.props b/identity-server/test/Directory.Build.props index f967d20c5..206b07847 100644 --- a/identity-server/test/Directory.Build.props +++ b/identity-server/test/Directory.Build.props @@ -5,5 +5,39 @@ true + disable + + $(NoWarn);CA1001 + $(NoWarn);CA1041 + $(NoWarn);CA1051 + $(NoWarn);CA1304 + $(NoWarn);CA1305 + $(NoWarn);CA1309 + $(NoWarn);CA1310 + $(NoWarn);CA1311 + $(NoWarn);CA1707 + $(NoWarn);CA1708 + $(NoWarn);CA1711 + $(NoWarn);CA1716 + $(NoWarn);CA1725 + $(NoWarn);CA1805 + $(NoWarn);CA1806 + $(NoWarn);CA1816 + $(NoWarn);CA1822 + $(NoWarn);CA1825 + $(NoWarn);CA1829 + $(NoWarn);CA1835 + $(NoWarn);CA1850 + $(NoWarn);CA1852 + $(NoWarn);CA1859 + $(NoWarn);CA1860 + $(NoWarn);CA1861 + $(NoWarn);CA1863 + $(NoWarn);CA1864 + $(NoWarn);CA1869 + $(NoWarn);CA1872 + $(NoWarn);CA2201 + $(NoWarn);CA2211 + $(NoWarn);CA5350 diff --git a/identity-server/test/IdentityServer.IntegrationTests/Endpoints/Token/DPoPTokenEndpointTests.cs b/identity-server/test/IdentityServer.IntegrationTests/Endpoints/Token/DPoPTokenEndpointTests.cs index f12363ae7..60d44eee0 100644 --- a/identity-server/test/IdentityServer.IntegrationTests/Endpoints/Token/DPoPTokenEndpointTests.cs +++ b/identity-server/test/IdentityServer.IntegrationTests/Endpoints/Token/DPoPTokenEndpointTests.cs @@ -444,7 +444,7 @@ public class DPoPTokenEndpointTests : DPoPEndpointTestBase public string ServerIssuedNonce { get; set; } - protected override async Task ValidateFreshnessAsync(DPoPProofValidatonContext context, DPoPProofValidatonResult result) + protected override async Task ValidateFreshnessAsync(DPoPProofValidationContext context, DPoPProofValidationResult result) { if (ServerIssuedNonce.IsPresent()) { diff --git a/identity-server/test/IdentityServer.UnitTests/Validation/DPoPProofValidatorTests.cs b/identity-server/test/IdentityServer.UnitTests/Validation/DPoPProofValidatorTests.cs index 2e1657028..4cbaf945e 100644 --- a/identity-server/test/IdentityServer.UnitTests/Validation/DPoPProofValidatorTests.cs +++ b/identity-server/test/IdentityServer.UnitTests/Validation/DPoPProofValidatorTests.cs @@ -43,7 +43,7 @@ public class DPoPProofValidatorTests } } - private DPoPProofValidatonContext _context = new DPoPProofValidatonContext + private DPoPProofValidationContext _context = new DPoPProofValidationContext { ClientClockSkew = TimeSpan.Zero, Url = "https://identityserver/connect/token", diff --git a/ignore-this/src/Directory.Build.props b/ignore-this/src/Directory.Build.props index de732b89c..5f4f4a12f 100644 --- a/ignore-this/src/Directory.Build.props +++ b/ignore-this/src/Directory.Build.props @@ -5,7 +5,6 @@ - enable Duende IgnoreThis it- 0.1 diff --git a/ignore-this/src/IgnoreThis/IgnoreThis.csproj b/ignore-this/src/IgnoreThis/IgnoreThis.csproj index 309182e16..42d495c52 100644 --- a/ignore-this/src/IgnoreThis/IgnoreThis.csproj +++ b/ignore-this/src/IgnoreThis/IgnoreThis.csproj @@ -1,7 +1,6 @@ net10.0 - enable true Duende.IgnoreThis $(PackageId) diff --git a/ignore-this/test/Directory.Build.props b/ignore-this/test/Directory.Build.props index 689890199..5371b278d 100644 --- a/ignore-this/test/Directory.Build.props +++ b/ignore-this/test/Directory.Build.props @@ -1,7 +1,4 @@ - - enable - diff --git a/products.slnx b/products.slnx index 101ad3ab5..fde8d558d 100644 --- a/products.slnx +++ b/products.slnx @@ -11,12 +11,6 @@ - - - - - - @@ -43,6 +37,10 @@ + + + + @@ -50,10 +48,6 @@ - - - - @@ -66,9 +60,15 @@ + + + + + + - + diff --git a/shared/ShouldlyExtensions/ShouldlyExtensions.csproj b/shared/ShouldlyExtensions/ShouldlyExtensions.csproj index c4188b665..660a006b8 100644 --- a/shared/ShouldlyExtensions/ShouldlyExtensions.csproj +++ b/shared/ShouldlyExtensions/ShouldlyExtensions.csproj @@ -3,7 +3,6 @@ None false - enable false Shouldly diff --git a/shared/Xunit.Playwright/Xunit.Playwright.csproj b/shared/Xunit.Playwright/Xunit.Playwright.csproj index e967e28ff..e9e37cea5 100644 --- a/shared/Xunit.Playwright/Xunit.Playwright.csproj +++ b/shared/Xunit.Playwright/Xunit.Playwright.csproj @@ -1,7 +1,6 @@ None - enable Duende.Xunit.Playwright Duende.Xunit.Playwright false diff --git a/src.props b/src.props index 37f8f20a4..a2d731bb9 100644 --- a/src.props +++ b/src.props @@ -1,33 +1,26 @@ - - false - true - Generated - true - - - true - - LICENSE - icon.png - https://github.com/duendesoftware/products - https://github.com/duendesoftware/products/releases - README.md - - 0 + Generated + true + true build.$(BUILD_NUMBER) - patch - - $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb - true - true - true - + icon.png + LICENSE + https://github.com/duendesoftware/products + README.md ../../README.md + https://github.com/duendesoftware/products/releases + true + + + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + true + true + true + $(NoWarn);RS0016 @@ -41,8 +34,7 @@ - + - diff --git a/templates/build/build.csproj b/templates/build/build.csproj index 7562235a5..b08af2dc4 100644 --- a/templates/build/build.csproj +++ b/templates/build/build.csproj @@ -2,7 +2,6 @@ Exe - enable $(NoWarn);CA1303 diff --git a/templates/templates.csproj b/templates/templates.csproj index e64bdc9bd..d414b0aaa 100644 --- a/templates/templates.csproj +++ b/templates/templates.csproj @@ -8,6 +8,7 @@ false true + disable Duende.Templates Templates for Duende Identity Server and Duende BFF diff --git a/test.props b/test.props index 57275d6e1..77c540734 100644 --- a/test.props +++ b/test.props @@ -8,66 +8,10 @@ exe true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(NoWarn);CA1000;CA1001;CA1002;CA1003;CA1012;CA1024;CA1031;CA1033;CA1041;CA1051;CA1052;CA1054;CA1055;CA1056;CA1062;CA1063;CA1304;CA1305;CA1307;CA1308;CA1309;CA1310;CA1311;CA1508;CA1515;CA1707;CA1708;CA1711;CA1716;CA1724;CA1725;CA1805;CA1806;CA1810;CA1812;CA1816;CA1820;CA1822;CA1823;CA1825;CA1829;CA1835;CA1848;CA1849;CA1850;CA1851;CA1852;CA1859;CA1860;CA1861;CA1863;CA1864;CA1866;CA1869;CA1872;CA2000;CA2016;CA2201;CA2211;CA2213;CA2227;CA2234;CA2254;CA5350 - + + $(NoWarn);CA1707 +