feat(kafka): Set and send SASL extensions (#13411)

This commit is contained in:
Joshua Powers 2023-07-14 09:23:59 -06:00 committed by GitHub
parent 0ba463817c
commit d4235ab86b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 7 deletions

View File

@ -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
}

View File

@ -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

View File

@ -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