-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Implement SASL/OAUTHBEARER support #1240
Conversation
This commit implements SASL/OAUTHBEARER client authentication as described in KIP-255.
Working on unit test to improve test coverage |
Make changes according to first round of feedback
Add documentation to OAuthBearerTokenProvider about timeouts
Tweak documentation
Fix type inference
Implement more type inference
@mkaminski1988 PR is looking great now. But you might have to add some more tests for codecoverage to pass. |
Cool, tests in progress. I also mentioned this PR to @rondagostino, who implemented SASL/OAUTHBEARER in Kafka. He said he'll take a look once he gets back from vacation after the new year. |
Makes sense and Thanks a lot for all the work. Very excited for it. |
Clarify token generator docs
Implement unit tests
Fix CI issues
Fix CI issues
Normalize test error format
@rondagostino I've implemented extensions. Couple of questions:
|
@mkaminski1988 Yes, you are correct about the With regard to any extensions that the Java client sends to the broker, it is implementation-dependent whether they are constant across token retrievals. The login callback handler is tasked with retrieving the extensions, and the default is for there to be no extensions if the login callback handler doesn't know how to handle |
@rondagostino Thanks for that explanation. I think for this implementation it would be better to create a new |
Upon further investigation I've decided to make the |
@varun06 This is ready to merge. |
🕺 This is great @mkaminski1988 . I am going to have a look and may be @bai or @jprobinson can also have one more look. This is a big change and thanks a lot of all the work. |
} | ||
|
||
for i, test := range testTable { | ||
|
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.
It may be just the style of the project, but I've noticed there's no use of "sub tests" via the t.Run()
method: https://golang.org/pkg/testing/#T.Run
This would allow users to run individual tests cases within table tests from the CLI and also prevent the need to prefix all Errorf
messages with a test.name
.
Just something to consider.
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.
Good to know about t.Run()
. I think I'll match the style of the project, unless the maintainers would like it otherwise.
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 just called out a few style things but other than that the logic looks solid.
Great work, @mkaminski1988! 🌮!
Thanks for your expertise @jprobinson! |
This is great, would very much like to see this merged. |
@bai What is the strategy to get this merged. It's a big change and might need a release? |
Thanks for getting this done, amazing work! I'm going to merge this one now and will compile changelog and do a release this week. |
My pleasure, thanks for your help everyone! |
Sorry for the noise here, just to clarify: 1.20.1 with deadlock fix is coming up in a moment, this one will go into 1.21. |
@bai Do you have an idea of when the next release will be cut? |
I intend to cut it tomorrow or Friday latest. |
Hello,
This commit implements SASL/OAUTHBEARER client authentication as described in KIP-255 and issue #1223.
To get started, the user must set
c.Net.SASL.Mechanism: OAUTHBEARER
and assign a user-defined token generator toconfig.Net.SASL.TokenProvider
. For backwards compatibility, a blank value forc.Net.SASL.Mechanism
defaults toPLAIN
.Example:
cc @ggrcha