-
-
Notifications
You must be signed in to change notification settings - Fork 120
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
Oauthbearer token refresh callback #410
Oauthbearer token refresh callback #410
Conversation
This PR will trigger the callback but it lacks ref https://github.com/confluentinc/librdkafka/blob/master/src/rdkafka.h#L2191 That said, nice start :) |
Ok, added bindings for set_token, set_token_failure. Checking for understanding:
|
You got it right.
This is already implemented in waterdrop and karafka, so no changes needed (aside from a high-level API but that I will do). |
@kdhfred I've added the Bindings and am working on testing out this feature against AWS MSK. I created some code to generate the tokens, modeling it after how Python is creating credentials. Haven't had any luck yet.
|
@bruce-szalwinski-he do you need my assistance with this? |
I've been trying to get a system test working. I need Ruby to create a valid pre-signed URL and I'm stuck. I've been able to create producers in both Python and in Go and they have no trouble creating pre-signed urls. I've fired up an EC2 box where I have a Ruby script that creates pre-signed URL and I feed it to the Python and Go programs and they both fail with some version of
I've had Go create a pre-signed URL and I feed it to Python and that works fine. I posted the script and a question over at aws/aws-sdk-ruby#2985. |
Ok, got my pre-signed url working. Now to plug that logic into system test and see if rdkafka-ruby in ecs will publish to kafka. |
I think I'm not understanding this part:
The arguments that are passed to the callbacks are defined by librdkafka, correct? I believe the oauth refresh callback is governed by https://github.com/confluentinc/librdkafka/blob/master/src/rdkafka.h#L2241, with is going to return the client, config, and opaque. Adding another arg to the callback
Results in crash reports. So perhaps you meant something else?
|
@mensfeld thanks for the chat today. I think this is ready now. I left you a few questions about docs. |
I can't repro the failure for 3.1
|
@bruce-szalwinski-he this error is due to lack of correct shutdown of rdkafka. I will take a look. It's something introduced within this code. |
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.
ptrs are not closed
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.
One last thing I do not understand: why extensions * 2
…om/bruce-szalwinski-he/rdkafka-ruby into oauthbearer_token_refresh_callback
Took a stab at adding support for the oauth bearer token refresh callback. For a system test, I built a small ruby script, put it in a container, ran the container in ECS. I can see that the callback is being called. It is not clear what actions the callback is supposed to perform. For python, the MskAuthTokenProvider.generate_auth_token function creates a base64 encoded signed url and the kafka-python library uses that to make an authentication request. Meaning that for python, using the
OAUTHBEARER
sasl mechanism looks like:For Ruby, so far this looks like:
The
token_callback
currently creates a base64 urlencoded signed v4 url, but I can't tell that anything in rdkafka uses that to make an authentication request. Is the callback supposed to implement the authentication request as well?Closes #406
Mentioned in: karafka/karafka#1767