Skip to content

Commit

Permalink
Merge branch 'master' into comp-md-bindings.gcp.bucket-2573
Browse files Browse the repository at this point in the history
  • Loading branch information
robertojrojas authored Aug 2, 2023
2 parents 1f041cf + c2dbb03 commit 7c1f83b
Show file tree
Hide file tree
Showing 54 changed files with 1,683 additions and 897 deletions.
8 changes: 8 additions & 0 deletions .build-tools/builtin-authentication-profiles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ aws:
required: true
sensitive: true
example: '"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"'
- 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
- title: "AWS: Credentials from Environment Variables"
description: Use AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from the environment

Expand Down
4 changes: 2 additions & 2 deletions .build-tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ require (
github.com/invopop/jsonschema v0.6.0
github.com/spf13/cobra v1.6.1
github.com/xeipuuv/gojsonschema v1.2.1-0.20201027075954-b076d39a02e5
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1
golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb
gopkg.in/yaml.v3 v3.0.1
sigs.k8s.io/yaml v1.3.0
)

require (
github.com/dapr/kit v0.11.3-0.20230615225244-804821bb8f2d // indirect
github.com/dapr/kit v0.11.3 // indirect
github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // indirect
Expand Down
12 changes: 6 additions & 6 deletions .build-tools/go.sum
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/dapr/kit v0.11.3-0.20230615225244-804821bb8f2d h1:bICHJ3JgkFVxN1W90k2KFfOO32dun13PQsvMqVol8Uw=
github.com/dapr/kit v0.11.3-0.20230615225244-804821bb8f2d/go.mod h1:hQA6xOhcLAiccXTj7e3/bzpHwvAJCSCp70p2xg3jB40=
github.com/dapr/kit v0.11.3 h1:u1X92tE8xsrwXIej7nkcI5Z1t1CFznPwlL18tizNEw4=
github.com/dapr/kit v0.11.3/go.mod h1:hQA6xOhcLAiccXTj7e3/bzpHwvAJCSCp70p2xg3jB40=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 h1:i462o439ZjprVSFSZLZxcsoAe592sZB1rci2Z8j4wdk=
Expand All @@ -16,8 +16,8 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 h1:BpfhmLKZf+SjVanKKhCgf3bg+511DmU9eDQTen7LLbY=
github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA=
Expand All @@ -37,8 +37,8 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHo
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v1.2.1-0.20201027075954-b076d39a02e5 h1:ImnGIsrcG8vwbovhYvvSY8fagVV6QhCWSWXfzwGDLVs=
github.com/xeipuuv/gojsonschema v1.2.1-0.20201027075954-b076d39a02e5/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc=
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=
golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb h1:xIApU0ow1zwMa2uL1VDNeQlNVFTWMQxZUZCMDy0Q4Us=
golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
Expand Down
42 changes: 41 additions & 1 deletion .build-tools/pkg/metadataschema/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,46 @@ func (c *ComponentMetadata) AppendBuiltin() error {
URL: "https://docs.dapr.io/developing-applications/building-blocks/pubsub/howto-namespace/",
},
},
Metadata{
Name: "allowedTopics",
Type: "string",
Description: "A comma-separated list of allowed topics for all applications. If empty (default) apps can publish and subscribe to all topics, notwithstanding `publishingScopes` and `subscriptionScopes`.",
Example: `"app1=topic1;app2=topic2,topic3"`,
URL: &URL{
Title: "Documentation",
URL: "https://docs.dapr.io/developing-applications/building-blocks/pubsub/pubsub-scopes/",
},
},
Metadata{
Name: "publishingScopes",
Type: "string",
Description: "A semicolon-separated list of applications and comma-separated topic lists, allowing that app to publish to that list of topics. If empty (default), apps can publish to all topics.",
Example: `"app1=topic1;app2=topic2,topic3;app3="`,
URL: &URL{
Title: "Documentation",
URL: "https://docs.dapr.io/developing-applications/building-blocks/pubsub/pubsub-scopes/",
},
},
Metadata{
Name: "subscriptionScopes",
Type: "string",
Description: "A semicolon-separated list of applications and comma-separated topic lists, allowing that app to subscribe to that list of topics. If empty (default), apps can subscribe to all topics.",
Example: `"app1=topic1;app2=topic2,topic3"`,
URL: &URL{
Title: "Documentation",
URL: "https://docs.dapr.io/developing-applications/building-blocks/pubsub/pubsub-scopes/",
},
},
Metadata{
Name: "protectedTopics",
Type: "string",
Description: `A comma-separated list of topics marked as "protected" for all applications. If a topic is marked as protected then an application must be explicitly granted publish or subscribe permissions through 'publishingScopes' or 'subscriptionScopes' to publish or subscribe to it.`,
Example: `"topic1,topic2"`,
URL: &URL{
Title: "Documentation",
URL: "https://docs.dapr.io/developing-applications/building-blocks/pubsub/pubsub-scopes/",
},
},
)
case mdutils.BindingType:
if c.Binding != nil {
Expand All @@ -176,7 +216,7 @@ func (c *ComponentMetadata) AppendBuiltin() error {
Name: bindingDirectionMetadataKey,
Type: "string",
Description: "Indicates the direction of the binding component.",
Example: `"`+direction+`"`,
Example: `"` + direction + `"`,
URL: &URL{
Title: "Documentation",
URL: "https://docs.dapr.io/reference/api/bindings_api/#binding-direction-optional",
Expand Down
78 changes: 78 additions & 0 deletions bindings/aws/s3/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# yaml-language-server: $schema=../../../component-metadata-schema.json
schemaVersion: v1
type: bindings
name: aws.s3
version: v1
status: stable
title: "AWS S3"
urls:
- title: Reference
url: https://docs.dapr.io/reference/components-reference/supported-bindings/s3/
binding:
output: true
operations:
- name: create
description: "Create blob"
- name: get
description: "Get blob"
- name: delete
description: "Delete blob"
- name: list
description: "List blob"
capabilities: []
builtinAuthenticationProfiles:
- name: "aws"
metadata:
- name: bucket
required: true
description: |
The name of the S3 bucket to write to.
example: '"bucket"'
type: string
- name: region
required: true
description: |
The specific AWS region where the S3 bucket is located.
example: '"us-east-1"'
type: string
- name: endpoint
required: false
description: |
AWS endpoint for the component to use, to connect to S3-compatible services or emulators.
Do not use this when running against production AWS.
example: '"http://localhost:4566"'
type: string
- name: forcePathStyle
description: |
Currently Amazon S3 SDK supports virtual-hosted-style and path-style access.
When false (the default), uses virtual-hosted-style format, i.e.: `https://<your bucket>.<endpoint>/<key>`.
When true, uses path-style format, i.e.: `https://<endpoint>/<your bucket>/<key>`.
type: bool
default: 'false'
example: '"true", "false"'
- name: decodeBase64
description: |
Configuration to decode base64 file content before saving to bucket storage.
(In case of saving a file with binary content).
type: bool
default: 'false'
example: '"true", "false"'
- name: encodeBase64
description: |
Configuration to encode base64 file content before returning the content.
(In case of opening a file with binary content).
type: bool
default: 'false'
example: '"true", "false"'
- name: disableSSL
description: |
Allows to connect to non-`https://` endpoints.
type: bool
default: 'false'
example: '"true", "false"'
- name: insecureSSL
description: |
When connecting to `https://` endpoints, accepts self-signed or invalid certificates.
type: bool
default: 'false'
example: '"true", "false"'
10 changes: 5 additions & 5 deletions bindings/aws/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,20 @@ type AWSS3 struct {

type s3Metadata 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"`
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" mapstructure:"region"`
Endpoint string `json:"endpoint" mapstructure:"endpoint"`
SessionToken string `json:"sessionToken" mapstructure:"sessionToken"`
Bucket string `json:"bucket" mapstructure:"bucket"`
DecodeBase64 bool `json:"decodeBase64,string" mapstructure:"decodeBase64"`
EncodeBase64 bool `json:"encodeBase64,string" mapstructure:"encodeBase64"`
ForcePathStyle bool `json:"forcePathStyle,string" mapstructure:"forcePathStyle"`
DisableSSL bool `json:"disableSSL,string" mapstructure:"disableSSL"`
InsecureSSL bool `json:"insecureSSL,string" mapstructure:"insecureSSL"`
FilePath string `mapstructure:"filePath"`
PresignTTL string `mapstructure:"presignTTL"`
FilePath string `json:"filePath" mapstructure:"filePath" mdignore:"true"`
PresignTTL string `json:"presignTTL" mapstructure:"presignTTL" mdignore:"true"`
}

type createResponse struct {
Expand Down
6 changes: 1 addition & 5 deletions bindings/azure/openai/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,4 @@ metadata:
- name: endpoint
required: true
description: "Endpoint of the Azure OpenAI service"
example: '"https://myopenai.openai.azure.com"'
- name: deploymentID
required: true
description: "ID of the model deployment in the Azure OpenAI service"
example: '"my-model"'
example: '"https://myopenai.openai.azure.com"'
Loading

0 comments on commit 7c1f83b

Please sign in to comment.