Skip to content

Commit 4339ef7

Browse files
authored
Merge pull request #303 from carillonator/krbclient-nil-check
Check for nil krbClient with GSSAPI
2 parents ca918ce + 6d3c143 commit 4339ef7

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

docs/reference-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ kafka:
5050
mechanism: "PLAIN"
5151
# GSSAPI / Kerberos config properties
5252
gssapi:
53+
# Required. One of USER_AUTH or KEYTAB_AUTH
5354
authType: ""
5455
keyTabPath: ""
5556
kerberosConfigPath: ""

kafka/client_config_helper.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ func NewKgoConfig(cfg Config, logger *zap.Logger) ([]kgo.Opt, error) {
107107
kerbCfg,
108108
client.DisablePAFXFAST(!cfg.SASL.GSSAPI.EnableFast))
109109
}
110+
if krbClient == nil {
111+
return nil, fmt.Errorf("kafka.sasl.gssapi.authType must be one of USER_AUTH or KEYTAB_AUTH")
112+
}
110113
kerberosMechanism := kerberos.Auth{
111114
Client: krbClient,
112115
Service: cfg.SASL.GSSAPI.ServiceName,

0 commit comments

Comments
 (0)