Skip to content

Commit

Permalink
Merge branch 'master' into pubsub-pulsar-authentication-oidc-init
Browse files Browse the repository at this point in the history
  • Loading branch information
yaron2 authored Aug 2, 2023
2 parents c092e47 + 60322a1 commit 7125624
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 6 deletions.
29 changes: 28 additions & 1 deletion bindings/azure/storagequeues/storagequeues.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ const (
defaultTTL = 10 * time.Minute
defaultVisibilityTimeout = 30 * time.Second
defaultPollingInterval = 10 * time.Second
dequeueCount = "dequeueCount"
insertionTime = "insertionTime"
expirationTime = "expirationTime"
nextVisibleTime = "nextVisibleTime"
popReceipt = "popReceipt"
messageID = "messageID"
)

type consumer struct {
Expand Down Expand Up @@ -177,9 +183,30 @@ func (d *AzureQueueHelper) Read(ctx context.Context, consumer *consumer) error {
}
}

metadata := make(map[string]string, 6)

if res.Messages[0].MessageID != nil {
metadata[messageID] = *res.Messages[0].MessageID
}
if res.Messages[0].PopReceipt != nil {
metadata[popReceipt] = *res.Messages[0].PopReceipt
}
if res.Messages[0].InsertionTime != nil {
metadata[insertionTime] = res.Messages[0].InsertionTime.Format(time.RFC3339)
}
if res.Messages[0].ExpirationTime != nil {
metadata[expirationTime] = res.Messages[0].ExpirationTime.Format(time.RFC3339)
}
if res.Messages[0].TimeNextVisible != nil {
metadata[nextVisibleTime] = res.Messages[0].TimeNextVisible.Format(time.RFC3339)
}
if res.Messages[0].DequeueCount != nil {
metadata[dequeueCount] = strconv.FormatInt(*res.Messages[0].DequeueCount, 10)
}

_, err = consumer.callback(ctx, &bindings.ReadResponse{
Data: data,
Metadata: map[string]string{},
Metadata: metadata,
})
if err != nil {
return err
Expand Down
34 changes: 34 additions & 0 deletions secretstores/aws/parameterstore/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# yaml-language-server: $schema=../../../component-metadata-schema.json
schemaVersion: v1
type: secretstores
name: aws.parameterstore
version: v1
status: alpha
title: "AWS SSM Parameter Store"
urls:
- title: Reference
url: https://docs.dapr.io/reference/components-reference/supported-secret-stores/aws-parameter-store/
builtinAuthenticationProfiles:
- name: "aws"
metadata:
- name: region
required: true
description: |
The specific AWS region the AWS SSM Parameter Store instance is deployed in.
example: '"us-east-1"'
type: string
- name: sessionToken
required: false
sensitive: true
description: |
AWS session token to use. A session token is only required if you are using
temporary security credentials.
example: '"TOKEN"'
type: string
- name: prefix
required: false
description: |
The SSM Parameter Store prefix to be specified. If specified, it will be
used as the 'BeginsWith' as part of the 'ParameterStringFilter'.
example: '"myprefix"'
type: string
4 changes: 2 additions & 2 deletions secretstores/aws/parameterstore/parameterstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ func NewParameterStore(logger logger.Logger) secretstores.SecretStore {

type ParameterStoreMetaData struct {
Region string `json:"region"`
AccessKey string `json:"accessKey"`
SecretKey string `json:"secretKey"`
AccessKey string `json:"accessKey" mapstructure:"accessKey" mdignore:"true"`
SecretKey string `json:"secretKey" mapstructure:"secretKey" mdignore:"true"`
SessionToken string `json:"sessionToken"`
Prefix string `json:"prefix"`
}
Expand Down
8 changes: 5 additions & 3 deletions state/aws/dynamodb/dynamodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ type StateStore struct {
}

type dynamoDBMetadata struct {
// Ignored by metadata parser because included in built-in authentication profile
AccessKey string `json:"accessKey" mapstructure:"accessKey" mdignore:"true"`
SecretKey string `json:"secretKey" mapstructure:"secretKey" mdignore:"true"`
SessionToken string `json:"sessionToken" mapstructure:"sessionToken" mdignore:"true"`

Region string `json:"region"`
Endpoint string `json:"endpoint"`
AccessKey string `json:"accessKey"`
SecretKey string `json:"secretKey"`
SessionToken string `json:"sessionToken"`
Table string `json:"table"`
TTLAttributeName string `json:"ttlAttributeName"`
PartitionKey string `json:"partitionKey"`
Expand Down
59 changes: 59 additions & 0 deletions state/aws/dynamodb/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# yaml-language-server: $schema=../../../component-metadata-schema.json
schemaVersion: v1
type: state
name: aws.dynamodb
version: v1
status: stable
title: "AWS DynamoDB"
urls:
- title: Reference
url: https://docs.dapr.io/reference/components-reference/supported-state-stores/setup-dynamodb/
capabilities:
- crud
- transactional
- etag
- ttl
- actorStateStore
builtinAuthenticationProfiles:
- name: "aws"
metadata:
- name: table
required: true
description: |
The name of the DynamoDB table to use.
example: '"Contracts"'
type: string
- name: region
required: false
description: |
The AWS region to use. Ensure that DynamoDB is available in that region.
See the `Amazon DynamoDB endpoints and quotas` documentation.
url:
title: Amazon DynamoDB endpoints and quotas
url: https://docs.aws.amazon.com/general/latest/gr/ddb.html
example: '"us-east-1"'
type: string
- name: endpoint
required: false
description: |
AWS endpoint for the component to use. Only used for local development.
The endpoint is not necessary when running against production AWS.
example: '"http://localhost:4566"'
type: string
- name: ttlAttributeName
required: false
description: |
The table attribute name which should be used for TTL.
example: '"expiresAt"'
type: string
- name: partitionKey
required: false
description: |
The table primary key or partition key attribute name.
This field is used to replace the default primary key attribute name "key".
url:
title: More details
url: https://docs.dapr.io/reference/components-reference/supported-state-stores/setup-dynamodb/#partition-keys
example: '"ContractID"'
type: string

0 comments on commit 7125624

Please sign in to comment.