Skip to content

Use TimeProvider instead of DateTimeOffset in DataProtectionAPI #57833

Open
@MichaelRomer

Description

@MichaelRomer

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

I am trying to integration test my application which uses the DataProtectionAPI to encrypt user session data. My tests should also cover some time-related aspects. Therefore I am using the TimeProvider and FakeTimeProvider which where introduced with Dotnet8. Unfortunately, the DataProtectionAPI still uses the static DateTimeOffset instead of the new TimeProvider and therefore does not react to time changes in my tests.

Describe the solution you'd like

Replace the DateTimeOffset class with the TimeProvider to determine the current time in the DataProtectionAPI implementation

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions