Skip to content

Commit 1aa44e9

Browse files
authored
Kafka: fix "awsiam" auth type name (dapr#3286)
Signed-off-by: Fabian Martinez <[email protected]>
1 parent 02c6b21 commit 1aa44e9

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

bindings/kafka/metadata.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ authenticationProfiles:
147147
required: true
148148
description: |
149149
Authentication type.
150-
This must be set to "awsIAM" for this authentication profile.
151-
example: '"awsIAM"'
150+
This must be set to "awsiam" for this authentication profile.
151+
example: '"awsiam"'
152152
allowedValues:
153-
- "awsIAM"
153+
- "awsiam"
154154
- name: awsRegion
155155
type: string
156156
required: true

common/component/kafka/kafka.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ package kafka
1515

1616
import (
1717
"context"
18+
"strings"
1819
"sync"
1920
"time"
2021

@@ -91,7 +92,7 @@ func (k *Kafka) Init(ctx context.Context, metadata map[string]string) error {
9192
return err
9293
}
9394

94-
switch k.authType {
95+
switch strings.ToLower(k.authType) {
9596
case oidcAuthType:
9697
k.logger.Info("Configuring SASL OAuth2/OIDC authentication")
9798
err = updateOidcAuthInfo(config, meta)

common/component/kafka/metadata.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ func (k *Kafka) getKafkaMetadata(meta map[string]string) (*KafkaMetadata, error)
230230
k.logger.Debug("Configuring root certificate authentication.")
231231
case awsIAMAuthType:
232232
if m.AWSRegion == "" {
233-
return nil, errors.New("missing AWS region property 'awsRegion' for authType 'awsIAM'")
233+
return nil, errors.New("missing AWS region property 'awsRegion' for authType 'awsiam'")
234234
}
235235
k.logger.Debug("Configuring AWS IAM authentication.")
236236
default:

pubsub/kafka/metadata.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ authenticationProfiles:
141141
required: true
142142
description: |
143143
Authentication type.
144-
This must be set to "awsIAM" for this authentication profile.
145-
example: '"awsIAM"'
144+
This must be set to "awsiam" for this authentication profile.
145+
example: '"awsiam"'
146146
allowedValues:
147-
- "awsIAM"
147+
- "awsiam"
148148
- name: awsRegion
149149
type: string
150150
required: true

0 commit comments

Comments
 (0)