Skip to content
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

Go wrapper for rd_kafka_sasl_set_credentials #879

Merged
merged 10 commits into from
Nov 22, 2022

Conversation

josvisser66
Copy link
Contributor

@josvisser66 josvisser66 commented Oct 27, 2022

This PR adds a Go wrapper for the rd_kafka_sasl_set_credentials call in librdkafka. Not much to it, since all of the hard work (locking etc) is done in the called C function.

Note: At the time of writing the underlying function is being added to librdkafka and might appear there in v1.9.4. This PR should only be merged after the new librdkafka version containing rd_kafka_sasl_set_credentials has been merged into librdkafka_vendor.

See confluentinc/librdkafka#4033

kafka/consumer.go Outdated Show resolved Hide resolved
kafka/kafka.go Outdated Show resolved Hide resolved
kafka/consumer.go Outdated Show resolved Hide resolved
Copy link
Contributor

@edenhill edenhill left a comment

Choose a reason for hiding this comment

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

some minor docstring comments.
This method also needs to be added to the admin client in admin.go

Please also add a line to the CHANGELOG

kafka/consumer.go Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@edenhill edenhill closed this Nov 8, 2022
@edenhill edenhill reopened this Nov 8, 2022
@edenhill
Copy link
Contributor

edenhill commented Nov 8, 2022

close-reopened tro trigger CI

Copy link
Contributor

@edenhill edenhill left a comment

Choose a reason for hiding this comment

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

We would need at least a dry test for this, just to make sure the API doesn't crash.
I recommend adding a call to the end of TestProducerAPIs() with a call to SetSaslCredentials():
https://github.com/confluentinc/confluent-kafka-go/blob/master/kafka/producer_test.go#L182

CHANGELOG.md Outdated

* Added SetSaslCredentials. This new method (on the Producer, Consumer, and
AdminClient) allows modifying the stored SASL PLAIN/SCRAM credentials that
will be used for subsequent (new) connections to a broker.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: weird indent, align with previous line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done and done

Copy link
Contributor

@edenhill edenhill left a comment

Choose a reason for hiding this comment

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

LGTM, thanks Jos!

@edenhill edenhill merged commit e95ebc7 into confluentinc:master Nov 22, 2022
PrasanthV454 pushed a commit that referenced this pull request Jan 12, 2023
* Go wrapper for rd_kafka_sasl_set_credentials

* Fixes after code review

* Fixes after code review

* Better description in CHANGELOG for this change.

* Changes requested through code review
PrasanthV454 pushed a commit that referenced this pull request Mar 17, 2023
* Go wrapper for rd_kafka_sasl_set_credentials

* Fixes after code review

* Fixes after code review

* Better description in CHANGELOG for this change.

* Changes requested through code review
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.

2 participants