feat(kafka): Set and send SASL extensions (#13411)
This commit is contained in:
parent
0ba463817c
commit
d4235ab86b
|
|
@ -9,10 +9,11 @@ import (
|
|||
)
|
||||
|
||||
type SASLAuth struct {
|
||||
SASLUsername config.Secret `toml:"sasl_username"`
|
||||
SASLPassword config.Secret `toml:"sasl_password"`
|
||||
SASLMechanism string `toml:"sasl_mechanism"`
|
||||
SASLVersion *int `toml:"sasl_version"`
|
||||
SASLUsername config.Secret `toml:"sasl_username"`
|
||||
SASLPassword config.Secret `toml:"sasl_password"`
|
||||
SASLExtentions map[string]string `toml:"sasl_extensions"`
|
||||
SASLMechanism string `toml:"sasl_mechanism"`
|
||||
SASLVersion *int `toml:"sasl_version"`
|
||||
|
||||
// GSSAPI config
|
||||
SASLGSSAPIServiceName string `toml:"sasl_gssapi_service_name"`
|
||||
|
|
@ -91,7 +92,7 @@ func (k *SASLAuth) Token() (*sarama.AccessToken, error) {
|
|||
defer config.ReleaseSecret(token)
|
||||
return &sarama.AccessToken{
|
||||
Token: string(token),
|
||||
Extensions: map[string]string{},
|
||||
Extensions: k.SASLExtentions,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -170,9 +170,13 @@ to use them.
|
|||
# sasl_gssapi_key_tab_path = ""
|
||||
# sasl_gssapi_disable_pafxfast = false
|
||||
|
||||
## used if sasl_mechanism is OAUTHBEARER
|
||||
## Access token used if sasl_mechanism is OAUTHBEARER
|
||||
# sasl_access_token = ""
|
||||
|
||||
## Arbitrary key value string pairs to pass as a TOML table. For example:
|
||||
# {logicalCluster = "cluster-042", poolId = "pool-027"}
|
||||
# sasl_extensions = {}
|
||||
|
||||
## SASL protocol version. When connecting to Azure EventHub set to 0.
|
||||
# sasl_version = 1
|
||||
|
||||
|
|
|
|||
|
|
@ -144,9 +144,13 @@
|
|||
# sasl_gssapi_key_tab_path = ""
|
||||
# sasl_gssapi_disable_pafxfast = false
|
||||
|
||||
## used if sasl_mechanism is OAUTHBEARER
|
||||
## Access token used if sasl_mechanism is OAUTHBEARER
|
||||
# sasl_access_token = ""
|
||||
|
||||
## Arbitrary key value string pairs to pass as a TOML table. For example:
|
||||
# {logicalCluster = "cluster-042", poolId = "pool-027"}
|
||||
# sasl_extensions = {}
|
||||
|
||||
## SASL protocol version. When connecting to Azure EventHub set to 0.
|
||||
# sasl_version = 1
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue