oauth2-proxy / oauth2-proxy

A reverse proxy that provides authentication with Google, Azure, OpenID Connect and many more identity providers.
https://oauth2-proxy.github.io/oauth2-proxy
MIT License
9.88k stars 1.6k forks source link

[RFC]: Replace archived clock library for mocking and testing #2840

Open tuunit opened 1 week ago

tuunit commented 1 week ago

Expected Behaviour

We should use a well maintained library for mocking time in tests.

Current Behaviour

The project introduced the https://github.com/benbjohnson/clock library for mocking time in unit tests in PR #1136

With the following goals:

Support a localized clock object to mock time in unit tests without breaking parallel testing support. Also allow mocking time globally to provide inter-package integration tests (this is not safe for parallel tests though).

Unfortunately, the library was discontinued over a year ago and archived: https://github.com/benbjohnson/clock

Solution

We should therefore replace it using the following library: https://github.com/jonboulle/clockwork

Honsei901 commented 1 week ago

Hi @tuunit. I'd like to contribute a bit. Could I work on this one?

tuunit commented 1 week ago

@Honsei901 that would be great! Feel free to go ahead and open a PR for it