-
Notifications
You must be signed in to change notification settings - Fork 789
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
GSSAPI SASL mechanism based on gokrb5/v8 #598
base: main
Are you sure you want to change the base?
Conversation
Posting this comment from my personal account to certify that I am indeed @viasat-akozhevnikov . |
Regarding how I added support for multiple brokers: I added a I did it this way to maintain backwards compatibility as much as possible:
Unfortunately, the combination of these constraints meant that in the GSSAPI mechanism, I had to make the |
func (m mechanism) WithHost(host string) sasl.Mechanism { | ||
m.host = host |
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 am curious if these two lines are obvious enough?
The fact that this returns a copy of the GSSAPI mechanism is implicit in using a non-pointer method receiver, and the reason for it is also left implicit.
I think if I were reading this code it would be obvious, so I didn't want to patronizingly draw attention to it, but I am happy to make this more explicit if desired. For example, I can see some benefits to writing it like this instead:
func (m mechanism) WithHost(host string) sasl.Mechanism { | |
m.host = host | |
func (m *mechanism) WithHost(host string) sasl.Mechanism { | |
// Creating a copy avoids race conditions if the | |
// mechanism is reused for multiple connections: | |
copy := *m | |
copy.host = host |
Hello @viasat-akozhevnikov, thanks for the contribution 👍 I would be happy to merge the extensions you added to the Would you be open to hosting this package yourself and have us include a link to your repository in the documentation? |
By the way, the context-based approach in #725 ended up meeting our needs just as well as the Rebasing the Sorry I never got back to you on this one. The proposal to split it apart and merge only the change to the Ultimately I think it was maybe for the best. At the time when I wrote this I thought the As for maintaining the |
This PR imports While The important one to note here is “and copyright notice”. This requirement comes from the end of the license “How to apply the Apache License to your work”. It states…
The boilerplate is one that we have all likely often seen, without considering its significance. Most importantly it is here where the copyright owner(s) of the code must be specified and where the application of the Apache 2.0 License is actually declared (those GitHub settings mean nothing).
No where in I have opened an issue on |
Good to know and nice catch about the licensing details @robcowart. By the way I'm no longer with Viasat so I can't update this PR or speak to their intentions with it. |
@viasat-akozhevnikov do you still working on this PR? |
@sdojjy nope. Per my last two comments on this issue:
That leaves just the
|
By the way, the legal technicality uncertainty with |
Is there any update? In KEDA we would be interested on this feature. We are integrating kafka-go to replace sarama client and this feature'd be nice |
Do I understand right that it could be merged as soon as the conflicts are solved (as long as the licensing issue seems to be resolved)? I could resolve the merge conflicts and make a new PR. |
This PR implements GSSAPI/Kerberos support.
I previously commented in PR #563 from my personal account (@mentalisttraceur) about how we also implemented GSSAPI/Kerberos support at Viasat and just hadn't yet had time to create the PR yet - this is that PR.
Key differences from PR #563:
Supports Kafka clusters with multiple brokers.
The Kerberos client is dependency-injected and managed externally.
Some of the GSSAPI internals are explained more thoroughly in the code comments.
Supports authenticating with either username+password or keytab file.
I won't take anything personally, so:
If you disagree with something I did or have criticisms/critique/concerns, or want me to change something, feel free to bring it up. For example, if we come up with a better way than dependency-injecting kerberos client objects from
gokrb5
, I'll be happy to implement it.I don't care which GSSAPI/Kerberos PR "wins", I just want to make sure that the end result supports complete functionality that we at Viasat and other typical users might need. For example, if this PR inspires improvements to feat(sasl): add GSSAPI as authentication mechanism #563 to support multiple brokers and username+password as an alternative to keytab, I will be fine if feat(sasl): add GSSAPI as authentication mechanism #563 gets merged instead of this one.
I will post another comment in here later to elaborate on my reasons for some choices I made in this PR, some alternatives I considered, and so on.