Skip to content

Conversation

cb-freddysart
Copy link
Contributor

No description provided.

Copy link

@jcunhafonte jcunhafonte left a comment

Choose a reason for hiding this comment

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

Great PR! I have been waiting for this PR for a while now. ❤️

Copy link
Owner

@arnaud-lb arnaud-lb left a comment

Choose a reason for hiding this comment

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

Thank you! LGTM appart from a few comments

conf.c Outdated

Z_ADDREF_P(&fci.function_name);

if (conf->cbs.log) {
Copy link
Owner

Choose a reason for hiding this comment

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

Should be conf->cbs.oauthbearer_token_refresh

conf.c Outdated
Comment on lines 741 to 744
#ifndef HAS_RD_KAFKA_OAUTHBEARER_TOKEN_REFRESH_CB
zend_throw_exception_ex(NULL, 0, "This version of rdkafka does not support the OAUTHBEARER sasl mechanism");
return;
#endif
Copy link
Owner

Choose a reason for hiding this comment

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

Please change this so that the setOauthbearerTokenRefreshCb method does not exist if HAS_RD_KAFKA_OAUTHBEARER_TOKEN_REFRESH_CB is not defined.

(stub files also support #ifdef)

@cb-freddysart
Copy link
Contributor Author

Thank you for the speedy review @arnaud-lb ! I'm a bit new to PHP extensions but I believe I've addressed your current round of feedback.

Also, sorry for not providing a summary. You beat me to the punch.

My goal here is to add support for OAUTHBEARER in such a way that we will be able to connect to AWS MSK with this library and I believe this PR is only half of that story.

The other half is adding support for rd_kafka_oauthbearer_set_token and rd_kafka_oauthbearer_set_token_failure (see https://github.com/confluentinc/librdkafka/blob/master/src/rdkafka.h#L2207-L2209). Would you be open to adding these methods as well? I would either open a separate PR or add them here and reorganize the commits to make review easier. Whichever works for you.

@arnaud-lb
Copy link
Owner

Nice work, thank you!

I'm generally open to adding any method provided by librdkafka. Please do so in a separate PR, as this will simplify reviews (maybe just one PR for the two methods, as they are very related).

@arnaud-lb arnaud-lb merged commit bcd5004 into arnaud-lb:6.x Jan 5, 2024
@Rastusik
Copy link
Contributor

hey @arnaud-lb is there any plan to integrate the oauthbearer token refresh also in the high level consumer/producer?

@arnaud-lb
Copy link
Owner

Hey @Rastusik

I do not plan to implement this, but I would gladly accept contributions.

@Rastusik
Copy link
Contributor

Thanks for the info. I think someone is already considering working on it #580 ... I can think about the implementation if I will be forced to use IAM in MSK, but I think the easier way for now would be to just use PLAIN mechanism.

@bdurkovic
Copy link

I think someone is already considering working on it

I'd consider it gladly, but C isn't part of my toolkit unfortunately. However knowing what I know now, I'd tag the ticket as a "feature" rather than a "bug".

@Rastusik
Copy link
Contributor

@bdurkovic I'm already working on it 6.x...Rastusik:php-rdkafka:oauthbearer_hlc ... but it still needs some polishing

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants