Too many ISystemClock definitions #16844
Labels
area-auth
Includes: Authn, Authz, OAuth, OIDC, Bearer
area-middleware
Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware
clean-up
This issue is internal clean-up and has no effect on public APIs or expected behaviors
feature-platform
Deprecated: Cross-cutting issues related to ASP.NET Core as a platform
Milestone
The
ISystemClock
defines a way to get the current time in UTC timezone, and it has a simple implementation:The interface exists in:
Microsoft.AspNetCore.Authentication
Microsoft.AspNetCore.ResponseCaching
Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure
Microsoft.Extensions.Internal
There is a small difference exists between implementations, but in most cases it can be moved out. In case of Kestrel's clock which has a specific logic inside, there could be made a new interface
IScopedSystemClock
which will provide the scope start time asUtcNow
does now. Therefore, looks like all of them could be merged into a single class/interface and put intoMicrosoft.Extensions.Primitives
.The text was updated successfully, but these errors were encountered: