From 3662b179dce0e824a615a5467678cfb32f2b4117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Thu, 12 Sep 2024 17:31:27 +0200 Subject: [PATCH 01/12] Rename event handlers and event properties that whose endpoint name has changed --- ...ctClientSystemNetHttpHandlers.Discovery.cs | 2 +- .../OpenIddictClientHandlers.Discovery.cs | 26 ++++----- ...ddictServerAspNetCoreHandlers.Discovery.cs | 4 +- ...nIddictServerAspNetCoreHandlers.Session.cs | 6 +- .../OpenIddictServerOwinHandlers.Discovery.cs | 4 +- .../OpenIddictServerOwinHandlers.Session.cs | 6 +- .../OpenIddictServerEvents.Discovery.cs | 8 +-- .../OpenIddictServerHandlers.Discovery.cs | 8 +-- .../OpenIddictServerHandlers.Session.cs | 8 +-- ...lidationSystemNetHttpHandlers.Discovery.cs | 2 +- .../OpenIddictValidationHandlers.Discovery.cs | 18 +++--- .../OpenIddictServerBuilderTests.cs | 56 +++++++++---------- 12 files changed, 74 insertions(+), 74 deletions(-) diff --git a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Discovery.cs b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Discovery.cs index e41a321bf..e4f6bc230 100644 --- a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Discovery.cs +++ b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.Discovery.cs @@ -36,7 +36,7 @@ public static class Discovery DisposeHttpResponse.Descriptor, /* - * Cryptography request processing: + * JSON Web Key Set request processing: */ CreateHttpClient.Descriptor, PrepareGetHttpRequest.Descriptor, diff --git a/src/OpenIddict.Client/OpenIddictClientHandlers.Discovery.cs b/src/OpenIddict.Client/OpenIddictClientHandlers.Discovery.cs index 39327e7a6..da433795f 100644 --- a/src/OpenIddict.Client/OpenIddictClientHandlers.Discovery.cs +++ b/src/OpenIddict.Client/OpenIddictClientHandlers.Discovery.cs @@ -27,7 +27,7 @@ public static class Discovery ExtractJsonWebKeySetEndpoint.Descriptor, ExtractDeviceAuthorizationEndpoint.Descriptor, ExtractIntrospectionEndpoint.Descriptor, - ExtractLogoutEndpoint.Descriptor, + ExtractEndSessionEndpoint.Descriptor, ExtractRevocationEndpoint.Descriptor, ExtractTokenEndpoint.Descriptor, ExtractUserInfoEndpoint.Descriptor, @@ -43,10 +43,10 @@ public static class Discovery ExtractTokenEndpointClientAuthenticationMethods.Descriptor, /* - * Cryptography response handling: + * JSON Web Key Set response handling: */ - ValidateWellKnownCryptographyParameters.Descriptor, - HandleCryptographyErrorResponse.Descriptor, + ValidateWellKnownJsonWebKeySetParameters.Descriptor, + HandleJsonWebKeySetErrorResponse.Descriptor, ExtractSigningKeys.Descriptor ]); @@ -433,14 +433,14 @@ public ValueTask HandleAsync(HandleConfigurationResponseContext context) /// /// Contains the logic responsible for extracting the end session endpoint URI from the discovery document. /// - public sealed class ExtractLogoutEndpoint : IOpenIddictClientHandler + public sealed class ExtractEndSessionEndpoint : IOpenIddictClientHandler { /// /// Gets the default descriptor definition assigned to this handler. /// public static OpenIddictClientHandlerDescriptor Descriptor { get; } = OpenIddictClientHandlerDescriptor.CreateBuilder() - .UseSingletonHandler() + .UseSingletonHandler() .SetOrder(ExtractIntrospectionEndpoint.Descriptor.Order + 1_000) .SetType(OpenIddictClientHandlerType.BuiltIn) .Build(); @@ -484,7 +484,7 @@ public sealed class ExtractRevocationEndpoint : IOpenIddictClientHandler() .UseSingletonHandler() - .SetOrder(ExtractLogoutEndpoint.Descriptor.Order + 1_000) + .SetOrder(ExtractEndSessionEndpoint.Descriptor.Order + 1_000) .SetType(OpenIddictClientHandlerType.BuiltIn) .Build(); @@ -1021,14 +1021,14 @@ public ValueTask HandleAsync(HandleConfigurationResponseContext context) /// /// Contains the logic responsible for validating the well-known parameters contained in the JSON Web Key Set response. /// - public sealed class ValidateWellKnownCryptographyParameters : IOpenIddictClientHandler + public sealed class ValidateWellKnownJsonWebKeySetParameters : IOpenIddictClientHandler { /// /// Gets the default descriptor definition assigned to this handler. /// public static OpenIddictClientHandlerDescriptor Descriptor { get; } = OpenIddictClientHandlerDescriptor.CreateBuilder() - .UseSingletonHandler() + .UseSingletonHandler() .SetOrder(int.MinValue + 100_000) .SetType(OpenIddictClientHandlerType.BuiltIn) .Build(); @@ -1095,15 +1095,15 @@ static bool ValidateObjectArray(JsonElement element) /// /// Contains the logic responsible for surfacing potential errors from the JSON Web Key Set response. /// - public sealed class HandleCryptographyErrorResponse : IOpenIddictClientHandler + public sealed class HandleJsonWebKeySetErrorResponse : IOpenIddictClientHandler { /// /// Gets the default descriptor definition assigned to this handler. /// public static OpenIddictClientHandlerDescriptor Descriptor { get; } = OpenIddictClientHandlerDescriptor.CreateBuilder() - .UseSingletonHandler() - .SetOrder(ValidateWellKnownCryptographyParameters.Descriptor.Order + 1_000) + .UseSingletonHandler() + .SetOrder(ValidateWellKnownJsonWebKeySetParameters.Descriptor.Order + 1_000) .SetType(OpenIddictClientHandlerType.BuiltIn) .Build(); @@ -1146,7 +1146,7 @@ public sealed class ExtractSigningKeys : IOpenIddictClientHandler() .UseSingletonHandler() - .SetOrder(HandleCryptographyErrorResponse.Descriptor.Order + 1_000) + .SetOrder(HandleJsonWebKeySetErrorResponse.Descriptor.Order + 1_000) .SetType(OpenIddictClientHandlerType.BuiltIn) .Build(); diff --git a/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Discovery.cs b/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Discovery.cs index b94baed14..cde269f49 100644 --- a/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Discovery.cs +++ b/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Discovery.cs @@ -26,12 +26,12 @@ public static class Discovery ProcessJsonResponse.Descriptor, /* - * Cryptography request extraction: + * JSON Web Key Set request extraction: */ ExtractGetRequest.Descriptor, /* - * Cryptography response processing: + * JSON Web Key Set response processing: */ AttachHttpResponseCode.Descriptor, AttachWwwAuthenticateHeader.Descriptor, diff --git a/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Session.cs b/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Session.cs index 92fc91672..b8e43285b 100644 --- a/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Session.cs +++ b/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.Session.cs @@ -27,19 +27,19 @@ public static class Session { public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([ /* - * Logout request extraction: + * End-session request extraction: */ ExtractGetOrPostRequest.Descriptor, RestoreCachedRequestParameters.Descriptor, CacheRequestParameters.Descriptor, /* - * Logout request handling: + * End-session request handling: */ EnablePassthroughMode.Descriptor, /* - * Logout response processing: + * End-session response processing: */ RemoveCachedRequest.Descriptor, AttachHttpResponseCode.Descriptor, diff --git a/src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.Discovery.cs b/src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.Discovery.cs index 6f7a0abef..cf0131966 100644 --- a/src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.Discovery.cs +++ b/src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.Discovery.cs @@ -28,12 +28,12 @@ public static class Discovery ProcessJsonResponse.Descriptor, /* - * Cryptography request extraction: + * JSON Web Key Set request extraction: */ ExtractGetRequest.Descriptor, /* - * Cryptography response processing: + * JSON Web Key Set response processing: */ AttachHttpResponseCode.Descriptor, AttachOwinResponseChallenge.Descriptor, diff --git a/src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.Session.cs b/src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.Session.cs index e4edc8bcb..30cdc9130 100644 --- a/src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.Session.cs +++ b/src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.Session.cs @@ -26,19 +26,19 @@ public static class Session { public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([ /* - * Logout request extraction: + * End-session request extraction: */ ExtractGetOrPostRequest.Descriptor, RestoreCachedRequestParameters.Descriptor, CacheRequestParameters.Descriptor, /* - * Logout request handling: + * End-session request handling: */ EnablePassthroughMode.Descriptor, /* - * Logout response processing: + * End-session response processing: */ RemoveCachedRequest.Descriptor, AttachHttpResponseCode.Descriptor, diff --git a/src/OpenIddict.Server/OpenIddictServerEvents.Discovery.cs b/src/OpenIddict.Server/OpenIddictServerEvents.Discovery.cs index 46f1cf4d8..bcc16fb34 100644 --- a/src/OpenIddict.Server/OpenIddictServerEvents.Discovery.cs +++ b/src/OpenIddict.Server/OpenIddictServerEvents.Discovery.cs @@ -107,14 +107,14 @@ public OpenIddictRequest Request public Uri? DeviceAuthorizationEndpoint { get; set; } /// - /// Gets or sets the introspection endpoint URI. + /// Gets or sets the end session endpoint URI. /// - public Uri? IntrospectionEndpoint { get; set; } + public Uri? EndSessionEndpoint { get; set; } /// - /// Gets or sets the end session endpoint URI. + /// Gets or sets the introspection endpoint URI. /// - public Uri? LogoutEndpoint { get; set; } + public Uri? IntrospectionEndpoint { get; set; } /// /// Gets or sets the revocation endpoint URI. diff --git a/src/OpenIddict.Server/OpenIddictServerHandlers.Discovery.cs b/src/OpenIddict.Server/OpenIddictServerHandlers.Discovery.cs index f26d748cc..7918ddfda 100644 --- a/src/OpenIddict.Server/OpenIddictServerHandlers.Discovery.cs +++ b/src/OpenIddict.Server/OpenIddictServerHandlers.Discovery.cs @@ -45,7 +45,7 @@ public static class Discovery AttachAdditionalMetadata.Descriptor, /* - * Cryptography request top-level processing: + * JSON Web Key Set request top-level processing: */ ExtractJsonWebKeySetRequest.Descriptor, ValidateJsonWebKeySetRequest.Descriptor, @@ -54,7 +54,7 @@ public static class Discovery ApplyJsonWebKeySetResponse.Descriptor, /* - * Cryptography request handling: + * JSON Web Key Set request handling: */ AttachSigningKeys.Descriptor ]); @@ -237,7 +237,7 @@ public async ValueTask HandleAsync(ProcessRequestContext context) [Metadata.AuthorizationEndpoint] = notification.AuthorizationEndpoint?.AbsoluteUri, [Metadata.TokenEndpoint] = notification.TokenEndpoint?.AbsoluteUri, [Metadata.IntrospectionEndpoint] = notification.IntrospectionEndpoint?.AbsoluteUri, - [Metadata.EndSessionEndpoint] = notification.LogoutEndpoint?.AbsoluteUri, + [Metadata.EndSessionEndpoint] = notification.EndSessionEndpoint?.AbsoluteUri, [Metadata.RevocationEndpoint] = notification.RevocationEndpoint?.AbsoluteUri, [Metadata.UserInfoEndpoint] = notification.UserInfoEndpoint?.AbsoluteUri, [Metadata.DeviceAuthorizationEndpoint] = notification.DeviceAuthorizationEndpoint?.AbsoluteUri, @@ -380,7 +380,7 @@ public ValueTask HandleAsync(HandleConfigurationRequestContext context) context.IntrospectionEndpoint ??= OpenIddictHelpers.CreateAbsoluteUri( context.BaseUri, context.Options.IntrospectionEndpointUris.FirstOrDefault()); - context.LogoutEndpoint ??= OpenIddictHelpers.CreateAbsoluteUri( + context.EndSessionEndpoint ??= OpenIddictHelpers.CreateAbsoluteUri( context.BaseUri, context.Options.EndSessionEndpointUris.FirstOrDefault()); context.RevocationEndpoint ??= OpenIddictHelpers.CreateAbsoluteUri( diff --git a/src/OpenIddict.Server/OpenIddictServerHandlers.Session.cs b/src/OpenIddict.Server/OpenIddictServerHandlers.Session.cs index 2dd97b522..ca498b945 100644 --- a/src/OpenIddict.Server/OpenIddictServerHandlers.Session.cs +++ b/src/OpenIddict.Server/OpenIddictServerHandlers.Session.cs @@ -21,7 +21,7 @@ public static class Session { public static ImmutableArray DefaultHandlers { get; } = ImmutableArray.Create([ /* - * Logout request top-level processing: + * End-session request top-level processing: */ ExtractEndSessionRequest.Descriptor, ValidateEndSessionRequest.Descriptor, @@ -31,7 +31,7 @@ public static class Session ApplyEndSessionResponse.Descriptor, /* - * Logout request validation: + * End-session request validation: */ ValidatePostLogoutRedirectUriParameter.Descriptor, ValidateAuthentication.Descriptor, @@ -40,12 +40,12 @@ public static class Session ValidateAuthorizedParty.Descriptor, /* - * Logout request handling: + * End-session request handling: */ AttachPrincipal.Descriptor, /* - * Logout response processing: + * End-session response processing: */ AttachPostLogoutRedirectUri.Descriptor, AttachResponseState.Descriptor diff --git a/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpHandlers.Discovery.cs b/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpHandlers.Discovery.cs index 8d17ffc46..4854c4cd2 100644 --- a/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpHandlers.Discovery.cs +++ b/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpHandlers.Discovery.cs @@ -36,7 +36,7 @@ public static class Discovery DisposeHttpResponse.Descriptor, /* - * Cryptography request processing: + * JSON Web Key Set request processing: */ CreateHttpClient.Descriptor, PrepareGetHttpRequest.Descriptor, diff --git a/src/OpenIddict.Validation/OpenIddictValidationHandlers.Discovery.cs b/src/OpenIddict.Validation/OpenIddictValidationHandlers.Discovery.cs index cee1c6232..6aa6c80e0 100644 --- a/src/OpenIddict.Validation/OpenIddictValidationHandlers.Discovery.cs +++ b/src/OpenIddict.Validation/OpenIddictValidationHandlers.Discovery.cs @@ -28,10 +28,10 @@ public static class Discovery ExtractIntrospectionEndpointClientAuthenticationMethods.Descriptor, /* - * Cryptography response handling: + * JSON Web Key Set response handling: */ - ValidateWellKnownCryptographyParameters.Descriptor, - HandleCryptographyErrorResponse.Descriptor, + ValidateWellKnownJsonWebKeySetParameters.Descriptor, + HandleJsonWebKeySetErrorResponse.Descriptor, ExtractSigningKeys.Descriptor ]); @@ -351,14 +351,14 @@ public ValueTask HandleAsync(HandleConfigurationResponseContext context) /// /// Contains the logic responsible for validating the well-known parameters contained in the JSON Web Key Set response. /// - public sealed class ValidateWellKnownCryptographyParameters : IOpenIddictValidationHandler + public sealed class ValidateWellKnownJsonWebKeySetParameters : IOpenIddictValidationHandler { /// /// Gets the default descriptor definition assigned to this handler. /// public static OpenIddictValidationHandlerDescriptor Descriptor { get; } = OpenIddictValidationHandlerDescriptor.CreateBuilder() - .UseSingletonHandler() + .UseSingletonHandler() .SetOrder(int.MinValue + 100_000) .SetType(OpenIddictValidationHandlerType.BuiltIn) .Build(); @@ -425,15 +425,15 @@ static bool ValidateObjectArray(JsonElement element) /// /// Contains the logic responsible for surfacing potential errors from the JSON Web Key Set response. /// - public sealed class HandleCryptographyErrorResponse : IOpenIddictValidationHandler + public sealed class HandleJsonWebKeySetErrorResponse : IOpenIddictValidationHandler { /// /// Gets the default descriptor definition assigned to this handler. /// public static OpenIddictValidationHandlerDescriptor Descriptor { get; } = OpenIddictValidationHandlerDescriptor.CreateBuilder() - .UseSingletonHandler() - .SetOrder(ValidateWellKnownCryptographyParameters.Descriptor.Order + 1_000) + .UseSingletonHandler() + .SetOrder(ValidateWellKnownJsonWebKeySetParameters.Descriptor.Order + 1_000) .SetType(OpenIddictValidationHandlerType.BuiltIn) .Build(); @@ -476,7 +476,7 @@ public sealed class ExtractSigningKeys : IOpenIddictValidationHandler() .UseSingletonHandler() - .SetOrder(HandleCryptographyErrorResponse.Descriptor.Order + 1_000) + .SetOrder(HandleJsonWebKeySetErrorResponse.Descriptor.Order + 1_000) .SetType(OpenIddictValidationHandlerType.BuiltIn) .Build(); diff --git a/test/OpenIddict.Server.Tests/OpenIddictServerBuilderTests.cs b/test/OpenIddict.Server.Tests/OpenIddictServerBuilderTests.cs index 3e3b7541a..7fe770867 100644 --- a/test/OpenIddict.Server.Tests/OpenIddictServerBuilderTests.cs +++ b/test/OpenIddict.Server.Tests/OpenIddictServerBuilderTests.cs @@ -1101,171 +1101,171 @@ public void SetDeviceAuthorizationEndpointUris_AddsUri() } [Fact] - public void SetIntrospectionEndpointUris_ThrowsExceptionWhenUrisIsNull() + public void SetEndSessionEndpointUris_ThrowsExceptionWhenUrisIsNull() { // Arrange var services = CreateServices(); var builder = CreateBuilder(services); // Act and assert - var exception = Assert.Throws(() => builder.SetIntrospectionEndpointUris(uris: (null as Uri[])!)); + var exception = Assert.Throws(() => builder.SetEndSessionEndpointUris(uris: (null as Uri[])!)); Assert.Equal("uris", exception.ParamName); } [Fact] - public void SetIntrospectionEndpointUris_Strings_ThrowsExceptionWhenUrisIsNull() + public void SetEndSessionEndpointUris_Strings_ThrowsExceptionWhenUrisIsNull() { // Arrange var services = CreateServices(); var builder = CreateBuilder(services); // Act and assert - var exception = Assert.Throws(() => builder.SetIntrospectionEndpointUris(uris: (null as string[])!)); + var exception = Assert.Throws(() => builder.SetEndSessionEndpointUris(uris: (null as string[])!)); Assert.Equal("uris", exception.ParamName); } [Theory] [InlineData(@"C:\")] - public void SetIntrospectionEndpointUris_ThrowsExceptionForMalformedUri(string uri) + public void SetEndSessionEndpointUris_ThrowsExceptionForMalformedUri(string uri) { // Arrange var services = CreateServices(); var builder = CreateBuilder(services); // Act and assert - var exception = Assert.Throws(() => builder.SetIntrospectionEndpointUris(new Uri(uri))); + var exception = Assert.Throws(() => builder.SetEndSessionEndpointUris(new Uri(uri))); Assert.Equal("uris", exception.ParamName); Assert.Contains(SR.GetResourceString(SR.ID0072), exception.Message); } [Theory] [InlineData("~/path")] - public void SetIntrospectionEndpointUris_ThrowsExceptionForInvalidRelativeUri(string uri) + public void SetEndSessionEndpointUris_ThrowsExceptionForInvalidRelativeUri(string uri) { // Arrange var services = CreateServices(); var builder = CreateBuilder(services); // Act and assert - var exception = Assert.Throws(() => builder.SetIntrospectionEndpointUris(new Uri(uri, UriKind.RelativeOrAbsolute))); + var exception = Assert.Throws(() => builder.SetEndSessionEndpointUris(new Uri(uri, UriKind.RelativeOrAbsolute))); Assert.Equal("uris", exception.ParamName); Assert.Contains(SR.FormatID0081("~"), exception.Message); } [Fact] - public void SetIntrospectionEndpointUris_ClearsUris() + public void SetEndSessionEndpointUris_ClearsUris() { // Arrange var services = CreateServices(); var builder = CreateBuilder(services); // Act - builder.SetIntrospectionEndpointUris(Array.Empty()); + builder.SetEndSessionEndpointUris(Array.Empty()); var options = GetOptions(services); // Assert - Assert.Empty(options.IntrospectionEndpointUris); + Assert.Empty(options.EndSessionEndpointUris); } [Fact] - public void SetIntrospectionEndpointUris_AddsUri() + public void SetEndSessionEndpointUris_AddsUri() { // Arrange var services = CreateServices(); var builder = CreateBuilder(services); // Act - builder.SetIntrospectionEndpointUris("http://localhost/endpoint-path"); + builder.SetEndSessionEndpointUris("http://localhost/endpoint-path"); var options = GetOptions(services); // Assert - Assert.Contains(new Uri("http://localhost/endpoint-path"), options.IntrospectionEndpointUris); + Assert.Contains(new Uri("http://localhost/endpoint-path"), options.EndSessionEndpointUris); } [Fact] - public void SetLogoutEndpointUris_ThrowsExceptionWhenUrisIsNull() + public void SetIntrospectionEndpointUris_ThrowsExceptionWhenUrisIsNull() { // Arrange var services = CreateServices(); var builder = CreateBuilder(services); // Act and assert - var exception = Assert.Throws(() => builder.SetEndSessionEndpointUris(uris: (null as Uri[])!)); + var exception = Assert.Throws(() => builder.SetIntrospectionEndpointUris(uris: (null as Uri[])!)); Assert.Equal("uris", exception.ParamName); } [Fact] - public void SetLogoutEndpointUris_Strings_ThrowsExceptionWhenUrisIsNull() + public void SetIntrospectionEndpointUris_Strings_ThrowsExceptionWhenUrisIsNull() { // Arrange var services = CreateServices(); var builder = CreateBuilder(services); // Act and assert - var exception = Assert.Throws(() => builder.SetEndSessionEndpointUris(uris: (null as string[])!)); + var exception = Assert.Throws(() => builder.SetIntrospectionEndpointUris(uris: (null as string[])!)); Assert.Equal("uris", exception.ParamName); } [Theory] [InlineData(@"C:\")] - public void SetLogoutEndpointUris_ThrowsExceptionForMalformedUri(string uri) + public void SetIntrospectionEndpointUris_ThrowsExceptionForMalformedUri(string uri) { // Arrange var services = CreateServices(); var builder = CreateBuilder(services); // Act and assert - var exception = Assert.Throws(() => builder.SetEndSessionEndpointUris(new Uri(uri))); + var exception = Assert.Throws(() => builder.SetIntrospectionEndpointUris(new Uri(uri))); Assert.Equal("uris", exception.ParamName); Assert.Contains(SR.GetResourceString(SR.ID0072), exception.Message); } [Theory] [InlineData("~/path")] - public void SetLogoutEndpointUris_ThrowsExceptionForInvalidRelativeUri(string uri) + public void SetIntrospectionEndpointUris_ThrowsExceptionForInvalidRelativeUri(string uri) { // Arrange var services = CreateServices(); var builder = CreateBuilder(services); // Act and assert - var exception = Assert.Throws(() => builder.SetEndSessionEndpointUris(new Uri(uri, UriKind.RelativeOrAbsolute))); + var exception = Assert.Throws(() => builder.SetIntrospectionEndpointUris(new Uri(uri, UriKind.RelativeOrAbsolute))); Assert.Equal("uris", exception.ParamName); Assert.Contains(SR.FormatID0081("~"), exception.Message); } [Fact] - public void SetLogoutEndpointUris_ClearsUris() + public void SetIntrospectionEndpointUris_ClearsUris() { // Arrange var services = CreateServices(); var builder = CreateBuilder(services); // Act - builder.SetEndSessionEndpointUris(Array.Empty()); + builder.SetIntrospectionEndpointUris(Array.Empty()); var options = GetOptions(services); // Assert - Assert.Empty(options.EndSessionEndpointUris); + Assert.Empty(options.IntrospectionEndpointUris); } [Fact] - public void SetLogoutEndpointUris_AddsUri() + public void SetIntrospectionEndpointUris_AddsUri() { // Arrange var services = CreateServices(); var builder = CreateBuilder(services); // Act - builder.SetEndSessionEndpointUris("http://localhost/endpoint-path"); + builder.SetIntrospectionEndpointUris("http://localhost/endpoint-path"); var options = GetOptions(services); // Assert - Assert.Contains(new Uri("http://localhost/endpoint-path"), options.EndSessionEndpointUris); + Assert.Contains(new Uri("http://localhost/endpoint-path"), options.IntrospectionEndpointUris); } [Fact] From 21c71bb14bef8634c5210eb6e25862dd6d2e45f9 Mon Sep 17 00:00:00 2001 From: OpenIddict Bot <32257313+openiddict-bot@users.noreply.github.com> Date: Sun, 15 Sep 2024 10:59:21 +0000 Subject: [PATCH 02/12] Update the sponsors section --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7cd344067..d833bc6ec 100644 --- a/README.md +++ b/README.md @@ -154,7 +154,7 @@ To reference the OpenIddict MyGet feed, **create a `NuGet.config` file** (at the

-Sébastien RosSchmitt ChristianFlorian WachsSebastian StehleCommunicatie CockpitJasmin SavardDigitalOps Co. Ltd.EYERIDE Fleet Management SystemJulien DebacheStian HåveRavindu LiyanapathiranaHieronymusBlazeAkhan ZhakiyanovBarry DorransDevQ S.r.l.GrégoireForterroMarcelJens WillmerBlauhaus Technology (Pty) LtdJan TrejbalAviationexam s.r.o.MonoforRatiodata SEDennis van ZettenJeroenElfsterLombiq Technologies Ltd.PureBlazorAndrew BabbittKarl Schrieksoftaware gmbhSingular SystemsSCP-srlJacob ClarkRealisable SoftwareJesús SC +Sébastien RosSchmitt ChristianFlorian WachsSebastian StehleCommunicatie CockpitJasmin SavardDigitalOps Co. Ltd.EYERIDE Fleet Management SystemJulien DebacheStian HåveRavindu LiyanapathiranaHieronymusBlazeAkhan ZhakiyanovBarry DorransDevQ S.r.l.GrégoireForterroMarcelJens WillmerBlauhaus Technology (Pty) LtdJan TrejbalAviationexam s.r.o.MonoforRatiodata SEDennis van ZettenJeroenElfsterLombiq Technologies Ltd.PureBlazorAndrew BabbittKarl Schrieksoftaware gmbhSingular SystemsSCP-srlRealisable SoftwareJesús SC -------------- From 2df389ad33c172529f98d70d17756d725fc37480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Sun, 15 Sep 2024 14:24:58 +0200 Subject: [PATCH 03/12] Replace the .NET Framework 4.6.1 target framework moniker by a .NET Framework 4.6.2 TFM --- Directory.Build.props | 2 +- Directory.Packages.props | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 118630f69..20a096470 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -99,7 +99,7 @@ Exists('$(MSBuildProgramFiles32)\Windows Kits\10\References\10.0.17763.0'))) ">true - net461; + net462; net472; net48 diff --git a/Directory.Packages.props b/Directory.Packages.props index 876164da2..3564a1bc2 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -12,14 +12,15 @@ - + From dbcd6d1ad75ab64f57ac9fe56c2a34f8b47cd963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Sun, 15 Sep 2024 14:49:09 +0200 Subject: [PATCH 04/12] Remove the members that were obsoleted in OpenIddict 5.x --- .../OpenIddictApplicationDescriptor.cs | 11 --- ...IddictClientSystemIntegrationExtensions.cs | 3 - ...ctClientSystemIntegrationHandlerFilters.cs | 29 ------- ...enIddictClientSystemIntegrationHandlers.cs | 85 ------------------- ...penIddictClientSystemIntegrationHelpers.cs | 13 --- ...OpenIddictClientSystemNetHttpExtensions.cs | 3 - ...IddictClientSystemNetHttpHandlerFilters.cs | 20 ----- ...tClientWebIntegrationHandlers.Discovery.cs | 44 ---------- .../OpenIddictClientConfiguration.cs | 8 -- .../OpenIddictClientHandlerFilters.cs | 18 +--- .../OpenIddictQuartzConfiguration.cs | 6 -- .../OpenIddictServerConfiguration.cs | 6 -- ...OpenIddictServerHandlers.Authentication.cs | 3 - .../OpenIddictServerHandlers.Protection.cs | 26 ------ ...IddictValidationSystemNetHttpExtensions.cs | 3 - ...ctValidationSystemNetHttpHandlerFilters.cs | 20 ----- .../OpenIddictValidationConfiguration.cs | 8 -- 17 files changed, 2 insertions(+), 304 deletions(-) diff --git a/src/OpenIddict.Abstractions/Descriptors/OpenIddictApplicationDescriptor.cs b/src/OpenIddict.Abstractions/Descriptors/OpenIddictApplicationDescriptor.cs index 196296f8c..648efa396 100644 --- a/src/OpenIddict.Abstractions/Descriptors/OpenIddictApplicationDescriptor.cs +++ b/src/OpenIddict.Abstractions/Descriptors/OpenIddictApplicationDescriptor.cs @@ -81,15 +81,4 @@ public class OpenIddictApplicationDescriptor /// Gets the settings associated with the application. ///
public Dictionary Settings { get; } = new(StringComparer.Ordinal); - - /// - /// Gets or sets the client type associated with the application. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete($"This property was replaced by {nameof(ClientType)} and will be removed in a future version.", true)] - public string? Type - { - get => ClientType; - set => ClientType = value; - } } diff --git a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationExtensions.cs b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationExtensions.cs index 123e4dcea..0e4981af6 100644 --- a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationExtensions.cs +++ b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationExtensions.cs @@ -112,9 +112,6 @@ public static OpenIddictClientSystemIntegrationBuilder UseSystemIntegration(this builder.Services.TryAddSingleton(); builder.Services.TryAddSingleton(); builder.Services.TryAddSingleton(); -#pragma warning disable CS0618 - builder.Services.TryAddSingleton(); -#pragma warning restore CS0618 // Register the built-in event handlers used by the OpenIddict client system integration components. // Note: the order used here is not important, as the actual order is set in the options. diff --git a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlerFilters.cs b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlerFilters.cs index dab17af12..942dc0e54 100644 --- a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlerFilters.cs +++ b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlerFilters.cs @@ -258,35 +258,6 @@ public ValueTask IsActiveAsync(BaseContext context) return new(mode is WebAuthenticationBroker); } -#endif - return new(false); - } - } - - /// - /// Represents a filter that excludes the associated handlers if no - /// web authentication operation was triggered during the transaction. - /// - [Obsolete("This filter is obsolete and will be removed in a future version.")] - public sealed class RequireWebAuthenticationResult : IOpenIddictClientHandlerFilter - { - /// - public ValueTask IsActiveAsync(BaseContext context) - { - if (context is null) - { - throw new ArgumentNullException(nameof(context)); - } - -#if SUPPORTS_WINDOWS_RUNTIME - if (IsWebAuthenticationBrokerSupported()) - { - return new(ContainsWebAuthenticationResult(context.Transaction)); - } - - [MethodImpl(MethodImplOptions.NoInlining)] - static bool ContainsWebAuthenticationResult(OpenIddictClientTransaction transaction) - => transaction.GetWebAuthenticationResult() is not null; #endif return new(false); } diff --git a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.cs b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.cs index 9e5222ffc..020d98a8d 100644 --- a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.cs +++ b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHandlers.cs @@ -237,29 +237,6 @@ public ValueTask HandleAsync(ProcessRequestContext context) } } - /// - /// Contains the logic responsible for resolving the request URI from the web authentication result. - /// Note: this handler is not used when the OpenID Connect request is not a web authentication result. - /// - [Obsolete("This event handler is obsolete and will be removed in a future version.")] - public sealed class ResolveRequestUriFromWebAuthenticationResult : IOpenIddictClientHandler - { - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler() - .SetOrder(ResolveRequestUriFromPlatformCallback.Descriptor.Order + 1_000) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(ProcessRequestContext context) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - } - /// /// Contains the logic responsible for inferring the endpoint type from the request URI, ignoring /// the port when comparing the request URI with the endpoint URIs configured in the options. @@ -620,30 +597,6 @@ public ValueTask HandleAsync(TContext context) } } - /// - /// Contains the logic responsible for extracting OpenID Connect - /// requests from the response data of a web authentication result. - /// Note: this handler is not used when the OpenID Connect request is not a web authentication result. - /// - [Obsolete("This event handler is obsolete and will be removed in a future version.")] - public sealed class ExtractWebAuthenticationResultData : IOpenIddictClientHandler where TContext : BaseValidatingContext - { - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler>() - .SetOrder(ExtractPlatformCallbackParameters.Descriptor.Order + 1_000) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(TContext context) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - } - /// /// Contains the logic responsible for waiting for the marshalled authentication operation to complete, if applicable. /// @@ -2446,42 +2399,4 @@ public ValueTask HandleAsync(TContext context) return default; } } - - /// - /// Contains the logic responsible for marking OpenID Connect - /// responses returned via web authentication results as processed. - /// - [Obsolete("This handler is obsolete and will be removed in a future version.")] - public sealed class ProcessWebAuthenticationResultResponse : IOpenIddictClientHandler - where TContext : BaseRequestContext - { - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .AddFilter() - .UseSingletonHandler>() - .SetOrder(int.MaxValue) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(TContext context) - { - if (context is null) - { - throw new ArgumentNullException(nameof(context)); - } - - // For both protocol activations (initial or redirected) and web-view-like results, - // no proper response can be generated and eventually displayed to the user. In this - // case, simply stop processing the response and mark the request as fully handled. - // - // Note: this logic applies to both successful and errored responses. - - context.HandleRequest(); - return default; - } - } } diff --git a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHelpers.cs b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHelpers.cs index ccb11fe3a..770baed39 100644 --- a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHelpers.cs +++ b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHelpers.cs @@ -68,19 +68,6 @@ public static class OpenIddictClientSystemIntegrationHelpers public static HttpListenerContext? GetHttpListenerContext(this OpenIddictClientTransaction transaction) => transaction.GetProperty(typeof(HttpListenerContext).FullName!); -#if SUPPORTS_WINDOWS_RUNTIME - /// - /// Gets the associated with the current context. - /// - /// The transaction instance. - /// The instance or if it couldn't be found. - [Obsolete("This extension is obsolete and will be removed in a future version."), SupportedOSPlatform("windows10.0.17763")] - public static WebAuthenticationResult? GetWebAuthenticationResult(this OpenIddictClientTransaction transaction) - => transaction.GetPlatformCallback() is OpenIddictClientSystemIntegrationPlatformCallback callback && - callback.Properties.TryGetValue(typeof(WebAuthenticationResult).FullName!, out object? property) && - property is WebAuthenticationResult result ? result : null; -#endif - /// /// Determines whether the current Windows version /// is greater than or equals to the specified version. diff --git a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpExtensions.cs b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpExtensions.cs index 617b30578..544053eca 100644 --- a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpExtensions.cs +++ b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpExtensions.cs @@ -37,9 +37,6 @@ public static OpenIddictClientSystemNetHttpBuilder UseSystemNetHttp(this OpenIdd builder.Services.TryAdd(OpenIddictClientSystemNetHttpHandlers.DefaultHandlers.Select(descriptor => descriptor.ServiceDescriptor)); // Register the built-in filters used by the default OpenIddict System.Net.Http event handlers. -#pragma warning disable CS0618 - builder.Services.TryAddSingleton(); -#pragma warning restore CS0618 builder.Services.TryAddSingleton(); // Note: TryAddEnumerable() is used here to ensure the initializers are registered only once. diff --git a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlerFilters.cs b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlerFilters.cs index e58000011..5b610d8b5 100644 --- a/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlerFilters.cs +++ b/src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlerFilters.cs @@ -11,26 +11,6 @@ namespace OpenIddict.Client.SystemNetHttp; [EditorBrowsable(EditorBrowsableState.Advanced)] public static class OpenIddictClientSystemNetHttpHandlerFilters { - /// - /// Represents a filter that excludes the associated handlers if the URI is not an HTTP or HTTPS address. - /// - [Obsolete("This filter is obsolete and will be removed in a future version.")] - public sealed class RequireHttpMetadataUri : IOpenIddictClientHandlerFilter - { - /// - public ValueTask IsActiveAsync(BaseExternalContext context) - { - if (context is null) - { - throw new ArgumentNullException(nameof(context)); - } - - return new( - string.Equals(context.RemoteUri?.Scheme, Uri.UriSchemeHttp, StringComparison.OrdinalIgnoreCase) || - string.Equals(context.RemoteUri?.Scheme, Uri.UriSchemeHttps, StringComparison.OrdinalIgnoreCase)); - } - } - /// /// Represents a filter that excludes the associated handlers if the URI is not an HTTP or HTTPS address. /// diff --git a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs index 041ed1011..83ef00a57 100644 --- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs +++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs @@ -259,50 +259,6 @@ public ValueTask HandleAsync(HandleConfigurationResponseContext context) } } - /// - /// Contains the logic responsible for amending the client authentication methods - /// supported by the device authorization endpoint for the providers that require it. - /// - [Obsolete("This event handler is obsolete and will be removed in a future version.", error: true)] - public sealed class AmendDeviceAuthorizationEndpointClientAuthenticationMethods : IOpenIddictClientHandler - { - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .UseSingletonHandler() - .SetOrder(ExtractTokenEndpointClientAuthenticationMethods.Descriptor.Order + 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(HandleConfigurationResponseContext context) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - } - - /// - /// Contains the logic responsible for amending the client authentication - /// methods supported by the token endpoint for the providers that require it. - /// - [Obsolete("This event handler is obsolete and will be removed in a future version.", error: true)] - public sealed class AmendTokenEndpointClientAuthenticationMethods : IOpenIddictClientHandler - { - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictClientHandlerDescriptor Descriptor { get; } - = OpenIddictClientHandlerDescriptor.CreateBuilder() - .UseSingletonHandler() - .SetOrder(AmendDeviceAuthorizationEndpointClientAuthenticationMethods.Descriptor.Order + 500) - .SetType(OpenIddictClientHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(HandleConfigurationResponseContext context) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - } - /// /// Contains the logic responsible for amending the supported client /// authentication methods for the providers that require it. diff --git a/src/OpenIddict.Client/OpenIddictClientConfiguration.cs b/src/OpenIddict.Client/OpenIddictClientConfiguration.cs index 2bf61114a..d09d181eb 100644 --- a/src/OpenIddict.Client/OpenIddictClientConfiguration.cs +++ b/src/OpenIddict.Client/OpenIddictClientConfiguration.cs @@ -27,14 +27,6 @@ public sealed class OpenIddictClientConfiguration : IPostConfigureOptions - /// Creates a new instance of the class. - /// - /// The OpenIddict client service. - [Obsolete("This constructor is no longer supported and will be removed in a future version.", error: true)] - public OpenIddictClientConfiguration(OpenIddictClientService service) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - /// /// Creates a new instance of the class. /// diff --git a/src/OpenIddict.Client/OpenIddictClientHandlerFilters.cs b/src/OpenIddict.Client/OpenIddictClientHandlerFilters.cs index 3e4c2e8a6..e01710e0a 100644 --- a/src/OpenIddict.Client/OpenIddictClientHandlerFilters.cs +++ b/src/OpenIddict.Client/OpenIddictClientHandlerFilters.cs @@ -629,24 +629,10 @@ public ValueTask IsActiveAsync(ProcessAuthenticationContext context) /// /// Represents a filter that excludes the associated handlers if the WS-Federation claim mapping feature was disabled. /// - public sealed class RequireWebServicesFederationClaimMappingEnabled : - IOpenIddictClientHandlerFilter, - IOpenIddictClientHandlerFilter + public sealed class RequireWebServicesFederationClaimMappingEnabled : IOpenIddictClientHandlerFilter { /// - [Obsolete("This method is obsolete and will be removed in a future version.")] - public ValueTask IsActiveAsync(ProcessAuthenticationContext context) - { - if (context is null) - { - throw new ArgumentNullException(nameof(context)); - } - - return new(!context.Options.DisableWebServicesFederationClaimMapping); - } - - /// - ValueTask IOpenIddictClientHandlerFilter.IsActiveAsync(BaseContext context) + public ValueTask IsActiveAsync(BaseContext context) { if (context is null) { diff --git a/src/OpenIddict.Quartz/OpenIddictQuartzConfiguration.cs b/src/OpenIddict.Quartz/OpenIddictQuartzConfiguration.cs index ccd9c113e..241883e83 100644 --- a/src/OpenIddict.Quartz/OpenIddictQuartzConfiguration.cs +++ b/src/OpenIddict.Quartz/OpenIddictQuartzConfiguration.cs @@ -18,12 +18,6 @@ public sealed class OpenIddictQuartzConfiguration : IConfigureOptions - /// Creates a new instance of the class. - /// - [Obsolete("This constructor is no longer supported and will be removed in a future version.", error: true)] - public OpenIddictQuartzConfiguration() => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - /// /// Creates a new instance of the class. /// diff --git a/src/OpenIddict.Server/OpenIddictServerConfiguration.cs b/src/OpenIddict.Server/OpenIddictServerConfiguration.cs index 41b3c3443..b8caa78de 100644 --- a/src/OpenIddict.Server/OpenIddictServerConfiguration.cs +++ b/src/OpenIddict.Server/OpenIddictServerConfiguration.cs @@ -24,12 +24,6 @@ public sealed class OpenIddictServerConfiguration : IPostConfigureOptions - /// Creates a new instance of the class. - /// - [Obsolete("This constructor is no longer supported and will be removed in a future version.", error: true)] - public OpenIddictServerConfiguration() => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - /// /// Creates a new instance of the class. /// diff --git a/src/OpenIddict.Server/OpenIddictServerHandlers.Authentication.cs b/src/OpenIddict.Server/OpenIddictServerHandlers.Authentication.cs index 0be08e40e..76d9de706 100644 --- a/src/OpenIddict.Server/OpenIddictServerHandlers.Authentication.cs +++ b/src/OpenIddict.Server/OpenIddictServerHandlers.Authentication.cs @@ -1068,9 +1068,6 @@ public sealed class ValidateResponseType : IOpenIddictServerHandler throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - public ValidateResponseType(IOpenIddictApplicationManager? applicationManager = null) => _applicationManager = applicationManager; diff --git a/src/OpenIddict.Server/OpenIddictServerHandlers.Protection.cs b/src/OpenIddict.Server/OpenIddictServerHandlers.Protection.cs index 3f91fbd18..4431087ef 100644 --- a/src/OpenIddict.Server/OpenIddictServerHandlers.Protection.cs +++ b/src/OpenIddict.Server/OpenIddictServerHandlers.Protection.cs @@ -1557,31 +1557,5 @@ public async ValueTask HandleAsync(GenerateTokenContext context) } } } - - /// - /// Contains the logic responsible for beautifying user-typed tokens. - /// Note: this handler is not used when the degraded mode is enabled. - /// - [Obsolete("This event handler is obsolete and will be removed in a future version.", error: true)] - public sealed class BeautifyToken : IOpenIddictServerHandler - { - /// - /// Gets the default descriptor definition assigned to this handler. - /// - public static OpenIddictServerHandlerDescriptor Descriptor { get; } - = OpenIddictServerHandlerDescriptor.CreateBuilder() - // Technically, this handler doesn't require that the degraded mode be disabled - // but the default CreateReferenceEntry handler that creates the user code - // reference identifiers only works when the degraded mode is disabled. - .AddFilter() - .UseSingletonHandler() - .SetOrder(AttachTokenPayload.Descriptor.Order + 1_000) - .SetType(OpenIddictServerHandlerType.BuiltIn) - .Build(); - - /// - public ValueTask HandleAsync(GenerateTokenContext context) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - } } } diff --git a/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpExtensions.cs b/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpExtensions.cs index 9a943d7f1..2409c70c2 100644 --- a/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpExtensions.cs +++ b/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpExtensions.cs @@ -37,9 +37,6 @@ public static OpenIddictValidationSystemNetHttpBuilder UseSystemNetHttp(this Ope builder.Services.TryAdd(OpenIddictValidationSystemNetHttpHandlers.DefaultHandlers.Select(descriptor => descriptor.ServiceDescriptor)); // Register the built-in filters used by the default OpenIddict System.Net.Http event handlers. -#pragma warning disable CS0618 - builder.Services.TryAddSingleton(); -#pragma warning restore CS0618 builder.Services.TryAddSingleton(); // Note: TryAddEnumerable() is used here to ensure the initializers are registered only once. diff --git a/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpHandlerFilters.cs b/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpHandlerFilters.cs index f7760ef33..c47afa3e2 100644 --- a/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpHandlerFilters.cs +++ b/src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpHandlerFilters.cs @@ -11,26 +11,6 @@ namespace OpenIddict.Validation.SystemNetHttp; [EditorBrowsable(EditorBrowsableState.Advanced)] public static class OpenIddictValidationSystemNetHttpHandlerFilters { - /// - /// Represents a filter that excludes the associated handlers if the URI is not an HTTP or HTTPS address. - /// - [Obsolete("This filter is obsolete and will be removed in a future version.")] - public sealed class RequireHttpMetadataUri : IOpenIddictValidationHandlerFilter - { - /// - public ValueTask IsActiveAsync(BaseExternalContext context) - { - if (context is null) - { - throw new ArgumentNullException(nameof(context)); - } - - return new( - string.Equals(context.RemoteUri?.Scheme, Uri.UriSchemeHttp, StringComparison.OrdinalIgnoreCase) || - string.Equals(context.RemoteUri?.Scheme, Uri.UriSchemeHttps, StringComparison.OrdinalIgnoreCase)); - } - } - /// /// Represents a filter that excludes the associated handlers if the URI is not an HTTP or HTTPS address. /// diff --git a/src/OpenIddict.Validation/OpenIddictValidationConfiguration.cs b/src/OpenIddict.Validation/OpenIddictValidationConfiguration.cs index c5688f34d..50697788f 100644 --- a/src/OpenIddict.Validation/OpenIddictValidationConfiguration.cs +++ b/src/OpenIddict.Validation/OpenIddictValidationConfiguration.cs @@ -20,14 +20,6 @@ public sealed class OpenIddictValidationConfiguration : IPostConfigureOptions - /// Creates a new instance of the class. - /// - /// The validation service. - [Obsolete("This constructor is no longer supported and will be removed in a future version.", error: true)] - public OpenIddictValidationConfiguration(OpenIddictValidationService service) - => throw new NotSupportedException(SR.GetResourceString(SR.ID0403)); - /// /// Creates a new instance of the class. /// From 6794242a745b9ef6fee5ccf040c50efb3c0049d3 Mon Sep 17 00:00:00 2001 From: OpenIddict Bot <32257313+openiddict-bot@users.noreply.github.com> Date: Sun, 15 Sep 2024 13:04:13 +0000 Subject: [PATCH 05/12] Update the sponsors section --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d833bc6ec..5919e9e40 100644 --- a/README.md +++ b/README.md @@ -154,7 +154,7 @@ To reference the OpenIddict MyGet feed, **create a `NuGet.config` file** (at the

-Sébastien RosSchmitt ChristianFlorian WachsSebastian StehleCommunicatie CockpitJasmin SavardDigitalOps Co. Ltd.EYERIDE Fleet Management SystemJulien DebacheStian HåveRavindu LiyanapathiranaHieronymusBlazeAkhan ZhakiyanovBarry DorransDevQ S.r.l.GrégoireForterroMarcelJens WillmerBlauhaus Technology (Pty) LtdJan TrejbalAviationexam s.r.o.MonoforRatiodata SEDennis van ZettenJeroenElfsterLombiq Technologies Ltd.PureBlazorAndrew BabbittKarl Schrieksoftaware gmbhSingular SystemsSCP-srlRealisable SoftwareJesús SC +Sébastien RosSchmitt ChristianFlorian WachsSebastian StehleCommunicatie CockpitJasmin SavardDigitalOps Co. Ltd.EYERIDE Fleet Management SystemJulien DebacheStian HåveRavindu LiyanapathiranaHieronymusBlazeAkhan ZhakiyanovBarry DorransDevQ S.r.l.GrégoireForterroMarcelJens WillmerBlauhaus Technology (Pty) LtdJan TrejbalAviationexam s.r.o.MonoforRatiodata SEDennis van ZettenJeroenElfsterLombiq Technologies Ltd.PureBlazorAndrew BabbittKarl Schrieksoftaware gmbhSingular SystemsSCP-srlRealisable SoftwareJesús SC -------------- From c71b7bb0c717b5af61fd33847214a037e9c0eac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Sun, 15 Sep 2024 14:55:08 +0200 Subject: [PATCH 06/12] Restrict the NuGet audit warnings to direct dependencies --- Directory.Build.props | 1 + 1 file changed, 1 insertion(+) diff --git a/Directory.Build.props b/Directory.Build.props index 20a096470..bbcf038ad 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -9,6 +9,7 @@ true $(NoWarn);CS1591;NETSDK1206;NU5118;NU5128;xUnit2002 NU1901;NU1902;NU1903;NU1904 + direct enable enable true From c5c4b74d17f5c1e8da780ad6ae961e09c905a000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Sun, 15 Sep 2024 15:02:02 +0200 Subject: [PATCH 07/12] Remove the .NET 7.0 target framework moniker --- Directory.Build.props | 3 --- Directory.Packages.props | 46 ---------------------------------------- 2 files changed, 49 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index bbcf038ad..0369959cd 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -107,7 +107,6 @@ net6.0; - net7.0; net8.0 @@ -135,8 +134,6 @@ Condition=" '$(NetCoreWindowsTargetFrameworks)' == '' And '$(SupportsWindowsTargeting)' == 'true' "> net6.0-windows7.0; net6.0-windows10.0.17763; - net7.0-windows7.0; - net7.0-windows10.0.17763; net8.0-windows7.0; net8.0-windows10.0.17763 diff --git a/Directory.Packages.props b/Directory.Packages.props index 3564a1bc2..01a9007bd 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -263,52 +263,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - + Sébastien RosSchmitt ChristianFlorian WachsSebastian StehleCommunicatie CockpitJasmin SavardDigitalOps Co. Ltd.EYERIDE Fleet Management SystemJulien DebacheStian HåveRavindu LiyanapathiranaHieronymusBlazeAkhan ZhakiyanovBarry DorransDevQ S.r.l.GrégoireForterroMarcelJens WillmerBlauhaus Technology (Pty) LtdJan TrejbalAviationexam s.r.o.MonoforRatiodata SEDennis van ZettenJeroenElfsterLombiq Technologies Ltd.PureBlazorAndrew BabbittKarl Schrieksoftaware gmbhSingular SystemsSCP-srlRealisable SoftwareJesús SC +Sébastien RosSchmitt ChristianFlorian WachsSebastian StehleCommunicatie CockpitJasmin SavardDigitalOps Co. Ltd.EYERIDE Fleet Management SystemJulien DebacheStian HåveRavindu LiyanapathiranaHieronymusBlazeAkhan ZhakiyanovBarry DorransDevQ S.r.l.GrégoireForterroMarcelJens WillmerBlauhaus Technology (Pty) LtdJan TrejbalAviationexam s.r.o.MonoforRatiodata SEDennis van ZettenJeroenElfsterLombiq Technologies Ltd.PureBlazorAndrew BabbittKarl Schrieksoftaware gmbhSingular SystemsSCP-srlRealisable SoftwareAlexander Marek --------------