-
Notifications
You must be signed in to change notification settings - Fork 101
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
Add SASL config properties sugar function to ConsumerSettings
#1226
base: series/3.x
Are you sure you want to change the base?
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.
Thank you for your contribution! 🙇🏽
Just some minor adjustments and the PR is ready to 🚀
@@ -417,6 +425,15 @@ object ConsumerSettings { | |||
override val recordMetadata: ConsumerRecord[K, V] => String, | |||
override val maxPrefetchBatches: Int | |||
) extends ConsumerSettings[F, K, V] { | |||
|
|||
def withPlainSasl(usernameToken: String, passwordToken: String): ConsumerSettings[F, K, V] = |
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.
I've never worked with SASL but from what I can see here in PlainLoginModule
there's no reference to any token.
Why not removing that prefix? 👇🏽
def withPlainSasl(usernameToken: String, passwordToken: String): ConsumerSettings[F, K, V] = | |
def withPlainSasl(username: String, password: String): ConsumerSettings[F, K, V] = |
* provides SASL credentials to Kafka host. A typical use case for this would be | ||
* interacting with Confluent Cloud. |
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.
I feel the second sentence is not needed. A user should be aware of what SASL is at this point (either by reading the docs or because he/she knows what's doing).
* provides SASL credentials to Kafka host. A typical use case for this would be | |
* interacting with Confluent Cloud. | |
* Provides SASL credentials to Kafka host. |
@@ -122,6 +122,23 @@ ConsumerSettings( | |||
.withGroupId("group") | |||
``` | |||
|
|||
### Sasl setting |
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.
### Sasl setting | |
### SASL settings |
<idToken>, | ||
<passwordToken> |
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.
Same here, I don't think mentioning token is needed.
Also, here you are using id
instead of username
. I'd suggest to use the same convention everywhere.
ConsumerSettings
* provides SASL credentials to Kafka host. A typical use case for this would be | ||
* interacting with Confluent Cloud. | ||
*/ | ||
def withPlainSasl(usernameToken: String, passwordToken: String): ConsumerSettings[F, K, V] |
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.
Could this be a new KafkaCredentialStore
rather than being directly on the consumer settings? That would also add support for the producer and admin client.
Adds a sugar function in
ConsumerSettings
for SASL. A primary use case for this newwithPlainSasl
method is when the client needs to authenticate to Kafka hosted in Confluent Cloud.