From 698f8b817c6b0531c593cc3d25bf51246f1fc39a Mon Sep 17 00:00:00 2001 From: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com> Date: Sun, 23 Jul 2023 11:33:04 -0700 Subject: [PATCH] Metadata: add other built-in properties for pubsub Docs: https://docs.dapr.io/developing-applications/building-blocks/pubsub/pubsub-scopes/ Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com> --- .build-tools/pkg/metadataschema/validators.go | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/.build-tools/pkg/metadataschema/validators.go b/.build-tools/pkg/metadataschema/validators.go index 88b026e690..85e6dade3c 100644 --- a/.build-tools/pkg/metadataschema/validators.go +++ b/.build-tools/pkg/metadataschema/validators.go @@ -153,6 +153,36 @@ 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/", + }, + }, ) case mdutils.BindingType: if c.Binding != nil { @@ -176,7 +206,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",