Skip to content

Commit a2acca8

Browse files
committed
Merge main into dynamo-global-ttl branch - resolve conflicts
2 parents 031a050 + 0ad2ae7 commit a2acca8

File tree

19 files changed

+217
-90
lines changed

19 files changed

+217
-90
lines changed

.build-tools/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
)
1313

1414
require (
15-
github.com/dapr/kit v0.15.3-0.20250717140748-8b780b4d81c5 // indirect
15+
github.com/dapr/kit v0.16.1 // indirect
1616
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
1717
github.com/gogo/protobuf v1.3.2 // indirect
1818
github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 // indirect

.build-tools/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
2-
github.com/dapr/kit v0.15.3-0.20250717140748-8b780b4d81c5 h1:Q26gmPxs6WnnBYoudOlznPHsmrbTawcYEpHg4VoB7v8=
3-
github.com/dapr/kit v0.15.3-0.20250717140748-8b780b4d81c5/go.mod h1:40ZWs5P6xfYf7O59XgwqZkIyDldTIXlhTQhGop8QoSM=
2+
github.com/dapr/kit v0.16.1 h1:MqLAhHVg8trPy2WJChMZFU7ToeondvxcNHYVvMDiVf4=
3+
github.com/dapr/kit v0.16.1/go.mod h1:40ZWs5P6xfYf7O59XgwqZkIyDldTIXlhTQhGop8QoSM=
44
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
55
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
66
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

.github/infrastructure/docker-compose-cassandra.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '2'
22

33
services:
44
cassandra:
5-
image: docker.io/bitnami/cassandra:4.1
5+
image: docker.io/bitnamilegacy/cassandra:4.1
66
ports:
77
- '7000:7000'
88
- '9042:9042'

common/component/kafka/clients.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ func (k *Kafka) latestClients() (*clients, error) {
2222

2323
// case 1: use aws clients with refreshable tokens in the cfg
2424
case k.awsConfig != nil:
25+
if k.clients != nil {
26+
return k.clients, nil
27+
}
28+
2529
awsKafkaOpts := KafkaOptions{
2630
Config: k.config,
2731
ConsumerGroup: k.consumerGroup,
@@ -34,10 +38,12 @@ func (k *Kafka) latestClients() (*clients, error) {
3438
if err != nil {
3539
return nil, fmt.Errorf("failed to get AWS IAM Kafka clients: %w", err)
3640
}
37-
return &clients{
41+
42+
k.clients = &clients{
3843
consumerGroup: awsKafkaClients.ConsumerGroup,
3944
producer: awsKafkaClients.Producer,
40-
}, nil
45+
}
46+
return k.clients, nil
4147

4248
// case 2: normal static auth profile clients
4349
default:

common/component/kafka/kafka.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,12 +295,16 @@ func (k *Kafka) ValidateAWS(metadata map[string]string) (awsAuth.Options, error)
295295
}
296296

297297
return awsAuth.Options{
298+
Logger: k.logger,
298299
Region: region,
299300
AccessKey: accessKey,
300301
SecretKey: secretKey,
301302
AssumeRoleArn: role,
302303
AssumeRoleSessionName: session,
303304
SessionToken: token,
305+
TrustAnchorArn: metadata["trustAnchorArn"],
306+
TrustProfileArn: metadata["trustProfileArn"],
307+
Properties: metadata,
304308
}, nil
305309
}
306310

common/component/kafka/kafka_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,14 @@ func TestValidateAWS(t *testing.T) {
520520
AssumeRoleArn: "testRoleArn",
521521
AssumeRoleSessionName: "testSessionName",
522522
SessionToken: "testSessionToken",
523+
Properties: map[string]string{
524+
"region": "us-east-1",
525+
"accessKey": "testAccessKey",
526+
"secretKey": "testSecretKey",
527+
"assumeRoleArn": "testRoleArn",
528+
"sessionName": "testSessionName",
529+
"sessionToken": "testSessionToken",
530+
},
523531
},
524532
err: nil,
525533
},
@@ -540,6 +548,14 @@ func TestValidateAWS(t *testing.T) {
540548
AssumeRoleArn: "awsRoleArn",
541549
AssumeRoleSessionName: "awsSessionName",
542550
SessionToken: "awsSessionToken",
551+
Properties: map[string]string{
552+
"awsRegion": "us-west-2",
553+
"awsAccessKey": "awsAccessKey",
554+
"awsSecretKey": "awsSecretKey",
555+
"awsIamRoleArn": "awsRoleArn",
556+
"awsStsSessionName": "awsSessionName",
557+
"awsSessionToken": "awsSessionToken",
558+
},
543559
},
544560
err: nil,
545561
},

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ require (
6464
github.com/cloudwego/kitex-examples v0.1.1
6565
github.com/cyphar/filepath-securejoin v0.2.4
6666
github.com/dancannon/gorethink v4.0.0+incompatible
67-
github.com/dapr/kit v0.15.3-0.20250717140748-8b780b4d81c5
67+
github.com/dapr/kit v0.16.1
6868
github.com/didip/tollbooth/v7 v7.0.1
6969
github.com/eclipse/paho.mqtt.golang v1.4.3
7070
github.com/fasthttp-contrib/sessions v0.0.0-20160905201309-74f6ac73d5d5

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,8 @@ github.com/dancannon/gorethink v4.0.0+incompatible h1:KFV7Gha3AuqT+gr0B/eKvGhbjm
516516
github.com/dancannon/gorethink v4.0.0+incompatible/go.mod h1:BLvkat9KmZc1efyYwhz3WnybhRZtgF1K929FD8z1avU=
517517
github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0=
518518
github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0=
519-
github.com/dapr/kit v0.15.3-0.20250717140748-8b780b4d81c5 h1:Q26gmPxs6WnnBYoudOlznPHsmrbTawcYEpHg4VoB7v8=
520-
github.com/dapr/kit v0.15.3-0.20250717140748-8b780b4d81c5/go.mod h1:40ZWs5P6xfYf7O59XgwqZkIyDldTIXlhTQhGop8QoSM=
519+
github.com/dapr/kit v0.16.1 h1:MqLAhHVg8trPy2WJChMZFU7ToeondvxcNHYVvMDiVf4=
520+
github.com/dapr/kit v0.16.1/go.mod h1:40ZWs5P6xfYf7O59XgwqZkIyDldTIXlhTQhGop8QoSM=
521521
github.com/dave/jennifer v1.4.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg=
522522
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
523523
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

secretstores/aws/secretmanager/secretmanager.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/dapr/components-contrib/metadata"
2626
"github.com/dapr/components-contrib/secretstores"
2727
"github.com/dapr/kit/logger"
28+
kitmd "github.com/dapr/kit/metadata"
2829
)
2930

3031
const (
@@ -177,17 +178,11 @@ func (s *smSecretStore) BulkGetSecret(ctx context.Context, req secretstores.Bulk
177178
}
178179

179180
func (s *smSecretStore) getSecretManagerMetadata(spec secretstores.Metadata) (*SecretManagerMetaData, error) {
180-
b, err := json.Marshal(spec.Properties)
181-
if err != nil {
182-
return nil, err
183-
}
184-
185181
var meta SecretManagerMetaData
186-
err = json.Unmarshal(b, &meta)
182+
err := kitmd.DecodeMetadata(spec.Properties, &meta)
187183
if err != nil {
188184
return nil, err
189185
}
190-
191186
return &meta, nil
192187
}
193188

secretstores/aws/secretmanager/secretmanager_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,3 +499,23 @@ func TestGetFeatures(t *testing.T) {
499499
assert.Empty(t, f)
500500
})
501501
}
502+
503+
func TestGetSecretManagerMetadata(t *testing.T) {
504+
s := &smSecretStore{
505+
logger: logger.NewLogger("test"),
506+
}
507+
508+
t.Run("parse multipleKeyValuesPerSecret as string", func(t *testing.T) {
509+
metadata := secretstores.Metadata{}
510+
metadata.Properties = map[string]string{
511+
"region": "us-east-1",
512+
"accessKey": "test",
513+
"secretKey": "test",
514+
"multipleKeyValuesPerSecret": "true",
515+
}
516+
517+
meta, err := s.getSecretManagerMetadata(metadata)
518+
require.NoError(t, err)
519+
assert.True(t, meta.MultipleKeyValuesPerSecret)
520+
})
521+
}

0 commit comments

Comments
 (0)