Add callback to NatsAuthOpts that allows refreshing a Token #712
Conversation
7bf2f6f to
c85fb33
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
0bdb854 to
fb423fb
Compare
This comment was marked as resolved.
This comment was marked as resolved.
|
The most recent options callback I reviewed did supply a URI and a CancellationToken as an argument nats.net/src/NATS.Client.Core/NatsWebSocketOpts.cs Lines 24 to 28 in caa4bef
Sounds like a good idea, a signature could be In Func<Uri, CancellationToken, ValueTask<NatsAuthOpts>? Callback { get; init; } = null;This would have to come with the caveat that a Callback could not return another Or in Func<Uri, CancellationToken, ValueTask<NatsAuthOpts>? AuthOptsCallback { get; init; } = null;Could also be a slipper slope though, what other options could be updated between reconnects? And which ones could be updated after knowing the URI that will be connected to? Is it worth putting just the auth ones in now, or coming up with a broader approach to allow for updating all potential options |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
fb423fb to
6080576
Compare
This comment was marked as resolved.
This comment was marked as resolved.
6080576 to
8851ab5
Compare
8851ab5 to
a093653
Compare
caleblloyd
left a comment
There was a problem hiding this comment.
I like how the API turned out!
|
@mtmk at this point, do you have a feeling on how close we are to approval/merging? And as a follow-up, how long can I expect until a new release is cut with these changes? |
|
@garrett-sutton I'd like to allow a few days for others to have a chance to review and comment. All being well, I'd say we can merge and release early next week. |
|
@mtmk sounds good. I'm looking to utilize the new feature in a new project at my org that we're trying to release soon. I just wanted to check in on where we are at. Thanks! |
a093653 to
333c03b
Compare
Add factory methods for NatsAuthCred
333c03b to
5fce728
Compare
Adds the following to
NatsAuthOptsFunc<Uri, CancellationToken, ValueTask<NatsAuthCred>>? AuthCredCallbackThe purpose of this PR is to allow for use cases to refresh a Token, JWT, or NKey associated with their NatsConnection during a reconnect scenario.
resolves #356