Skip to content
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

Use TimeProvider #2071

Merged
merged 30 commits into from May 12, 2024
Merged

Use TimeProvider #2071

merged 30 commits into from May 12, 2024

Conversation

trejjam
Copy link
Contributor

@trejjam trejjam commented May 10, 2024

Fixes #2069

@trejjam trejjam marked this pull request as ready for review May 10, 2024 11:24
Copy link
Member

@kevinchalet kevinchalet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR!

src/OpenIddict.Abstractions/IOptionWithTimeProvider.cs Outdated Show resolved Hide resolved
src/OpenIddict.Client/OpenIddictClientBuilder.cs Outdated Show resolved Hide resolved
src/OpenIddict.Client/OpenIddictClientConfiguration.cs Outdated Show resolved Hide resolved
src/OpenIddict.Client/OpenIddictClientConfiguration.cs Outdated Show resolved Hide resolved
src/OpenIddict.Client/OpenIddictClientOptions.cs Outdated Show resolved Hide resolved
src/OpenIddict.Validation/OpenIddictValidationOptions.cs Outdated Show resolved Hide resolved
@trejjam trejjam requested a review from kevinchalet May 10, 2024 15:08
Copy link
Member

@kevinchalet kevinchalet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

src/OpenIddict.Client/OpenIddictClientBuilder.cs Outdated Show resolved Hide resolved
src/OpenIddict.Client/OpenIddictClientConfiguration.cs Outdated Show resolved Hide resolved
src/OpenIddict.Client/OpenIddictClientConfiguration.cs Outdated Show resolved Hide resolved
src/OpenIddict.Client/OpenIddictClientHandlers.cs Outdated Show resolved Hide resolved
src/OpenIddict.Server/OpenIddictServerConfiguration.cs Outdated Show resolved Hide resolved
Co-authored-by: Kévin Chalet <kevinchalet@gmail.com>
@trejjam
Copy link
Contributor Author

trejjam commented May 10, 2024

To keep things simple, I changed TimeProvider.GetLocalNow().LocalDateTime to TimeProvider.GetUtcNow().LocalDateTime. It produces the same value. The difference is that DateTimeOffset is always in UTC. Also, it's less weird (for me). I expect that TimeProvider.GetLocalNow().DateTime will return Kind=Local, which is an incorrect assumption.

@trejjam trejjam requested a review from kevinchalet May 10, 2024 17:10
…OpenIddictServerConfiguration and fix inconsistencies
@kevinchalet
Copy link
Member

Looks great! Thanks a lot for this great contribution ❤️

@kevinchalet kevinchalet merged commit 2475ed3 into openiddict:dev May 12, 2024
6 checks passed
@trejjam trejjam deleted the feature/time-provider branch May 12, 2024 15:51
@kevinchalet
Copy link
Member

5.6.0 "nightly builds" including your PR are now available on the MyGet feed. Could you please give 'em a try to confirm this does what you wanted? 😃

@trejjam
Copy link
Contributor Author

trejjam commented May 13, 2024

I would love to, but the issue is that our solution is targeting net7. Migration to net8 is in process but still needs to be done. This PR (without BCL) was a gift for a future me.

I hit the time issue while using BCL package under net7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use TimeProvider
2 participants