Browse Source

Rename HandleConfigurationRequestContext.CryptographyEndpoint to JsonWebKeySetEndpoint to match the recent endpoint changes

pull/2178/head
Kévin Chalet 2 years ago
parent
commit
68d9e6c203
  1. 8
      src/OpenIddict.Client/OpenIddictClientHandlers.Discovery.cs
  2. 2
      src/OpenIddict.Server/OpenIddictServerEvents.Discovery.cs
  3. 4
      src/OpenIddict.Server/OpenIddictServerHandlers.Discovery.cs
  4. 8
      src/OpenIddict.Validation/OpenIddictValidationHandlers.Discovery.cs

8
src/OpenIddict.Client/OpenIddictClientHandlers.Discovery.cs

@ -24,7 +24,7 @@ public static partial class OpenIddictClientHandlers
HandleConfigurationErrorResponse.Descriptor, HandleConfigurationErrorResponse.Descriptor,
ValidateIssuer.Descriptor, ValidateIssuer.Descriptor,
ExtractAuthorizationEndpoint.Descriptor, ExtractAuthorizationEndpoint.Descriptor,
ExtractCryptographyEndpoint.Descriptor, ExtractJsonWebKeySetEndpoint.Descriptor,
ExtractDeviceAuthorizationEndpoint.Descriptor, ExtractDeviceAuthorizationEndpoint.Descriptor,
ExtractIntrospectionEndpoint.Descriptor, ExtractIntrospectionEndpoint.Descriptor,
ExtractLogoutEndpoint.Descriptor, ExtractLogoutEndpoint.Descriptor,
@ -295,14 +295,14 @@ public static partial class OpenIddictClientHandlers
/// <summary> /// <summary>
/// Contains the logic responsible for extracting the JSON Web Key Set endpoint URI from the discovery document. /// Contains the logic responsible for extracting the JSON Web Key Set endpoint URI from the discovery document.
/// </summary> /// </summary>
public sealed class ExtractCryptographyEndpoint : IOpenIddictClientHandler<HandleConfigurationResponseContext> public sealed class ExtractJsonWebKeySetEndpoint : IOpenIddictClientHandler<HandleConfigurationResponseContext>
{ {
/// <summary> /// <summary>
/// Gets the default descriptor definition assigned to this handler. /// Gets the default descriptor definition assigned to this handler.
/// </summary> /// </summary>
public static OpenIddictClientHandlerDescriptor Descriptor { get; } public static OpenIddictClientHandlerDescriptor Descriptor { get; }
= OpenIddictClientHandlerDescriptor.CreateBuilder<HandleConfigurationResponseContext>() = OpenIddictClientHandlerDescriptor.CreateBuilder<HandleConfigurationResponseContext>()
.UseSingletonHandler<ExtractCryptographyEndpoint>() .UseSingletonHandler<ExtractJsonWebKeySetEndpoint>()
.SetOrder(ExtractAuthorizationEndpoint.Descriptor.Order + 1_000) .SetOrder(ExtractAuthorizationEndpoint.Descriptor.Order + 1_000)
.SetType(OpenIddictClientHandlerType.BuiltIn) .SetType(OpenIddictClientHandlerType.BuiltIn)
.Build(); .Build();
@ -355,7 +355,7 @@ public static partial class OpenIddictClientHandlers
public static OpenIddictClientHandlerDescriptor Descriptor { get; } public static OpenIddictClientHandlerDescriptor Descriptor { get; }
= OpenIddictClientHandlerDescriptor.CreateBuilder<HandleConfigurationResponseContext>() = OpenIddictClientHandlerDescriptor.CreateBuilder<HandleConfigurationResponseContext>()
.UseSingletonHandler<ExtractDeviceAuthorizationEndpoint>() .UseSingletonHandler<ExtractDeviceAuthorizationEndpoint>()
.SetOrder(ExtractCryptographyEndpoint.Descriptor.Order + 1_000) .SetOrder(ExtractJsonWebKeySetEndpoint.Descriptor.Order + 1_000)
.SetType(OpenIddictClientHandlerType.BuiltIn) .SetType(OpenIddictClientHandlerType.BuiltIn)
.Build(); .Build();

2
src/OpenIddict.Server/OpenIddictServerEvents.Discovery.cs

@ -99,7 +99,7 @@ public static partial class OpenIddictServerEvents
/// <summary> /// <summary>
/// Gets or sets the JSON Web Key Set endpoint URI. /// Gets or sets the JSON Web Key Set endpoint URI.
/// </summary> /// </summary>
public Uri? CryptographyEndpoint { get; set; } public Uri? JsonWebKeySetEndpoint { get; set; }
/// <summary> /// <summary>
/// Gets or sets the device authorization endpoint URI. /// Gets or sets the device authorization endpoint URI.

4
src/OpenIddict.Server/OpenIddictServerHandlers.Discovery.cs

@ -241,7 +241,7 @@ public static partial class OpenIddictServerHandlers
[Metadata.RevocationEndpoint] = notification.RevocationEndpoint?.AbsoluteUri, [Metadata.RevocationEndpoint] = notification.RevocationEndpoint?.AbsoluteUri,
[Metadata.UserInfoEndpoint] = notification.UserInfoEndpoint?.AbsoluteUri, [Metadata.UserInfoEndpoint] = notification.UserInfoEndpoint?.AbsoluteUri,
[Metadata.DeviceAuthorizationEndpoint] = notification.DeviceAuthorizationEndpoint?.AbsoluteUri, [Metadata.DeviceAuthorizationEndpoint] = notification.DeviceAuthorizationEndpoint?.AbsoluteUri,
[Metadata.JwksUri] = notification.CryptographyEndpoint?.AbsoluteUri, [Metadata.JwksUri] = notification.JsonWebKeySetEndpoint?.AbsoluteUri,
[Metadata.GrantTypesSupported] = notification.GrantTypes.ToArray(), [Metadata.GrantTypesSupported] = notification.GrantTypes.ToArray(),
[Metadata.ResponseTypesSupported] = notification.ResponseTypes.ToArray(), [Metadata.ResponseTypesSupported] = notification.ResponseTypes.ToArray(),
[Metadata.ResponseModesSupported] = notification.ResponseModes.ToArray(), [Metadata.ResponseModesSupported] = notification.ResponseModes.ToArray(),
@ -371,7 +371,7 @@ public static partial class OpenIddictServerHandlers
context.AuthorizationEndpoint ??= OpenIddictHelpers.CreateAbsoluteUri( context.AuthorizationEndpoint ??= OpenIddictHelpers.CreateAbsoluteUri(
context.BaseUri, context.Options.AuthorizationEndpointUris.FirstOrDefault()); context.BaseUri, context.Options.AuthorizationEndpointUris.FirstOrDefault());
context.CryptographyEndpoint ??= OpenIddictHelpers.CreateAbsoluteUri( context.JsonWebKeySetEndpoint ??= OpenIddictHelpers.CreateAbsoluteUri(
context.BaseUri, context.Options.JsonWebKeySetEndpointUris.FirstOrDefault()); context.BaseUri, context.Options.JsonWebKeySetEndpointUris.FirstOrDefault());
context.DeviceAuthorizationEndpoint ??= OpenIddictHelpers.CreateAbsoluteUri( context.DeviceAuthorizationEndpoint ??= OpenIddictHelpers.CreateAbsoluteUri(

8
src/OpenIddict.Validation/OpenIddictValidationHandlers.Discovery.cs

@ -23,7 +23,7 @@ public static partial class OpenIddictValidationHandlers
ValidateWellKnownConfigurationParameters.Descriptor, ValidateWellKnownConfigurationParameters.Descriptor,
HandleConfigurationErrorResponse.Descriptor, HandleConfigurationErrorResponse.Descriptor,
ValidateIssuer.Descriptor, ValidateIssuer.Descriptor,
ExtractCryptographyEndpoint.Descriptor, ExtractJsonWebKeySetEndpoint.Descriptor,
ExtractIntrospectionEndpoint.Descriptor, ExtractIntrospectionEndpoint.Descriptor,
ExtractIntrospectionEndpointClientAuthenticationMethods.Descriptor, ExtractIntrospectionEndpointClientAuthenticationMethods.Descriptor,
@ -213,14 +213,14 @@ public static partial class OpenIddictValidationHandlers
/// <summary> /// <summary>
/// Contains the logic responsible for extracting the JSON Web Key Set endpoint URI from the discovery document. /// Contains the logic responsible for extracting the JSON Web Key Set endpoint URI from the discovery document.
/// </summary> /// </summary>
public sealed class ExtractCryptographyEndpoint : IOpenIddictValidationHandler<HandleConfigurationResponseContext> public sealed class ExtractJsonWebKeySetEndpoint : IOpenIddictValidationHandler<HandleConfigurationResponseContext>
{ {
/// <summary> /// <summary>
/// Gets the default descriptor definition assigned to this handler. /// Gets the default descriptor definition assigned to this handler.
/// </summary> /// </summary>
public static OpenIddictValidationHandlerDescriptor Descriptor { get; } public static OpenIddictValidationHandlerDescriptor Descriptor { get; }
= OpenIddictValidationHandlerDescriptor.CreateBuilder<HandleConfigurationResponseContext>() = OpenIddictValidationHandlerDescriptor.CreateBuilder<HandleConfigurationResponseContext>()
.UseSingletonHandler<ExtractCryptographyEndpoint>() .UseSingletonHandler<ExtractJsonWebKeySetEndpoint>()
.SetOrder(ValidateIssuer.Descriptor.Order + 1_000) .SetOrder(ValidateIssuer.Descriptor.Order + 1_000)
.SetType(OpenIddictValidationHandlerType.BuiltIn) .SetType(OpenIddictValidationHandlerType.BuiltIn)
.Build(); .Build();
@ -273,7 +273,7 @@ public static partial class OpenIddictValidationHandlers
public static OpenIddictValidationHandlerDescriptor Descriptor { get; } public static OpenIddictValidationHandlerDescriptor Descriptor { get; }
= OpenIddictValidationHandlerDescriptor.CreateBuilder<HandleConfigurationResponseContext>() = OpenIddictValidationHandlerDescriptor.CreateBuilder<HandleConfigurationResponseContext>()
.UseSingletonHandler<ExtractIntrospectionEndpoint>() .UseSingletonHandler<ExtractIntrospectionEndpoint>()
.SetOrder(ExtractCryptographyEndpoint.Descriptor.Order + 1_000) .SetOrder(ExtractJsonWebKeySetEndpoint.Descriptor.Order + 1_000)
.SetType(OpenIddictValidationHandlerType.BuiltIn) .SetType(OpenIddictValidationHandlerType.BuiltIn)
.Build(); .Build();

Loading…
Cancel
Save