-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Onboard aspnetcore into the new TimeProvider type from runtime #47472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Not sure if area-infrastructure is the right label for this, but given it is spread across multiple parts of the repo I'll let others triage appropriately. |
I'm interested, but will be busy for a few weeks. |
I think you meant @sebastienros 😄 |
We should also be aware of #13628 when doing this. I don't know if this work will make it easier or harder to convert Kestrel to wall clock (except for the Date header obviously) |
Follow up: |
This comment was marked as duplicate.
This comment was marked as duplicate.
API Review Notes: Proposed APIISystemClock and SystemClock are now obsolete. namespace Microsoft.AspNetCore.Authentication;
+ [Obsolete]
public interface ISystemClock
{
}
+ [Obsolete]
public class SystemClock : ISystemClock
{
} Each auth handler and security token validator is obsoleting the existing constructor and adding a new one without ISystemClock. Their Clock property is now obsolete and replaced by TimeProvider. TimeProvider can now be set via options or via DI (IPostConfigureOptions). public AuthenticationHandler<TOptions>
{
+ [Obsolete]
protected AuthenticationHandler(IOptionsMonitor<TOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock)
+ protected AuthenticationHandler(IOptionsMonitor<TOptions> options, ILoggerFactory logger, UrlEncoder encoder)
+ [Obsolete]
public ISystemClock Clock { get; }
+ public TimeProvider TimeProvider { get; }
}
public AuthenticaitonSchemeOptions
{
+ public TimeProvider? TimeProvider { get; set; }
}
public SecuirtyTokenValidator
{
+ [Obsolete]
public SecurityStampValidator(IOptions<SecurityStampValidatorOptions> options, SignInManager<TUser> signInManager, ISystemClock clock, ILoggerFactory logger)
+ public SecurityStampValidator(IOptions<SecurityStampValidatorOptions> options, SignInManager<TUser> signInManager, ILoggerFactory logger)
+ [Obsolete]
public ISystemClock Clock { get; }
+ public TimeProvider TimeProvider { get; }
}
public SecurityStampValidatorOptions
{
+ public TimeProvider? TimeProvider { get; set; }
}
Updated proposal. |
Why is the property and argument name "time" instead of "timeProvider" |
Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:
|
API Review Notes:
namespace Microsoft.AspNetCore.Authentication;
+ [Obsolete]
public interface ISystemClock
{
}
+ [Obsolete]
public class SystemClock : ISystemClock
{
}
public AuthenticationHandler<TOptions>
{
+ [Obsolete]
protected AuthenticationHandler(IOptionsMonitor<TOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock)
+ protected AuthenticationHandler(IOptionsMonitor<TOptions> options, ILoggerFactory logger, UrlEncoder encoder)
+ [Obsolete]
public ISystemClock Clock { get; }
+ public TimeProvider TimeProvider { get; }
}
public AuthenticaitonSchemeOptions
{
+ public TimeProvider? TimeProvider { get; set; }
}
public SecuirtyTokenValidator
{
+ [Obsolete]
public SecurityStampValidator(IOptions<SecurityStampValidatorOptions> options, SignInManager<TUser> signInManager, ISystemClock clock, ILoggerFactory logger)
+ public SecurityStampValidator(IOptions<SecurityStampValidatorOptions> options, SignInManager<TUser> signInManager, ILoggerFactory logger)
+ [Obsolete]
public ISystemClock Clock { get; }
+ public TimeProvider TimeProvider { get; }
}
public SecurityStampValidatorOptions
{
+ public TimeProvider? TimeProvider { get; set; }
} API Approved as updated! |
Now that TimeProvider has been added to the platform in dotnet/runtime#83604, we should make the following changes in the aspnetcore layer for .NET 8:
cc: @tarekgh @Tratcher @adityamandaleeka @davidfowl @mkArtakMSFT
The text was updated successfully, but these errors were encountered: