Skip to content

Commit 2199481

Browse files
authored
Merge pull request #292 from k-wall/enable-sasl-v1
feat: Allow SASL handshake version to be influenced from config
2 parents 88511b9 + 99a05b1 commit 2199481

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

cmd/kaf/kaf.go

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ func getConfig() (saramaConfig *sarama.Config) {
4040
saramaConfig.Net.SASL.User = cluster.SASL.Username
4141
saramaConfig.Net.SASL.Password = cluster.SASL.Password
4242
}
43+
saramaConfig.Net.SASL.Version = cluster.SASL.Version
4344
}
4445
if cluster.TLS != nil && cluster.SecurityProtocol != "SASL_SSL" {
4546
saramaConfig.Net.TLS.Enable = true

examples/sasl_v1_handshake.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
clusters:
2+
- name: test
3+
brokers:
4+
- localhost:9092
5+
SASL:
6+
mechanism: PLAIN
7+
username: admin
8+
password: mypasswordisnotsosimple
9+
version: 1

pkg/config/config.go

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type SASL struct {
1717
ClientSecret string `yaml:"clientSecret"`
1818
TokenURL string `yaml:"tokenURL"`
1919
Token string `yaml:"token"`
20+
Version int16 `yaml:"version"`
2021
}
2122

2223
type TLS struct {

0 commit comments

Comments
 (0)