diff --git a/identity-server/src/Configuration.EntityFramework/ClientConfigurationStore.cs b/identity-server/src/Configuration.EntityFramework/ClientConfigurationStore.cs index 6cadb30b7..82da46636 100644 --- a/identity-server/src/Configuration.EntityFramework/ClientConfigurationStore.cs +++ b/identity-server/src/Configuration.EntityFramework/ClientConfigurationStore.cs @@ -5,7 +5,6 @@ using Duende.IdentityServer.EntityFramework.Interfaces; using Duende.IdentityServer.EntityFramework.Mappers; using Duende.IdentityServer.Models; -using Duende.IdentityServer.Services; using Microsoft.Extensions.Logging; namespace Duende.IdentityServer.Configuration; @@ -21,11 +20,6 @@ public class ClientConfigurationStore : IClientConfigurationStore /// protected readonly IConfigurationDbContext DbContext; - /// - /// The CancellationToken provider. - /// - protected readonly ICancellationTokenProvider CancellationTokenProvider; - /// /// The logger. /// @@ -37,11 +31,9 @@ public class ClientConfigurationStore : IClientConfigurationStore /// public ClientConfigurationStore( IConfigurationDbContext dbContext, - ICancellationTokenProvider cancellationTokenProvider, ILogger logger) { DbContext = dbContext; - CancellationTokenProvider = cancellationTokenProvider; Logger = logger; } diff --git a/identity-server/src/Configuration.EntityFramework/DefaultCancellationTokenProvider.cs b/identity-server/src/Configuration.EntityFramework/DefaultCancellationTokenProvider.cs deleted file mode 100644 index 582bf8c3a..000000000 --- a/identity-server/src/Configuration.EntityFramework/DefaultCancellationTokenProvider.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Duende Software. All rights reserved. -// See LICENSE in the project root for license information. - - -using Duende.IdentityServer.Services; -using Microsoft.AspNetCore.Http; - -namespace Duende.IdentityServer.Configuration.EntityFramework; - -/// -/// Provides cancellation tokens based on the incoming http request -/// -#pragma warning disable CA1812 // This class is not instantiated directly, but rather used by the DI container -internal sealed class DefaultCancellationTokenProvider : ICancellationTokenProvider -#pragma warning restore CA1812 -{ - private readonly IHttpContextAccessor _httpContextAccessor; - - /// - /// Constructor - /// - /// - public DefaultCancellationTokenProvider(IHttpContextAccessor httpContextAccessor) => _httpContextAccessor = httpContextAccessor; - - /// - /// Provides access to the cancellation token from the http context - /// - public CancellationToken CancellationToken => _httpContextAccessor.HttpContext?.RequestAborted ?? CancellationToken.None; -} diff --git a/identity-server/src/Configuration.EntityFramework/ServiceCollectionExtensions.cs b/identity-server/src/Configuration.EntityFramework/ServiceCollectionExtensions.cs index 61c9089a4..36d826fb0 100644 --- a/identity-server/src/Configuration.EntityFramework/ServiceCollectionExtensions.cs +++ b/identity-server/src/Configuration.EntityFramework/ServiceCollectionExtensions.cs @@ -2,7 +2,6 @@ // See LICENSE in the project root for license information. -using Duende.IdentityServer.Services; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; @@ -22,7 +21,6 @@ public static class ServiceCollectionExtensions /// public static IServiceCollection AddClientConfigurationStore(this IdentityServerConfigurationBuilder builder) { - builder.Services.TryAddTransient(); builder.Services.TryAddSingleton(); return builder.Services.AddTransient(); } diff --git a/identity-server/src/EntityFramework.Storage/Stores/ClientStore.cs b/identity-server/src/EntityFramework.Storage/Stores/ClientStore.cs index dc9626024..a3ee20b31 100644 --- a/identity-server/src/EntityFramework.Storage/Stores/ClientStore.cs +++ b/identity-server/src/EntityFramework.Storage/Stores/ClientStore.cs @@ -5,7 +5,6 @@ using System.Runtime.CompilerServices; using Duende.IdentityServer.EntityFramework.Interfaces; using Duende.IdentityServer.EntityFramework.Mappers; -using Duende.IdentityServer.Services; using Duende.IdentityServer.Stores; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; @@ -23,11 +22,6 @@ public class ClientStore : IClientStore /// protected readonly IConfigurationDbContext Context; - /// - /// The CancellationToken provider. - /// - protected readonly ICancellationTokenProvider CancellationTokenProvider; - /// /// The logger. /// @@ -38,13 +32,11 @@ public class ClientStore : IClientStore /// /// The context. /// The logger. - /// /// context - public ClientStore(IConfigurationDbContext context, ILogger logger, ICancellationTokenProvider cancellationTokenProvider) + public ClientStore(IConfigurationDbContext context, ILogger logger) { Context = context ?? throw new ArgumentNullException(nameof(context)); Logger = logger; - CancellationTokenProvider = cancellationTokenProvider; } /// diff --git a/identity-server/src/EntityFramework.Storage/Stores/DeviceFlowStore.cs b/identity-server/src/EntityFramework.Storage/Stores/DeviceFlowStore.cs index 63b73b637..42b527435 100644 --- a/identity-server/src/EntityFramework.Storage/Stores/DeviceFlowStore.cs +++ b/identity-server/src/EntityFramework.Storage/Stores/DeviceFlowStore.cs @@ -6,7 +6,6 @@ using Duende.IdentityModel; using Duende.IdentityServer.EntityFramework.Entities; using Duende.IdentityServer.EntityFramework.Interfaces; using Duende.IdentityServer.Models; -using Duende.IdentityServer.Services; using Duende.IdentityServer.Stores; using Duende.IdentityServer.Stores.Serialization; using Microsoft.EntityFrameworkCore; @@ -30,11 +29,6 @@ public class DeviceFlowStore : IDeviceFlowStore /// protected readonly IPersistentGrantSerializer Serializer; - /// - /// The CancellationToken provider. - /// - protected readonly ICancellationTokenProvider CancellationTokenProvider; - /// /// The logger. /// @@ -46,17 +40,14 @@ public class DeviceFlowStore : IDeviceFlowStore /// The context. /// The serializer /// The logger. - /// public DeviceFlowStore( IPersistedGrantDbContext context, IPersistentGrantSerializer serializer, - ILogger logger, - ICancellationTokenProvider cancellationTokenProvider) + ILogger logger) { Context = context; Serializer = serializer; Logger = logger; - CancellationTokenProvider = cancellationTokenProvider; } /// diff --git a/identity-server/src/EntityFramework.Storage/Stores/IdentityProviderStore.cs b/identity-server/src/EntityFramework.Storage/Stores/IdentityProviderStore.cs index 3bb47604d..a5c48efeb 100644 --- a/identity-server/src/EntityFramework.Storage/Stores/IdentityProviderStore.cs +++ b/identity-server/src/EntityFramework.Storage/Stores/IdentityProviderStore.cs @@ -5,7 +5,6 @@ using Duende.IdentityServer.EntityFramework.Interfaces; using Duende.IdentityServer.EntityFramework.Mappers; using Duende.IdentityServer.Models; -using Duende.IdentityServer.Services; using Duende.IdentityServer.Stores; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; @@ -23,11 +22,6 @@ public class IdentityProviderStore : IIdentityProviderStore /// protected readonly IConfigurationDbContext Context; - /// - /// The CancellationToken provider. - /// - protected readonly ICancellationTokenProvider CancellationTokenProvider; - /// /// The logger. /// @@ -38,13 +32,11 @@ public class IdentityProviderStore : IIdentityProviderStore /// /// The context. /// The logger. - /// /// context - public IdentityProviderStore(IConfigurationDbContext context, ILogger logger, ICancellationTokenProvider cancellationTokenProvider) + public IdentityProviderStore(IConfigurationDbContext context, ILogger logger) { Context = context ?? throw new ArgumentNullException(nameof(context)); Logger = logger; - CancellationTokenProvider = cancellationTokenProvider; } /// diff --git a/identity-server/src/EntityFramework.Storage/Stores/PersistedGrantStore.cs b/identity-server/src/EntityFramework.Storage/Stores/PersistedGrantStore.cs index b0de64d99..adae13135 100644 --- a/identity-server/src/EntityFramework.Storage/Stores/PersistedGrantStore.cs +++ b/identity-server/src/EntityFramework.Storage/Stores/PersistedGrantStore.cs @@ -6,7 +6,6 @@ using Duende.IdentityServer.EntityFramework.Entities; using Duende.IdentityServer.EntityFramework.Interfaces; using Duende.IdentityServer.EntityFramework.Mappers; using Duende.IdentityServer.Extensions; -using Duende.IdentityServer.Services; using Duende.IdentityServer.Stores; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; @@ -24,11 +23,6 @@ public class PersistedGrantStore : Duende.IdentityServer.Stores.IPersistedGrantS /// protected readonly IPersistedGrantDbContext Context; - /// - /// The CancellationToken service. - /// - protected readonly ICancellationTokenProvider CancellationTokenProvider; - /// /// The logger. /// @@ -39,12 +33,10 @@ public class PersistedGrantStore : Duende.IdentityServer.Stores.IPersistedGrantS /// /// The context. /// The logger. - /// - public PersistedGrantStore(IPersistedGrantDbContext context, ILogger logger, ICancellationTokenProvider cancellationTokenProvider) + public PersistedGrantStore(IPersistedGrantDbContext context, ILogger logger) { Context = context; Logger = logger; - CancellationTokenProvider = cancellationTokenProvider; } /// diff --git a/identity-server/src/EntityFramework.Storage/Stores/PushedAuthorizationRequestStore.cs b/identity-server/src/EntityFramework.Storage/Stores/PushedAuthorizationRequestStore.cs index eee42b67a..6917fce45 100644 --- a/identity-server/src/EntityFramework.Storage/Stores/PushedAuthorizationRequestStore.cs +++ b/identity-server/src/EntityFramework.Storage/Stores/PushedAuthorizationRequestStore.cs @@ -4,7 +4,6 @@ using Duende.IdentityServer.EntityFramework.Interfaces; using Duende.IdentityServer.EntityFramework.Mappers; -using Duende.IdentityServer.Services; using Duende.IdentityServer.Stores; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; @@ -19,11 +18,6 @@ public class PushedAuthorizationRequestStore : IPushedAuthorizationRequestStore /// protected readonly IPersistedGrantDbContext Context; - /// - /// The CancellationToken service. - /// - protected readonly ICancellationTokenProvider CancellationTokenProvider; - /// /// The logger. /// @@ -34,12 +28,10 @@ public class PushedAuthorizationRequestStore : IPushedAuthorizationRequestStore /// /// The context. /// The logger. - /// - public PushedAuthorizationRequestStore(IPersistedGrantDbContext context, ILogger logger, ICancellationTokenProvider cancellationTokenProvider) + public PushedAuthorizationRequestStore(IPersistedGrantDbContext context, ILogger logger) { Context = context; Logger = logger; - CancellationTokenProvider = cancellationTokenProvider; } /// diff --git a/identity-server/src/EntityFramework.Storage/Stores/ResourceStore.cs b/identity-server/src/EntityFramework.Storage/Stores/ResourceStore.cs index 30dffb4be..338d6cae7 100644 --- a/identity-server/src/EntityFramework.Storage/Stores/ResourceStore.cs +++ b/identity-server/src/EntityFramework.Storage/Stores/ResourceStore.cs @@ -1,4 +1,4 @@ -// Copyright (c) Duende Software. All rights reserved. +// Copyright (c) Duende Software. All rights reserved. // See LICENSE in the project root for license information. @@ -6,7 +6,6 @@ using Duende.IdentityServer.EntityFramework.Interfaces; using Duende.IdentityServer.EntityFramework.Mappers; using Duende.IdentityServer.Extensions; using Duende.IdentityServer.Models; -using Duende.IdentityServer.Services; using Duende.IdentityServer.Stores; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; @@ -24,11 +23,6 @@ public class ResourceStore : IResourceStore /// protected readonly IConfigurationDbContext Context; - /// - /// The CancellationToken provider. - /// - protected readonly ICancellationTokenProvider CancellationTokenProvider; - /// /// The logger. /// @@ -39,13 +33,11 @@ public class ResourceStore : IResourceStore /// /// The context. /// The logger. - /// /// context - public ResourceStore(IConfigurationDbContext context, ILogger logger, ICancellationTokenProvider cancellationTokenProvider) + public ResourceStore(IConfigurationDbContext context, ILogger logger) { Context = context ?? throw new ArgumentNullException(nameof(context)); Logger = logger; - CancellationTokenProvider = cancellationTokenProvider; } /// diff --git a/identity-server/src/EntityFramework.Storage/Stores/ServerSideSessionStore.cs b/identity-server/src/EntityFramework.Storage/Stores/ServerSideSessionStore.cs index 29bbb6a71..7a987137b 100644 --- a/identity-server/src/EntityFramework.Storage/Stores/ServerSideSessionStore.cs +++ b/identity-server/src/EntityFramework.Storage/Stores/ServerSideSessionStore.cs @@ -5,7 +5,6 @@ using Duende.IdentityServer.EntityFramework.Extensions; using Duende.IdentityServer.EntityFramework.Interfaces; using Duende.IdentityServer.Models; -using Duende.IdentityServer.Services; using Duende.IdentityServer.Stores; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; @@ -23,11 +22,6 @@ public class ServerSideSessionStore : IServerSideSessionStore /// protected readonly IPersistedGrantDbContext Context; - /// - /// The CancellationToken provider. - /// - protected readonly ICancellationTokenProvider CancellationTokenProvider; - /// /// The logger. /// @@ -38,13 +32,11 @@ public class ServerSideSessionStore : IServerSideSessionStore /// /// The context. /// The logger. - /// /// context - public ServerSideSessionStore(IPersistedGrantDbContext context, ILogger logger, ICancellationTokenProvider cancellationTokenProvider) + public ServerSideSessionStore(IPersistedGrantDbContext context, ILogger logger) { Context = context ?? throw new ArgumentNullException(nameof(context)); Logger = logger; - CancellationTokenProvider = cancellationTokenProvider; } diff --git a/identity-server/src/EntityFramework.Storage/Stores/SigningKeyStore.cs b/identity-server/src/EntityFramework.Storage/Stores/SigningKeyStore.cs index 571fd7053..453590b0c 100644 --- a/identity-server/src/EntityFramework.Storage/Stores/SigningKeyStore.cs +++ b/identity-server/src/EntityFramework.Storage/Stores/SigningKeyStore.cs @@ -1,11 +1,10 @@ -// Copyright (c) Duende Software. All rights reserved. +// Copyright (c) Duende Software. All rights reserved. // See LICENSE in the project root for license information. using Duende.IdentityServer.EntityFramework.Entities; using Duende.IdentityServer.EntityFramework.Interfaces; using Duende.IdentityServer.Models; -using Duende.IdentityServer.Services; using Duende.IdentityServer.Stores; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; @@ -25,11 +24,6 @@ public class SigningKeyStore : ISigningKeyStore /// protected readonly IPersistedGrantDbContext Context; - /// - /// The CancellationToken provider. - /// - protected readonly ICancellationTokenProvider CancellationTokenProvider; - /// /// The logger. /// @@ -40,13 +34,11 @@ public class SigningKeyStore : ISigningKeyStore /// /// The context. /// The logger. - /// /// context - public SigningKeyStore(IPersistedGrantDbContext context, ILogger logger, ICancellationTokenProvider cancellationTokenProvider) + public SigningKeyStore(IPersistedGrantDbContext context, ILogger logger) { Context = context ?? throw new ArgumentNullException(nameof(context)); Logger = logger; - CancellationTokenProvider = cancellationTokenProvider; } /// diff --git a/identity-server/src/EntityFramework/Services/CorsPolicyService.cs b/identity-server/src/EntityFramework/Services/CorsPolicyService.cs index 3c042af2b..0fa4199fe 100644 --- a/identity-server/src/EntityFramework/Services/CorsPolicyService.cs +++ b/identity-server/src/EntityFramework/Services/CorsPolicyService.cs @@ -20,11 +20,6 @@ public class CorsPolicyService : ICorsPolicyService /// protected readonly IConfigurationDbContext DbContext; - /// - /// The CancellationToken provider. - /// - protected readonly ICancellationTokenProvider CancellationTokenProvider; - /// /// The logger. /// @@ -36,13 +31,11 @@ public class CorsPolicyService : ICorsPolicyService /// /// The DbContext /// The logger. - /// /// context - public CorsPolicyService(IConfigurationDbContext dbContext, ILogger logger, ICancellationTokenProvider cancellationTokenProvider) + public CorsPolicyService(IConfigurationDbContext dbContext, ILogger logger) { DbContext = dbContext; Logger = logger; - CancellationTokenProvider = cancellationTokenProvider; } /// diff --git a/identity-server/src/IdentityServer/Configuration/DependencyInjection/BuilderExtensions/Additional.cs b/identity-server/src/IdentityServer/Configuration/DependencyInjection/BuilderExtensions/Additional.cs index d88e18730..265c9a373 100644 --- a/identity-server/src/IdentityServer/Configuration/DependencyInjection/BuilderExtensions/Additional.cs +++ b/identity-server/src/IdentityServer/Configuration/DependencyInjection/BuilderExtensions/Additional.cs @@ -454,7 +454,7 @@ public static class IdentityServerBuilderExtensionsAdditional var httpClient = httpClientFactory.CreateClient(name); var loggerFactory = s.GetRequiredService(); - return new DefaultBackChannelLogoutHttpClient(httpClient, loggerFactory, new NoneCancellationTokenProvider()); + return new DefaultBackChannelLogoutHttpClient(httpClient, loggerFactory); }); return httpBuilder; @@ -491,7 +491,7 @@ public static class IdentityServerBuilderExtensionsAdditional var loggerFactory = s.GetRequiredService(); var options = s.GetRequiredService(); - return new DefaultJwtRequestUriHttpClient(httpClient, options, loggerFactory, new NoneCancellationTokenProvider()); + return new DefaultJwtRequestUriHttpClient(httpClient, options, loggerFactory); }); return httpBuilder; diff --git a/identity-server/src/IdentityServer/Configuration/DependencyInjection/BuilderExtensions/Core.cs b/identity-server/src/IdentityServer/Configuration/DependencyInjection/BuilderExtensions/Core.cs index f524c677e..d595bc7fd 100644 --- a/identity-server/src/IdentityServer/Configuration/DependencyInjection/BuilderExtensions/Core.cs +++ b/identity-server/src/IdentityServer/Configuration/DependencyInjection/BuilderExtensions/Core.cs @@ -252,7 +252,6 @@ public static class IdentityServerBuilderExtensionsCore /// public static IIdentityServerBuilder AddPluggableServices(this IIdentityServerBuilder builder) { - builder.Services.TryAddTransient(); builder.Services.TryAddTransient(); builder.Services.TryAddTransient(); builder.Services.TryAddTransient(); diff --git a/identity-server/src/IdentityServer/Licensing/V2/Diagnostics/DiagnosticEntries/RegisteredImplementationsDiagnosticEntry.cs b/identity-server/src/IdentityServer/Licensing/V2/Diagnostics/DiagnosticEntries/RegisteredImplementationsDiagnosticEntry.cs index c610ee524..e14422df9 100644 --- a/identity-server/src/IdentityServer/Licensing/V2/Diagnostics/DiagnosticEntries/RegisteredImplementationsDiagnosticEntry.cs +++ b/identity-server/src/IdentityServer/Licensing/V2/Diagnostics/DiagnosticEntries/RegisteredImplementationsDiagnosticEntry.cs @@ -61,7 +61,6 @@ internal class RegisteredImplementationsDiagnosticEntry(ServiceCollectionAccesso new(typeof(IBackChannelLogoutHttpClient), [typeof(DefaultBackChannelLogoutHttpClient)]), new(typeof(IBackChannelLogoutService), [typeof(DefaultBackChannelLogoutService)]), new(typeof(ICache<>), [typeof(DefaultCache<>)]), - new(typeof(ICancellationTokenProvider), [typeof(DefaultCancellationTokenProvider)]), new(typeof(IClaimsService), [typeof(DefaultClaimsService)]), new(typeof(IConsentService), [typeof(DefaultConsentService)]), new(typeof(ICorsPolicyService), [typeof(DefaultCorsPolicyService)]), diff --git a/identity-server/src/IdentityServer/Services/Default/BackChannelLogoutHttpClient.cs b/identity-server/src/IdentityServer/Services/Default/BackChannelLogoutHttpClient.cs index 45b0baca9..e1586f473 100644 --- a/identity-server/src/IdentityServer/Services/Default/BackChannelLogoutHttpClient.cs +++ b/identity-server/src/IdentityServer/Services/Default/BackChannelLogoutHttpClient.cs @@ -1,4 +1,4 @@ -// Copyright (c) Duende Software. All rights reserved. +// Copyright (c) Duende Software. All rights reserved. // See LICENSE in the project root for license information. @@ -14,19 +14,16 @@ public class DefaultBackChannelLogoutHttpClient : IBackChannelLogoutHttpClient { private readonly HttpClient _client; private readonly ILogger _logger; - private readonly ICancellationTokenProvider _cancellationTokenProvider; /// /// Constructor for BackChannelLogoutHttpClient. /// /// /// - /// - public DefaultBackChannelLogoutHttpClient(HttpClient client, ILoggerFactory loggerFactory, ICancellationTokenProvider cancellationTokenProvider) + public DefaultBackChannelLogoutHttpClient(HttpClient client, ILoggerFactory loggerFactory) { _client = client; _logger = loggerFactory.CreateLogger(); - _cancellationTokenProvider = cancellationTokenProvider; } /// diff --git a/identity-server/src/IdentityServer/Services/Default/DefaultCancellationTokenProvider.cs b/identity-server/src/IdentityServer/Services/Default/DefaultCancellationTokenProvider.cs deleted file mode 100644 index 451a5e148..000000000 --- a/identity-server/src/IdentityServer/Services/Default/DefaultCancellationTokenProvider.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Duende Software. All rights reserved. -// See LICENSE in the project root for license information. - - -using Microsoft.AspNetCore.Http; - -namespace Duende.IdentityServer.Services.Default; - -/// -/// Provides cancellation tokens based on the incoming http request -/// -internal class DefaultCancellationTokenProvider : ICancellationTokenProvider -{ - private readonly IHttpContextAccessor _httpContextAccessor; - - /// - /// Constructor - /// - /// - public DefaultCancellationTokenProvider(IHttpContextAccessor httpContextAccessor) => _httpContextAccessor = httpContextAccessor; - - /// - /// Provides access to the cancellation token from the http context - /// - public CT CancellationToken => _httpContextAccessor.HttpContext?.RequestAborted ?? CT.None; -} diff --git a/identity-server/src/IdentityServer/Services/Default/DefaultJwtRequestUriHttpClient.cs b/identity-server/src/IdentityServer/Services/Default/DefaultJwtRequestUriHttpClient.cs index 5fe5b3874..22afcda09 100644 --- a/identity-server/src/IdentityServer/Services/Default/DefaultJwtRequestUriHttpClient.cs +++ b/identity-server/src/IdentityServer/Services/Default/DefaultJwtRequestUriHttpClient.cs @@ -18,7 +18,6 @@ public class DefaultJwtRequestUriHttpClient : IJwtRequestUriHttpClient private readonly HttpClient _client; private readonly IdentityServerOptions _options; private readonly SanitizedLogger _sanitizedLogger; - private readonly ICancellationTokenProvider _cancellationTokenProvider; /// /// ctor @@ -26,14 +25,12 @@ public class DefaultJwtRequestUriHttpClient : IJwtRequestUriHttpClient /// An HTTP client /// The options. /// The logger factory - /// public DefaultJwtRequestUriHttpClient(HttpClient client, IdentityServerOptions options, - ILoggerFactory loggerFactory, ICancellationTokenProvider cancellationTokenProvider) + ILoggerFactory loggerFactory) { _client = client; _options = options; _sanitizedLogger = new SanitizedLogger(loggerFactory.CreateLogger()); - _cancellationTokenProvider = cancellationTokenProvider; } diff --git a/identity-server/src/Storage/Services/ICancellationTokenProvider.cs b/identity-server/src/Storage/Services/ICancellationTokenProvider.cs deleted file mode 100644 index adcbd3166..000000000 --- a/identity-server/src/Storage/Services/ICancellationTokenProvider.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Duende Software. All rights reserved. -// See LICENSE in the project root for license information. - - -#nullable enable - -namespace Duende.IdentityServer.Services; - -/// -/// Service to provide CancellationToken for async operations. -/// -public interface ICancellationTokenProvider -{ - /// - /// Returns the current CancellationToken, or null if none present. - /// - CT CancellationToken { get; } -} diff --git a/identity-server/src/Storage/Services/NoneCancellationTokenProvider.cs b/identity-server/src/Storage/Services/NoneCancellationTokenProvider.cs deleted file mode 100644 index db480ae91..000000000 --- a/identity-server/src/Storage/Services/NoneCancellationTokenProvider.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) Duende Software. All rights reserved. -// See LICENSE in the project root for license information. - - -namespace Duende.IdentityServer.Services; - -/// -/// Implementation of ICancellationTokenProvider that returns CancellationToken.None -/// -public class NoneCancellationTokenProvider : ICancellationTokenProvider -{ - /// - public CT CancellationToken => CT.None; -} diff --git a/identity-server/test/IdentityServer.IntegrationTests/Common/MockCancellationTokenProvider.cs b/identity-server/test/IdentityServer.IntegrationTests/Common/MockCancellationTokenProvider.cs deleted file mode 100644 index 71b3e24f6..000000000 --- a/identity-server/test/IdentityServer.IntegrationTests/Common/MockCancellationTokenProvider.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Duende Software. All rights reserved. -// See LICENSE in the project root for license information. - - -using Duende.IdentityServer.Services; - -namespace Duende.IdentityServer.IntegrationTests.Common; - -public class MockCancellationTokenProvider : ICancellationTokenProvider -{ - public CancellationToken CancellationToken => CancellationToken.None; -} diff --git a/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/EntityFrameworkBasedLogoutTests.cs b/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/EntityFrameworkBasedLogoutTests.cs index 6ebfbf5fe..ba08fd210 100644 --- a/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/EntityFrameworkBasedLogoutTests.cs +++ b/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/EntityFrameworkBasedLogoutTests.cs @@ -7,7 +7,7 @@ using Duende.IdentityServer.EntityFramework.Options; using Duende.IdentityServer.EntityFramework.Stores; using Duende.IdentityServer.IntegrationTests.Common; using Duende.IdentityServer.Models; -using Duende.IdentityServer.Services; + using Duende.IdentityServer.Services.KeyManagement; using Duende.IdentityServer.Stores; using Duende.IdentityServer.Test; @@ -80,8 +80,7 @@ public class EntityFrameworkBasedLogoutTests _mockPipeline.OnPostConfigureServices += services => { //Override the default developer signing key store and signing credential store with the EF based implementations to repo bug specific to concurrent access to an EF db context - services.AddSingleton(new SigningKeyStore(context, new NullLogger(), - new NoneCancellationTokenProvider())); + services.AddSingleton(new SigningKeyStore(context, new NullLogger())); services.Replace(ServiceDescriptor.Singleton()); }; _mockPipeline.Initialize(); diff --git a/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Services/CorsPolicyServiceTests.cs b/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Services/CorsPolicyServiceTests.cs index 07b88a786..ff63c7d44 100644 --- a/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Services/CorsPolicyServiceTests.cs +++ b/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Services/CorsPolicyServiceTests.cs @@ -7,7 +7,6 @@ using Duende.IdentityServer.EntityFramework.Mappers; using Duende.IdentityServer.EntityFramework.Options; using Duende.IdentityServer.EntityFramework.Services; using Duende.IdentityServer.Models; -using Duende.IdentityServer.Services; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging.Abstractions; @@ -51,7 +50,7 @@ public class CorsPolicyServiceTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var service = new CorsPolicyService(context, new NullLogger()); result = await service.IsOriginAllowedAsync(testCorsOrigin, _ct); } @@ -75,7 +74,7 @@ public class CorsPolicyServiceTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var service = new CorsPolicyService(context, new NullLogger()); result = await service.IsOriginAllowedAsync("InvalidOrigin", _ct); } diff --git a/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Storage/Stores/ClientStoreTests.cs b/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Storage/Stores/ClientStoreTests.cs index b172df59b..16cf559cf 100644 --- a/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Storage/Stores/ClientStoreTests.cs +++ b/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Storage/Stores/ClientStoreTests.cs @@ -7,7 +7,6 @@ using Duende.IdentityServer.EntityFramework.Mappers; using Duende.IdentityServer.EntityFramework.Options; using Duende.IdentityServer.EntityFramework.Stores; using Duende.IdentityServer.Models; -using Duende.IdentityServer.Services; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging.Abstractions; using Xunit.Sdk; @@ -31,7 +30,7 @@ public class ClientStoreTests : IntegrationTest options) { await using var context = new ConfigurationDbContext(options); - var store = new ClientStore(context, new NullLogger(), new NoneCancellationTokenProvider()); + var store = new ClientStore(context, new NullLogger()); var client = await store.FindClientByIdAsync(Guid.NewGuid().ToString(), _ct); client.ShouldBeNull(); } @@ -54,7 +53,7 @@ public class ClientStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new ClientStore(context, new NullLogger()); client = await store.FindClientByIdAsync(testClient.ClientId, _ct); } @@ -88,7 +87,7 @@ public class ClientStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new ClientStore(context, new NullLogger()); client = await store.FindClientByIdAsync(testClient.ClientId, _ct); } @@ -149,7 +148,7 @@ public class ClientStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new ClientStore(context, new NullLogger()); const int timeout = 5000; var task = Task.Run(() => store.FindClientByIdAsync(testClient.ClientId, _ct)); @@ -183,7 +182,7 @@ public class ClientStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new ClientStore(context, new NullLogger()); var clients = new List(); await foreach (var client in store.GetAllClientsAsync(_ct)) @@ -216,7 +215,7 @@ public class ClientStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new ClientStore(context, new NullLogger()); var clients = new List(); await foreach (var client in store.GetAllClientsAsync(_ct)) @@ -258,7 +257,7 @@ public class ClientStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new ClientStore(context, new NullLogger()); var clients = new List(); await foreach (var c in store.GetAllClientsAsync(_ct)) diff --git a/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Storage/Stores/DeviceFlowStoreTests.cs b/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Storage/Stores/DeviceFlowStoreTests.cs index faf07921f..20a0ee0d4 100644 --- a/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Storage/Stores/DeviceFlowStoreTests.cs +++ b/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Storage/Stores/DeviceFlowStoreTests.cs @@ -9,7 +9,6 @@ using Duende.IdentityServer.EntityFramework.Entities; using Duende.IdentityServer.EntityFramework.Options; using Duende.IdentityServer.EntityFramework.Stores; using Duende.IdentityServer.Models; -using Duende.IdentityServer.Services; using Duende.IdentityServer.Stores.Serialization; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.InMemory.Infrastructure.Internal; @@ -45,7 +44,7 @@ public class DeviceFlowStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new DeviceFlowStore(context, new PersistentGrantSerializer(), new NullLogger()); await store.StoreDeviceAuthorizationAsync(deviceCode, userCode, data, _ct); } @@ -73,7 +72,7 @@ public class DeviceFlowStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new DeviceFlowStore(context, new PersistentGrantSerializer(), new NullLogger()); await store.StoreDeviceAuthorizationAsync(deviceCode, userCode, data, _ct); } @@ -122,7 +121,7 @@ public class DeviceFlowStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new DeviceFlowStore(context, new PersistentGrantSerializer(), new NullLogger()); // skip odd behaviour of in-memory provider #pragma warning disable EF1001 // Internal EF Core API usage. @@ -167,7 +166,7 @@ public class DeviceFlowStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new DeviceFlowStore(context, new PersistentGrantSerializer(), new NullLogger()); // skip odd behaviour of in-memory provider #pragma warning disable EF1001 // Internal EF Core API usage. @@ -215,7 +214,7 @@ public class DeviceFlowStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new DeviceFlowStore(context, new PersistentGrantSerializer(), new NullLogger()); code = await store.FindByUserCodeAsync(testUserCode, _ct); } @@ -236,7 +235,7 @@ public class DeviceFlowStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new DeviceFlowStore(context, new PersistentGrantSerializer(), new NullLogger()); var code = await store.FindByUserCodeAsync($"user_{Guid.NewGuid().ToString()}", _ct); code.ShouldBeNull(); } @@ -277,7 +276,7 @@ public class DeviceFlowStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new DeviceFlowStore(context, new PersistentGrantSerializer(), new NullLogger()); code = await store.FindByDeviceCodeAsync(testDeviceCode, _ct); } @@ -297,7 +296,7 @@ public class DeviceFlowStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new DeviceFlowStore(context, new PersistentGrantSerializer(), new NullLogger()); var code = await store.FindByDeviceCodeAsync($"device_{Guid.NewGuid().ToString()}", _ct); code.ShouldBeNull(); } @@ -347,7 +346,7 @@ public class DeviceFlowStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new DeviceFlowStore(context, new PersistentGrantSerializer(), new NullLogger()); await store.UpdateByUserCodeAsync(testUserCode, authorizedDeviceCode, _ct); } @@ -410,7 +409,7 @@ public class DeviceFlowStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new DeviceFlowStore(context, new PersistentGrantSerializer(), new NullLogger()); await store.RemoveByDeviceCodeAsync(testDeviceCode, _ct); } @@ -424,7 +423,7 @@ public class DeviceFlowStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new DeviceFlowStore(context, new PersistentGrantSerializer(), new NullLogger()); await store.RemoveByDeviceCodeAsync($"device_{Guid.NewGuid().ToString()}", _ct); } } diff --git a/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Storage/Stores/IdentityProviderStoreTests.cs b/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Storage/Stores/IdentityProviderStoreTests.cs index e3a0bf3c3..020d8a255 100644 --- a/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Storage/Stores/IdentityProviderStoreTests.cs +++ b/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Storage/Stores/IdentityProviderStoreTests.cs @@ -7,7 +7,6 @@ using Duende.IdentityServer.EntityFramework.Mappers; using Duende.IdentityServer.EntityFramework.Options; using Duende.IdentityServer.EntityFramework.Stores; using Duende.IdentityServer.Models; -using Duende.IdentityServer.Services; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging.Abstractions; @@ -44,7 +43,7 @@ public class IdentityProviderStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new IdentityProviderStore(context, new NullLogger()); var item = await store.GetBySchemeAsync("scheme1", _ct); item.ShouldNotBeNull(); @@ -68,7 +67,7 @@ public class IdentityProviderStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new IdentityProviderStore(context, new NullLogger()); var item = await store.GetBySchemeAsync("scheme2", _ct); item.ShouldBeNull(); @@ -91,7 +90,7 @@ public class IdentityProviderStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new IdentityProviderStore(context, new NullLogger()); var item = await store.GetBySchemeAsync("scheme3", _ct); item.ShouldBeNull(); diff --git a/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Storage/Stores/PersistedGrantStoreTests.cs b/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Storage/Stores/PersistedGrantStoreTests.cs index b2e92c8ed..2e63b18b5 100644 --- a/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Storage/Stores/PersistedGrantStoreTests.cs +++ b/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Storage/Stores/PersistedGrantStoreTests.cs @@ -7,7 +7,6 @@ using Duende.IdentityServer.EntityFramework.Mappers; using Duende.IdentityServer.EntityFramework.Options; using Duende.IdentityServer.EntityFramework.Stores; using Duende.IdentityServer.Models; -using Duende.IdentityServer.Services; using Duende.IdentityServer.Stores; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging.Abstractions; @@ -46,7 +45,7 @@ public class PersistedGrantStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new PersistedGrantStore(context, new NullLogger()); await store.StoreAsync(persistedGrant, _ct); } @@ -71,7 +70,7 @@ public class PersistedGrantStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new PersistedGrantStore(context, new NullLogger()); foundPersistedGrant = await store.GetAsync(persistedGrant.Key, _ct); } @@ -92,7 +91,7 @@ public class PersistedGrantStoreTests : IntegrationTest foundPersistedGrants; await using (var context = new PersistedGrantDbContext(options)) { - var store = new PersistedGrantStore(context, new NullLogger(), new NoneCancellationTokenProvider()); + var store = new PersistedGrantStore(context, new NullLogger()); foundPersistedGrants = (await store.GetAllAsync(new PersistedGrantFilter { SubjectId = persistedGrant.SubjectId }, _ct)).ToList(); } @@ -121,7 +120,7 @@ public class PersistedGrantStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new PersistedGrantStore(context, new NullLogger()); (await store.GetAllAsync(new PersistedGrantFilter { @@ -193,7 +192,7 @@ public class PersistedGrantStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new PersistedGrantStore(context, new NullLogger()); await store.RemoveAsync(persistedGrant.Key, _ct); } @@ -217,7 +216,7 @@ public class PersistedGrantStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new PersistedGrantStore(context, new NullLogger()); await store.RemoveAllAsync(new PersistedGrantFilter { SubjectId = persistedGrant.SubjectId, @@ -245,7 +244,7 @@ public class PersistedGrantStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new PersistedGrantStore(context, new NullLogger()); await store.RemoveAllAsync(new PersistedGrantFilter { SubjectId = persistedGrant.SubjectId, @@ -287,7 +286,7 @@ public class PersistedGrantStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new PersistedGrantStore(context, new NullLogger()); await store.RemoveAllAsync(new PersistedGrantFilter { @@ -299,7 +298,7 @@ public class PersistedGrantStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new PersistedGrantStore(context, new NullLogger()); await store.RemoveAllAsync(new PersistedGrantFilter { @@ -311,7 +310,7 @@ public class PersistedGrantStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new PersistedGrantStore(context, new NullLogger()); await store.RemoveAllAsync(new PersistedGrantFilter { @@ -324,7 +323,7 @@ public class PersistedGrantStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new PersistedGrantStore(context, new NullLogger()); await store.RemoveAllAsync(new PersistedGrantFilter { @@ -337,7 +336,7 @@ public class PersistedGrantStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new PersistedGrantStore(context, new NullLogger()); await store.RemoveAllAsync(new PersistedGrantFilter { @@ -350,7 +349,7 @@ public class PersistedGrantStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new PersistedGrantStore(context, new NullLogger()); await store.RemoveAllAsync(new PersistedGrantFilter { @@ -363,7 +362,7 @@ public class PersistedGrantStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new PersistedGrantStore(context, new NullLogger()); await store.RemoveAllAsync(new PersistedGrantFilter { @@ -377,7 +376,7 @@ public class PersistedGrantStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new PersistedGrantStore(context, new NullLogger()); await store.RemoveAllAsync(new PersistedGrantFilter { @@ -391,7 +390,7 @@ public class PersistedGrantStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new PersistedGrantStore(context, new NullLogger()); await store.RemoveAllAsync(new PersistedGrantFilter { @@ -406,7 +405,7 @@ public class PersistedGrantStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new PersistedGrantStore(context, new NullLogger()); await store.RemoveAllAsync(new PersistedGrantFilter { @@ -432,7 +431,7 @@ public class PersistedGrantStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new PersistedGrantStore(context, new NullLogger()); await store.StoreAsync(persistedGrant, _ct); } @@ -457,7 +456,7 @@ public class PersistedGrantStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new PersistedGrantStore(context, new NullLogger()); persistedGrant.Expiration = newDate; await store.StoreAsync(persistedGrant, _ct); } diff --git a/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Storage/Stores/ResourceStoreTests.cs b/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Storage/Stores/ResourceStoreTests.cs index 4ab8b0566..8b60a1a98 100644 --- a/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Storage/Stores/ResourceStoreTests.cs +++ b/identity-server/test/IdentityServer.IntegrationTests/EntityFramework/Storage/Stores/ResourceStoreTests.cs @@ -8,7 +8,6 @@ using Duende.IdentityServer.EntityFramework.Mappers; using Duende.IdentityServer.EntityFramework.Options; using Duende.IdentityServer.EntityFramework.Stores; using Duende.IdentityServer.Models; -using Duende.IdentityServer.Services; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging.Abstractions; @@ -77,7 +76,7 @@ public class ScopeStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new ResourceStore(context, new NullLogger()); foundResource = (await store.FindApiResourcesByNameAsync(new[] { resource.Name }, _ct)).SingleOrDefault(); } @@ -106,7 +105,7 @@ public class ScopeStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new ResourceStore(context, new NullLogger()); foundResource = (await store.FindApiResourcesByNameAsync(new[] { resource.Name }, _ct)).SingleOrDefault(); } @@ -138,7 +137,7 @@ public class ScopeStoreTests : IntegrationTest resources; await using (var context = new ConfigurationDbContext(options)) { - var store = new ResourceStore(context, new NullLogger(), new NoneCancellationTokenProvider()); + var store = new ResourceStore(context, new NullLogger()); resources = await store.FindApiResourcesByScopeNameAsync(new List { testApiScope.Name @@ -172,7 +171,7 @@ public class ScopeStoreTests : IntegrationTest resources; await using (var context = new ConfigurationDbContext(options)) { - var store = new ResourceStore(context, new NullLogger(), new NoneCancellationTokenProvider()); + var store = new ResourceStore(context, new NullLogger()); resources = await store.FindApiResourcesByScopeNameAsync(new[] { testApiScope.Name }, _ct); } @@ -195,7 +194,7 @@ public class ScopeStoreTests : IntegrationTest resources; await using (var context = new ConfigurationDbContext(options)) { - var store = new ResourceStore(context, new NullLogger(), new NoneCancellationTokenProvider()); + var store = new ResourceStore(context, new NullLogger()); resources = (await store.FindIdentityResourcesByScopeNameAsync(new List { resource.Name @@ -226,7 +225,7 @@ public class ScopeStoreTests : IntegrationTest resources; await using (var context = new ConfigurationDbContext(options)) { - var store = new ResourceStore(context, new NullLogger(), new NoneCancellationTokenProvider()); + var store = new ResourceStore(context, new NullLogger()); resources = (await store.FindIdentityResourcesByScopeNameAsync(new List { resource.Name @@ -252,7 +251,7 @@ public class ScopeStoreTests : IntegrationTest resources; await using (var context = new ConfigurationDbContext(options)) { - var store = new ResourceStore(context, new NullLogger(), new NoneCancellationTokenProvider()); + var store = new ResourceStore(context, new NullLogger()); resources = (await store.FindApiScopesByNameAsync(new List { resource.Name @@ -283,7 +282,7 @@ public class ScopeStoreTests : IntegrationTest resources; await using (var context = new ConfigurationDbContext(options)) { - var store = new ResourceStore(context, new NullLogger(), new NoneCancellationTokenProvider()); + var store = new ResourceStore(context, new NullLogger()); resources = (await store.FindApiScopesByNameAsync(new List { resource.Name @@ -330,7 +329,7 @@ public class ScopeStoreTests : IntegrationTest(), new NoneCancellationTokenProvider()); + var store = new ResourceStore(context, new NullLogger()); resources = await store.GetAllResourcesAsync(_ct); } diff --git a/identity-server/test/IdentityServer.IntegrationTests/TestHosts/ConfigurationHost.cs b/identity-server/test/IdentityServer.IntegrationTests/TestHosts/ConfigurationHost.cs index 145a82130..ff7da4e57 100644 --- a/identity-server/test/IdentityServer.IntegrationTests/TestHosts/ConfigurationHost.cs +++ b/identity-server/test/IdentityServer.IntegrationTests/TestHosts/ConfigurationHost.cs @@ -6,9 +6,7 @@ using Duende.IdentityServer.Configuration; using Duende.IdentityServer.Configuration.EntityFramework; using Duende.IdentityServer.EntityFramework.Options; using Duende.IdentityServer.EntityFramework.Storage; -using Duende.IdentityServer.IntegrationTests.Common; using Duende.IdentityServer.IntegrationTests.TestFramework; -using Duende.IdentityServer.Services; using Microsoft.AspNetCore.Builder; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Storage; @@ -32,8 +30,6 @@ public class ConfigurationHost : GenericHost services.AddRouting(); services.AddAuthorization(); - services.AddSingleton(); - services.AddIdentityServerConfiguration(opt => { diff --git a/identity-server/test/IdentityServer.UnitTests/Validation/Setup/Factory.cs b/identity-server/test/IdentityServer.UnitTests/Validation/Setup/Factory.cs index 81369918a..69b5f623b 100644 --- a/identity-server/test/IdentityServer.UnitTests/Validation/Setup/Factory.cs +++ b/identity-server/test/IdentityServer.UnitTests/Validation/Setup/Factory.cs @@ -285,7 +285,7 @@ internal static class Factory new LoggerFactory().CreateLogger()); jwtRequestUriHttpClient ??= new DefaultJwtRequestUriHttpClient( new HttpClient(new NetworkHandler(new Exception("no jwt request uri response configured"))), options, - new LoggerFactory(), new NoneCancellationTokenProvider()); + new LoggerFactory()); pushedAuthorizationService ??= new TestPushedAuthorizationService(); options ??= TestIdentityServerOptions.Create();