-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
area-authIncludes: Authn, Authz, OAuth, OIDC, BearerIncludes: Authn, Authz, OAuth, OIDC, Bearerarea-middlewareIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresclean-upThis issue is internal clean-up and has no effect on public APIs or expected behaviorsThis issue is internal clean-up and has no effect on public APIs or expected behaviorsfeature-platformDeprecated: Cross-cutting issues related to ASP.NET Core as a platformDeprecated: Cross-cutting issues related to ASP.NET Core as a platform
Milestone
Description
The ISystemClock
defines a way to get the current time in UTC timezone, and it has a simple implementation:
public interface ISystemClock
{
DateTimeOffset UtcNow { get; }
}
public interface SystemClock : ISystemClock
{
public DateTimeOffset UtcNow => DateTimeOffset.UtcNow;
}
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 as UtcNow
does now. Therefore, looks like all of them could be merged into a single class/interface and put into Microsoft.Extensions.Primitives
.
asleire, AraHaan, yzorg and DmytroHeorhin
Metadata
Metadata
Assignees
Labels
area-authIncludes: Authn, Authz, OAuth, OIDC, BearerIncludes: Authn, Authz, OAuth, OIDC, Bearerarea-middlewareIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresclean-upThis issue is internal clean-up and has no effect on public APIs or expected behaviorsThis issue is internal clean-up and has no effect on public APIs or expected behaviorsfeature-platformDeprecated: Cross-cutting issues related to ASP.NET Core as a platformDeprecated: Cross-cutting issues related to ASP.NET Core as a platform