Merge branch 'master' into postgresql_config_store

This commit is contained in:
Bernd Verst 2022-09-14 16:29:36 -07:00 committed by GitHub
commit 9f7bd5244c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
94 changed files with 2588 additions and 202 deletions

View File

@ -45,6 +45,7 @@ jobs:
- state.mongodb
- state.redis
- state.postgresql
- state.cassandra
- bindings.alicloud.dubbo
- bindings.kafka
- secretstores.local.env
@ -284,7 +285,7 @@ jobs:
name: Notify Total coverage
runs-on: ubuntu-latest
needs: certification
if: always()
if: github.event_name == 'schedule'
steps:
- name: Download Cert Coverage Artifact
uses: actions/download-artifact@v3

View File

@ -58,6 +58,7 @@ jobs:
- pubsub.natsstreaming
- pubsub.pulsar
- pubsub.rabbitmq
- pubsub.redis
- pubsub.kafka-wurstmeister
- pubsub.kafka-confluent
- secretstores.kubernetes

4
go.mod
View File

@ -173,6 +173,8 @@ require (
github.com/multiformats/go-multihash v0.2.1
github.com/nacos-group/nacos-sdk-go/v2 v2.0.1
github.com/rabbitmq/amqp091-go v1.3.4
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.476
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssm v1.0.476
github.com/wapc/wapc-go v0.5.2
go.uber.org/ratelimit v0.2.0
gopkg.in/couchbase/gocb.v1 v1.6.4
@ -420,7 +422,7 @@ require (
github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68 // indirect
github.com/alibabacloud-go/endpoint-util v1.1.0 // indirect
github.com/alibabacloud-go/openapi-util v0.0.10 // indirect
github.com/alibabacloud-go/tea-utils v1.4.3 // indirect
github.com/alibabacloud-go/tea-utils v1.4.3
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect
github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 // indirect
github.com/aliyun/credentials-go v1.1.2 // indirect

4
go.sum
View File

@ -2800,6 +2800,10 @@ github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpP
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I=
github.com/tebeka/strftime v0.1.3/go.mod h1:7wJm3dZlpr4l/oVK0t1HYIc4rMzQ2XJlOMIUJUJH6XQ=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.476 h1:2VOnCo8XYky0o8dEmBUyjyC6pnXM2Xu0hgvVfOQspv8=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.476/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssm v1.0.476 h1:KjkP84yJW8tweRzJlUnJdeAncxdcaajrFkUgVEmnN4k=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssm v1.0.476/go.mod h1:huGvjX9BMaK26Pbfk+0g89VrFxWxokvC3OFrHpZbkWs=
github.com/tetratelabs/wazero v1.0.0-pre.1 h1:bUZ4vf21c36RmgA3enNOlLgPElEVDYoRJJ9+McRGF6Q=
github.com/tetratelabs/wazero v1.0.0-pre.1/go.mod h1:M8UDNECGm/HVjOfq0EOe4QfCY9Les1eq54IChMLETbc=
github.com/tevid/gohamcrest v1.1.1/go.mod h1:3UvtWlqm8j5JbwYZh80D/PVBt0mJ1eJiYgZMibh0H/k=

View File

@ -19,6 +19,7 @@ import (
"github.com/dapr/components-contrib/metadata"
"github.com/dapr/components-contrib/pubsub"
"github.com/dapr/kit/logger"
)
var (
@ -37,12 +38,13 @@ const (
)
type rocketMQMetaData struct {
AccessProto string `mapstructure:"accessProto"`
// rocketmq Credentials
AccessKey string `mapstructure:"accessKey"`
SecretKey string `mapstructure:"secretKey"`
NameServer string `mapstructure:"nameServer"`
// Deprecated: use ProducerGroup instead.
GroupName string `mapstructure:"groupName"`
ProducerGroup string `mapstructure:"producerGroup"`
NameSpace string `mapstructure:"nameSpace"`
// consumer group rocketmq's subscribers
ConsumerGroup string `mapstructure:"consumerGroup"`
@ -53,23 +55,26 @@ type rocketMQMetaData struct {
ContentType string `mapstructure:"content-type"`
// retry times to connect rocketmq's broker
Retries int `mapstructure:"retries"`
// Deprecated: send msg timeout to connect rocketmq's broker, nanoseconds
SendTimeOut int `mapstructure:"sendTimeOut"`
// send msg timeout to connect rocketmq's broker, seconds
SendTimeOutSec int `mapstructure:"sendTimeOutSec"`
}
func getDefaultRocketMQMetaData() *rocketMQMetaData {
return &rocketMQMetaData{
AccessProto: "",
AccessKey: "",
SecretKey: "",
NameServer: "",
GroupName: "",
ProducerGroup: "",
NameSpace: "",
ConsumerGroup: "",
ConsumerBatchSize: 0,
NameServerDomain: "",
ContentType: pubsub.DefaultCloudEventDataContentType,
Retries: 3,
SendTimeOut: 10,
SendTimeOutSec: 60,
}
}
@ -80,7 +85,7 @@ func (s *rocketMQMetaData) Decode(in interface{}) error {
return nil
}
func parseRocketMQMetaData(metadata pubsub.Metadata) (*rocketMQMetaData, error) {
func parseRocketMQMetaData(metadata pubsub.Metadata, logger logger.Logger) (*rocketMQMetaData, error) {
rMetaData := getDefaultRocketMQMetaData()
if metadata.Properties != nil {
err := rMetaData.Decode(metadata.Properties)
@ -88,5 +93,17 @@ func parseRocketMQMetaData(metadata pubsub.Metadata) (*rocketMQMetaData, error)
return nil, fmt.Errorf("rocketmq configuration error: %w", err)
}
}
if rMetaData.GroupName != "" {
logger.Warn("pubsub.rocketmq: metadata property 'groupName' has been deprecated - use 'producerGroup' instead. See: https://docs.dapr.io/reference/components-reference/supported-pubsub/setup-rocketmq/")
}
if rMetaData.SendTimeOut != 0 {
logger.Warn("pubsub.rocketmq: metadata property 'sendTimeOut' has been deprecated - use 'sendTimeOutSec' instead. See: https://docs.dapr.io/reference/components-reference/supported-pubsub/setup-rocketmq/")
if rMetaData.SendTimeOutSec == 0 {
rMetaData.SendTimeOutSec = rMetaData.SendTimeOut / 1000000
}
}
return rMetaData, nil
}

View File

@ -21,11 +21,11 @@ import (
mdata "github.com/dapr/components-contrib/metadata"
"github.com/dapr/components-contrib/pubsub"
"github.com/dapr/kit/logger"
)
func TestMetaDataDecode(t *testing.T) {
props := map[string]string{
"accessProto": "http",
"accessKey": "**",
"secretKey": "***",
"nameServer": "http://test.nameserver",
@ -33,9 +33,8 @@ func TestMetaDataDecode(t *testing.T) {
"nameSpace": "defaultNamespace",
}
pubsubMeta := pubsub.Metadata{Base: mdata.Base{Properties: props}}
metaData, err := parseRocketMQMetaData(pubsubMeta)
metaData, err := parseRocketMQMetaData(pubsubMeta, logger.NewLogger("test"))
require.NoError(t, err)
assert.Equal(t, "http", metaData.AccessProto)
assert.Equal(t, "**", metaData.AccessKey)
assert.Equal(t, "***", metaData.SecretKey)
assert.Equal(t, "defaultGroup", metaData.ConsumerGroup)

View File

@ -66,7 +66,7 @@ func NewRocketMQ(l logger.Logger) pubsub.PubSub {
func (r *rocketMQ) Init(metadata pubsub.Metadata) error {
var err error
r.metadata, err = parseRocketMQMetaData(metadata)
r.metadata, err = parseRocketMQMetaData(metadata, r.logger)
if err != nil {
return err
}
@ -80,6 +80,9 @@ func (r *rocketMQ) setUpConsumer() (mq.PushConsumer, error) {
if r.metadata.ConsumerGroup != "" {
opts = append(opts, mqc.WithGroupName(r.metadata.ConsumerGroup))
}
if r.metadata.ConsumerBatchSize != 0 {
opts = append(opts, mqc.WithPullBatchSize(int32(r.metadata.ConsumerBatchSize)))
}
if r.metadata.NameSpace != "" {
opts = append(opts, mqc.WithNamespace(r.metadata.NameSpace))
}
@ -109,6 +112,9 @@ func (r *rocketMQ) setUpProducer() (mq.Producer, error) {
if r.metadata.GroupName != "" {
opts = append(opts, mqp.WithGroupName(r.metadata.GroupName))
}
if r.metadata.ProducerGroup != "" {
opts = append(opts, mqp.WithGroupName(r.metadata.ProducerGroup))
}
if r.metadata.NameServerDomain != "" {
opts = append(opts, mqp.WithNameServerDomain(r.metadata.NameServerDomain))
}
@ -167,7 +173,8 @@ func (r *rocketMQ) Publish(req *pubsub.PublishRequest) error {
}
}
ctx, cancel := context.WithTimeout(r.ctx, time.Duration(r.metadata.SendTimeOut))
sendTimeOut := time.Duration(r.metadata.SendTimeOutSec) * time.Second
ctx, cancel := context.WithTimeout(r.ctx, sendTimeOut)
defer cancel()
result, err := producer.SendSync(ctx, msg)
if err != nil {

View File

@ -30,8 +30,6 @@ func getTestMetadata() map[string]string {
"consumerGroup": "dapr.rocketmq.producer",
"accessKey": "RocketMQ",
"secretKey": "12345",
"consumerBatchSize": "1",
"consumerThreadNums": "2",
"retries": "2",
}
}
@ -39,7 +37,7 @@ func getTestMetadata() map[string]string {
func TestParseRocketMQMetadata(t *testing.T) {
t.Run("correct metadata", func(t *testing.T) {
meta := getTestMetadata()
_, err := parseRocketMQMetaData(pubsub.Metadata{Base: mdata.Base{Properties: meta}})
_, err := parseRocketMQMetaData(pubsub.Metadata{Base: mdata.Base{Properties: meta}}, logger.NewLogger("test"))
assert.Nil(t, err)
})

View File

@ -14,12 +14,15 @@ limitations under the License.
package parameterstore
import (
"context"
"encoding/json"
"fmt"
"strconv"
"time"
"github.com/alibabacloud-go/darabonba-openapi/client"
oos "github.com/alibabacloud-go/oos-20190601/client"
util "github.com/alibabacloud-go/tea-utils/service"
"github.com/alibabacloud-go/tea/tea"
"github.com/dapr/components-contrib/secretstores"
@ -32,6 +35,8 @@ const (
Path = "path"
)
var _ secretstores.SecretStore = (*oosSecretStore)(nil)
// NewParameterStore returns a new oos parameter store.
func NewParameterStore(logger logger.Logger) secretstores.SecretStore {
return &oosSecretStore{logger: logger}
@ -45,8 +50,8 @@ type parameterStoreMetaData struct {
}
type parameterStoreClient interface {
GetSecretParameter(request *oos.GetSecretParameterRequest) (*oos.GetSecretParameterResponse, error)
GetSecretParametersByPath(request *oos.GetSecretParametersByPathRequest) (*oos.GetSecretParametersByPathResponse, error)
GetSecretParameterWithOptions(request *oos.GetSecretParameterRequest, runtime *util.RuntimeOptions) (*oos.GetSecretParameterResponse, error)
GetSecretParametersByPathWithOptions(request *oos.GetSecretParametersByPathRequest, runtime *util.RuntimeOptions) (*oos.GetSecretParametersByPathResponse, error)
}
type oosSecretStore struct {
@ -71,7 +76,7 @@ func (o *oosSecretStore) Init(metadata secretstores.Metadata) error {
}
// GetSecret retrieves a secret using a key and returns a map of decrypted string/string values.
func (o *oosSecretStore) GetSecret(req secretstores.GetSecretRequest) (secretstores.GetSecretResponse, error) {
func (o *oosSecretStore) GetSecret(ctx context.Context, req secretstores.GetSecretRequest) (secretstores.GetSecretResponse, error) {
name := req.Name
parameterVersion, err := o.getVersionFromMetadata(req.Metadata)
@ -79,11 +84,16 @@ func (o *oosSecretStore) GetSecret(req secretstores.GetSecretRequest) (secretsto
return secretstores.GetSecretResponse{}, err
}
output, err := o.client.GetSecretParameter(&oos.GetSecretParameterRequest{
runtime := &util.RuntimeOptions{}
if deadline, ok := ctx.Deadline(); ok {
timeout := deadline.Sub(time.Now()).Milliseconds()
runtime.SetReadTimeout(int(timeout))
}
output, err := o.client.GetSecretParameterWithOptions(&oos.GetSecretParameterRequest{
Name: tea.String(name),
WithDecryption: tea.Bool(true),
ParameterVersion: parameterVersion,
})
}, runtime)
if err != nil {
return secretstores.GetSecretResponse{Data: nil}, fmt.Errorf("couldn't get secret: %w", err)
}
@ -100,7 +110,7 @@ func (o *oosSecretStore) GetSecret(req secretstores.GetSecretRequest) (secretsto
}
// BulkGetSecret retrieves all secrets in the store and returns a map of decrypted string/string values.
func (o *oosSecretStore) BulkGetSecret(req secretstores.BulkGetSecretRequest) (secretstores.BulkGetSecretResponse, error) {
func (o *oosSecretStore) BulkGetSecret(ctx context.Context, req secretstores.BulkGetSecretRequest) (secretstores.BulkGetSecretResponse, error) {
response := secretstores.BulkGetSecretResponse{
Data: map[string]map[string]string{},
}
@ -112,12 +122,17 @@ func (o *oosSecretStore) BulkGetSecret(req secretstores.BulkGetSecretRequest) (s
var nextToken *string
for {
output, err := o.client.GetSecretParametersByPath(&oos.GetSecretParametersByPathRequest{
runtime := &util.RuntimeOptions{}
if deadline, ok := ctx.Deadline(); ok {
timeout := deadline.Sub(time.Now()).Milliseconds()
runtime.SetReadTimeout(int(timeout))
}
output, err := o.client.GetSecretParametersByPathWithOptions(&oos.GetSecretParametersByPathRequest{
Path: path,
WithDecryption: tea.Bool(true),
Recursive: tea.Bool(true),
NextToken: nextToken,
})
}, runtime)
if err != nil {
return secretstores.BulkGetSecretResponse{}, fmt.Errorf("couldn't get secrets: %w", err)
}

View File

@ -14,10 +14,12 @@ limitations under the License.
package parameterstore
import (
"context"
"fmt"
"testing"
oos "github.com/alibabacloud-go/oos-20190601/client"
util "github.com/alibabacloud-go/tea-utils/service"
"github.com/alibabacloud-go/tea/tea"
"github.com/stretchr/testify/assert"
@ -34,7 +36,7 @@ type mockedParameterStore struct {
parameterStoreClient
}
func (m *mockedParameterStore) GetSecretParameter(request *oos.GetSecretParameterRequest) (*oos.GetSecretParameterResponse, error) {
func (m *mockedParameterStore) GetSecretParameterWithOptions(request *oos.GetSecretParameterRequest, runtime *util.RuntimeOptions) (*oos.GetSecretParameterResponse, error) {
return &oos.GetSecretParameterResponse{
Body: &oos.GetSecretParameterResponseBody{
Parameter: &oos.GetSecretParameterResponseBodyParameter{
@ -45,7 +47,7 @@ func (m *mockedParameterStore) GetSecretParameter(request *oos.GetSecretParamete
}, nil
}
func (m *mockedParameterStore) GetSecretParametersByPath(request *oos.GetSecretParametersByPathRequest) (*oos.GetSecretParametersByPathResponse, error) {
func (m *mockedParameterStore) GetSecretParametersByPathWithOptions(request *oos.GetSecretParametersByPathRequest, runtime *util.RuntimeOptions) (*oos.GetSecretParametersByPathResponse, error) {
return &oos.GetSecretParametersByPathResponse{
Body: &oos.GetSecretParametersByPathResponseBody{
Parameters: []*oos.GetSecretParametersByPathResponseBodyParameters{
@ -62,11 +64,11 @@ type mockedParameterStoreReturnError struct {
parameterStoreClient
}
func (m *mockedParameterStoreReturnError) GetSecretParameter(request *oos.GetSecretParameterRequest) (*oos.GetSecretParameterResponse, error) {
func (m *mockedParameterStoreReturnError) GetSecretParameterWithOptions(request *oos.GetSecretParameterRequest, runtime *util.RuntimeOptions) (*oos.GetSecretParameterResponse, error) {
return nil, fmt.Errorf("mocked error")
}
func (m *mockedParameterStoreReturnError) GetSecretParametersByPath(request *oos.GetSecretParametersByPathRequest) (*oos.GetSecretParametersByPathResponse, error) {
func (m *mockedParameterStoreReturnError) GetSecretParametersByPathWithOptions(request *oos.GetSecretParametersByPathRequest, runtime *util.RuntimeOptions) (*oos.GetSecretParametersByPathResponse, error) {
return nil, fmt.Errorf("mocked error")
}
@ -104,7 +106,7 @@ func TestGetSecret(t *testing.T) {
Name: secretName,
Metadata: map[string]string{},
}
output, e := s.GetSecret(req)
output, e := s.GetSecret(context.Background(), req)
assert.Nil(t, e)
assert.Equal(t, secretValue, output.Data[req.Name])
})
@ -120,7 +122,7 @@ func TestGetSecret(t *testing.T) {
"version_id": "1",
},
}
output, e := s.GetSecret(req)
output, e := s.GetSecret(context.Background(), req)
assert.Nil(t, e)
assert.Equal(t, secretValue, output.Data[req.Name])
})
@ -138,7 +140,7 @@ func TestGetSecret(t *testing.T) {
"version_id": "not-number",
},
}
_, e := s.GetSecret(req)
_, e := s.GetSecret(context.Background(), req)
assert.NotNil(t, e)
})
@ -151,7 +153,7 @@ func TestGetSecret(t *testing.T) {
Name: secretName,
Metadata: map[string]string{},
}
_, e := s.GetSecret(req)
_, e := s.GetSecret(context.Background(), req)
assert.NotNil(t, e)
})
})
@ -167,7 +169,7 @@ func TestBulkGetSecret(t *testing.T) {
req := secretstores.BulkGetSecretRequest{
Metadata: map[string]string{},
}
output, e := s.BulkGetSecret(req)
output, e := s.BulkGetSecret(context.Background(), req)
assert.Nil(t, e)
assert.Contains(t, output.Data, secretName)
})
@ -182,7 +184,7 @@ func TestBulkGetSecret(t *testing.T) {
"path": "/oos/",
},
}
output, e := s.BulkGetSecret(req)
output, e := s.BulkGetSecret(context.Background(), req)
assert.Nil(t, e)
assert.Contains(t, output.Data, secretName)
})
@ -197,7 +199,7 @@ func TestBulkGetSecret(t *testing.T) {
req := secretstores.BulkGetSecretRequest{
Metadata: map[string]string{},
}
_, e := s.BulkGetSecret(req)
_, e := s.BulkGetSecret(context.Background(), req)
assert.NotNil(t, e)
})
})

View File

@ -14,6 +14,7 @@ limitations under the License.
package parameterstore
import (
"context"
"encoding/json"
"fmt"
@ -31,6 +32,8 @@ const (
VersionID = "version_id"
)
var _ secretstores.SecretStore = (*ssmSecretStore)(nil)
// NewParameterStore returns a new ssm parameter store.
func NewParameterStore(logger logger.Logger) secretstores.SecretStore {
return &ssmSecretStore{logger: logger}
@ -68,7 +71,7 @@ func (s *ssmSecretStore) Init(metadata secretstores.Metadata) error {
}
// GetSecret retrieves a secret using a key and returns a map of decrypted string/string values.
func (s *ssmSecretStore) GetSecret(req secretstores.GetSecretRequest) (secretstores.GetSecretResponse, error) {
func (s *ssmSecretStore) GetSecret(ctx context.Context, req secretstores.GetSecretRequest) (secretstores.GetSecretResponse, error) {
name := req.Name
var versionID string
@ -77,7 +80,7 @@ func (s *ssmSecretStore) GetSecret(req secretstores.GetSecretRequest) (secretsto
name = fmt.Sprintf("%s:%s", req.Name, versionID)
}
output, err := s.client.GetParameter(&ssm.GetParameterInput{
output, err := s.client.GetParameterWithContext(ctx, &ssm.GetParameterInput{
Name: aws.String(s.prefix + name),
WithDecryption: aws.Bool(true),
})
@ -97,7 +100,7 @@ func (s *ssmSecretStore) GetSecret(req secretstores.GetSecretRequest) (secretsto
}
// BulkGetSecret retrieves all secrets in the store and returns a map of decrypted string/string values.
func (s *ssmSecretStore) BulkGetSecret(req secretstores.BulkGetSecretRequest) (secretstores.BulkGetSecretResponse, error) {
func (s *ssmSecretStore) BulkGetSecret(ctx context.Context, req secretstores.BulkGetSecretRequest) (secretstores.BulkGetSecretResponse, error) {
resp := secretstores.BulkGetSecretResponse{
Data: map[string]map[string]string{},
}
@ -117,7 +120,7 @@ func (s *ssmSecretStore) BulkGetSecret(req secretstores.BulkGetSecretRequest) (s
}
for search {
output, err := s.client.DescribeParameters(&ssm.DescribeParametersInput{
output, err := s.client.DescribeParametersWithContext(ctx, &ssm.DescribeParametersInput{
MaxResults: nil,
NextToken: nextToken,
ParameterFilters: filters,
@ -127,7 +130,7 @@ func (s *ssmSecretStore) BulkGetSecret(req secretstores.BulkGetSecretRequest) (s
}
for _, entry := range output.Parameters {
params, err := s.client.GetParameter(&ssm.GetParameterInput{
params, err := s.client.GetParameterWithContext(ctx, &ssm.GetParameterInput{
Name: entry.Name,
WithDecryption: aws.Bool(true),
})

View File

@ -15,11 +15,13 @@ limitations under the License.
package parameterstore
import (
"context"
"fmt"
"strings"
"testing"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/ssm"
"github.com/aws/aws-sdk-go/service/ssm/ssmiface"
"github.com/stretchr/testify/assert"
@ -31,17 +33,17 @@ import (
const secretValue = "secret"
type mockedSSM struct {
GetParameterFn func(*ssm.GetParameterInput) (*ssm.GetParameterOutput, error)
DescribeParametersFn func(*ssm.DescribeParametersInput) (*ssm.DescribeParametersOutput, error)
GetParameterFn func(context.Context, *ssm.GetParameterInput, ...request.Option) (*ssm.GetParameterOutput, error)
DescribeParametersFn func(context.Context, *ssm.DescribeParametersInput, ...request.Option) (*ssm.DescribeParametersOutput, error)
ssmiface.SSMAPI
}
func (m *mockedSSM) GetParameter(input *ssm.GetParameterInput) (*ssm.GetParameterOutput, error) {
return m.GetParameterFn(input)
func (m *mockedSSM) GetParameterWithContext(ctx context.Context, input *ssm.GetParameterInput, option ...request.Option) (*ssm.GetParameterOutput, error) {
return m.GetParameterFn(ctx, input, option...)
}
func (m *mockedSSM) DescribeParameters(input *ssm.DescribeParametersInput) (*ssm.DescribeParametersOutput, error) {
return m.DescribeParametersFn(input)
func (m *mockedSSM) DescribeParametersWithContext(ctx context.Context, input *ssm.DescribeParametersInput, option ...request.Option) (*ssm.DescribeParametersOutput, error) {
return m.DescribeParametersFn(ctx, input, option...)
}
func TestInit(t *testing.T) {
@ -65,7 +67,7 @@ func TestGetSecret(t *testing.T) {
t.Run("with valid path", func(t *testing.T) {
s := ssmSecretStore{
client: &mockedSSM{
GetParameterFn: func(input *ssm.GetParameterInput) (*ssm.GetParameterOutput, error) {
GetParameterFn: func(ctx context.Context, input *ssm.GetParameterInput, option ...request.Option) (*ssm.GetParameterOutput, error) {
secret := secretValue
return &ssm.GetParameterOutput{
@ -82,7 +84,7 @@ func TestGetSecret(t *testing.T) {
Name: "/aws/dev/secret",
Metadata: map[string]string{},
}
output, e := s.GetSecret(req)
output, e := s.GetSecret(context.Background(), req)
assert.Nil(t, e)
assert.Equal(t, "secret", output.Data[req.Name])
})
@ -90,7 +92,7 @@ func TestGetSecret(t *testing.T) {
t.Run("with version id", func(t *testing.T) {
s := ssmSecretStore{
client: &mockedSSM{
GetParameterFn: func(input *ssm.GetParameterInput) (*ssm.GetParameterOutput, error) {
GetParameterFn: func(ctx context.Context, input *ssm.GetParameterInput, option ...request.Option) (*ssm.GetParameterOutput, error) {
secret := secretValue
keys := strings.Split(*input.Name, ":")
assert.NotNil(t, keys)
@ -113,7 +115,7 @@ func TestGetSecret(t *testing.T) {
VersionID: "1",
},
}
output, e := s.GetSecret(req)
output, e := s.GetSecret(context.Background(), req)
assert.Nil(t, e)
assert.Equal(t, secretValue, output.Data[req.Name])
})
@ -121,7 +123,7 @@ func TestGetSecret(t *testing.T) {
t.Run("with prefix", func(t *testing.T) {
s := ssmSecretStore{
client: &mockedSSM{
GetParameterFn: func(input *ssm.GetParameterInput) (*ssm.GetParameterOutput, error) {
GetParameterFn: func(ctx context.Context, input *ssm.GetParameterInput, option ...request.Option) (*ssm.GetParameterOutput, error) {
assert.Equal(t, "/prefix/aws/dev/secret", *input.Name)
secret := secretValue
@ -140,7 +142,7 @@ func TestGetSecret(t *testing.T) {
Name: "/aws/dev/secret",
Metadata: map[string]string{},
}
output, e := s.GetSecret(req)
output, e := s.GetSecret(context.Background(), req)
assert.Nil(t, e)
assert.Equal(t, "secret", output.Data[req.Name])
})
@ -149,7 +151,7 @@ func TestGetSecret(t *testing.T) {
t.Run("unsuccessfully retrieve secret", func(t *testing.T) {
s := ssmSecretStore{
client: &mockedSSM{
GetParameterFn: func(input *ssm.GetParameterInput) (*ssm.GetParameterOutput, error) {
GetParameterFn: func(ctx context.Context, input *ssm.GetParameterInput, option ...request.Option) (*ssm.GetParameterOutput, error) {
return nil, fmt.Errorf("failed due to any reason")
},
},
@ -158,7 +160,7 @@ func TestGetSecret(t *testing.T) {
Name: "/aws/dev/secret",
Metadata: map[string]string{},
}
_, err := s.GetSecret(req)
_, err := s.GetSecret(context.Background(), req)
assert.NotNil(t, err)
})
}
@ -167,7 +169,7 @@ func TestGetBulkSecrets(t *testing.T) {
t.Run("successfully retrieve bulk secrets", func(t *testing.T) {
s := ssmSecretStore{
client: &mockedSSM{
DescribeParametersFn: func(*ssm.DescribeParametersInput) (*ssm.DescribeParametersOutput, error) {
DescribeParametersFn: func(context.Context, *ssm.DescribeParametersInput, ...request.Option) (*ssm.DescribeParametersOutput, error) {
return &ssm.DescribeParametersOutput{NextToken: nil, Parameters: []*ssm.ParameterMetadata{
{
Name: aws.String("/aws/dev/secret1"),
@ -177,7 +179,7 @@ func TestGetBulkSecrets(t *testing.T) {
},
}}, nil
},
GetParameterFn: func(input *ssm.GetParameterInput) (*ssm.GetParameterOutput, error) {
GetParameterFn: func(ctx context.Context, input *ssm.GetParameterInput, option ...request.Option) (*ssm.GetParameterOutput, error) {
secret := fmt.Sprintf("%s-%s", *input.Name, secretValue)
return &ssm.GetParameterOutput{
@ -193,7 +195,7 @@ func TestGetBulkSecrets(t *testing.T) {
req := secretstores.BulkGetSecretRequest{
Metadata: map[string]string{},
}
output, e := s.BulkGetSecret(req)
output, e := s.BulkGetSecret(context.Background(), req)
assert.Nil(t, e)
assert.Contains(t, output.Data, "/aws/dev/secret1")
assert.Contains(t, output.Data, "/aws/dev/secret2")
@ -202,7 +204,7 @@ func TestGetBulkSecrets(t *testing.T) {
t.Run("successfully retrieve bulk secrets with prefix", func(t *testing.T) {
s := ssmSecretStore{
client: &mockedSSM{
DescribeParametersFn: func(*ssm.DescribeParametersInput) (*ssm.DescribeParametersOutput, error) {
DescribeParametersFn: func(context.Context, *ssm.DescribeParametersInput, ...request.Option) (*ssm.DescribeParametersOutput, error) {
return &ssm.DescribeParametersOutput{NextToken: nil, Parameters: []*ssm.ParameterMetadata{
{
Name: aws.String("/prefix/aws/dev/secret1"),
@ -212,7 +214,7 @@ func TestGetBulkSecrets(t *testing.T) {
},
}}, nil
},
GetParameterFn: func(input *ssm.GetParameterInput) (*ssm.GetParameterOutput, error) {
GetParameterFn: func(ctx context.Context, input *ssm.GetParameterInput, option ...request.Option) (*ssm.GetParameterOutput, error) {
secret := fmt.Sprintf("%s-%s", *input.Name, secretValue)
return &ssm.GetParameterOutput{
@ -229,7 +231,7 @@ func TestGetBulkSecrets(t *testing.T) {
req := secretstores.BulkGetSecretRequest{
Metadata: map[string]string{},
}
output, e := s.BulkGetSecret(req)
output, e := s.BulkGetSecret(context.Background(), req)
assert.Nil(t, e)
assert.Equal(t, "map[/aws/dev/secret1:/prefix/aws/dev/secret1-secret]", fmt.Sprint(output.Data["/aws/dev/secret1"]))
assert.Equal(t, "map[/aws/dev/secret2:/prefix/aws/dev/secret2-secret]", fmt.Sprint(output.Data["/aws/dev/secret2"]))
@ -238,7 +240,7 @@ func TestGetBulkSecrets(t *testing.T) {
t.Run("unsuccessfully retrieve bulk secrets on get parameter", func(t *testing.T) {
s := ssmSecretStore{
client: &mockedSSM{
DescribeParametersFn: func(*ssm.DescribeParametersInput) (*ssm.DescribeParametersOutput, error) {
DescribeParametersFn: func(context.Context, *ssm.DescribeParametersInput, ...request.Option) (*ssm.DescribeParametersOutput, error) {
return &ssm.DescribeParametersOutput{NextToken: nil, Parameters: []*ssm.ParameterMetadata{
{
Name: aws.String("/aws/dev/secret1"),
@ -248,7 +250,7 @@ func TestGetBulkSecrets(t *testing.T) {
},
}}, nil
},
GetParameterFn: func(input *ssm.GetParameterInput) (*ssm.GetParameterOutput, error) {
GetParameterFn: func(ctx context.Context, input *ssm.GetParameterInput, option ...request.Option) (*ssm.GetParameterOutput, error) {
return nil, fmt.Errorf("failed due to any reason")
},
},
@ -256,14 +258,14 @@ func TestGetBulkSecrets(t *testing.T) {
req := secretstores.BulkGetSecretRequest{
Metadata: map[string]string{},
}
_, err := s.BulkGetSecret(req)
_, err := s.BulkGetSecret(context.Background(), req)
assert.NotNil(t, err)
})
t.Run("unsuccessfully retrieve bulk secrets on describe parameter", func(t *testing.T) {
s := ssmSecretStore{
client: &mockedSSM{
DescribeParametersFn: func(*ssm.DescribeParametersInput) (*ssm.DescribeParametersOutput, error) {
DescribeParametersFn: func(context.Context, *ssm.DescribeParametersInput, ...request.Option) (*ssm.DescribeParametersOutput, error) {
return nil, fmt.Errorf("failed due to any reason")
},
},
@ -271,7 +273,7 @@ func TestGetBulkSecrets(t *testing.T) {
req := secretstores.BulkGetSecretRequest{
Metadata: map[string]string{},
}
_, err := s.BulkGetSecret(req)
_, err := s.BulkGetSecret(context.Background(), req)
assert.NotNil(t, err)
})
}

View File

@ -14,6 +14,7 @@ limitations under the License.
package secretmanager
import (
"context"
"encoding/json"
"fmt"
@ -30,6 +31,8 @@ const (
VersionStage = "version_stage"
)
var _ secretstores.SecretStore = (*smSecretStore)(nil)
// NewSecretManager returns a new secret manager store.
func NewSecretManager(logger logger.Logger) secretstores.SecretStore {
return &smSecretStore{logger: logger}
@ -64,7 +67,7 @@ func (s *smSecretStore) Init(metadata secretstores.Metadata) error {
}
// GetSecret retrieves a secret using a key and returns a map of decrypted string/string values.
func (s *smSecretStore) GetSecret(req secretstores.GetSecretRequest) (secretstores.GetSecretResponse, error) {
func (s *smSecretStore) GetSecret(ctx context.Context, req secretstores.GetSecretRequest) (secretstores.GetSecretResponse, error) {
var versionID *string
if value, ok := req.Metadata[VersionID]; ok {
versionID = &value
@ -74,7 +77,7 @@ func (s *smSecretStore) GetSecret(req secretstores.GetSecretRequest) (secretstor
versionStage = &value
}
output, err := s.client.GetSecretValue(&secretsmanager.GetSecretValueInput{
output, err := s.client.GetSecretValueWithContext(ctx, &secretsmanager.GetSecretValueInput{
SecretId: &req.Name,
VersionId: versionID,
VersionStage: versionStage,
@ -94,7 +97,7 @@ func (s *smSecretStore) GetSecret(req secretstores.GetSecretRequest) (secretstor
}
// BulkGetSecret retrieves all secrets in the store and returns a map of decrypted string/string values.
func (s *smSecretStore) BulkGetSecret(req secretstores.BulkGetSecretRequest) (secretstores.BulkGetSecretResponse, error) {
func (s *smSecretStore) BulkGetSecret(ctx context.Context, req secretstores.BulkGetSecretRequest) (secretstores.BulkGetSecretResponse, error) {
resp := secretstores.BulkGetSecretResponse{
Data: map[string]map[string]string{},
}
@ -103,7 +106,7 @@ func (s *smSecretStore) BulkGetSecret(req secretstores.BulkGetSecretRequest) (se
var nextToken *string = nil
for search {
output, err := s.client.ListSecrets(&secretsmanager.ListSecretsInput{
output, err := s.client.ListSecretsWithContext(ctx, &secretsmanager.ListSecretsInput{
MaxResults: nil,
NextToken: nextToken,
})
@ -112,7 +115,7 @@ func (s *smSecretStore) BulkGetSecret(req secretstores.BulkGetSecretRequest) (se
}
for _, entry := range output.SecretList {
secrets, err := s.client.GetSecretValue(&secretsmanager.GetSecretValueInput{
secrets, err := s.client.GetSecretValueWithContext(ctx, &secretsmanager.GetSecretValueInput{
SecretId: entry.Name,
})
if err != nil {

View File

@ -15,9 +15,11 @@ limitations under the License.
package secretmanager
import (
"context"
"fmt"
"testing"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/secretsmanager"
"github.com/aws/aws-sdk-go/service/secretsmanager/secretsmanageriface"
"github.com/stretchr/testify/assert"
@ -29,12 +31,12 @@ import (
const secretValue = "secret"
type mockedSM struct {
GetSecretValueFn func(*secretsmanager.GetSecretValueInput) (*secretsmanager.GetSecretValueOutput, error)
GetSecretValueFn func(context.Context, *secretsmanager.GetSecretValueInput, ...request.Option) (*secretsmanager.GetSecretValueOutput, error)
secretsmanageriface.SecretsManagerAPI
}
func (m *mockedSM) GetSecretValue(input *secretsmanager.GetSecretValueInput) (*secretsmanager.GetSecretValueOutput, error) {
return m.GetSecretValueFn(input)
func (m *mockedSM) GetSecretValueWithContext(ctx context.Context, input *secretsmanager.GetSecretValueInput, option ...request.Option) (*secretsmanager.GetSecretValueOutput, error) {
return m.GetSecretValueFn(ctx, input, option...)
}
func TestInit(t *testing.T) {
@ -58,7 +60,7 @@ func TestGetSecret(t *testing.T) {
t.Run("without version id and version stage", func(t *testing.T) {
s := smSecretStore{
client: &mockedSM{
GetSecretValueFn: func(input *secretsmanager.GetSecretValueInput) (*secretsmanager.GetSecretValueOutput, error) {
GetSecretValueFn: func(ctx context.Context, input *secretsmanager.GetSecretValueInput, option ...request.Option) (*secretsmanager.GetSecretValueOutput, error) {
assert.Nil(t, input.VersionId)
assert.Nil(t, input.VersionStage)
secret := secretValue
@ -75,7 +77,7 @@ func TestGetSecret(t *testing.T) {
Name: "/aws/secret/testing",
Metadata: map[string]string{},
}
output, e := s.GetSecret(req)
output, e := s.GetSecret(context.Background(), req)
assert.Nil(t, e)
assert.Equal(t, "secret", output.Data[req.Name])
})
@ -83,7 +85,7 @@ func TestGetSecret(t *testing.T) {
t.Run("with version id", func(t *testing.T) {
s := smSecretStore{
client: &mockedSM{
GetSecretValueFn: func(input *secretsmanager.GetSecretValueInput) (*secretsmanager.GetSecretValueOutput, error) {
GetSecretValueFn: func(ctx context.Context, input *secretsmanager.GetSecretValueInput, option ...request.Option) (*secretsmanager.GetSecretValueOutput, error) {
assert.NotNil(t, input.VersionId)
secret := secretValue
@ -101,7 +103,7 @@ func TestGetSecret(t *testing.T) {
VersionID: "1",
},
}
output, e := s.GetSecret(req)
output, e := s.GetSecret(context.Background(), req)
assert.Nil(t, e)
assert.Equal(t, secretValue, output.Data[req.Name])
})
@ -109,7 +111,7 @@ func TestGetSecret(t *testing.T) {
t.Run("with version stage", func(t *testing.T) {
s := smSecretStore{
client: &mockedSM{
GetSecretValueFn: func(input *secretsmanager.GetSecretValueInput) (*secretsmanager.GetSecretValueOutput, error) {
GetSecretValueFn: func(ctx context.Context, input *secretsmanager.GetSecretValueInput, option ...request.Option) (*secretsmanager.GetSecretValueOutput, error) {
assert.NotNil(t, input.VersionStage)
secret := secretValue
@ -127,7 +129,7 @@ func TestGetSecret(t *testing.T) {
VersionStage: "dev",
},
}
output, e := s.GetSecret(req)
output, e := s.GetSecret(context.Background(), req)
assert.Nil(t, e)
assert.Equal(t, secretValue, output.Data[req.Name])
})
@ -136,7 +138,7 @@ func TestGetSecret(t *testing.T) {
t.Run("unsuccessfully retrieve secret", func(t *testing.T) {
s := smSecretStore{
client: &mockedSM{
GetSecretValueFn: func(input *secretsmanager.GetSecretValueInput) (*secretsmanager.GetSecretValueOutput, error) {
GetSecretValueFn: func(ctx context.Context, input *secretsmanager.GetSecretValueInput, option ...request.Option) (*secretsmanager.GetSecretValueOutput, error) {
return nil, fmt.Errorf("failed due to any reason")
},
},
@ -145,7 +147,7 @@ func TestGetSecret(t *testing.T) {
Name: "/aws/secret/testing",
Metadata: map[string]string{},
}
_, err := s.GetSecret(req)
_, err := s.GetSecret(context.Background(), req)
assert.NotNil(t, err)
})
}

View File

@ -36,6 +36,8 @@ const (
secretItemIDPrefix = "/secrets/"
)
var _ secretstores.SecretStore = (*keyvaultSecretStore)(nil)
type keyvaultSecretStore struct {
vaultName string
vaultClient *azsecrets.Client
@ -107,13 +109,13 @@ func (k *keyvaultSecretStore) Init(metadata secretstores.Metadata) error {
}
// GetSecret retrieves a secret using a key and returns a map of decrypted string/string values.
func (k *keyvaultSecretStore) GetSecret(req secretstores.GetSecretRequest) (secretstores.GetSecretResponse, error) {
func (k *keyvaultSecretStore) GetSecret(ctx context.Context, req secretstores.GetSecretRequest) (secretstores.GetSecretResponse, error) {
opts := &azsecrets.GetSecretOptions{}
if value, ok := req.Metadata[VersionID]; ok {
opts.Version = value
}
secretResp, err := k.vaultClient.GetSecret(context.TODO(), req.Name, opts)
secretResp, err := k.vaultClient.GetSecret(ctx, req.Name, opts)
if err != nil {
return secretstores.GetSecretResponse{}, err
}
@ -131,7 +133,7 @@ func (k *keyvaultSecretStore) GetSecret(req secretstores.GetSecretRequest) (secr
}
// BulkGetSecret retrieves all secrets in the store and returns a map of decrypted string/string values.
func (k *keyvaultSecretStore) BulkGetSecret(req secretstores.BulkGetSecretRequest) (secretstores.BulkGetSecretResponse, error) {
func (k *keyvaultSecretStore) BulkGetSecret(ctx context.Context, req secretstores.BulkGetSecretRequest) (secretstores.BulkGetSecretResponse, error) {
maxResults, err := k.getMaxResultsFromMetadata(req.Metadata)
if err != nil {
return secretstores.BulkGetSecretResponse{}, err
@ -147,7 +149,7 @@ func (k *keyvaultSecretStore) BulkGetSecret(req secretstores.BulkGetSecretReques
out:
for pager.More() {
pr, err := pager.NextPage(context.TODO())
pr, err := pager.NextPage(ctx)
if err != nil {
return secretstores.BulkGetSecretResponse{}, err
}
@ -158,7 +160,7 @@ out:
}
secretName := strings.TrimPrefix(*secret.ID, secretIDPrefix)
secretResp, err := k.vaultClient.GetSecret(context.TODO(), secretName, nil)
secretResp, err := k.vaultClient.GetSecret(ctx, secretName, nil)
if err != nil {
return secretstores.BulkGetSecretResponse{}, err
}

View File

@ -46,6 +46,8 @@ type secretManagerMetadata struct {
gcpCredentials
}
var _ secretstores.SecretStore = (*Store)(nil)
// Store contains and GCP secret manager client and project id.
type Store struct {
client *secretmanager.Client
@ -91,7 +93,7 @@ func (s *Store) getClient(metadata *secretManagerMetadata) (*secretmanager.Clien
}
// GetSecret retrieves a secret using a key and returns a map of decrypted string.
func (s *Store) GetSecret(req secretstores.GetSecretRequest) (secretstores.GetSecretResponse, error) {
func (s *Store) GetSecret(ctx context.Context, req secretstores.GetSecretRequest) (secretstores.GetSecretResponse, error) {
res := secretstores.GetSecretResponse{Data: nil}
if s.client == nil {
@ -107,7 +109,7 @@ func (s *Store) GetSecret(req secretstores.GetSecretRequest) (secretstores.GetSe
versionID = value
}
secret, err := s.getSecret(req.Name, versionID)
secret, err := s.getSecret(ctx, req.Name, versionID)
if err != nil {
return res, fmt.Errorf("failed to access secret version: %v", err)
}
@ -116,7 +118,7 @@ func (s *Store) GetSecret(req secretstores.GetSecretRequest) (secretstores.GetSe
}
// BulkGetSecret retrieves all secrets in the store and returns a map of decrypted string/string values.
func (s *Store) BulkGetSecret(req secretstores.BulkGetSecretRequest) (secretstores.BulkGetSecretResponse, error) {
func (s *Store) BulkGetSecret(ctx context.Context, req secretstores.BulkGetSecretRequest) (secretstores.BulkGetSecretResponse, error) {
versionID := "latest"
response := map[string]map[string]string{}
@ -125,8 +127,6 @@ func (s *Store) BulkGetSecret(req secretstores.BulkGetSecretRequest) (secretstor
return secretstores.BulkGetSecretResponse{Data: nil}, fmt.Errorf("client is not initialized")
}
ctx := context.Background()
request := &secretmanagerpb.ListSecretsRequest{
Parent: fmt.Sprintf("projects/%s", s.ProjectID),
}
@ -144,7 +144,7 @@ func (s *Store) BulkGetSecret(req secretstores.BulkGetSecretRequest) (secretstor
}
name := resp.GetName()
secret, err := s.getSecret(name, versionID)
secret, err := s.getSecret(ctx, name, versionID)
if err != nil {
return secretstores.BulkGetSecretResponse{Data: nil}, fmt.Errorf("failed to access secret version: %v", err)
}
@ -154,8 +154,7 @@ func (s *Store) BulkGetSecret(req secretstores.BulkGetSecretRequest) (secretstor
return secretstores.BulkGetSecretResponse{Data: response}, nil
}
func (s *Store) getSecret(secretName string, versionID string) (*string, error) {
ctx := context.Background()
func (s *Store) getSecret(ctx context.Context, secretName string, versionID string) (*string, error) {
accessRequest := &secretmanagerpb.AccessSecretVersionRequest{
Name: fmt.Sprintf("projects/%s/secrets/%s/versions/%s", s.ProjectID, secretName, versionID),
}

View File

@ -14,6 +14,7 @@ limitations under the License.
package secretmanager
import (
"context"
"fmt"
"testing"
@ -69,7 +70,7 @@ func TestGetSecret(t *testing.T) {
sm := NewSecreteManager(logger.NewLogger("test"))
t.Run("Get Secret - without Init", func(t *testing.T) {
v, err := sm.GetSecret(secretstores.GetSecretRequest{Name: "test"})
v, err := sm.GetSecret(context.Background(), secretstores.GetSecretRequest{Name: "test"})
assert.NotNil(t, err)
assert.Equal(t, err, fmt.Errorf("client is not initialized"))
assert.Equal(t, secretstores.GetSecretResponse{Data: nil}, v)
@ -91,7 +92,7 @@ func TestGetSecret(t *testing.T) {
},
}}
sm.Init(m)
v, err := sm.GetSecret(secretstores.GetSecretRequest{Name: "test"})
v, err := sm.GetSecret(context.Background(), secretstores.GetSecretRequest{Name: "test"})
assert.NotNil(t, err)
assert.Equal(t, secretstores.GetSecretResponse{Data: nil}, v)
})
@ -101,7 +102,7 @@ func TestBulkGetSecret(t *testing.T) {
sm := NewSecreteManager(logger.NewLogger("test"))
t.Run("Bulk Get Secret - without Init", func(t *testing.T) {
v, err := sm.BulkGetSecret(secretstores.BulkGetSecretRequest{})
v, err := sm.BulkGetSecret(context.Background(), secretstores.BulkGetSecretRequest{})
assert.NotNil(t, err)
assert.Equal(t, err, fmt.Errorf("client is not initialized"))
assert.Equal(t, secretstores.BulkGetSecretResponse{Data: nil}, v)
@ -125,7 +126,7 @@ func TestBulkGetSecret(t *testing.T) {
},
}
sm.Init(m)
v, err := sm.BulkGetSecret(secretstores.BulkGetSecretRequest{})
v, err := sm.BulkGetSecret(context.Background(), secretstores.BulkGetSecretRequest{})
assert.NotNil(t, err)
assert.Equal(t, secretstores.BulkGetSecretResponse{Data: nil}, v)
})

View File

@ -65,6 +65,8 @@ const (
valueTypeText valueType = "text"
)
var _ secretstores.SecretStore = (*vaultSecretStore)(nil)
func (v valueType) isMapType() bool {
return v == valueTypeMap
}
@ -204,11 +206,11 @@ func metadataToTLSConfig(props map[string]string) *tlsConfig {
}
// GetSecret retrieves a secret using a key and returns a map of decrypted string/string values.
func (v *vaultSecretStore) getSecret(secret, version string) (*vaultKVResponse, error) {
func (v *vaultSecretStore) getSecret(ctx context.Context, secret, version string) (*vaultKVResponse, error) {
// Create get secret url
vaultSecretPathAddr := fmt.Sprintf("%s/v1/%s/data/%s/%s?version=%s", v.vaultAddress, v.vaultEnginePath, v.vaultKVPrefix, secret, version)
httpReq, err := http.NewRequestWithContext(context.Background(), http.MethodGet, vaultSecretPathAddr, nil)
httpReq, err := http.NewRequestWithContext(ctx, http.MethodGet, vaultSecretPathAddr, nil)
if err != nil {
return nil, fmt.Errorf("couldn't generate request: %w", err)
}
@ -260,13 +262,13 @@ func (v *vaultSecretStore) getSecret(secret, version string) (*vaultKVResponse,
}
// GetSecret retrieves a secret using a key and returns a map of decrypted string/string values.
func (v *vaultSecretStore) GetSecret(req secretstores.GetSecretRequest) (secretstores.GetSecretResponse, error) {
func (v *vaultSecretStore) GetSecret(ctx context.Context, req secretstores.GetSecretRequest) (secretstores.GetSecretResponse, error) {
// version 0 represent for latest version
version := "0"
if value, ok := req.Metadata[versionID]; ok {
version = value
}
d, err := v.getSecret(req.Name, version)
d, err := v.getSecret(ctx, req.Name, version)
if err != nil {
return secretstores.GetSecretResponse{Data: nil}, err
}
@ -279,7 +281,7 @@ func (v *vaultSecretStore) GetSecret(req secretstores.GetSecretRequest) (secrets
}
// BulkGetSecret retrieves all secrets in the store and returns a map of decrypted string/string values.
func (v *vaultSecretStore) BulkGetSecret(req secretstores.BulkGetSecretRequest) (secretstores.BulkGetSecretResponse, error) {
func (v *vaultSecretStore) BulkGetSecret(ctx context.Context, req secretstores.BulkGetSecretRequest) (secretstores.BulkGetSecretResponse, error) {
version := "0"
if value, ok := req.Metadata[versionID]; ok {
version = value
@ -289,14 +291,14 @@ func (v *vaultSecretStore) BulkGetSecret(req secretstores.BulkGetSecretRequest)
Data: map[string]map[string]string{},
}
keys, err := v.listKeysUnderPath("")
keys, err := v.listKeysUnderPath(ctx, "")
if err != nil {
return secretstores.BulkGetSecretResponse{}, err
}
for _, key := range keys {
keyValues := map[string]string{}
secrets, err := v.getSecret(key, version)
secrets, err := v.getSecret(ctx, key, version)
if err != nil {
if errors.Is(err, ErrNotFound) {
// version not exist skip
@ -317,7 +319,7 @@ func (v *vaultSecretStore) BulkGetSecret(req secretstores.BulkGetSecretRequest)
// listKeysUnderPath get all the keys recursively under a given path.(returned keys including path as prefix)
// path should not has `/` prefix.
func (v *vaultSecretStore) listKeysUnderPath(path string) ([]string, error) {
func (v *vaultSecretStore) listKeysUnderPath(ctx context.Context, path string) ([]string, error) {
var vaultSecretsPathAddr string
// Create list secrets url
@ -327,7 +329,7 @@ func (v *vaultSecretStore) listKeysUnderPath(path string) ([]string, error) {
vaultSecretsPathAddr = fmt.Sprintf("%s/v1/%s/metadata/%s/%s", v.vaultAddress, v.vaultEnginePath, v.vaultKVPrefix, path)
}
httpReq, err := http.NewRequestWithContext(context.Background(), "LIST", vaultSecretsPathAddr, nil)
httpReq, err := http.NewRequestWithContext(ctx, "LIST", vaultSecretsPathAddr, nil)
if err != nil {
return nil, fmt.Errorf("couldn't generate request: %s", err)
}
@ -361,7 +363,7 @@ func (v *vaultSecretStore) listKeysUnderPath(path string) ([]string, error) {
if v.isSecretPath(key) {
res = append(res, path+key)
} else {
subKeys, err := v.listKeysUnderPath(path + key)
subKeys, err := v.listKeysUnderPath(ctx, path+key)
if err != nil {
return nil, err
}

View File

@ -14,6 +14,8 @@ limitations under the License.
package csms
import (
"context"
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
csms "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/csms/v1"
"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/csms/v1/model"
@ -37,6 +39,8 @@ type csmsClient interface {
ShowSecretVersion(request *model.ShowSecretVersionRequest) (*model.ShowSecretVersionResponse, error)
}
var _ secretstores.SecretStore = (*csmsSecretStore)(nil)
type csmsSecretStore struct {
client csmsClient
logger logger.Logger
@ -64,7 +68,7 @@ func (c *csmsSecretStore) Init(metadata secretstores.Metadata) error {
}
// GetSecret retrieves a secret using a key and returns a map of decrypted string/string values.
func (c *csmsSecretStore) GetSecret(req secretstores.GetSecretRequest) (secretstores.GetSecretResponse, error) {
func (c *csmsSecretStore) GetSecret(ctx context.Context, req secretstores.GetSecretRequest) (secretstores.GetSecretResponse, error) {
request := &model.ShowSecretVersionRequest{}
request.SecretName = req.Name
if value, ok := req.Metadata[versionID]; ok {
@ -84,8 +88,8 @@ func (c *csmsSecretStore) GetSecret(req secretstores.GetSecretRequest) (secretst
}
// BulkGetSecret retrieves all secrets in the store and returns a map of decrypted string/string values.
func (c *csmsSecretStore) BulkGetSecret(req secretstores.BulkGetSecretRequest) (secretstores.BulkGetSecretResponse, error) {
secretNames, err := c.getSecretNames(nil)
func (c *csmsSecretStore) BulkGetSecret(ctx context.Context, req secretstores.BulkGetSecretRequest) (secretstores.BulkGetSecretResponse, error) {
secretNames, err := c.getSecretNames(ctx, nil)
if err != nil {
return secretstores.BulkGetSecretResponse{}, err
}
@ -95,7 +99,7 @@ func (c *csmsSecretStore) BulkGetSecret(req secretstores.BulkGetSecretRequest) (
}
for _, secretName := range secretNames {
secret, err := c.GetSecret(secretstores.GetSecretRequest{
secret, err := c.GetSecret(ctx, secretstores.GetSecretRequest{
Name: secretName,
Metadata: map[string]string{
versionID: latestVersion,
@ -112,7 +116,7 @@ func (c *csmsSecretStore) BulkGetSecret(req secretstores.BulkGetSecretRequest) (
}
// Get all secret names recursively.
func (c *csmsSecretStore) getSecretNames(marker *string) ([]string, error) {
func (c *csmsSecretStore) getSecretNames(ctx context.Context, marker *string) ([]string, error) {
request := &model.ListSecretsRequest{}
limit := pageLimit
request.Limit = &limit
@ -130,7 +134,7 @@ func (c *csmsSecretStore) getSecretNames(marker *string) ([]string, error) {
// If the NextMarker has value then continue to retrieve data from next page.
if response.PageInfo.NextMarker != nil {
nextResp, err := c.getSecretNames(response.PageInfo.NextMarker)
nextResp, err := c.getSecretNames(ctx, response.PageInfo.NextMarker)
if err != nil {
return nil, err
}

View File

@ -14,6 +14,7 @@ limitations under the License.
package csms
import (
"context"
"fmt"
"testing"
@ -102,7 +103,7 @@ func TestGetSecret(t *testing.T) {
},
}
resp, e := c.GetSecret(req)
resp, e := c.GetSecret(context.Background(), req)
assert.Nil(t, e)
assert.Equal(t, secretValue, resp.Data[req.Name])
})
@ -117,7 +118,7 @@ func TestGetSecret(t *testing.T) {
Metadata: map[string]string{},
}
_, e := c.GetSecret(req)
_, e := c.GetSecret(context.Background(), req)
assert.NotNil(t, e)
})
}
@ -134,7 +135,7 @@ func TestBulkGetSecret(t *testing.T) {
secretName: secretValue,
},
}
resp, e := c.BulkGetSecret(req)
resp, e := c.BulkGetSecret(context.Background(), req)
assert.Nil(t, e)
assert.Equal(t, expectedSecrets, resp.Data)
})
@ -146,7 +147,7 @@ func TestBulkGetSecret(t *testing.T) {
}
req := secretstores.BulkGetSecretRequest{}
_, e := c.BulkGetSecret(req)
_, e := c.BulkGetSecret(context.Background(), req)
assert.NotNil(t, e)
})
@ -156,7 +157,7 @@ func TestBulkGetSecret(t *testing.T) {
}
req := secretstores.BulkGetSecretRequest{}
_, e := c.BulkGetSecret(req)
_, e := c.BulkGetSecret(context.Background(), req)
assert.NotNil(t, e)
})
})

View File

@ -27,6 +27,8 @@ import (
"github.com/dapr/kit/logger"
)
var _ secretstores.SecretStore = (*kubernetesSecretStore)(nil)
type kubernetesSecretStore struct {
kubeClient kubernetes.Interface
logger logger.Logger
@ -49,7 +51,7 @@ func (k *kubernetesSecretStore) Init(metadata secretstores.Metadata) error {
}
// GetSecret retrieves a secret using a key and returns a map of decrypted string/string values.
func (k *kubernetesSecretStore) GetSecret(req secretstores.GetSecretRequest) (secretstores.GetSecretResponse, error) {
func (k *kubernetesSecretStore) GetSecret(ctx context.Context, req secretstores.GetSecretRequest) (secretstores.GetSecretResponse, error) {
resp := secretstores.GetSecretResponse{
Data: map[string]string{},
}
@ -58,7 +60,7 @@ func (k *kubernetesSecretStore) GetSecret(req secretstores.GetSecretRequest) (se
return resp, err
}
secret, err := k.kubeClient.CoreV1().Secrets(namespace).Get(context.TODO(), req.Name, meta_v1.GetOptions{}) //nolint:nosnakecase
secret, err := k.kubeClient.CoreV1().Secrets(namespace).Get(ctx, req.Name, meta_v1.GetOptions{}) //nolint:nosnakecase
if err != nil {
return resp, err
}
@ -71,7 +73,7 @@ func (k *kubernetesSecretStore) GetSecret(req secretstores.GetSecretRequest) (se
}
// BulkGetSecret retrieves all secrets in the store and returns a map of decrypted string/string values.
func (k *kubernetesSecretStore) BulkGetSecret(req secretstores.BulkGetSecretRequest) (secretstores.BulkGetSecretResponse, error) {
func (k *kubernetesSecretStore) BulkGetSecret(ctx context.Context, req secretstores.BulkGetSecretRequest) (secretstores.BulkGetSecretResponse, error) {
resp := secretstores.BulkGetSecretResponse{
Data: map[string]map[string]string{},
}
@ -80,7 +82,7 @@ func (k *kubernetesSecretStore) BulkGetSecret(req secretstores.BulkGetSecretRequ
return resp, err
}
secrets, err := k.kubeClient.CoreV1().Secrets(namespace).List(context.TODO(), meta_v1.ListOptions{}) //nolint:nosnakecase
secrets, err := k.kubeClient.CoreV1().Secrets(namespace).List(ctx, meta_v1.ListOptions{}) //nolint:nosnakecase
if err != nil {
return resp, err
}

View File

@ -14,6 +14,7 @@ limitations under the License.
package env
import (
"context"
"os"
"strings"
@ -21,6 +22,8 @@ import (
"github.com/dapr/kit/logger"
)
var _ secretstores.SecretStore = (*envSecretStore)(nil)
type envSecretStore struct {
logger logger.Logger
}
@ -38,7 +41,7 @@ func (s *envSecretStore) Init(metadata secretstores.Metadata) error {
}
// GetSecret retrieves a secret from env var using provided key.
func (s *envSecretStore) GetSecret(req secretstores.GetSecretRequest) (secretstores.GetSecretResponse, error) {
func (s *envSecretStore) GetSecret(ctx context.Context, req secretstores.GetSecretRequest) (secretstores.GetSecretResponse, error) {
return secretstores.GetSecretResponse{
Data: map[string]string{
req.Name: os.Getenv(req.Name),
@ -47,7 +50,7 @@ func (s *envSecretStore) GetSecret(req secretstores.GetSecretRequest) (secretsto
}
// BulkGetSecret retrieves all secrets in the store and returns a map of decrypted string/string values.
func (s *envSecretStore) BulkGetSecret(req secretstores.BulkGetSecretRequest) (secretstores.BulkGetSecretResponse, error) {
func (s *envSecretStore) BulkGetSecret(ctx context.Context, req secretstores.BulkGetSecretRequest) (secretstores.BulkGetSecretResponse, error) {
r := map[string]map[string]string{}
for _, element := range os.Environ() {

View File

@ -15,6 +15,7 @@ limitations under the License.
package env
import (
"context"
"os"
"testing"
@ -41,7 +42,7 @@ func TestInit(t *testing.T) {
t.Run("Test set and get", func(t *testing.T) {
err := s.Init(secretstores.Metadata{})
assert.Nil(t, err)
resp, err := s.GetSecret(secretstores.GetSecretRequest{Name: key})
resp, err := s.GetSecret(context.Background(), secretstores.GetSecretRequest{Name: key})
assert.Nil(t, err)
assert.NotNil(t, resp)
assert.Equal(t, secret, resp.Data[key])
@ -50,7 +51,7 @@ func TestInit(t *testing.T) {
t.Run("Test bulk get", func(t *testing.T) {
err := s.Init(secretstores.Metadata{})
assert.Nil(t, err)
resp, err := s.BulkGetSecret(secretstores.BulkGetSecretRequest{})
resp, err := s.BulkGetSecret(context.Background(), secretstores.BulkGetSecretRequest{})
assert.Nil(t, err)
assert.NotNil(t, resp)
assert.Equal(t, secret, resp.Data[key][key])

View File

@ -14,6 +14,7 @@ limitations under the License.
package file
import (
"context"
"encoding/json"
"errors"
"fmt"
@ -34,6 +35,8 @@ type localSecretStoreMetaData struct {
MultiValued bool `mapstructure:"multiValued"`
}
var _ secretstores.SecretStore = (*localSecretStore)(nil)
type localSecretStore struct {
secretsFile string
nestedSeparator string
@ -104,7 +107,7 @@ func (j *localSecretStore) Init(metadata secretstores.Metadata) error {
}
// GetSecret retrieves a secret using a key and returns a map of decrypted string/string values.
func (j *localSecretStore) GetSecret(req secretstores.GetSecretRequest) (secretstores.GetSecretResponse, error) {
func (j *localSecretStore) GetSecret(ctx context.Context, req secretstores.GetSecretRequest) (secretstores.GetSecretResponse, error) {
secretValue, exists := j.secrets[req.Name]
if !exists {
return secretstores.GetSecretResponse{}, fmt.Errorf("secret %s not found", req.Name)
@ -133,7 +136,7 @@ func (j *localSecretStore) GetSecret(req secretstores.GetSecretRequest) (secrets
}
// BulkGetSecret retrieves all secrets in the store and returns a map of decrypted string/string values.
func (j *localSecretStore) BulkGetSecret(req secretstores.BulkGetSecretRequest) (secretstores.BulkGetSecretResponse, error) {
func (j *localSecretStore) BulkGetSecret(ctx context.Context, req secretstores.BulkGetSecretRequest) (secretstores.BulkGetSecretResponse, error) {
r := map[string]map[string]string{}
for k, v := range j.secrets {

View File

@ -15,6 +15,7 @@ limitations under the License.
package file
import (
"context"
"encoding/json"
"fmt"
"testing"
@ -80,7 +81,7 @@ func TestSeparator(t *testing.T) {
Name: "root.key1",
Metadata: map[string]string{},
}
output, err := s.GetSecret(req)
output, err := s.GetSecret(context.Background(), req)
assert.Nil(t, err)
assert.Equal(t, "value1", output.Data[req.Name])
})
@ -96,7 +97,7 @@ func TestSeparator(t *testing.T) {
Name: "root:key2",
Metadata: map[string]string{},
}
output, err := s.GetSecret(req)
output, err := s.GetSecret(context.Background(), req)
assert.Nil(t, err)
assert.Equal(t, "value2", output.Data[req.Name])
})
@ -124,7 +125,7 @@ func TestGetSecret(t *testing.T) {
Name: "secret",
Metadata: map[string]string{},
}
output, e := s.GetSecret(req)
output, e := s.GetSecret(context.Background(), req)
assert.Nil(t, e)
assert.Equal(t, "secret", output.Data[req.Name])
})
@ -134,7 +135,7 @@ func TestGetSecret(t *testing.T) {
Name: "NoSecret",
Metadata: map[string]string{},
}
_, err := s.GetSecret(req)
_, err := s.GetSecret(context.Background(), req)
assert.NotNil(t, err)
assert.Equal(t, err, fmt.Errorf("secret %s not found", req.Name))
})
@ -163,7 +164,7 @@ func TestBulkGetSecret(t *testing.T) {
t.Run("successfully retrieve secrets", func(t *testing.T) {
req := secretstores.BulkGetSecretRequest{}
output, e := s.BulkGetSecret(req)
output, e := s.BulkGetSecret(context.Background(), req)
assert.Nil(t, e)
assert.Equal(t, "secret", output.Data["secret"]["secret"])
})
@ -207,7 +208,7 @@ func TestMultiValuedSecrets(t *testing.T) {
req := secretstores.GetSecretRequest{
Name: "parent",
}
resp, err := s.GetSecret(req)
resp, err := s.GetSecret(context.Background(), req)
require.NoError(t, err)
assert.Equal(t, map[string]string{
"child1": "12345",
@ -218,7 +219,7 @@ func TestMultiValuedSecrets(t *testing.T) {
t.Run("successfully retrieve multi-valued secrets", func(t *testing.T) {
req := secretstores.BulkGetSecretRequest{}
resp, err := s.BulkGetSecret(req)
resp, err := s.BulkGetSecret(context.Background(), req)
require.NoError(t, err)
assert.Equal(t, map[string]map[string]string{
"parent": {

View File

@ -14,6 +14,7 @@ limitations under the License.
package secretstores
import (
"context"
"fmt"
"github.com/dapr/components-contrib/health"
@ -24,9 +25,9 @@ type SecretStore interface {
// Init authenticates with the actual secret store and performs other init operation
Init(metadata Metadata) error
// GetSecret retrieves a secret using a key and returns a map of decrypted string/string values.
GetSecret(req GetSecretRequest) (GetSecretResponse, error)
GetSecret(ctx context.Context, req GetSecretRequest) (GetSecretResponse, error)
// BulkGetSecret retrieves all secrets in the store and returns a map of decrypted string/string values.
BulkGetSecret(req BulkGetSecretRequest) (BulkGetSecretResponse, error)
BulkGetSecret(ctx context.Context, req BulkGetSecretRequest) (BulkGetSecretResponse, error)
// Features lists the features supported by the secret store.
Features() []Feature
}

View File

@ -0,0 +1,192 @@
/*
Copyright 2021 The Dapr Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ssm
import (
"context"
"errors"
"strconv"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile"
ssm "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssm/v20190923"
"github.com/dapr/components-contrib/secretstores"
"github.com/dapr/kit/logger"
)
const (
SecretID = "SecretID"
SecretKey = "SecretKey"
Token = "Token"
Region = "Region"
VersionID = "VersionID"
RequestID = "RequestID"
ValueType = "SecretValueType"
pageLimit uint64 = 100
)
type SecretValueType uint16
var (
// TextSecretValue text secret.
TextSecretValue SecretValueType = 10
// BinarySecretValue binary secret.
BinarySecretValue SecretValueType = 20
)
type ssmClient interface {
ListSecretsWithContext(ctx context.Context, request *ssm.ListSecretsRequest) (*ssm.ListSecretsResponse, error)
GetSecretValueWithContext(ctx context.Context, request *ssm.GetSecretValueRequest) (*ssm.GetSecretValueResponse, error)
}
type ssmSecretStore struct {
client ssmClient
logger logger.Logger
}
// NewSSM returns a new TencentCloud ssm secret store.
func NewSSM(logger logger.Logger) secretstores.SecretStore {
return &ssmSecretStore{
logger: logger,
}
}
// Init creates a TencentCloud ssm client.
func (s *ssmSecretStore) Init(metadata secretstores.Metadata) error {
var (
err error
region string
)
secretID := metadata.Properties[SecretID]
secretKey := metadata.Properties[SecretKey]
token := metadata.Properties[Token]
region = metadata.Properties[Region]
if secretID == "" || secretKey == "" {
return errors.New("secret params are empty")
}
credential := common.NewTokenCredential(secretID, secretKey, token)
s.client, err = ssm.NewClient(credential, region, profile.NewClientProfile())
if err != nil {
return err
}
return nil
}
// GetSecret retrieves a secret using a key and returns a map of decrypted string/string values.
func (s *ssmSecretStore) GetSecret(ctx context.Context, req secretstores.GetSecretRequest) (secretstores.GetSecretResponse, error) {
response := secretstores.GetSecretResponse{
Data: map[string]string{},
}
if req.Name == "" {
return response, errors.New("secret name is empty")
}
versionID := req.Metadata[VersionID]
ssmReq := ssm.NewGetSecretValueRequest()
ssmReq.SecretName = &req.Name
ssmReq.VersionId = &versionID
ssResp, err := s.client.GetSecretValueWithContext(ctx, ssmReq)
if err != nil {
return response, err
}
var val string
ssResponse := ssResp.Response
if ssResponse.SecretBinary != nil {
response.Data[ValueType] = strconv.Itoa(int(BinarySecretValue))
val = *ssResponse.SecretBinary
} else if ssResponse.SecretString != nil {
response.Data[ValueType] = strconv.Itoa(int(TextSecretValue))
val = *ssResponse.SecretString
}
if ssResponse.SecretName != nil {
response.Data[*ssResponse.SecretName] = val
}
if ssResponse.RequestId != nil {
response.Data[RequestID] = *ssResponse.RequestId
}
return response, nil
}
func (s *ssmSecretStore) BulkGetSecret(ctx context.Context, req secretstores.BulkGetSecretRequest) (secretstores.BulkGetSecretResponse, error) {
response := secretstores.BulkGetSecretResponse{
Data: map[string]map[string]string{},
}
versionID := req.Metadata[VersionID]
var start uint64 = 0
names, err := s.getSecretNames(ctx, &start)
if err != nil {
return response, err
}
for _, name := range names {
resp, err := s.GetSecret(ctx, secretstores.GetSecretRequest{
Name: name,
Metadata: map[string]string{
VersionID: versionID,
},
})
if err != nil {
return response, err
}
response.Data[name] = resp.Data
}
return response, nil
}
func (s *ssmSecretStore) getSecretNames(ctx context.Context, offset *uint64) ([]string, error) {
names := []string{}
limit := pageLimit
// secret name is in Enabled state.
var state uint64 = 1
ssmReq := ssm.NewListSecretsRequest()
ssmReq.Offset = offset
ssmReq.Limit = &limit
ssmReq.State = &state
ssmResp, err := s.client.ListSecretsWithContext(ctx, ssmReq)
if err != nil {
return nil, err
}
resp := ssmResp.Response
for _, metadata := range resp.SecretMetadatas {
names = append(names, *metadata.SecretName)
}
retLen := uint64(len(resp.SecretMetadatas))
if limit > retLen {
return names, nil
}
var newNames []string
*offset += retLen
newNames, err = s.getSecretNames(ctx, offset)
if err != nil {
return nil, err
}
names = append(names, newNames...)
return names, nil
}
// Features returns the features available in this secret store.
func (s *ssmSecretStore) Features() []secretstores.Feature {
return []secretstores.Feature{} // No Feature supported.
}

View File

@ -0,0 +1,171 @@
/*
Copyright 2021 The Dapr Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ssm
import (
"context"
"fmt"
"testing"
"github.com/stretchr/testify/assert"
ssm "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssm/v20190923"
"github.com/dapr/components-contrib/secretstores"
)
const (
secretName = "secret-name"
secretValue = "secret-value"
)
type mockedSsmSecretStore struct {
ssmClient
}
func (m *mockedSsmSecretStore) ListSecretsWithContext(ctx context.Context, request *ssm.ListSecretsRequest) (*ssm.ListSecretsResponse, error) {
name := secretName
requestID := "requestid"
return &ssm.ListSecretsResponse{
Response: &ssm.ListSecretsResponseParams{
SecretMetadatas: []*ssm.SecretMetadata{
{
SecretName: &name,
},
},
RequestId: &requestID,
},
}, nil
}
func (m *mockedSsmSecretStore) GetSecretValueWithContext(ctx context.Context, request *ssm.GetSecretValueRequest) (*ssm.GetSecretValueResponse, error) {
secretString := secretValue
requestID := "requestid"
return &ssm.GetSecretValueResponse{
Response: &ssm.GetSecretValueResponseParams{
SecretName: request.SecretName,
SecretString: &secretString,
RequestId: &requestID,
},
}, nil
}
type mockedSsmSecretStoreReturnError struct {
ssmClient
}
func (m *mockedSsmSecretStoreReturnError) ListSecretsWithContext(ctx context.Context, request *ssm.ListSecretsRequest) (*ssm.ListSecretsResponse, error) {
name := secretName
requestID := "requestid"
return &ssm.ListSecretsResponse{
Response: &ssm.ListSecretsResponseParams{
SecretMetadatas: []*ssm.SecretMetadata{
{
SecretName: &name,
},
},
RequestId: &requestID,
},
}, nil
}
func (m *mockedSsmSecretStoreReturnError) GetSecretValueWithContext(ctx context.Context, request *ssm.GetSecretValueRequest) (*ssm.GetSecretValueResponse, error) {
return nil, fmt.Errorf("mocked error")
}
type mockedSsmSecretStoreBothReturnError struct {
ssmClient
}
func (m *mockedSsmSecretStoreBothReturnError) ListSecretsWithContext(ctx context.Context, request *ssm.ListSecretsRequest) (*ssm.ListSecretsResponse, error) {
return nil, fmt.Errorf("mocked error")
}
func (m *mockedSsmSecretStoreBothReturnError) GetSecretValueWithContext(ctx context.Context, request *ssm.GetSecretValueRequest) (*ssm.GetSecretValueResponse, error) {
return nil, fmt.Errorf("mocked error")
}
func TestGetSecret(t *testing.T) {
t.Run("successfully get secret", func(t *testing.T) {
c := ssmSecretStore{
client: &mockedSsmSecretStore{},
}
req := secretstores.GetSecretRequest{
Name: secretName,
Metadata: map[string]string{
"VersionID": "v1",
},
}
resp, e := c.GetSecret(context.Background(), req)
assert.Nil(t, e)
assert.Equal(t, secretValue, resp.Data[req.Name])
})
t.Run("unsuccessfully get secret", func(t *testing.T) {
c := ssmSecretStore{
client: &mockedSsmSecretStoreBothReturnError{},
}
req := secretstores.GetSecretRequest{
Name: secretName,
Metadata: map[string]string{},
}
_, e := c.GetSecret(context.Background(), req)
assert.NotNil(t, e)
})
}
func TestBulkGetSecret(t *testing.T) {
t.Run("successfully bulk get secret", func(t *testing.T) {
c := ssmSecretStore{
client: &mockedSsmSecretStore{},
}
req := secretstores.BulkGetSecretRequest{}
expectedSecrets := map[string]map[string]string{
secretName: {
secretName: secretValue,
RequestID: "requestid",
ValueType: "10",
},
}
resp, e := c.BulkGetSecret(context.Background(), req)
assert.Nil(t, e)
assert.Equal(t, expectedSecrets, resp.Data)
})
t.Run("unsuccessfully bulk get secret", func(t *testing.T) {
t.Run("with failed to retrieve list of secrets", func(t *testing.T) {
c := ssmSecretStore{
client: &mockedSsmSecretStoreBothReturnError{},
}
req := secretstores.BulkGetSecretRequest{}
_, e := c.BulkGetSecret(context.Background(), req)
assert.NotNil(t, e)
})
t.Run("with failed to retrieve the secret", func(t *testing.T) {
c := ssmSecretStore{
client: &mockedSsmSecretStoreReturnError{},
}
req := secretstores.BulkGetSecretRequest{}
_, e := c.BulkGetSecret(context.Background(), req)
assert.NotNil(t, e)
})
})
}

View File

@ -165,3 +165,5 @@ replace github.com/dapr/components-contrib => ../../../../..
replace github.com/dapr/components-contrib/tests/certification => ../../..
replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.20220709114046-2f2dc4f9a684
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -41,6 +41,8 @@ contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZ
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
dubbo.apache.org/dubbo-go/v3 v3.0.3-0.20220610080020-48691a404537 h1:NblXw7tbHBFZ0AWEH09fgM9MwQ3XNPUPHDFeBjM7HV4=
dubbo.apache.org/dubbo-go/v3 v3.0.3-0.20220610080020-48691a404537/go.mod h1:O7eTHAilCWlqBjEkG2MW9khZFImiARb/tSOE8PJas+g=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
@ -193,8 +195,6 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creasty/defaults v1.5.2 h1:/VfB6uxpyp6h0fr7SPp7n8WJBoV8jfxQXPCnkVSjyls=
github.com/creasty/defaults v1.5.2/go.mod h1:FPZ+Y0WNrbqOVw+c6av63eyHUAl6pMHZwqLPvXUZGfY=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -138,3 +138,5 @@ replace github.com/dapr/components-contrib => ../../../../..
replace github.com/dapr/components-contrib/tests/certification => ../../..
replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.20220709114046-2f2dc4f9a684
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
@ -137,8 +139,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -152,3 +152,5 @@ replace github.com/dapr/components-contrib/tests/certification => ../../../
replace github.com/dapr/components-contrib => ../../../../../
replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.20220709114046-2f2dc4f9a684
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/azure-amqp-common-go/v3 v3.2.3 h1:uDF62mbd9bypXWi19V1bN5NZEO84JqgmI5G73ibAmrk=
@ -177,8 +179,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -154,3 +154,5 @@ replace github.com/dapr/components-contrib/tests/certification => ../../../
replace github.com/dapr/components-contrib => ../../../../../
replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.20220709114046-2f2dc4f9a684
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/azure-amqp-common-go/v3 v3.2.3 h1:uDF62mbd9bypXWi19V1bN5NZEO84JqgmI5G73ibAmrk=
@ -181,8 +183,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -161,3 +161,5 @@ replace github.com/dapr/components-contrib => ../../../../..
replace github.com/dapr/components-contrib/tests/certification => ../../..
replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.20220709114046-2f2dc4f9a684
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/azure-amqp-common-go/v3 v3.2.3 h1:uDF62mbd9bypXWi19V1bN5NZEO84JqgmI5G73ibAmrk=
@ -193,8 +195,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -158,3 +158,5 @@ replace github.com/dapr/components-contrib => ../../../../..
replace github.com/dapr/components-contrib/tests/certification => ../../..
replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.20220709114046-2f2dc4f9a684
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/azure-amqp-common-go/v3 v3.2.3 h1:uDF62mbd9bypXWi19V1bN5NZEO84JqgmI5G73ibAmrk=
@ -183,8 +185,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -154,3 +154,5 @@ replace github.com/dapr/components-contrib => ../../../../..
replace github.com/dapr/components-contrib/tests/certification => ../../..
replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.20220709114046-2f2dc4f9a684
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/azure-amqp-common-go/v3 v3.2.3 h1:uDF62mbd9bypXWi19V1bN5NZEO84JqgmI5G73ibAmrk=
@ -175,8 +177,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -154,3 +154,5 @@ replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.2022
// in the Dapr runtime. Don't commit with this uncommented!
//
// replace github.com/dapr/dapr => ../../../../../dapr
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
@ -133,8 +135,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@ -177,8 +177,8 @@ github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoD
github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY=
github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k=
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI=

View File

@ -129,3 +129,5 @@ replace github.com/dapr/components-contrib => ../../../..
replace github.com/dapr/components-contrib/tests/certification => ../..
replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.20220709114046-2f2dc4f9a684
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
@ -133,8 +135,6 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/cyphar/filepath-securejoin v0.2.3 h1:YX6ebbZCZP7VkM3scTTokDgBL2TY741X51MTk3ycuNI=
github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -137,3 +137,5 @@ replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.2022
// in the Dapr runtime. Don't commit with this uncommented!
//
// replace github.com/dapr/dapr => ../../../../../dapr
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
@ -131,8 +133,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -130,3 +130,5 @@ require (
replace github.com/dapr/components-contrib => ../../
replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.20220709114046-2f2dc4f9a684
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
@ -131,8 +133,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -165,3 +165,5 @@ replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.2022
// in the Dapr runtime. Don't commit with this uncommented!
//
// replace github.com/dapr/dapr => ../../../../../dapr
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/azure-amqp-common-go/v3 v3.2.3 h1:uDF62mbd9bypXWi19V1bN5NZEO84JqgmI5G73ibAmrk=
@ -193,8 +195,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -158,3 +158,5 @@ replace github.com/dapr/components-contrib => ../../../../..
replace github.com/dapr/components-contrib/tests/certification => ../../..
replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.20220709114046-2f2dc4f9a684
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/azure-amqp-common-go/v3 v3.2.3 h1:uDF62mbd9bypXWi19V1bN5NZEO84JqgmI5G73ibAmrk=
@ -181,8 +183,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -154,3 +154,5 @@ replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.2022
// in the Dapr runtime. Don't commit with this uncommented!
//
// replace github.com/dapr/dapr => ../../../../../dapr
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
@ -133,8 +135,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@ -177,8 +177,8 @@ github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoD
github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY=
github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k=
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI=

View File

@ -143,3 +143,5 @@ replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.2022
// in the Dapr runtime. Don't commit with this uncommented!
//
// replace github.com/dapr/dapr => ../../../../../dapr
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
@ -133,8 +135,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -137,3 +137,5 @@ replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.2022
// in the Dapr runtime. Don't commit with this uncommented!
//
// replace github.com/dapr/dapr => ../../../../../dapr
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
@ -131,8 +133,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -153,3 +153,5 @@ replace github.com/dapr/components-contrib/tests/certification => ../../../
replace github.com/dapr/components-contrib => ../../../../../
replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.20220709114046-2f2dc4f9a684
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/azure-amqp-common-go/v3 v3.2.3 h1:uDF62mbd9bypXWi19V1bN5NZEO84JqgmI5G73ibAmrk=
@ -179,8 +181,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -128,3 +128,5 @@ replace github.com/dapr/components-contrib => ../../../../..
replace github.com/dapr/components-contrib/tests/certification => ../../..
replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.20220709114046-2f2dc4f9a684
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
@ -131,8 +133,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -128,3 +128,5 @@ replace github.com/dapr/components-contrib => ../../../../..
replace github.com/dapr/components-contrib/tests/certification => ../../..
replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.20220709114046-2f2dc4f9a684
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
@ -131,8 +133,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -152,3 +152,5 @@ replace github.com/dapr/components-contrib => ../../../../..
replace github.com/dapr/components-contrib/tests/certification => ../../..
replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.20220709114046-2f2dc4f9a684
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/azure-amqp-common-go/v3 v3.2.3 h1:uDF62mbd9bypXWi19V1bN5NZEO84JqgmI5G73ibAmrk=
@ -176,8 +178,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -153,3 +153,5 @@ replace github.com/dapr/components-contrib => ../../../../..
replace github.com/dapr/components-contrib/tests/certification => ../../..
replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.20220709114046-2f2dc4f9a684
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/azure-amqp-common-go/v3 v3.2.3 h1:uDF62mbd9bypXWi19V1bN5NZEO84JqgmI5G73ibAmrk=
@ -179,8 +181,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -152,3 +152,5 @@ replace github.com/dapr/components-contrib => ../../../../..
replace github.com/dapr/components-contrib/tests/certification => ../../..
replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.20220709114046-2f2dc4f9a684
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/azure-amqp-common-go/v3 v3.2.3 h1:uDF62mbd9bypXWi19V1bN5NZEO84JqgmI5G73ibAmrk=
@ -177,8 +179,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -0,0 +1,65 @@
## Test for TTL
1. TTL not expiring
2. TTL not a valid number
3. TTL Expires as expected
- Provide a TTL of 5 second
- Fetch this record just after saving
- Sleep for 5 seconds
- Try to fetch again after a gap of 5 seconds, record shouldn't be deleted
## Connection Recovery
1. When Cassandra goes down and then comes back up the client is able to reconnect
## Test Metadata Fields
1. Verify `port` attribute is used
- set port to non default value
- run dapr application with component
- component should successfully initialize
2. Verify `keyspace` attribute is used
- set keyspace to non-default value
- run dapr application with component
- component should successfully initialize and create keyspace
3. Verify `table` attribute is used
- set table to non-default value
- run dapr application with component
- component should successfully initialize and create table
- successfully run query on table
4. Verify `protoVersion` attribute is used
- set protoVersion to non-default value 0
- run dapr application with component
- cassandra client itself should detect version from cluster if protoVersion == 0
- component should successfully initialize
- run queries to verify
5. Verify `protoVersion` attribute is used -negative test
- set protoVersion to non-default value 1
- run dapr application with component
- component should recieve errors on queries
6. Verify `replicationFactor` attribute is used
- set replicationFactor to non-default value 2
- run dapr application with component using 2 nodes
- component should successfully initialize
- run queries to verify
7. Verify `replicationFactor` attribute is used - negative test
- set replicationFactor to non-default value 2
- run dapr application with component using 1 node
- component should recieve errors on queries
8. Verify `consistency` attribute is used - negative test
- set consistency to non-default value "Three"
- run dapr application with component
- component should successfully initialize
- run queries and see failure due to less than 3 nodes available
9. Verify `consistency` attribute is used
- set consistency to non-default value "Two"
- run dapr application with component
- component should successfully initialize
- run queries successfully

View File

@ -0,0 +1,312 @@
/*
Copyright 2022 The Dapr Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package cassandra_test
import (
"fmt"
"github.com/dapr/components-contrib/state"
state_cassandra "github.com/dapr/components-contrib/state/cassandra"
"github.com/dapr/components-contrib/tests/certification/embedded"
"github.com/dapr/components-contrib/tests/certification/flow"
"github.com/dapr/components-contrib/tests/certification/flow/dockercompose"
"github.com/dapr/components-contrib/tests/certification/flow/network"
"github.com/dapr/components-contrib/tests/certification/flow/sidecar"
state_loader "github.com/dapr/dapr/pkg/components/state"
"github.com/dapr/dapr/pkg/runtime"
dapr_testing "github.com/dapr/dapr/pkg/testing"
goclient "github.com/dapr/go-sdk/client"
"github.com/dapr/kit/logger"
"github.com/stretchr/testify/assert"
"strconv"
"testing"
"time"
)
const (
sidecarNamePrefix = "cassandra-sidecar-"
dockerComposeYAMLCLUSTER = "docker-compose-cluster.yml"
dockerComposeYAML = "docker-compose-single.yml"
stateStoreName = "statestore"
stateStoreCluster = "statestorecluster"
stateStoreClusterFail = "statestoreclusterfail"
stateStoreVersionFail = "statestoreversionfail"
stateStoreFactorFail = "statestorefactorfail"
certificationTestPrefix = "stable-certification-"
stateStoreNoConfigError = "error saving state: rpc error: code = FailedPrecondition desc = state store is not configured"
)
func TestCassandra(t *testing.T) {
log := logger.NewLogger("dapr.components")
stateStore := state_cassandra.NewCassandraStateStore(log).(*state_cassandra.Cassandra)
ports, err := dapr_testing.GetFreePorts(2)
assert.NoError(t, err)
stateRegistry := state_loader.NewRegistry()
stateRegistry.Logger = log
stateRegistry.RegisterComponent(func(l logger.Logger) state.Store {
return stateStore
}, "cassandra")
currentGrpcPort := ports[0]
currentHTTPPort := ports[1]
basicTest := func(ctx flow.Context) error {
client, err := goclient.NewClientWithPort(fmt.Sprint(currentGrpcPort))
if err != nil {
panic(err)
}
defer client.Close()
err = client.SaveState(ctx, stateStoreName, certificationTestPrefix+"key1", []byte("cassandraCert"), nil)
assert.NoError(t, err)
// get state
item, err := client.GetState(ctx, stateStoreName, certificationTestPrefix+"key1", nil)
assert.NoError(t, err)
assert.Equal(t, "cassandraCert", string(item.Value))
errUpdate := client.SaveState(ctx, stateStoreName, certificationTestPrefix+"key1", []byte("cassandraCertUpdate"), nil)
assert.NoError(t, errUpdate)
item, errUpdatedGet := client.GetState(ctx, stateStoreName, certificationTestPrefix+"key1", nil)
assert.NoError(t, errUpdatedGet)
assert.Equal(t, "cassandraCertUpdate", string(item.Value))
// delete state
err = client.DeleteState(ctx, stateStoreName, certificationTestPrefix+"key1", nil)
assert.NoError(t, err)
return nil
}
// Time-To-Live Test
timeToLiveTest := func(ctx flow.Context) error {
client, err := goclient.NewClientWithPort(fmt.Sprint(currentGrpcPort))
if err != nil {
panic(err)
}
defer client.Close()
ttlInSecondsWrongValue := "mock value"
mapOptionsWrongValue :=
map[string]string{
"ttlInSeconds": ttlInSecondsWrongValue,
}
ttlInSecondsNonExpiring := 0
mapOptionsNonExpiring :=
map[string]string{
"ttlInSeconds": strconv.Itoa(ttlInSecondsNonExpiring),
}
ttlInSeconds := 5
mapOptions :=
map[string]string{
"ttlInSeconds": strconv.Itoa(ttlInSeconds),
}
err1 := client.SaveState(ctx, stateStoreName, certificationTestPrefix+"ttl1", []byte("cassandraCert"), mapOptionsWrongValue)
assert.Error(t, err1)
err2 := client.SaveState(ctx, stateStoreName, certificationTestPrefix+"ttl2", []byte("cassandraCert2"), mapOptionsNonExpiring)
assert.NoError(t, err2)
err3 := client.SaveState(ctx, stateStoreName, certificationTestPrefix+"ttl3", []byte("cassandraCert3"), mapOptions)
assert.NoError(t, err3)
// get state
item, err := client.GetState(ctx, stateStoreName, certificationTestPrefix+"ttl3", nil)
assert.NoError(t, err)
assert.Equal(t, "cassandraCert3", string(item.Value))
time.Sleep(5 * time.Second)
//entry should be expired now
itemAgain, errAgain := client.GetState(ctx, stateStoreName, certificationTestPrefix+"ttl3", nil)
assert.NoError(t, errAgain)
assert.Nil(t, nil, itemAgain)
return nil
}
testGetAfterCassandraRestart := func(ctx flow.Context) error {
client, err := goclient.NewClientWithPort(fmt.Sprint(currentGrpcPort))
if err != nil {
panic(err)
}
defer client.Close()
// get state
item, err := client.GetState(ctx, stateStoreName, certificationTestPrefix+"ttl2", nil)
assert.NoError(t, err)
assert.Equal(t, "cassandraCert2", string(item.Value))
return nil
}
failTest := func(ctx flow.Context) error {
client, err := goclient.NewClientWithPort(fmt.Sprint(currentGrpcPort + 2))
if err != nil {
panic(err)
}
defer client.Close()
//should fail due to lack of replicas
err = client.SaveState(ctx, stateStoreFactorFail, certificationTestPrefix+"key1", []byte("cassandraCert"), nil)
assert.Error(t, err)
return nil
}
failVerTest := func(ctx flow.Context) error {
client, err := goclient.NewClientWithPort(fmt.Sprint(currentGrpcPort + 4))
if err != nil {
panic(err)
}
defer client.Close()
// should fail due to unsupported version
err = client.SaveState(ctx, stateStoreVersionFail, certificationTestPrefix+"key1", []byte("cassandraCert"), nil)
assert.Error(t, err)
return nil
}
flow.New(t, "Connecting cassandra And Ports and Verifying TTL and network tests and table creation").
Step(dockercompose.Run("cassandra", dockerComposeYAML)).
Step("wait", flow.Sleep(80*time.Second)).
Step(sidecar.Run(sidecarNamePrefix+"dockerDefault",
embedded.WithoutApp(),
embedded.WithDaprGRPCPort(currentGrpcPort),
embedded.WithDaprHTTPPort(currentHTTPPort),
embedded.WithComponentsPath("components/docker/default"),
runtime.WithStates(stateRegistry),
)).
Step("wait", flow.Sleep(30*time.Second)).
Step("Run TTL related test", timeToLiveTest).
Step("interrupt network",
network.InterruptNetwork(10*time.Second, nil, nil, "9044:9042")).
//Component should recover at this point.
Step("wait", flow.Sleep(30*time.Second)).
Step("Run basic test again to verify reconnection occurred", basicTest).
Step("stop cassandra server", dockercompose.Stop("cassandra", dockerComposeYAML, "cassandra")).
Step("start cassandra server", dockercompose.Start("cassandra", dockerComposeYAML, "cassandra")).
Step("wait", flow.Sleep(60*time.Second)).
Step("Get Values Saved Earlier And Not Expired, after Cassandra restart", testGetAfterCassandraRestart).
Step("Run basic test", basicTest).
Step(sidecar.Run(sidecarNamePrefix+"dockerDefault2",
embedded.WithoutApp(),
embedded.WithProfilePort(runtime.DefaultProfilePort+2),
embedded.WithDaprGRPCPort(currentGrpcPort+2),
embedded.WithDaprHTTPPort(currentHTTPPort+2),
embedded.WithComponentsPath("components/docker/defaultfactorfail"),
runtime.WithStates(stateRegistry),
)).
Step("wait", flow.Sleep(30*time.Second)).
Step("Run replication factor fail test", failTest).
Step(sidecar.Run(sidecarNamePrefix+"dockerDefault3",
embedded.WithoutApp(),
embedded.WithProfilePort(runtime.DefaultProfilePort+4),
embedded.WithDaprGRPCPort(currentGrpcPort+4),
embedded.WithDaprHTTPPort(currentHTTPPort+4),
embedded.WithComponentsPath("components/docker/defaultverisonfail"),
runtime.WithStates(stateRegistry),
)).
Step("wait", flow.Sleep(30*time.Second)).
Step("Run replication factor fail test", failVerTest).
Run()
}
func TestCluster(t *testing.T) {
log := logger.NewLogger("dapr.components")
stateStore := state_cassandra.NewCassandraStateStore(log).(*state_cassandra.Cassandra)
ports, err := dapr_testing.GetFreePorts(2)
assert.NoError(t, err)
currentGrpcPort := ports[0]
currentHTTPPort := ports[1]
stateRegistry := state_loader.NewRegistry()
stateRegistry.Logger = log
stateRegistry.RegisterComponent(func(l logger.Logger) state.Store {
return stateStore
}, "cassandra")
basicTest := func(ctx flow.Context) error {
client, err := goclient.NewClientWithPort(fmt.Sprint(currentGrpcPort))
if err != nil {
panic(err)
}
defer client.Close()
err = client.SaveState(ctx, stateStoreCluster, certificationTestPrefix+"key1", []byte("cassandraCert"), nil)
assert.NoError(t, err)
// get state
item, err := client.GetState(ctx, stateStoreCluster, certificationTestPrefix+"key1", nil)
assert.NoError(t, err)
assert.Equal(t, "cassandraCert", string(item.Value))
errUpdate := client.SaveState(ctx, stateStoreCluster, certificationTestPrefix+"key1", []byte("cassandraCertUpdate"), nil)
assert.NoError(t, errUpdate)
item, errUpdatedGet := client.GetState(ctx, stateStoreCluster, certificationTestPrefix+"key1", nil)
assert.NoError(t, errUpdatedGet)
assert.Equal(t, "cassandraCertUpdate", string(item.Value))
// delete state
err = client.DeleteState(ctx, stateStoreCluster, certificationTestPrefix+"key1", nil)
assert.NoError(t, err)
return nil
}
failTest := func(ctx flow.Context) error {
client, err := goclient.NewClientWithPort(fmt.Sprint(currentGrpcPort + 2))
if err != nil {
panic(err)
}
defer client.Close()
err = client.SaveState(ctx, stateStoreClusterFail, certificationTestPrefix+"key1", []byte("cassandraCert"), nil)
assert.NoError(t, err)
// get state
_, err = client.GetStateWithConsistency(ctx, stateStoreClusterFail, certificationTestPrefix+"key1", nil, goclient.StateConsistencyUndefined)
assert.Error(t, err)
return nil
}
flow.New(t, "Connecting cassandra And Verifying port/tables/keyspaces/consistency").
Step(dockercompose.Run("cassandra", dockerComposeYAMLCLUSTER)).
Step("wait", flow.Sleep(80*time.Second)).
Step(sidecar.Run(sidecarNamePrefix+"dockerDefault",
embedded.WithoutApp(),
embedded.WithDaprGRPCPort(currentGrpcPort),
embedded.WithDaprHTTPPort(currentHTTPPort),
embedded.WithComponentsPath("components/docker/cluster"),
runtime.WithStates(stateRegistry),
)).
Step("wait", flow.Sleep(30*time.Second)).
Step("Run basic test", basicTest).
Step(sidecar.Run(sidecarNamePrefix+"dockerDefault2",
embedded.WithoutApp(),
embedded.WithDaprGRPCPort(currentGrpcPort+2),
embedded.WithDaprHTTPPort(currentHTTPPort+2),
embedded.WithComponentsPath("components/docker/cluster-fail"),
embedded.WithProfilePort(runtime.DefaultProfilePort+2),
runtime.WithStates(stateRegistry),
)).
Step("wait", flow.Sleep(30*time.Second)).
Step("Run consistency fail test", failTest).
Run()
}

View File

@ -0,0 +1,19 @@
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: statestoreclusterfail
spec:
type: state.cassandra
version: v1
initTimeout: 20s
metadata:
- name: hosts
value: localhost
- name: username
value: cassandra
- name: password
value: cassandra
- name: consistency
value: "Three"
- name: replicationFactor
value: "3"

View File

@ -0,0 +1,21 @@
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: statestorecluster
spec:
type: state.cassandra
version: v1
initTimeout: 20s
metadata:
- name: hosts
value: localhost
- name: username
value: cassandra
- name: password
value: cassandra
- name: protoVersion
value: "0"
- name: replicationFactor
value: "2"
- name: consistency
value: "Two"

View File

@ -0,0 +1,21 @@
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: statestore
spec:
type: state.cassandra
version: v1
initTimeout: 20s
metadata:
- name: hosts
value: localhost
- name: username
value: cassandra
- name: password
value: cassandra
- name: port
value: "9044"
- name: table
value: "daprTable"
- name: keyspace
value: "daprKeyspace"

View File

@ -0,0 +1,23 @@
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: statestorefactorfail
spec:
type: state.cassandra
version: v1
initTimeout: 30s
metadata:
- name: hosts
value: localhost
- name: username
value: cassandra
- name: password
value: cassandra
- name: port
value: "9044"
- name: table
value: "daprTableFactor"
- name: keyspace
value: "daprKeyspaceFactor"
- name: replicationFactor
value: "2"

View File

@ -0,0 +1,24 @@
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: statestoreversionfail
spec:
type: state.cassandra
version: v1
initTimeout: 20s
ignoreErrors: true
metadata:
- name: hosts
value: localhost
- name: username
value: cassandra
- name: password
value: cassandra
- name: port
value: "9044"
- name: table
value: "daprTableVersion"
- name: keyspace
value: "daprKeyspaceVersion"
- name: protoVersion
value: "1"

View File

@ -0,0 +1,6 @@
apiVersion: dapr.io/v1alpha1
kind: Configuration
metadata:
name: keyvaultconfig
spec:
features:

View File

@ -0,0 +1,31 @@
version: '2'
services:
cassandra:
image: docker.io/bitnami/cassandra:4.0.1
ports:
- '7000:7000'
- '9042:9042'
volumes:
- 'cassandra_data:/bitnami'
environment:
- CASSANDRA_SEEDS=cassandra,cassandra2
- CASSANDRA_CLUSTER_NAME=cassandra-cluster
- CASSANDRA_PASSWORD=cassandra
- CASSANDRA_PASSWORD_SEEDER=yes
cassandra2:
image: docker.io/bitnami/cassandra:4.0.1
ports:
- 7001:7000
- 9043:9042
volumes:
- cassandra2_data:/bitnami
environment:
- CASSANDRA_SEEDS=cassandra,cassandra2
- CASSANDRA_CLUSTER_NAME=cassandra-cluster
- CASSANDRA_PASSWORD=cassandra
volumes:
cassandra_data:
driver: local
cassandra2_data:
driver: local

View File

@ -0,0 +1,14 @@
version: '2'
services:
cassandra:
image: docker.io/bitnami/cassandra:4.0.1
ports:
- '7002:7000'
- '9044:9042'
volumes:
- 'cassandra_data:/bitnami'
environment:
- CASSANDRA_PASSWORD=cassandra
volumes:
cassandra_data:
driver: local

View File

@ -0,0 +1,139 @@
module github.com/dapr/components-contrib/tests/certification/state/cassandra
go 1.19
require (
github.com/dapr/components-contrib v1.8.0-rc.6
github.com/dapr/components-contrib/tests/certification v0.0.0-20211026011813-36b75e9ae272
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c
github.com/dapr/go-sdk v1.4.0
github.com/dapr/kit v0.0.2
github.com/stretchr/testify v1.8.0
)
require (
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gocql/gocql v0.0.0-20210515062232-b7ef815b4556 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.7.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.7.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.7.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.7.0 // indirect
go.opentelemetry.io/otel/exporters/zipkin v1.7.0 // indirect
go.opentelemetry.io/otel/sdk v1.7.0 // indirect
go.opentelemetry.io/otel/trace v1.7.0 // indirect
go.opentelemetry.io/proto/otlp v0.16.0 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/tools v0.1.11 // indirect
)
require (
contrib.go.opencensus.io/exporter/prometheus v0.4.1 // indirect
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/antlr/antlr4 v0.0.0-20200503195918-621b933c7a7f // indirect
github.com/armon/go-metrics v0.3.10 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/fasthttp/router v1.3.8 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-kit/log v0.2.0 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/cel-go v0.9.0 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/grandcat/zeroconf v0.0.0-20190424104450-85eadb44205c // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
github.com/hashicorp/consul/api v1.11.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-hclog v1.2.1 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/serf v0.9.6 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.15.1 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/miekg/dns v1.1.50 // indirect
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/openzipkin/zipkin-go v0.4.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.12.2 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.35.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/prometheus/statsd_exporter v0.22.3 // indirect
github.com/savsgio/gotils v0.0.0-20210217112953-d4a072536008 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/sony/gobreaker v0.4.2-0.20210216022020-dd874f9dd33b // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stoewer/go-strcase v1.2.0 // indirect
github.com/stretchr/objx v0.4.0 // indirect
github.com/tylertreat/comcast v1.0.1 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasthttp v1.34.0 // indirect
go.opencensus.io v0.23.0 // indirect
go.opentelemetry.io/otel v1.7.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/net v0.0.0-20220630215102-69896b714898 // indirect
golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a // indirect
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220622171453-ea41d75dfa0f // indirect
google.golang.org/grpc v1.47.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.23.0 // indirect
k8s.io/apiextensions-apiserver v0.23.0 // indirect
k8s.io/apimachinery v0.23.0 // indirect
k8s.io/client-go v0.23.0 // indirect
k8s.io/component-base v0.23.0 // indirect
k8s.io/klog/v2 v2.30.0 // indirect
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b // indirect
sigs.k8s.io/controller-runtime v0.11.0 // indirect
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.0 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
replace github.com/dapr/components-contrib/tests/certification => ../../
replace github.com/dapr/components-contrib => ../../../../
replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.20220709114046-2f2dc4f9a684
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

File diff suppressed because it is too large Load Diff

View File

@ -141,3 +141,5 @@ replace github.com/dapr/components-contrib/tests/certification => ../../
replace github.com/dapr/components-contrib => ../../../../
replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.20220709114046-2f2dc4f9a684
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
@ -135,8 +137,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -138,3 +138,5 @@ replace github.com/dapr/components-contrib/tests/certification => ../../
replace github.com/dapr/components-contrib => ../../../../
replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.20220709114046-2f2dc4f9a684
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
@ -139,8 +141,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -135,3 +135,5 @@ replace github.com/dapr/components-contrib/tests/certification => ../../
replace github.com/dapr/components-contrib => ../../../../
replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.20220709114046-2f2dc4f9a684
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
@ -134,8 +136,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -133,3 +133,5 @@ replace github.com/dapr/components-contrib/tests/certification => ../../
replace github.com/dapr/components-contrib => ../../../../
replace github.com/dapr/go-sdk => github.com/hunter007/dapr-go-sdk v1.3.1-0.20220709114046-2f2dc4f9a684
replace github.com/dapr/dapr => github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1

View File

@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM=
contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1 h1:DQRAreuCKzrpXrojGe99Kn/0HLx1FIIhVfdUY/zLUVs=
github.com/1046102779/dapr v1.5.2-0.20220829014128-56ac94bfadd1/go.mod h1:buXV26puGO2PYHJVMXz1wm0lf7ZVfj/+ehBKOBwSe4c=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a h1:XVdatQFSP2YhJGjqLLIfW8QBk4loz/SCe/PxkXDiW+s=
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a/go.mod h1:C0A1KeiVHs+trY6gUTPhhGammbrZ30ZfXRW/nuT7HLw=
github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
@ -132,8 +134,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c h1:WmpDH/Ts/WYoJM8CJgY9WZWZVj5i8iUeSd1bS/aqlIs=
github.com/dapr/dapr v1.8.4-0.20220829184035-996cc622ad0c/go.mod h1:id6jlg9wW4fuvsCnJMqPKllBZFpb6Baqn0CbnDrEbPg=
github.com/dapr/kit v0.0.2 h1:VNg6RWrBMOdtY0/ZLztyAa/RjyFLaskdO9wt2HIREwk=
github.com/dapr/kit v0.0.2/go.mod h1:Q4TWm9+vcPZFGehaJUZt2hvA805wJm7FIuoArytWJ8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -12,4 +12,3 @@ spec:
value: cassandra
- name: password
value: cassandra

View File

@ -14,6 +14,7 @@ limitations under the License.
package secretstores
import (
"context"
"os"
"testing"
@ -80,7 +81,7 @@ func ConformanceTests(t *testing.T, props map[string]string, store secretstores.
}
t.Run("get", func(t *testing.T) {
resp, err := store.GetSecret(getSecretRequest)
resp, err := store.GetSecret(context.Background(), getSecretRequest)
assert.NoError(t, err, "expected no error on getting secret %v", getSecretRequest)
assert.NotNil(t, resp, "expected value to be returned")
assert.NotNil(t, resp.Data, "expected value to be returned")
@ -101,7 +102,7 @@ func ConformanceTests(t *testing.T, props map[string]string, store secretstores.
}
t.Run("bulkget", func(t *testing.T) {
resp, err := store.BulkGetSecret(bulkReq)
resp, err := store.BulkGetSecret(context.Background(), bulkReq)
assert.NoError(t, err, "expected no error on getting secret %v", bulkReq)
assert.NotNil(t, resp, "expected value to be returned")
assert.NotNil(t, resp.Data, "expected value to be returned")