-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat: add SASLv1 support for Kerberos #3279
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
Conversation
puellanivis
left a comment
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.
Understanding this is a draft. I mean, it all looks pretty good so far. I think all I commented on was style things. 😂
gssapi_kerberos.go
Outdated
| } | ||
|
|
||
| // AuthorizeV2 performs the SASL v2 GSSAPI authentication with the Kafka broker. | ||
| func (krbAuth *GSSAPIKerberosAuth) AuthorizeV2(broker *Broker, authSendReceiver func(authBytes []byte) (*SaslAuthenticateResponse, error)) error { |
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’m not sure how I feel about passing in a fairly arbitrary function here.
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.
Yeah as you've probably seen, this is mimicking what the other b.sendAndReceiveSASLFoo funcs currently accept and use and was just the simplest way to get a V2 flow working
For some reason we were still pinning the old v0 SASL when using GSSAPI and this doesn't work if an ApiVersionsRequest is sent before the auth flow. Add support for sending the krb5 bytes in the v1 SASL SaslAuthenticate protocol wrapping. Signed-off-by: Dominic Evans <[email protected]>
Signed-off-by: Dominic Evans <[email protected]>
Signed-off-by: Dominic Evans <[email protected]>
Use the simpler parameter name consistently. Also re-order params for initSecContext Signed-off-by: Dominic Evans <[email protected]>
Also use consistent func doc comment format Signed-off-by: Dominic Evans <[email protected]>
For some reason we were still pinning the old v0 SASL when using GSSAPI and this doesn't work if an ApiVersionsRequest is sent before the auth flow.
Add support for sending the krb5 bytes in the v1 SASL SaslAuthenticate protocol wrapping.
Note: this is just a draft for now as although it is tested and working against a GSSAPI enabled cluster, the underlying code is very much a copy-and-paste of the existing v0 auth flow, just wrappering the bytes in the SaslAuthenticate rather than sending them to the broker directly. This needs more work to tidyup the implementation