-
Notifications
You must be signed in to change notification settings - Fork 612
Refactor credential refresh #1649
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is mostly stuff, I noticed when I experimented making the current api async.
I know you're still working on it, but anyway:
@Tornhoof I appreciate you taking a look! |
What @Tornhoof said |
@danielmarbach @MatthiasWerning @Tornhoof - I'm pretty much done with this. I'm going to modify the OAuth2 integration test to include restarting RabbitMQ mid-test, and probably add those annotations to JsonToken. |
@lukebakken before I take a deeper look I'm curious to hear why you didn't go down the route of collapsing the refreshing into the provider similar to how Azure.Identity does it? |
Time constraints. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks a lot better than before :)
Fixes #1639 * Remove all traces of credential refresh from `RabbitMQ.Client` * Add `CredentialsRefresher`, which does not use timers, and calls refresh based on `ValidUntil` * Use `ICredentialsProvider` in the auth mechanisms, async * Pass `CancellationToken` around and correctly dispose Http objects (thanks @Tornhoof) * Use `SemaphoreSlim` * Refresh token at 1/3 the interval value. * Close connection mid-integration test for OAuth2 * Use OAuth2 for EasyNetQ.Management.Client in OAuth2 tests. * Create separate credentials provider for HTTP API requests. * Set RabbitMQ logging to debug for OAuth2 * Use `JsonPropertyName` * Use OAuth2 for HTTP API access. Thanks @MarcialRosales
47b5ce7
to
2018045
Compare
@danielmarbach @Tornhoof @paulomorgado @MatthiasWerning @MarcialRosales I plan on merging this in a few hours to produce another version 7 RC. |
The earliest I can review is probably tomorrow |
Thanks @danielmarbach. I'm going to merge this PR to produce a new RC, but of course I welcome your review. Any changes can be addressed in a follow-up PR. |
Fixes #1639
RabbitMQ.Client
CredentialsRefresher
, which does not use timers, and calls refresh based onValidUntil
Note, there is still a lot of work to get all tests running, but this gives you the idea.
Also, there is a big TODO around integrating these changes with
PlainMechanism
cc @danielmarbach @MatthiasWerning