saslHandshake sends the SASL handshake message. This will determine whether the Mechanism is supported by the cluster. If it's not, this function will error out with UnsupportedSASLMechanism. If the mechanism is unsupported, the handshake request will reply with the list of the cluster's configur
(pc *protocol.Conn, mechanism string)
| 1329 | // |
| 1330 | // See http://kafka.apache.org/protocol.html#The_Messages_SaslHandshake |
| 1331 | func saslHandshakeRoundTrip(pc *protocol.Conn, mechanism string) error { |
| 1332 | msg, err := pc.RoundTrip(&saslhandshake.Request{ |
| 1333 | Mechanism: mechanism, |
| 1334 | }) |
| 1335 | if err != nil { |
| 1336 | return err |
| 1337 | } |
| 1338 | res := msg.(*saslhandshake.Response) |
| 1339 | if res.ErrorCode != 0 { |
| 1340 | err = Error(res.ErrorCode) |
| 1341 | } |
| 1342 | return err |
| 1343 | } |
| 1344 | |
| 1345 | // saslAuthenticate sends the SASL authenticate message. This function must |
| 1346 | // be immediately preceded by a successful saslHandshake. |
no test coverage detected