Skip to content

Commit

Permalink
Merge pull request #292 from k-wall/enable-sasl-v1
Browse files Browse the repository at this point in the history
feat: Allow SASL handshake version to be influenced from config
  • Loading branch information
birdayz authored Dec 27, 2023
2 parents 88511b9 + 99a05b1 commit 2199481
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/kaf/kaf.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func getConfig() (saramaConfig *sarama.Config) {
saramaConfig.Net.SASL.User = cluster.SASL.Username
saramaConfig.Net.SASL.Password = cluster.SASL.Password
}
saramaConfig.Net.SASL.Version = cluster.SASL.Version
}
if cluster.TLS != nil && cluster.SecurityProtocol != "SASL_SSL" {
saramaConfig.Net.TLS.Enable = true
Expand Down
9 changes: 9 additions & 0 deletions examples/sasl_v1_handshake.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
clusters:
- name: test
brokers:
- localhost:9092
SASL:
mechanism: PLAIN
username: admin
password: mypasswordisnotsosimple
version: 1
1 change: 1 addition & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type SASL struct {
ClientSecret string `yaml:"clientSecret"`
TokenURL string `yaml:"tokenURL"`
Token string `yaml:"token"`
Version int16 `yaml:"version"`
}

type TLS struct {
Expand Down

0 comments on commit 2199481

Please sign in to comment.