diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 04e98e1d..0441abd7 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -35,8 +35,8 @@ jobs: runs-on: ubuntu-latest env: GOVER: 1.22 - DAPR_CLI_VER: 1.14.0-rc.8 - DAPR_RUNTIME_VER: 1.14.0-rc.7 + DAPR_CLI_VER: 1.14.0 + DAPR_RUNTIME_VER: 1.14.0 DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/master/install/install.sh DAPR_CLI_REF: "" DAPR_REF: "" diff --git a/documentation/development.md b/documentation/development.md index dec7f6d4..2665a89a 100644 --- a/documentation/development.md +++ b/documentation/development.md @@ -22,10 +22,27 @@ npm run start:dev ## Publishing Package Package Maintenance -For publishing a new version, we update the version in `package.json` and we run `./publish.sh` +To publish a new package to [https://www.npmjs.com/package/@dapr/dapr](https://www.npmjs.com/package/@dapr/dapr) we need to do the following building and publishing steps. + +For **building** a new version, we: +- update the version in `package.json` in the repo root, e.g. `3.4.0` for a final releaes or `3.4.0-rc.1` for a pre-release +- run `npm install` again to refresh lock file (it should now be dirty and part of the change list) +- verify the dapr runtime and versions in [./scripts/fetch-proto.sh](./scripts/fetch-proto.sh) and update if necessary +- run `./scripts/fetch-proto.sh` from the repo root to regenerate protos to match runtime +- verify [.github/workflows/test-e2e.yml](.github/workflows/test-e2e.yml) env variables, especially the Dapr and Node versions to test against + +PR this change into the right release branch, e.g. `release-3.4.0`. Merging to `master` branch should happen last. A custom script is utilized here since we have 2 libraries in one for HTTP and gRPC +For **publishing** the package, we simply cut a new release by: +- create a new release/tag in the dapr/js-sdk repo + - for a final release the tag should look like `v3.4.0` and mark it as final official release. Generate release notes using the N-1 released version, e.g. using 3.3.1. + - for a pre-release it should look like `v3.4.0-rc.1` and mark it as a pre-release +- verify the package is now uploaded to [https://www.npmjs.com/package/@dapr/dapr](https://www.npmjs.com/package/@dapr/dapr) and shows the new version + +Upon creating the github repo release, a Github action workflow [.github/workflows/build.yml](.github/workflows/build.yml) will build and publish to npmjs.org on Dapr project's behalf. + ## Running Tests Tests are written per protocol layer: http or grpc. This is done because Dapr requires endpoints to be registered for for pubsub and bindings, making us having to start up the test, initialize those endpoints and then run. Since Dapr is a sidecar architecture, we thus have to start 2 test suites seperately. It requires the following containers: diff --git a/package-lock.json b/package-lock.json index 7101312c..d84d3731 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@dapr/dapr", - "version": "3.4.0-rc.1", + "version": "3.4.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@dapr/dapr", - "version": "3.4.0-rc.1", + "version": "3.4.0", "license": "ISC", "dependencies": { "@grpc/grpc-js": "^1.9.3", diff --git a/package.json b/package.json index 4ed8a12b..c08de91b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dapr/dapr", - "version": "3.4.0-rc.1", + "version": "3.4.0", "description": "The official Dapr (https://dapr.io) SDK for Node.js", "types": "./build/index.d.ts", "scripts": { @@ -48,13 +48,13 @@ "dependencies": { "@grpc/grpc-js": "^1.9.3", "@js-temporal/polyfill": "^0.3.0", + "@microsoft/durabletask-js": "^0.1.0-alpha.1", "@types/google-protobuf": "^3.15.5", "@types/node-fetch": "^2.6.2", "body-parser": "^1.19.0", "express": "^4.18.2", "google-protobuf": "^3.18.0", "http-terminator": "^3.2.0", - "@microsoft/durabletask-js": "^0.1.0-alpha.1", "node-fetch": "^2.6.7" }, "devDependencies": { diff --git a/scripts/fetch-proto.sh b/scripts/fetch-proto.sh index d0ef577e..e9ad22c2 100755 --- a/scripts/fetch-proto.sh +++ b/scripts/fetch-proto.sh @@ -3,7 +3,7 @@ OS=$(echo `uname`|tr '[:upper:]' '[:lower:]') ARCH=$(uname -m) ORG_NAME="dapr" REPO_NAME="dapr" -BRANCH_NAME="v1.14.0-rc.7" +BRANCH_NAME="v1.14.0" # Path to store output PATH_ROOT=$(pwd) diff --git a/scripts/src/proto/dapr/proto/common/v1/common.proto b/scripts/src/proto/dapr/proto/common/v1/common.proto new file mode 100644 index 00000000..1e63b885 --- /dev/null +++ b/scripts/src/proto/dapr/proto/common/v1/common.proto @@ -0,0 +1,160 @@ +/* +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. +*/ + +syntax = "proto3"; + +package dapr.proto.common.v1; + +import "google/protobuf/any.proto"; + +option csharp_namespace = "Dapr.Client.Autogen.Grpc.v1"; +option java_outer_classname = "CommonProtos"; +option java_package = "io.dapr.v1"; +option go_package = "github.com/dapr/dapr/pkg/proto/common/v1;common"; + +// HTTPExtension includes HTTP verb and querystring +// when Dapr runtime delivers HTTP content. +// +// For example, when callers calls http invoke api +// POST http://localhost:3500/v1.0/invoke//method/?query1=value1&query2=value2 +// +// Dapr runtime will parse POST as a verb and extract querystring to quersytring map. +message HTTPExtension { + // Type of HTTP 1.1 Methods + // RFC 7231: https://tools.ietf.org/html/rfc7231#page-24 + // RFC 5789: https://datatracker.ietf.org/doc/html/rfc5789 + enum Verb { + NONE = 0; + GET = 1; + HEAD = 2; + POST = 3; + PUT = 4; + DELETE = 5; + CONNECT = 6; + OPTIONS = 7; + TRACE = 8; + PATCH = 9; + } + + // Required. HTTP verb. + Verb verb = 1; + + // Optional. querystring represents an encoded HTTP url query string in the following format: name=value&name2=value2 + string querystring = 2; +} + +// InvokeRequest is the message to invoke a method with the data. +// This message is used in InvokeService of Dapr gRPC Service and OnInvoke +// of AppCallback gRPC service. +message InvokeRequest { + // Required. method is a method name which will be invoked by caller. + string method = 1; + + // Required in unary RPCs. Bytes value or Protobuf message which caller sent. + // Dapr treats Any.value as bytes type if Any.type_url is unset. + google.protobuf.Any data = 2; + + // The type of data content. + // + // This field is required if data delivers http request body + // Otherwise, this is optional. + string content_type = 3; + + // HTTP specific fields if request conveys http-compatible request. + // + // This field is required for http-compatible request. Otherwise, + // this field is optional. + HTTPExtension http_extension = 4; +} + +// InvokeResponse is the response message including data and its content type +// from app callback. +// This message is used in InvokeService of Dapr gRPC Service and OnInvoke +// of AppCallback gRPC service. +message InvokeResponse { + // Required in unary RPCs. The content body of InvokeService response. + google.protobuf.Any data = 1; + + // Required. The type of data content. + string content_type = 2; +} + +// Chunk of data sent in a streaming request or response. +// This is used in requests including InternalInvokeRequestStream. +message StreamPayload { + // Data sent in the chunk. + // The amount of data included in each chunk is up to the discretion of the sender, and can be empty. + // Additionally, the amount of data doesn't need to be fixed and subsequent messages can send more, or less, data. + // Receivers must not make assumptions about the number of bytes they'll receive in each chunk. + bytes data = 1; + + // Sequence number. This is a counter that starts from 0 and increments by 1 on each chunk sent. + uint64 seq = 2; +} + +// StateItem represents state key, value, and additional options to save state. +message StateItem { + // Required. The state key + string key = 1; + + // Required. The state data for key + bytes value = 2; + + // The entity tag which represents the specific version of data. + // The exact ETag format is defined by the corresponding data store. + Etag etag = 3; + + // The metadata which will be passed to state store component. + map metadata = 4; + + // Options for concurrency and consistency to save the state. + StateOptions options = 5; +} + +// Etag represents a state item version +message Etag { + // value sets the etag value + string value = 1; +} + +// StateOptions configures concurrency and consistency for state operations +message StateOptions { + // Enum describing the supported concurrency for state. + enum StateConcurrency { + CONCURRENCY_UNSPECIFIED = 0; + CONCURRENCY_FIRST_WRITE = 1; + CONCURRENCY_LAST_WRITE = 2; + } + + // Enum describing the supported consistency for state. + enum StateConsistency { + CONSISTENCY_UNSPECIFIED = 0; + CONSISTENCY_EVENTUAL = 1; + CONSISTENCY_STRONG = 2; + } + + StateConcurrency concurrency = 1; + StateConsistency consistency = 2; +} + +// ConfigurationItem represents all the configuration with its name(key). +message ConfigurationItem { + // Required. The value of configuration item. + string value = 1; + + // Version is response only and cannot be fetched. Store is not expected to keep all versions available + string version = 2; + + // the metadata which will be passed to/from configuration store component. + map metadata = 3; +} diff --git a/scripts/src/proto/dapr/proto/internals/v1/apiversion.proto b/scripts/src/proto/dapr/proto/internals/v1/apiversion.proto new file mode 100644 index 00000000..cb6c6ff0 --- /dev/null +++ b/scripts/src/proto/dapr/proto/internals/v1/apiversion.proto @@ -0,0 +1,27 @@ +/* +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. +*/ + +syntax = "proto3"; + +package dapr.proto.internals.v1; + +option go_package = "github.com/dapr/dapr/pkg/proto/internals/v1;internals"; + +// APIVersion represents the version of Dapr Runtime API. +enum APIVersion { + // unspecified apiversion + APIVERSION_UNSPECIFIED = 0; + + // Dapr API v1 + V1 = 1; +} diff --git a/scripts/src/proto/dapr/proto/internals/v1/service_invocation.proto b/scripts/src/proto/dapr/proto/internals/v1/service_invocation.proto new file mode 100644 index 00000000..b45c31d6 --- /dev/null +++ b/scripts/src/proto/dapr/proto/internals/v1/service_invocation.proto @@ -0,0 +1,125 @@ +/* +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. +*/ + +syntax = "proto3"; + +package dapr.proto.internals.v1; + +import "dapr/proto/common/v1/common.proto"; +import "dapr/proto/internals/v1/reminders.proto"; +import "dapr/proto/internals/v1/apiversion.proto"; +import "dapr/proto/internals/v1/status.proto"; +import "google/protobuf/empty.proto"; + +option go_package = "github.com/dapr/dapr/pkg/proto/internals/v1;internals"; + +// ServiceInvocation service is used to exchange the data between +// caller dapr runtime and callee dapr runtime. +// +// The request message includes caller's HTTP/gRPC request +// and deliver callee's response including status code. +// The response status of rpc methods represents of internal gRPC +// connection status, not callee's response status. +// +// Thus, ServiceInvocation gRPC response returns OK in most cases +// regardless of callee's response. +service ServiceInvocation { + // Invokes a method of the specific actor. + rpc CallActor (InternalInvokeRequest) returns (InternalInvokeResponse) {} + + // Invokes a method of the specific service. + rpc CallLocal (InternalInvokeRequest) returns (InternalInvokeResponse) {} + + // Invoke a remote internal actor reminder + rpc CallActorReminder(Reminder) returns (google.protobuf.Empty) {} + + // Invokes a method of the specific service using a stream of data. + // Although this uses a bi-directional stream, it behaves as a "simple RPC" in which the caller sends the full request (chunked in multiple messages in the stream), then reads the full response (chunked in the stream). + // Each message in the stream contains a `InternalInvokeRequestStream` (for caller) or `InternalInvokeResponseStream` (for callee): + // - The first message in the stream MUST contain a `request` (caller) or `response` (callee) message with all required properties present. + // - The first message in the stream MAY contain a `payload`, which is not required and may be empty. + // - Subsequent messages (any message except the first one in the stream) MUST contain a `payload` and MUST NOT contain any other property (like `request` or `response`). + // - Each message with a `payload` MUST contain a sequence number in `seq`, which is a counter that starts from 0 and MUST be incremented by 1 in each chunk. The `seq` counter MUST NOT be included if the message does not have a `payload`. + // - When the sender has completed sending the data, it MUST call `CloseSend` on the stream. + // The caller and callee must send at least one message in the stream. If only 1 message is sent in each direction, that message must contain both a `request`/`response` (the `payload` may be empty). + rpc CallLocalStream (stream InternalInvokeRequestStream) returns (stream InternalInvokeResponseStream) {} +} + +// Actor represents actor using actor_type and actor_id +message Actor { + // Required. The type of actor. + string actor_type = 1; + + // Required. The ID of actor type (actor_type) + string actor_id = 2; +} + +// InternalInvokeRequest is the message to transfer caller's data to callee +// for service invocation. This includes callee's app id and caller's request data. +message InternalInvokeRequest { + // Required. The version of Dapr runtime API. + APIVersion ver = 1; + + // Required. metadata holds caller's HTTP headers or gRPC metadata. + map metadata = 2; + + // Required. message including caller's invocation request. + common.v1.InvokeRequest message = 3; + + // Actor type and id. This field is used only for + // actor service invocation. + Actor actor = 4; +} + +// InternalInvokeResponse is the message to transfer callee's response to caller +// for service invocation. +message InternalInvokeResponse { + // Required. HTTP/gRPC status. + Status status = 1; + + // Required. The app callback response headers. + map headers = 2; + + // App callback response trailers. + // This will be used only for gRPC app callback + map trailers = 3; + + // Callee's invocation response message. + common.v1.InvokeResponse message = 4; +} + +// InternalInvokeRequestStream is a variant of InternalInvokeRequest used in streaming RPCs. +message InternalInvokeRequestStream { + // Request details. + // This does not contain any data in message.data. + InternalInvokeRequest request = 1; + + // Chunk of data. + common.v1.StreamPayload payload = 2; +} + +// InternalInvokeResponseStream is a variant of InternalInvokeResponse used in streaming RPCs. +message InternalInvokeResponseStream { + // Response details. + // This does not contain any data in message.data. + InternalInvokeResponse response = 1; + + // Chunk of data. + common.v1.StreamPayload payload = 2; +} + +// ListStringValue represents string value array +message ListStringValue { + // The array of string. + repeated string values = 1; +} diff --git a/scripts/src/proto/dapr/proto/internals/v1/status.proto b/scripts/src/proto/dapr/proto/internals/v1/status.proto new file mode 100644 index 00000000..3a6e47eb --- /dev/null +++ b/scripts/src/proto/dapr/proto/internals/v1/status.proto @@ -0,0 +1,32 @@ +/* +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. +*/ + +syntax = "proto3"; + +package dapr.proto.internals.v1; + +import "google/protobuf/any.proto"; + +option go_package = "github.com/dapr/dapr/pkg/proto/internals/v1;internals"; + +// Status represents the response status for HTTP and gRPC app channel. +message Status { + // Required. The status code + int32 code = 1; + + // Error message + string message = 2; + + // A list of messages that carry the error details + repeated google.protobuf.Any details = 3; +} diff --git a/scripts/src/proto/dapr/proto/operator/v1/operator.proto b/scripts/src/proto/dapr/proto/operator/v1/operator.proto new file mode 100644 index 00000000..4046627f --- /dev/null +++ b/scripts/src/proto/dapr/proto/operator/v1/operator.proto @@ -0,0 +1,172 @@ +/* +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. +*/ + +syntax = "proto3"; + +package dapr.proto.operator.v1; + +import "google/protobuf/empty.proto"; + +option go_package = "github.com/dapr/dapr/pkg/proto/operator/v1;operator"; + +service Operator { + // Sends events to Dapr sidecars upon component changes. + rpc ComponentUpdate (ComponentUpdateRequest) returns (stream ComponentUpdateEvent) {} + // Returns a list of available components + rpc ListComponents (ListComponentsRequest) returns (ListComponentResponse) {} + // Returns a given configuration by name + rpc GetConfiguration (GetConfigurationRequest) returns (GetConfigurationResponse) {} + // Returns a list of pub/sub subscriptions + rpc ListSubscriptions (google.protobuf.Empty) returns (ListSubscriptionsResponse) {} + // Returns a given resiliency configuration by name + rpc GetResiliency (GetResiliencyRequest) returns (GetResiliencyResponse) {} + // Returns a list of resiliency configurations + rpc ListResiliency (ListResiliencyRequest) returns (ListResiliencyResponse) {} + // Returns a list of pub/sub subscriptions, ListSubscriptionsRequest to expose pod info + rpc ListSubscriptionsV2 (ListSubscriptionsRequest) returns (ListSubscriptionsResponse) {} + // Sends events to Dapr sidecars upon subscription changes. + rpc SubscriptionUpdate (SubscriptionUpdateRequest) returns (stream SubscriptionUpdateEvent) {} + // Returns a list of http endpoints + rpc ListHTTPEndpoints (ListHTTPEndpointsRequest) returns (ListHTTPEndpointsResponse) {} + // Sends events to Dapr sidecars upon http endpoint changes. + rpc HTTPEndpointUpdate (HTTPEndpointUpdateRequest) returns (stream HTTPEndpointUpdateEvent) {} +} + +// ResourceEventType is the type of event to a resource. +enum ResourceEventType { + // UNKNOWN indicates that the event type is unknown. + UNKNOWN = 0; + + // CREATED indicates that the resource has been created. + CREATED = 1; + + // UPDATED indicates that the resource has been updated. + UPDATED = 2; + + // DELETED indicates that the resource has been deleted. + DELETED = 3; +} + +// ListComponentsRequest is the request to get components for a sidecar in namespace. +message ListComponentsRequest { + string namespace = 1; + string podName = 2; +} + +// ComponentUpdateRequest is the request to get updates about new components for a given namespace. +message ComponentUpdateRequest { + string namespace = 1; + string podName = 2; +} + +// ComponentUpdateEvent includes the updated component event. +message ComponentUpdateEvent { + bytes component = 1; + + // type is the type of event. + ResourceEventType type = 2; +} + +// ListComponentResponse includes the list of available components. +message ListComponentResponse { + repeated bytes components = 1; +} + +// GetConfigurationRequest is the request message to get the configuration. +message GetConfigurationRequest { + string name = 1; + string namespace = 2; + string podName = 3; +} + +// GetConfigurationResponse includes the requested configuration. +message GetConfigurationResponse { + bytes configuration = 1; +} + +// ListSubscriptionsResponse includes pub/sub subscriptions. +message ListSubscriptionsResponse { + repeated bytes subscriptions = 1; +} + +// SubscriptionUpdateRequest is the request to get updates about new +// subscriptions for a given namespace. +message SubscriptionUpdateRequest { + string namespace = 1; + string podName = 2; +} + +// SubscriptionUpdateEvent includes the updated subscription event. +message SubscriptionUpdateEvent { + bytes subscription = 1; + + // type is the type of event. + ResourceEventType type = 2; +} + +// GetResiliencyRequest is the request to get a resiliency configuration. +message GetResiliencyRequest { + string name = 1; + string namespace = 2; +} + +// GetResiliencyResponse includes the requested resiliency configuration. +message GetResiliencyResponse { + bytes resiliency = 1; +} + +// ListResiliencyRequest is the requests to get resiliency configurations for a sidecar namespace. +message ListResiliencyRequest { + string namespace = 1; +} + +// ListResiliencyResponse includes the list of available resiliency configurations. +message ListResiliencyResponse { + repeated bytes resiliencies = 1; +} + +message ListSubscriptionsRequest { + string podName = 1; + string namespace = 2; +} + +// GetHTTPEndpointRequest is the request to get an http endpoint configuration. +message GetHTTPEndpointRequest { + string name = 1; + string namespace = 2; +} + +// GetHTTPEndpointResponse includes the requested http endpoint configuration. +message GetHTTPEndpointResponse { + bytes http_endpoint = 1; +} + +// ListHTTPEndpointsResponse includes the list of available http endpoint configurations. +message ListHTTPEndpointsResponse { + repeated bytes http_endpoints = 1; +} + +message ListHTTPEndpointsRequest { + string namespace = 1; +} + +// HTTPEndpointsUpdateRequest is the request to get updates about new http endpoints for a given namespace. +message HTTPEndpointUpdateRequest { + string namespace = 1; + string pod_name = 2; +} + +// HTTPEndpointsUpdateEvent includes the updated http endpoint event. +message HTTPEndpointUpdateEvent { + bytes http_endpoints = 1; +} diff --git a/scripts/src/proto/dapr/proto/placement/v1/placement.proto b/scripts/src/proto/dapr/proto/placement/v1/placement.proto new file mode 100644 index 00000000..605d92bb --- /dev/null +++ b/scripts/src/proto/dapr/proto/placement/v1/placement.proto @@ -0,0 +1,56 @@ +/* +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. +*/ + +syntax = "proto3"; + +package dapr.proto.placement.v1; + +option go_package = "github.com/dapr/dapr/pkg/proto/placement/v1;placement"; + +// Placement service is used to report Dapr runtime host status. +service Placement { + // Reports Dapr actor status and retrieves actor placement table. + rpc ReportDaprStatus(stream Host) returns (stream PlacementOrder) {} +} + +message PlacementOrder { + PlacementTables tables = 1; + string operation = 2; +} + +message PlacementTables { + map entries = 1; + string version = 2; + // Minimum observed version of the Actor APIs supported by connected runtimes + uint32 api_level = 3; + int64 replication_factor = 4; +} + +message PlacementTable { + map hosts = 1; + repeated uint64 sorted_set = 2; + map load_map = 3; + int64 total_load = 4; +} + +message Host { + string name = 1; + int64 port = 2; + int64 load = 3; + repeated string entities = 4; + string id = 5; + string pod = 6; + // Version of the Actor APIs supported by the Dapr runtime + uint32 api_level = 7; + string namespace = 8; +} diff --git a/scripts/src/proto/dapr/proto/runtime/v1/appcallback.proto b/scripts/src/proto/dapr/proto/runtime/v1/appcallback.proto new file mode 100644 index 00000000..3e98b536 --- /dev/null +++ b/scripts/src/proto/dapr/proto/runtime/v1/appcallback.proto @@ -0,0 +1,343 @@ +/* +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. +*/ + +syntax = "proto3"; + +package dapr.proto.runtime.v1; + +import "google/protobuf/any.proto"; +import "google/protobuf/empty.proto"; +import "dapr/proto/common/v1/common.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Dapr.AppCallback.Autogen.Grpc.v1"; +option java_outer_classname = "DaprAppCallbackProtos"; +option java_package = "io.dapr.v1"; +option go_package = "github.com/dapr/dapr/pkg/proto/runtime/v1;runtime"; + +// AppCallback V1 allows user application to interact with Dapr runtime. +// User application needs to implement AppCallback service if it needs to +// receive message from dapr runtime. +service AppCallback { + // Invokes service method with InvokeRequest. + rpc OnInvoke (common.v1.InvokeRequest) returns (common.v1.InvokeResponse) {} + + // Lists all topics subscribed by this app. + rpc ListTopicSubscriptions(google.protobuf.Empty) returns (ListTopicSubscriptionsResponse) {} + + // Subscribes events from Pubsub + rpc OnTopicEvent(TopicEventRequest) returns (TopicEventResponse) {} + + // Lists all input bindings subscribed by this app. + rpc ListInputBindings(google.protobuf.Empty) returns (ListInputBindingsResponse) {} + + // Listens events from the input bindings + // + // User application can save the states or send the events to the output + // bindings optionally by returning BindingEventResponse. + rpc OnBindingEvent(BindingEventRequest) returns (BindingEventResponse) {} +} + +// AppCallbackHealthCheck V1 is an optional extension to AppCallback V1 to implement +// the HealthCheck method. +service AppCallbackHealthCheck { + // Health check. + rpc HealthCheck(google.protobuf.Empty) returns (HealthCheckResponse) {} +} + +// AppCallbackAlpha V1 is an optional extension to AppCallback V1 to opt +// for Alpha RPCs. +service AppCallbackAlpha { + // Subscribes bulk events from Pubsub + rpc OnBulkTopicEventAlpha1(TopicEventBulkRequest) returns (TopicEventBulkResponse) {} + + // Sends job back to the app's endpoint at trigger time. + rpc OnJobEventAlpha1 (JobEventRequest) returns (JobEventResponse); +} + +message JobEventRequest { + // Job name. + string name = 1; + + // Job data to be sent back to app. + google.protobuf.Any data = 2; + + // Required. method is a method name which will be invoked by caller. + string method = 3; + + // The type of data content. + // + // This field is required if data delivers http request body + // Otherwise, this is optional. + string content_type = 4; + + // HTTP specific fields if request conveys http-compatible request. + // + // This field is required for http-compatible request. Otherwise, + // this field is optional. + common.v1.HTTPExtension http_extension = 5; +} + +// JobEventResponse is the response from the app when a job is triggered. +message JobEventResponse {} + +// TopicEventRequest message is compatible with CloudEvent spec v1.0 +// https://github.com/cloudevents/spec/blob/v1.0/spec.md +message TopicEventRequest { + // id identifies the event. Producers MUST ensure that source + id + // is unique for each distinct event. If a duplicate event is re-sent + // (e.g. due to a network error) it MAY have the same id. + string id = 1; + + // source identifies the context in which an event happened. + // Often this will include information such as the type of the + // event source, the organization publishing the event or the process + // that produced the event. The exact syntax and semantics behind + // the data encoded in the URI is defined by the event producer. + string source = 2; + + // The type of event related to the originating occurrence. + string type = 3; + + // The version of the CloudEvents specification. + string spec_version = 4; + + // The content type of data value. + string data_content_type = 5; + + // The content of the event. + bytes data = 7; + + // The pubsub topic which publisher sent to. + string topic = 6; + + // The name of the pubsub the publisher sent to. + string pubsub_name = 8; + + // The matching path from TopicSubscription/routes (if specified) for this event. + // This value is used by OnTopicEvent to "switch" inside the handler. + string path = 9; + + // The map of additional custom properties to be sent to the app. These are considered to be cloud event extensions. + google.protobuf.Struct extensions = 10; +} + +// TopicEventResponse is response from app on published message +message TopicEventResponse { + // TopicEventResponseStatus allows apps to have finer control over handling of the message. + enum TopicEventResponseStatus { + // SUCCESS is the default behavior: message is acknowledged and not retried or logged. + SUCCESS = 0; + // RETRY status signals Dapr to retry the message as part of an expected scenario (no warning is logged). + RETRY = 1; + // DROP status signals Dapr to drop the message as part of an unexpected scenario (warning is logged). + DROP = 2; + } + + // The list of output bindings. + TopicEventResponseStatus status = 1; +} + +// TopicEventCERequest message is compatible with CloudEvent spec v1.0 +message TopicEventCERequest { + // The unique identifier of this cloud event. + string id = 1; + + // source identifies the context in which an event happened. + string source = 2; + + // The type of event related to the originating occurrence. + string type = 3; + + // The version of the CloudEvents specification. + string spec_version = 4; + + // The content type of data value. + string data_content_type = 5; + + // The content of the event. + bytes data = 6; + + // Custom attributes which includes cloud event extensions. + google.protobuf.Struct extensions = 7; +} + +// TopicEventBulkRequestEntry represents a single message inside a bulk request +message TopicEventBulkRequestEntry { + // Unique identifier for the message. + string entry_id = 1; + + // The content of the event. + oneof event { + bytes bytes = 2; + TopicEventCERequest cloud_event = 3; + } + + // content type of the event contained. + string content_type = 4; + + // The metadata associated with the event. + map metadata = 5; +} + +// TopicEventBulkRequest represents request for bulk message +message TopicEventBulkRequest { + // Unique identifier for the bulk request. + string id = 1; + + // The list of items inside this bulk request. + repeated TopicEventBulkRequestEntry entries = 2; + + // The metadata associated with the this bulk request. + map metadata = 3; + + // The pubsub topic which publisher sent to. + string topic = 4; + + // The name of the pubsub the publisher sent to. + string pubsub_name = 5; + + // The type of event related to the originating occurrence. + string type = 6; + + // The matching path from TopicSubscription/routes (if specified) for this event. + // This value is used by OnTopicEvent to "switch" inside the handler. + string path = 7; +} + +// TopicEventBulkResponseEntry Represents single response, as part of TopicEventBulkResponse, to be +// sent by subscibed App for the corresponding single message during bulk subscribe +message TopicEventBulkResponseEntry { + // Unique identifier associated the message. + string entry_id = 1; + + // The status of the response. + TopicEventResponse.TopicEventResponseStatus status = 2; +} + +// AppBulkResponse is response from app on published message +message TopicEventBulkResponse { + + // The list of all responses for the bulk request. + repeated TopicEventBulkResponseEntry statuses = 1; +} + +// BindingEventRequest represents input bindings event. +message BindingEventRequest { + // Required. The name of the input binding component. + string name = 1; + + // Required. The payload that the input bindings sent + bytes data = 2; + + // The metadata set by the input binging components. + map metadata = 3; +} + +// BindingEventResponse includes operations to save state or +// send data to output bindings optionally. +message BindingEventResponse { + // The name of state store where states are saved. + string store_name = 1; + + // The state key values which will be stored in store_name. + repeated common.v1.StateItem states = 2; + + // BindingEventConcurrency is the kind of concurrency + enum BindingEventConcurrency { + // SEQUENTIAL sends data to output bindings specified in "to" sequentially. + SEQUENTIAL = 0; + // PARALLEL sends data to output bindings specified in "to" in parallel. + PARALLEL = 1; + } + + // The list of output bindings. + repeated string to = 3; + + // The content which will be sent to "to" output bindings. + bytes data = 4; + + // The concurrency of output bindings to send data to + // "to" output bindings list. The default is SEQUENTIAL. + BindingEventConcurrency concurrency = 5; +} + +// ListTopicSubscriptionsResponse is the message including the list of the subscribing topics. +message ListTopicSubscriptionsResponse { + // The list of topics. + repeated TopicSubscription subscriptions = 1; +} + +// TopicSubscription represents topic and metadata. +message TopicSubscription { + // Required. The name of the pubsub containing the topic below to subscribe to. + string pubsub_name = 1; + + // Required. The name of topic which will be subscribed + string topic = 2; + + // The optional properties used for this topic's subscription e.g. session id + map metadata = 3; + + // The optional routing rules to match against. In the gRPC interface, OnTopicEvent + // is still invoked but the matching path is sent in the TopicEventRequest. + TopicRoutes routes = 5; + + // The optional dead letter queue for this topic to send events to. + string dead_letter_topic = 6; + + // The optional bulk subscribe settings for this topic. + BulkSubscribeConfig bulk_subscribe = 7; +} + +message TopicRoutes { + // The list of rules for this topic. + repeated TopicRule rules = 1; + + // The default path for this topic. + string default = 2; +} + +message TopicRule { + // The optional CEL expression used to match the event. + // If the match is not specified, then the route is considered + // the default. + string match = 1; + + // The path used to identify matches for this subscription. + // This value is passed in TopicEventRequest and used by OnTopicEvent to "switch" + // inside the handler. + string path = 2; +} + +// BulkSubscribeConfig is the message to pass settings for bulk subscribe +message BulkSubscribeConfig { + // Required. Flag to enable/disable bulk subscribe + bool enabled = 1; + + // Optional. Max number of messages to be sent in a single bulk request + int32 max_messages_count = 2; + + // Optional. Max duration to wait for messages to be sent in a single bulk request + int32 max_await_duration_ms = 3; +} + +// ListInputBindingsResponse is the message including the list of input bindings. +message ListInputBindingsResponse { + // The list of input bindings. + repeated string bindings = 1; +} + +// HealthCheckResponse is the message with the response to the health check. +// This message is currently empty as used as placeholder. +message HealthCheckResponse {} diff --git a/scripts/src/proto/dapr/proto/runtime/v1/dapr.proto b/scripts/src/proto/dapr/proto/runtime/v1/dapr.proto new file mode 100644 index 00000000..8ecc3984 --- /dev/null +++ b/scripts/src/proto/dapr/proto/runtime/v1/dapr.proto @@ -0,0 +1,1276 @@ +/* +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. +*/ + +syntax = "proto3"; + +package dapr.proto.runtime.v1; + +import "google/protobuf/any.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; +import "dapr/proto/common/v1/common.proto"; +import "dapr/proto/runtime/v1/appcallback.proto"; + +option csharp_namespace = "Dapr.Client.Autogen.Grpc.v1"; +option java_outer_classname = "DaprProtos"; +option java_package = "io.dapr.v1"; +option go_package = "github.com/dapr/dapr/pkg/proto/runtime/v1;runtime"; + +// Dapr service provides APIs to user application to access Dapr building blocks. +service Dapr { + // Invokes a method on a remote Dapr app. + // Deprecated: Use proxy mode service invocation instead. + rpc InvokeService(InvokeServiceRequest) returns (common.v1.InvokeResponse) {} + + // Gets the state for a specific key. + rpc GetState(GetStateRequest) returns (GetStateResponse) {} + + // Gets a bulk of state items for a list of keys + rpc GetBulkState(GetBulkStateRequest) returns (GetBulkStateResponse) {} + + // Saves the state for a specific key. + rpc SaveState(SaveStateRequest) returns (google.protobuf.Empty) {} + + // Queries the state. + rpc QueryStateAlpha1(QueryStateRequest) returns (QueryStateResponse) {} + + // Deletes the state for a specific key. + rpc DeleteState(DeleteStateRequest) returns (google.protobuf.Empty) {} + + // Deletes a bulk of state items for a list of keys + rpc DeleteBulkState(DeleteBulkStateRequest) returns (google.protobuf.Empty) {} + + // Executes transactions for a specified store + rpc ExecuteStateTransaction(ExecuteStateTransactionRequest) returns (google.protobuf.Empty) {} + + // Publishes events to the specific topic. + rpc PublishEvent(PublishEventRequest) returns (google.protobuf.Empty) {} + + // Bulk Publishes multiple events to the specified topic. + rpc BulkPublishEventAlpha1(BulkPublishRequest) returns (BulkPublishResponse) {} + + // SubscribeTopicEventsAlpha1 subscribes to a PubSub topic and receives topic + // events from it. + rpc SubscribeTopicEventsAlpha1(stream SubscribeTopicEventsRequestAlpha1) returns (stream SubscribeTopicEventsResponseAlpha1) {} + + // Invokes binding data to specific output bindings + rpc InvokeBinding(InvokeBindingRequest) returns (InvokeBindingResponse) {} + + // Gets secrets from secret stores. + rpc GetSecret(GetSecretRequest) returns (GetSecretResponse) {} + + // Gets a bulk of secrets + rpc GetBulkSecret(GetBulkSecretRequest) returns (GetBulkSecretResponse) {} + + // Register an actor timer. + rpc RegisterActorTimer(RegisterActorTimerRequest) returns (google.protobuf.Empty) {} + + // Unregister an actor timer. + rpc UnregisterActorTimer(UnregisterActorTimerRequest) returns (google.protobuf.Empty) {} + + // Register an actor reminder. + rpc RegisterActorReminder(RegisterActorReminderRequest) returns (google.protobuf.Empty) {} + + // Unregister an actor reminder. + rpc UnregisterActorReminder(UnregisterActorReminderRequest) returns (google.protobuf.Empty) {} + + // Gets the state for a specific actor. + rpc GetActorState(GetActorStateRequest) returns (GetActorStateResponse) {} + + // Executes state transactions for a specified actor + rpc ExecuteActorStateTransaction(ExecuteActorStateTransactionRequest) returns (google.protobuf.Empty) {} + + // InvokeActor calls a method on an actor. + rpc InvokeActor (InvokeActorRequest) returns (InvokeActorResponse) {} + + // GetConfiguration gets configuration from configuration store. + rpc GetConfigurationAlpha1(GetConfigurationRequest) returns (GetConfigurationResponse) {} + + // GetConfiguration gets configuration from configuration store. + rpc GetConfiguration(GetConfigurationRequest) returns (GetConfigurationResponse) {} + + // SubscribeConfiguration gets configuration from configuration store and subscribe the updates event by grpc stream + rpc SubscribeConfigurationAlpha1(SubscribeConfigurationRequest) returns (stream SubscribeConfigurationResponse) {} + + // SubscribeConfiguration gets configuration from configuration store and subscribe the updates event by grpc stream + rpc SubscribeConfiguration(SubscribeConfigurationRequest) returns (stream SubscribeConfigurationResponse) {} + + // UnSubscribeConfiguration unsubscribe the subscription of configuration + rpc UnsubscribeConfigurationAlpha1(UnsubscribeConfigurationRequest) returns (UnsubscribeConfigurationResponse) {} + + // UnSubscribeConfiguration unsubscribe the subscription of configuration + rpc UnsubscribeConfiguration(UnsubscribeConfigurationRequest) returns (UnsubscribeConfigurationResponse) {} + + // TryLockAlpha1 tries to get a lock with an expiry. + rpc TryLockAlpha1(TryLockRequest)returns (TryLockResponse) {} + + // UnlockAlpha1 unlocks a lock. + rpc UnlockAlpha1(UnlockRequest)returns (UnlockResponse) {} + + // EncryptAlpha1 encrypts a message using the Dapr encryption scheme and a key stored in the vault. + rpc EncryptAlpha1(stream EncryptRequest) returns (stream EncryptResponse); + + // DecryptAlpha1 decrypts a message using the Dapr encryption scheme and a key stored in the vault. + rpc DecryptAlpha1(stream DecryptRequest) returns (stream DecryptResponse); + + // Gets metadata of the sidecar + rpc GetMetadata (GetMetadataRequest) returns (GetMetadataResponse) {} + + // Sets value in extended metadata of the sidecar + rpc SetMetadata (SetMetadataRequest) returns (google.protobuf.Empty) {} + + // SubtleGetKeyAlpha1 returns the public part of an asymmetric key stored in the vault. + rpc SubtleGetKeyAlpha1(SubtleGetKeyRequest) returns (SubtleGetKeyResponse); + + // SubtleEncryptAlpha1 encrypts a small message using a key stored in the vault. + rpc SubtleEncryptAlpha1(SubtleEncryptRequest) returns (SubtleEncryptResponse); + + // SubtleDecryptAlpha1 decrypts a small message using a key stored in the vault. + rpc SubtleDecryptAlpha1(SubtleDecryptRequest) returns (SubtleDecryptResponse); + + // SubtleWrapKeyAlpha1 wraps a key using a key stored in the vault. + rpc SubtleWrapKeyAlpha1(SubtleWrapKeyRequest) returns (SubtleWrapKeyResponse); + + // SubtleUnwrapKeyAlpha1 unwraps a key using a key stored in the vault. + rpc SubtleUnwrapKeyAlpha1(SubtleUnwrapKeyRequest) returns (SubtleUnwrapKeyResponse); + + // SubtleSignAlpha1 signs a message using a key stored in the vault. + rpc SubtleSignAlpha1(SubtleSignRequest) returns (SubtleSignResponse); + + // SubtleVerifyAlpha1 verifies the signature of a message using a key stored in the vault. + rpc SubtleVerifyAlpha1(SubtleVerifyRequest) returns (SubtleVerifyResponse); + + // Starts a new instance of a workflow + rpc StartWorkflowAlpha1 (StartWorkflowRequest) returns (StartWorkflowResponse) {} + + // Gets details about a started workflow instance + rpc GetWorkflowAlpha1 (GetWorkflowRequest) returns (GetWorkflowResponse) {} + + // Purge Workflow + rpc PurgeWorkflowAlpha1 (PurgeWorkflowRequest) returns (google.protobuf.Empty) {} + + // Terminates a running workflow instance + rpc TerminateWorkflowAlpha1 (TerminateWorkflowRequest) returns (google.protobuf.Empty) {} + + // Pauses a running workflow instance + rpc PauseWorkflowAlpha1 (PauseWorkflowRequest) returns (google.protobuf.Empty) {} + + // Resumes a paused workflow instance + rpc ResumeWorkflowAlpha1 (ResumeWorkflowRequest) returns (google.protobuf.Empty) {} + + // Raise an event to a running workflow instance + rpc RaiseEventWorkflowAlpha1 (RaiseEventWorkflowRequest) returns (google.protobuf.Empty) {} + + // Starts a new instance of a workflow + rpc StartWorkflowBeta1 (StartWorkflowRequest) returns (StartWorkflowResponse) {} + + // Gets details about a started workflow instance + rpc GetWorkflowBeta1 (GetWorkflowRequest) returns (GetWorkflowResponse) {} + + // Purge Workflow + rpc PurgeWorkflowBeta1 (PurgeWorkflowRequest) returns (google.protobuf.Empty) {} + + // Terminates a running workflow instance + rpc TerminateWorkflowBeta1 (TerminateWorkflowRequest) returns (google.protobuf.Empty) {} + + // Pauses a running workflow instance + rpc PauseWorkflowBeta1 (PauseWorkflowRequest) returns (google.protobuf.Empty) {} + + // Resumes a paused workflow instance + rpc ResumeWorkflowBeta1 (ResumeWorkflowRequest) returns (google.protobuf.Empty) {} + + // Raise an event to a running workflow instance + rpc RaiseEventWorkflowBeta1 (RaiseEventWorkflowRequest) returns (google.protobuf.Empty) {} + // Shutdown the sidecar + rpc Shutdown (ShutdownRequest) returns (google.protobuf.Empty) {} + + // Create and schedule a job + rpc ScheduleJobAlpha1(ScheduleJobRequest) returns (ScheduleJobResponse) {} + + // Gets a scheduled job + rpc GetJobAlpha1(GetJobRequest) returns (GetJobResponse) {} + + // Delete a job + rpc DeleteJobAlpha1(DeleteJobRequest) returns (DeleteJobResponse) {} +} + +// InvokeServiceRequest represents the request message for Service invocation. +message InvokeServiceRequest { + // Required. Callee's app id. + string id = 1; + + // Required. message which will be delivered to callee. + common.v1.InvokeRequest message = 3; +} + +// GetStateRequest is the message to get key-value states from specific state store. +message GetStateRequest { + // The name of state store. + string store_name = 1; + + // The key of the desired state + string key = 2; + + // The read consistency of the state store. + common.v1.StateOptions.StateConsistency consistency = 3; + + // The metadata which will be sent to state store components. + map metadata = 4; +} + +// GetBulkStateRequest is the message to get a list of key-value states from specific state store. +message GetBulkStateRequest { + // The name of state store. + string store_name = 1; + + // The keys to get. + repeated string keys = 2; + + // The number of parallel operations executed on the state store for a get operation. + int32 parallelism = 3; + + // The metadata which will be sent to state store components. + map metadata = 4; +} + +// GetBulkStateResponse is the response conveying the list of state values. +message GetBulkStateResponse { + // The list of items containing the keys to get values for. + repeated BulkStateItem items = 1; +} + +// BulkStateItem is the response item for a bulk get operation. +// Return values include the item key, data and etag. +message BulkStateItem { + // state item key + string key = 1; + + // The byte array data + bytes data = 2; + + // The entity tag which represents the specific version of data. + // ETag format is defined by the corresponding data store. + string etag = 3; + + // The error that was returned from the state store in case of a failed get operation. + string error = 4; + + // The metadata which will be sent to app. + map metadata = 5; +} + +// GetStateResponse is the response conveying the state value and etag. +message GetStateResponse { + // The byte array data + bytes data = 1; + + // The entity tag which represents the specific version of data. + // ETag format is defined by the corresponding data store. + string etag = 2; + + // The metadata which will be sent to app. + map metadata = 3; +} + +// DeleteStateRequest is the message to delete key-value states in the specific state store. +message DeleteStateRequest { + // The name of state store. + string store_name = 1; + + // The key of the desired state + string key = 2; + + // The entity tag which represents the specific version of data. + // The exact ETag format is defined by the corresponding data store. + common.v1.Etag etag = 3; + + // State operation options which includes concurrency/ + // consistency/retry_policy. + common.v1.StateOptions options = 4; + + // The metadata which will be sent to state store components. + map metadata = 5; +} + +// DeleteBulkStateRequest is the message to delete a list of key-value states from specific state store. +message DeleteBulkStateRequest { + // The name of state store. + string store_name = 1; + + // The array of the state key values. + repeated common.v1.StateItem states = 2; +} + +// SaveStateRequest is the message to save multiple states into state store. +message SaveStateRequest { + // The name of state store. + string store_name = 1; + + // The array of the state key values. + repeated common.v1.StateItem states = 2; +} + +// QueryStateRequest is the message to query state store. +message QueryStateRequest { + // The name of state store. + string store_name = 1 [json_name = "storeName"]; + + // The query in JSON format. + string query = 2; + + // The metadata which will be sent to state store components. + map metadata = 3; +} + +message QueryStateItem { + // The object key. + string key = 1; + + // The object value. + bytes data = 2; + + // The entity tag which represents the specific version of data. + // ETag format is defined by the corresponding data store. + string etag = 3; + + // The error message indicating an error in processing of the query result. + string error = 4; +} + +// QueryStateResponse is the response conveying the query results. +message QueryStateResponse { + // An array of query results. + repeated QueryStateItem results = 1; + + // Pagination token. + string token = 2; + + // The metadata which will be sent to app. + map metadata = 3; +} + +// PublishEventRequest is the message to publish event data to pubsub topic +message PublishEventRequest { + // The name of the pubsub component + string pubsub_name = 1; + + // The pubsub topic + string topic = 2; + + // The data which will be published to topic. + bytes data = 3; + + // The content type for the data (optional). + string data_content_type = 4; + + // The metadata passing to pub components + // + // metadata property: + // - key : the key of the message. + map metadata = 5; +} + +// BulkPublishRequest is the message to bulk publish events to pubsub topic +message BulkPublishRequest { + // The name of the pubsub component + string pubsub_name = 1; + + // The pubsub topic + string topic = 2; + + // The entries which contain the individual events and associated details to be published + repeated BulkPublishRequestEntry entries = 3; + + // The request level metadata passing to to the pubsub components + map metadata = 4; +} + +// BulkPublishRequestEntry is the message containing the event to be bulk published +message BulkPublishRequestEntry { + // The request scoped unique ID referring to this message. Used to map status in response + string entry_id = 1; + + // The event which will be pulished to the topic + bytes event = 2; + + // The content type for the event + string content_type = 3; + + // The event level metadata passing to the pubsub component + map metadata = 4; +} + +// BulkPublishResponse is the message returned from a BulkPublishEvent call +message BulkPublishResponse { + // The entries for different events that failed publish in the BulkPublishEvent call + repeated BulkPublishResponseFailedEntry failedEntries = 1; +} + +// BulkPublishResponseFailedEntry is the message containing the entryID and error of a failed event in BulkPublishEvent call +message BulkPublishResponseFailedEntry { + // The response scoped unique ID referring to this message + string entry_id = 1; + + // The error message if any on failure + string error = 2; +} + +// SubscribeTopicEventsRequestAlpha1 is a message containing the details for +// subscribing to a topic via streaming. +// The first message must always be the initial request. All subsequent +// messages must be event processed responses. +message SubscribeTopicEventsRequestAlpha1 { + oneof subscribe_topic_events_request_type { + SubscribeTopicEventsRequestInitialAlpha1 initial_request = 1; + SubscribeTopicEventsRequestProcessedAlpha1 event_processed = 2; + } +} + +// SubscribeTopicEventsRequestInitialAlpha1 is the initial message containing +// the details for subscribing to a topic via streaming. +message SubscribeTopicEventsRequestInitialAlpha1 { + // The name of the pubsub component + string pubsub_name = 1; + + // The pubsub topic + string topic = 2; + + // The metadata passing to pub components + // + // metadata property: + // - key : the key of the message. + map metadata = 3; + + // dead_letter_topic is the topic to which messages that fail to be processed + // are sent. + optional string dead_letter_topic = 4; +} + +// SubscribeTopicEventsRequestProcessedAlpha1 is the message containing the +// subscription to a topic. +message SubscribeTopicEventsRequestProcessedAlpha1 { + // id is the unique identifier for the subscription request. + string id = 1; + + // status is the result of the subscription request. + TopicEventResponse status = 2; +} + + +// SubscribeTopicEventsResponseAlpha1 is a message returned from daprd +// when subscribing to a topic via streaming. +message SubscribeTopicEventsResponseAlpha1 { + oneof subscribe_topic_events_response_type { + SubscribeTopicEventsResponseInitialAlpha1 initial_response = 1; + TopicEventRequest event_message = 2; + } +} + +// SubscribeTopicEventsResponseInitialAlpha1 is the initial response from daprd +// when subscribing to a topic. +message SubscribeTopicEventsResponseInitialAlpha1 {} + + +// InvokeBindingRequest is the message to send data to output bindings +message InvokeBindingRequest { + // The name of the output binding to invoke. + string name = 1; + + // The data which will be sent to output binding. + bytes data = 2; + + // The metadata passing to output binding components + // + // Common metadata property: + // - ttlInSeconds : the time to live in seconds for the message. + // If set in the binding definition will cause all messages to + // have a default time to live. The message ttl overrides any value + // in the binding definition. + map metadata = 3; + + // The name of the operation type for the binding to invoke + string operation = 4; +} + +// InvokeBindingResponse is the message returned from an output binding invocation +message InvokeBindingResponse { + // The data which will be sent to output binding. + bytes data = 1; + + // The metadata returned from an external system + map metadata = 2; +} + +// GetSecretRequest is the message to get secret from secret store. +message GetSecretRequest { + // The name of secret store. + string store_name = 1 [json_name = "storeName"]; + + // The name of secret key. + string key = 2; + + // The metadata which will be sent to secret store components. + map metadata = 3; +} + +// GetSecretResponse is the response message to convey the requested secret. +message GetSecretResponse { + // data is the secret value. Some secret store, such as kubernetes secret + // store, can save multiple secrets for single secret key. + map data = 1; +} + +// GetBulkSecretRequest is the message to get the secrets from secret store. +message GetBulkSecretRequest { + // The name of secret store. + string store_name = 1 [json_name = "storeName"]; + + // The metadata which will be sent to secret store components. + map metadata = 2; +} + +// SecretResponse is a map of decrypted string/string values +message SecretResponse { + map secrets = 1; +} + +// GetBulkSecretResponse is the response message to convey the requested secrets. +message GetBulkSecretResponse { + // data hold the secret values. Some secret store, such as kubernetes secret + // store, can save multiple secrets for single secret key. + map data = 1; +} + +// TransactionalStateOperation is the message to execute a specified operation with a key-value pair. +message TransactionalStateOperation { + // The type of operation to be executed + string operationType = 1; + + // State values to be operated on + common.v1.StateItem request = 2; +} + +// ExecuteStateTransactionRequest is the message to execute multiple operations on a specified store. +message ExecuteStateTransactionRequest { + // Required. name of state store. + string storeName = 1; + + // Required. transactional operation list. + repeated TransactionalStateOperation operations = 2; + + // The metadata used for transactional operations. + map metadata = 3; +} + +// RegisterActorTimerRequest is the message to register a timer for an actor of a given type and id. +message RegisterActorTimerRequest { + string actor_type = 1 [json_name = "actorType"]; + string actor_id = 2 [json_name = "actorId"]; + string name = 3; + string due_time = 4 [json_name = "dueTime"]; + string period = 5; + string callback = 6; + bytes data = 7; + string ttl = 8; +} + +// UnregisterActorTimerRequest is the message to unregister an actor timer +message UnregisterActorTimerRequest { + string actor_type = 1 [json_name = "actorType"]; + string actor_id = 2 [json_name = "actorId"]; + string name = 3; +} + +// RegisterActorReminderRequest is the message to register a reminder for an actor of a given type and id. +message RegisterActorReminderRequest { + string actor_type = 1 [json_name = "actorType"]; + string actor_id = 2 [json_name = "actorId"]; + string name = 3; + string due_time = 4 [json_name = "dueTime"]; + string period = 5; + bytes data = 6; + string ttl = 7; +} + +// UnregisterActorReminderRequest is the message to unregister an actor reminder. +message UnregisterActorReminderRequest { + string actor_type = 1 [json_name = "actorType"]; + string actor_id = 2 [json_name = "actorId"]; + string name = 3; +} + +// GetActorStateRequest is the message to get key-value states from specific actor. +message GetActorStateRequest { + string actor_type = 1 [json_name = "actorType"]; + string actor_id = 2 [json_name = "actorId"]; + string key = 3; +} + +// GetActorStateResponse is the response conveying the actor's state value. +message GetActorStateResponse { + bytes data = 1; + + // The metadata which will be sent to app. + map metadata = 2; +} + +// ExecuteActorStateTransactionRequest is the message to execute multiple operations on a specified actor. +message ExecuteActorStateTransactionRequest { + string actor_type = 1 [json_name = "actorType"]; + string actor_id = 2 [json_name = "actorId"]; + repeated TransactionalActorStateOperation operations = 3; +} + +// TransactionalActorStateOperation is the message to execute a specified operation with a key-value pair. +message TransactionalActorStateOperation { + string operationType = 1; + string key = 2; + google.protobuf.Any value = 3; + // The metadata used for transactional operations. + // + // Common metadata property: + // - ttlInSeconds : the time to live in seconds for the stored value. + map metadata = 4; +} + +// InvokeActorRequest is the message to call an actor. +message InvokeActorRequest { + string actor_type = 1 [json_name = "actorType"]; + string actor_id = 2 [json_name = "actorId"]; + string method = 3; + bytes data = 4; + map metadata = 5; +} + +// InvokeActorResponse is the method that returns an actor invocation response. +message InvokeActorResponse { + bytes data = 1; +} + +// GetMetadataRequest is the message for the GetMetadata request. +message GetMetadataRequest { + // Empty +} + +// GetMetadataResponse is a message that is returned on GetMetadata rpc call. +message GetMetadataResponse { + string id = 1; + // Deprecated alias for actor_runtime.active_actors. + repeated ActiveActorsCount active_actors_count = 2 [json_name = "actors", deprecated = true]; + repeated RegisteredComponents registered_components = 3 [json_name = "components"]; + map extended_metadata = 4 [json_name = "extended"]; + repeated PubsubSubscription subscriptions = 5 [json_name = "subscriptions"]; + repeated MetadataHTTPEndpoint http_endpoints = 6 [json_name = "httpEndpoints"]; + AppConnectionProperties app_connection_properties = 7 [json_name = "appConnectionProperties"]; + string runtime_version = 8 [json_name = "runtimeVersion"]; + repeated string enabled_features = 9 [json_name = "enabledFeatures"]; + ActorRuntime actor_runtime = 10 [json_name = "actorRuntime"]; + //TODO: Cassie: probably add scheduler runtime status +} + +message ActorRuntime { + enum ActorRuntimeStatus { + // Indicates that the actor runtime is still being initialized. + INITIALIZING = 0; + // Indicates that the actor runtime is disabled. + // This normally happens when Dapr is started without "placement-host-address" + DISABLED = 1; + // Indicates the actor runtime is running, either as an actor host or client. + RUNNING = 2; + } + + // Contains an enum indicating whether the actor runtime has been initialized. + ActorRuntimeStatus runtime_status = 1 [json_name = "runtimeStatus"]; + // Count of active actors per type. + repeated ActiveActorsCount active_actors = 2 [json_name = "activeActors"]; + // Indicates whether the actor runtime is ready to host actors. + bool host_ready = 3 [json_name = "hostReady"]; + // Custom message from the placement provider. + string placement = 4 [json_name = "placement"]; +} + +message ActiveActorsCount { + string type = 1; + int32 count = 2; +} + +message RegisteredComponents { + string name = 1; + string type = 2; + string version = 3; + repeated string capabilities = 4; +} + +message MetadataHTTPEndpoint { + string name = 1 [json_name = "name"]; +} + +message AppConnectionProperties { + int32 port = 1; + string protocol = 2; + string channel_address = 3 [json_name = "channelAddress"]; + int32 max_concurrency = 4 [json_name = "maxConcurrency"]; + AppConnectionHealthProperties health = 5; +} + +message AppConnectionHealthProperties { + string health_check_path = 1 [json_name = "healthCheckPath"]; + string health_probe_interval = 2 [json_name = "healthProbeInterval"]; + string health_probe_timeout = 3 [json_name = "healthProbeTimeout"]; + int32 health_threshold = 4 [json_name = "healthThreshold"]; +} + +message PubsubSubscription { + string pubsub_name = 1 [json_name = "pubsubname"]; + string topic = 2 [json_name = "topic"]; + map metadata = 3 [json_name = "metadata"]; + PubsubSubscriptionRules rules = 4 [json_name = "rules"]; + string dead_letter_topic = 5 [json_name = "deadLetterTopic"]; + PubsubSubscriptionType type = 6 [json_name = "type"]; +} + +// PubsubSubscriptionType indicates the type of subscription +enum PubsubSubscriptionType { + // UNKNOWN is the default value for the subscription type. + UNKNOWN = 0; + // Declarative subscription (k8s CRD) + DECLARATIVE = 1; + // Programmatically created subscription + PROGRAMMATIC = 2; + // Bidirectional Streaming subscription + STREAMING = 3; +} + +message PubsubSubscriptionRules { + repeated PubsubSubscriptionRule rules = 1; +} + +message PubsubSubscriptionRule { + string match = 1; + string path = 2; +} + +message SetMetadataRequest { + string key = 1; + string value = 2; +} + +// GetConfigurationRequest is the message to get a list of key-value configuration from specified configuration store. +message GetConfigurationRequest { + // Required. The name of configuration store. + string store_name = 1; + + // Optional. The key of the configuration item to fetch. + // If set, only query for the specified configuration items. + // Empty list means fetch all. + repeated string keys = 2; + + // Optional. The metadata which will be sent to configuration store components. + map metadata = 3; +} + +// GetConfigurationResponse is the response conveying the list of configuration values. +// It should be the FULL configuration of specified application which contains all of its configuration items. +message GetConfigurationResponse { + map items = 1; +} + +// SubscribeConfigurationRequest is the message to get a list of key-value configuration from specified configuration store. +message SubscribeConfigurationRequest { + // The name of configuration store. + string store_name = 1; + + // Optional. The key of the configuration item to fetch. + // If set, only query for the specified configuration items. + // Empty list means fetch all. + repeated string keys = 2; + + // The metadata which will be sent to configuration store components. + map metadata = 3; +} + +// UnSubscribeConfigurationRequest is the message to stop watching the key-value configuration. +message UnsubscribeConfigurationRequest { + // The name of configuration store. + string store_name = 1; + + // The id to unsubscribe. + string id = 2; +} + +message SubscribeConfigurationResponse { + // Subscribe id, used to stop subscription. + string id = 1; + + // The list of items containing configuration values + map items = 2; +} + +message UnsubscribeConfigurationResponse { + bool ok = 1; + string message = 2; +} + +message TryLockRequest { + // Required. The lock store name,e.g. `redis`. + string store_name = 1 [json_name = "storeName"]; + + // Required. resource_id is the lock key. e.g. `order_id_111` + // It stands for "which resource I want to protect" + string resource_id = 2 [json_name = "resourceId"]; + + // Required. lock_owner indicate the identifier of lock owner. + // You can generate a uuid as lock_owner.For example,in golang: + // + // req.LockOwner = uuid.New().String() + // + // This field is per request,not per process,so it is different for each request, + // which aims to prevent multi-thread in the same process trying the same lock concurrently. + // + // The reason why we don't make it automatically generated is: + // 1. If it is automatically generated,there must be a 'my_lock_owner_id' field in the response. + // This name is so weird that we think it is inappropriate to put it into the api spec + // 2. If we change the field 'my_lock_owner_id' in the response to 'lock_owner',which means the current lock owner of this lock, + // we find that in some lock services users can't get the current lock owner.Actually users don't need it at all. + // 3. When reentrant lock is needed,the existing lock_owner is required to identify client and check "whether this client can reenter this lock". + // So this field in the request shouldn't be removed. + string lock_owner = 3 [json_name = "lockOwner"]; + + // Required. The time before expiry.The time unit is second. + int32 expiry_in_seconds = 4 [json_name = "expiryInSeconds"]; +} + +message TryLockResponse { + bool success = 1; +} + +message UnlockRequest { + string store_name = 1 [json_name = "storeName"]; + // resource_id is the lock key. + string resource_id = 2 [json_name = "resourceId"]; + string lock_owner = 3 [json_name = "lockOwner"]; +} + +message UnlockResponse { + enum Status { + SUCCESS = 0; + LOCK_DOES_NOT_EXIST = 1; + LOCK_BELONGS_TO_OTHERS = 2; + INTERNAL_ERROR = 3; + } + + Status status = 1; +} + +// SubtleGetKeyRequest is the request object for SubtleGetKeyAlpha1. +message SubtleGetKeyRequest { + enum KeyFormat { + // PEM (PKIX) (default) + PEM = 0; + // JSON (JSON Web Key) as string + JSON = 1; + } + + // Name of the component + string component_name = 1 [json_name="componentName"]; + // Name (or name/version) of the key to use in the key vault + string name = 2; + // Response format + KeyFormat format = 3; +} + +// SubtleGetKeyResponse is the response for SubtleGetKeyAlpha1. +message SubtleGetKeyResponse { + // Name (or name/version) of the key. + // This is returned as response too in case there is a version. + string name = 1; + // Public key, encoded in the requested format + string public_key = 2 [json_name="publicKey"]; +} + +// SubtleEncryptRequest is the request for SubtleEncryptAlpha1. +message SubtleEncryptRequest { + // Name of the component + string component_name = 1 [json_name="componentName"]; + // Message to encrypt. + bytes plaintext = 2; + // Algorithm to use, as in the JWA standard. + string algorithm = 3; + // Name (or name/version) of the key. + string key_name = 4 [json_name="keyName"]; + // Nonce / initialization vector. + // Ignored with asymmetric ciphers. + bytes nonce = 5; + // Associated Data when using AEAD ciphers (optional). + bytes associated_data = 6 [json_name="associatedData"]; +} + +// SubtleEncryptResponse is the response for SubtleEncryptAlpha1. +message SubtleEncryptResponse { + // Encrypted ciphertext. + bytes ciphertext = 1; + // Authentication tag. + // This is nil when not using an authenticated cipher. + bytes tag = 2; +} + +// SubtleDecryptRequest is the request for SubtleDecryptAlpha1. +message SubtleDecryptRequest { + // Name of the component + string component_name = 1 [json_name="componentName"]; + // Message to decrypt. + bytes ciphertext = 2; + // Algorithm to use, as in the JWA standard. + string algorithm = 3; + // Name (or name/version) of the key. + string key_name = 4 [json_name="keyName"]; + // Nonce / initialization vector. + // Ignored with asymmetric ciphers. + bytes nonce = 5; + // Authentication tag. + // This is nil when not using an authenticated cipher. + bytes tag = 6; + // Associated Data when using AEAD ciphers (optional). + bytes associated_data = 7 [json_name="associatedData"]; +} + +// SubtleDecryptResponse is the response for SubtleDecryptAlpha1. +message SubtleDecryptResponse { + // Decrypted plaintext. + bytes plaintext = 1; +} + +// SubtleWrapKeyRequest is the request for SubtleWrapKeyAlpha1. +message SubtleWrapKeyRequest { + // Name of the component + string component_name = 1 [json_name="componentName"]; + // Key to wrap + bytes plaintext_key = 2 [json_name="plaintextKey"]; + // Algorithm to use, as in the JWA standard. + string algorithm = 3; + // Name (or name/version) of the key. + string key_name = 4 [json_name="keyName"]; + // Nonce / initialization vector. + // Ignored with asymmetric ciphers. + bytes nonce = 5; + // Associated Data when using AEAD ciphers (optional). + bytes associated_data = 6 [json_name="associatedData"]; +} + +// SubtleWrapKeyResponse is the response for SubtleWrapKeyAlpha1. +message SubtleWrapKeyResponse { + // Wrapped key. + bytes wrapped_key = 1 [json_name="wrappedKey"]; + // Authentication tag. + // This is nil when not using an authenticated cipher. + bytes tag = 2; +} + +// SubtleUnwrapKeyRequest is the request for SubtleUnwrapKeyAlpha1. +message SubtleUnwrapKeyRequest { + // Name of the component + string component_name = 1 [json_name="componentName"]; + // Wrapped key. + bytes wrapped_key = 2 [json_name="wrappedKey"]; + // Algorithm to use, as in the JWA standard. + string algorithm = 3; + // Name (or name/version) of the key. + string key_name = 4 [json_name="keyName"]; + // Nonce / initialization vector. + // Ignored with asymmetric ciphers. + bytes nonce = 5; + // Authentication tag. + // This is nil when not using an authenticated cipher. + bytes tag = 6; + // Associated Data when using AEAD ciphers (optional). + bytes associated_data = 7 [json_name="associatedData"]; +} + +// SubtleUnwrapKeyResponse is the response for SubtleUnwrapKeyAlpha1. +message SubtleUnwrapKeyResponse { + // Key in plaintext + bytes plaintext_key = 1 [json_name="plaintextKey"]; +} + +// SubtleSignRequest is the request for SubtleSignAlpha1. +message SubtleSignRequest { + // Name of the component + string component_name = 1 [json_name="componentName"]; + // Digest to sign. + bytes digest = 2; + // Algorithm to use, as in the JWA standard. + string algorithm = 3; + // Name (or name/version) of the key. + string key_name = 4 [json_name="keyName"]; +} + +// SubtleSignResponse is the response for SubtleSignAlpha1. +message SubtleSignResponse { + // The signature that was computed + bytes signature = 1; +} + +// SubtleVerifyRequest is the request for SubtleVerifyAlpha1. +message SubtleVerifyRequest { + // Name of the component + string component_name = 1 [json_name="componentName"]; + // Digest of the message. + bytes digest = 2; + // Algorithm to use, as in the JWA standard. + string algorithm = 3; + // Name (or name/version) of the key. + string key_name = 4 [json_name="keyName"]; + // Signature to verify. + bytes signature = 5; +} + +// SubtleVerifyResponse is the response for SubtleVerifyAlpha1. +message SubtleVerifyResponse { + // True if the signature is valid. + bool valid = 1; +} + +// EncryptRequest is the request for EncryptAlpha1. +message EncryptRequest { + // Request details. Must be present in the first message only. + EncryptRequestOptions options = 1; + // Chunk of data of arbitrary size. + common.v1.StreamPayload payload = 2; +} + +// EncryptRequestOptions contains options for the first message in the EncryptAlpha1 request. +message EncryptRequestOptions { + // Name of the component. Required. + string component_name = 1 [json_name="componentName"]; + // Name (or name/version) of the key. Required. + string key_name = 2 [json_name="keyName"]; + // Key wrapping algorithm to use. Required. + // Supported options include: A256KW (alias: AES), A128CBC, A192CBC, A256CBC, RSA-OAEP-256 (alias: RSA). + string key_wrap_algorithm = 3; + // Cipher used to encrypt data (optional): "aes-gcm" (default) or "chacha20-poly1305" + string data_encryption_cipher = 10; + // If true, the encrypted document does not contain a key reference. + // In that case, calls to the Decrypt method must provide a key reference (name or name/version). + // Defaults to false. + bool omit_decryption_key_name = 11 [json_name="omitDecryptionKeyName"]; + // Key reference to embed in the encrypted document (name or name/version). + // This is helpful if the reference of the key used to decrypt the document is different from the one used to encrypt it. + // If unset, uses the reference of the key used to encrypt the document (this is the default behavior). + // This option is ignored if omit_decryption_key_name is true. + string decryption_key_name = 12 [json_name="decryptionKeyName"]; +} + +// EncryptResponse is the response for EncryptAlpha1. +message EncryptResponse { + // Chunk of data. + common.v1.StreamPayload payload = 1; +} + +// DecryptRequest is the request for DecryptAlpha1. +message DecryptRequest { + // Request details. Must be present in the first message only. + DecryptRequestOptions options = 1; + // Chunk of data of arbitrary size. + common.v1.StreamPayload payload = 2; +} + +// DecryptRequestOptions contains options for the first message in the DecryptAlpha1 request. +message DecryptRequestOptions { + // Name of the component + string component_name = 1 [json_name="componentName"]; + // Name (or name/version) of the key to decrypt the message. + // Overrides any key reference included in the message if present. + // This is required if the message doesn't include a key reference (i.e. was created with omit_decryption_key_name set to true). + string key_name = 12 [json_name="keyName"]; +} + +// DecryptResponse is the response for DecryptAlpha1. +message DecryptResponse { + // Chunk of data. + common.v1.StreamPayload payload = 1; +} + +// GetWorkflowRequest is the request for GetWorkflowBeta1. +message GetWorkflowRequest { + // ID of the workflow instance to query. + string instance_id = 1 [json_name = "instanceID"]; + // Name of the workflow component. + string workflow_component = 2 [json_name = "workflowComponent"]; +} + +// GetWorkflowResponse is the response for GetWorkflowBeta1. +message GetWorkflowResponse { + // ID of the workflow instance. + string instance_id = 1 [json_name = "instanceID"]; + // Name of the workflow. + string workflow_name = 2 [json_name = "workflowName"]; + // The time at which the workflow instance was created. + google.protobuf.Timestamp created_at = 3 [json_name = "createdAt"]; + // The last time at which the workflow instance had its state changed. + google.protobuf.Timestamp last_updated_at = 4 [json_name = "lastUpdatedAt"]; + // The current status of the workflow instance, for example, "PENDING", "RUNNING", "SUSPENDED", "COMPLETED", "FAILED", and "TERMINATED". + string runtime_status = 5 [json_name = "runtimeStatus"]; + // Additional component-specific properties of the workflow instance. + map properties = 6; +} + +// StartWorkflowRequest is the request for StartWorkflowBeta1. +message StartWorkflowRequest { + // The ID to assign to the started workflow instance. If empty, a random ID is generated. + string instance_id = 1 [json_name = "instanceID"]; + // Name of the workflow component. + string workflow_component = 2 [json_name = "workflowComponent"]; + // Name of the workflow. + string workflow_name = 3 [json_name = "workflowName"]; + // Additional component-specific options for starting the workflow instance. + map options = 4; + // Input data for the workflow instance. + bytes input = 5; +} + +// StartWorkflowResponse is the response for StartWorkflowBeta1. +message StartWorkflowResponse { + // ID of the started workflow instance. + string instance_id = 1 [json_name = "instanceID"]; +} + +// TerminateWorkflowRequest is the request for TerminateWorkflowBeta1. +message TerminateWorkflowRequest { + // ID of the workflow instance to terminate. + string instance_id = 1 [json_name = "instanceID"]; + // Name of the workflow component. + string workflow_component = 2 [json_name = "workflowComponent"]; +} + +// PauseWorkflowRequest is the request for PauseWorkflowBeta1. +message PauseWorkflowRequest { + // ID of the workflow instance to pause. + string instance_id = 1 [json_name = "instanceID"]; + // Name of the workflow component. + string workflow_component = 2 [json_name = "workflowComponent"]; +} + +// ResumeWorkflowRequest is the request for ResumeWorkflowBeta1. +message ResumeWorkflowRequest { + // ID of the workflow instance to resume. + string instance_id = 1 [json_name = "instanceID"]; + // Name of the workflow component. + string workflow_component = 2 [json_name = "workflowComponent"]; +} + +// RaiseEventWorkflowRequest is the request for RaiseEventWorkflowBeta1. +message RaiseEventWorkflowRequest { + // ID of the workflow instance to raise an event for. + string instance_id = 1 [json_name = "instanceID"]; + // Name of the workflow component. + string workflow_component = 2 [json_name = "workflowComponent"]; + // Name of the event. + string event_name = 3 [json_name = "eventName"]; + // Data associated with the event. + bytes event_data = 4; +} + +// PurgeWorkflowRequest is the request for PurgeWorkflowBeta1. +message PurgeWorkflowRequest { + // ID of the workflow instance to purge. + string instance_id = 1 [json_name = "instanceID"]; + // Name of the workflow component. + string workflow_component = 2 [json_name = "workflowComponent"]; +} + +// ShutdownRequest is the request for Shutdown. +message ShutdownRequest { + // Empty +} + +// Job is the definition of a job. At least one of schedule or due_time must be +// provided but can also be provided together. +message Job { + // The unique name for the job. + string name = 1 [json_name = "name"]; + + // schedule is an optional schedule at which the job is to be run. + // Accepts both systemd timer style cron expressions, as well as human + // readable '@' prefixed period strings as defined below. + // + // Systemd timer style cron accepts 6 fields: + // seconds | minutes | hours | day of month | month | day of week + // 0-59 | 0-59 | 0-23 | 1-31 | 1-12/jan-dec | 0-7/sun-sat + // + // "0 30 * * * *" - every hour on the half hour + // "0 15 3 * * *" - every day at 03:15 + // + // Period string expressions: + // Entry | Description | Equivalent To + // ----- | ----------- | ------------- + // @every | Run every (e.g. '@every 1h30m') | N/A + // @yearly (or @annually) | Run once a year, midnight, Jan. 1st | 0 0 0 1 1 * + // @monthly | Run once a month, midnight, first of month | 0 0 0 1 * * + // @weekly | Run once a week, midnight on Sunday | 0 0 0 * * 0 + // @daily (or @midnight) | Run once a day, midnight | 0 0 0 * * * + // @hourly | Run once an hour, beginning of hour | 0 0 * * * * + optional string schedule = 2 [json_name = "schedule"]; + + // repeats is the optional number of times in which the job should be + // triggered. If not set, the job will run indefinitely or until expiration. + optional uint32 repeats = 3 [json_name = "repeats"]; + + // due_time is the optional time at which the job should be active, or the + // "one shot" time if other scheduling type fields are not provided. Accepts + // a "point in time" string in the format of RFC3339, Go duration string + // (calculated from job creation time), or non-repeating ISO8601. + optional string due_time = 4 [json_name = "dueTime"]; + + // ttl is the optional time to live or expiration of the job. Accepts a + // "point in time" string in the format of RFC3339, Go duration string + // (calculated from job creation time), or non-repeating ISO8601. + optional string ttl = 5 [json_name = "ttl"]; + + // payload is the serialized job payload that will be sent to the recipient + // when the job is triggered. + google.protobuf.Any data = 6 [json_name = "data"]; +} + +// ScheduleJobRequest is the message to create/schedule the job. +message ScheduleJobRequest { + // The job details. + Job job = 1; +} + +// ScheduleJobResponse is the message response to create/schedule the job. +message ScheduleJobResponse { + // Empty +} + +// GetJobRequest is the message to retrieve a job. +message GetJobRequest { + // The name of the job. + string name = 1; +} + +// GetJobResponse is the message's response for a job retrieved. +message GetJobResponse { + // The job details. + Job job = 1; +} + +// DeleteJobRequest is the message to delete the job by name. +message DeleteJobRequest { + // The name of the job. + string name = 1; +} + +// DeleteJobResponse is the message response to delete the job by name. +message DeleteJobResponse { + // Empty +} diff --git a/scripts/src/proto/dapr/proto/sentry/v1/sentry.proto b/scripts/src/proto/dapr/proto/sentry/v1/sentry.proto new file mode 100644 index 00000000..49be6342 --- /dev/null +++ b/scripts/src/proto/dapr/proto/sentry/v1/sentry.proto @@ -0,0 +1,60 @@ +/* +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. +*/ + +syntax = "proto3"; + +package dapr.proto.sentry.v1; + +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/dapr/dapr/pkg/proto/sentry/v1;sentry"; + +service CA { + // A request for a time-bound certificate to be signed. + // + // The requesting side must provide an id for both loosely based + // And strong based identities. + rpc SignCertificate (SignCertificateRequest) returns (SignCertificateResponse) {} +} + +message SignCertificateRequest { + enum TokenValidator { + // Not specified - use the default value. + UNKNOWN = 0; + // Insecure validator (default on self-hosted). + INSECURE = 1; + // Kubernetes validator (default on Kubernetes). + KUBERNETES = 2; + // JWKS validator. + JWKS = 3; + } + string id = 1; + string token = 2; + string trust_domain = 3; + string namespace = 4; + // A PEM-encoded x509 CSR. + bytes certificate_signing_request = 5; + // Name of the validator to use, if not the default for the environemtn. + TokenValidator token_validator = 6; +} + +message SignCertificateResponse { + // A PEM-encoded x509 Certificate. + bytes workload_certificate = 1; + + // A list of PEM-encoded x509 Certificates that establish the trust chain + // between the workload certificate and the well-known trust root cert. + repeated bytes trust_chain_certificates = 2; + + google.protobuf.Timestamp valid_until = 3; +} diff --git a/scripts/src/proto/google/protobuf/any.proto b/scripts/src/proto/google/protobuf/any.proto new file mode 100644 index 00000000..eff44e50 --- /dev/null +++ b/scripts/src/proto/google/protobuf/any.proto @@ -0,0 +1,162 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option go_package = "google.golang.org/protobuf/types/known/anypb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "AnyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; + +// `Any` contains an arbitrary serialized protocol buffer message along with a +// URL that describes the type of the serialized message. +// +// Protobuf library provides support to pack/unpack Any values in the form +// of utility functions or additional generated methods of the Any type. +// +// Example 1: Pack and unpack a message in C++. +// +// Foo foo = ...; +// Any any; +// any.PackFrom(foo); +// ... +// if (any.UnpackTo(&foo)) { +// ... +// } +// +// Example 2: Pack and unpack a message in Java. +// +// Foo foo = ...; +// Any any = Any.pack(foo); +// ... +// if (any.is(Foo.class)) { +// foo = any.unpack(Foo.class); +// } +// // or ... +// if (any.isSameTypeAs(Foo.getDefaultInstance())) { +// foo = any.unpack(Foo.getDefaultInstance()); +// } +// +// Example 3: Pack and unpack a message in Python. +// +// foo = Foo(...) +// any = Any() +// any.Pack(foo) +// ... +// if any.Is(Foo.DESCRIPTOR): +// any.Unpack(foo) +// ... +// +// Example 4: Pack and unpack a message in Go +// +// foo := &pb.Foo{...} +// any, err := anypb.New(foo) +// if err != nil { +// ... +// } +// ... +// foo := &pb.Foo{} +// if err := any.UnmarshalTo(foo); err != nil { +// ... +// } +// +// The pack methods provided by protobuf library will by default use +// 'type.googleapis.com/full.type.name' as the type URL and the unpack +// methods only use the fully qualified type name after the last '/' +// in the type URL, for example "foo.bar.com/x/y.z" will yield type +// name "y.z". +// +// JSON +// ==== +// The JSON representation of an `Any` value uses the regular +// representation of the deserialized, embedded message, with an +// additional field `@type` which contains the type URL. Example: +// +// package google.profile; +// message Person { +// string first_name = 1; +// string last_name = 2; +// } +// +// { +// "@type": "type.googleapis.com/google.profile.Person", +// "firstName": , +// "lastName": +// } +// +// If the embedded message type is well-known and has a custom JSON +// representation, that representation will be embedded adding a field +// `value` which holds the custom JSON in addition to the `@type` +// field. Example (for message [google.protobuf.Duration][]): +// +// { +// "@type": "type.googleapis.com/google.protobuf.Duration", +// "value": "1.212s" +// } +// +message Any { + // A URL/resource name that uniquely identifies the type of the serialized + // protocol buffer message. This string must contain at least + // one "/" character. The last segment of the URL's path must represent + // the fully qualified name of the type (as in + // `path/google.protobuf.Duration`). The name should be in a canonical form + // (e.g., leading "." is not accepted). + // + // In practice, teams usually precompile into the binary all types that they + // expect it to use in the context of Any. However, for URLs which use the + // scheme `http`, `https`, or no scheme, one can optionally set up a type + // server that maps type URLs to message definitions as follows: + // + // * If no scheme is provided, `https` is assumed. + // * An HTTP GET on the URL must yield a [google.protobuf.Type][] + // value in binary format, or produce an error. + // * Applications are allowed to cache lookup results based on the + // URL, or have them precompiled into a binary to avoid any + // lookup. Therefore, binary compatibility needs to be preserved + // on changes to types. (Use versioned type names to manage + // breaking changes.) + // + // Note: this functionality is not currently available in the official + // protobuf release, and it is not used for type URLs beginning with + // type.googleapis.com. As of May 2023, there are no widely used type server + // implementations and no plans to implement one. + // + // Schemes other than `http`, `https` (or the empty scheme) might be + // used with implementation specific semantics. + // + string type_url = 1; + + // Must be a valid serialized protocol buffer of the above specified type. + bytes value = 2; +} diff --git a/scripts/src/proto/google/protobuf/empty.proto b/scripts/src/proto/google/protobuf/empty.proto new file mode 100644 index 00000000..b87c89dc --- /dev/null +++ b/scripts/src/proto/google/protobuf/empty.proto @@ -0,0 +1,51 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option go_package = "google.golang.org/protobuf/types/known/emptypb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "EmptyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; + +// A generic empty message that you can re-use to avoid defining duplicated +// empty messages in your APIs. A typical example is to use it as the request +// or the response type of an API method. For instance: +// +// service Foo { +// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +// } +// +message Empty {} diff --git a/scripts/src/proto/google/protobuf/timestamp.proto b/scripts/src/proto/google/protobuf/timestamp.proto new file mode 100644 index 00000000..fd0bc07d --- /dev/null +++ b/scripts/src/proto/google/protobuf/timestamp.proto @@ -0,0 +1,144 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/timestamppb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TimestampProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; + +// A Timestamp represents a point in time independent of any time zone or local +// calendar, encoded as a count of seconds and fractions of seconds at +// nanosecond resolution. The count is relative to an epoch at UTC midnight on +// January 1, 1970, in the proleptic Gregorian calendar which extends the +// Gregorian calendar backwards to year one. +// +// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap +// second table is needed for interpretation, using a [24-hour linear +// smear](https://developers.google.com/time/smear). +// +// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By +// restricting to that range, we ensure that we can convert to and from [RFC +// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. +// +// # Examples +// +// Example 1: Compute Timestamp from POSIX `time()`. +// +// Timestamp timestamp; +// timestamp.set_seconds(time(NULL)); +// timestamp.set_nanos(0); +// +// Example 2: Compute Timestamp from POSIX `gettimeofday()`. +// +// struct timeval tv; +// gettimeofday(&tv, NULL); +// +// Timestamp timestamp; +// timestamp.set_seconds(tv.tv_sec); +// timestamp.set_nanos(tv.tv_usec * 1000); +// +// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. +// +// FILETIME ft; +// GetSystemTimeAsFileTime(&ft); +// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; +// +// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z +// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. +// Timestamp timestamp; +// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); +// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); +// +// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. +// +// long millis = System.currentTimeMillis(); +// +// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) +// .setNanos((int) ((millis % 1000) * 1000000)).build(); +// +// Example 5: Compute Timestamp from Java `Instant.now()`. +// +// Instant now = Instant.now(); +// +// Timestamp timestamp = +// Timestamp.newBuilder().setSeconds(now.getEpochSecond()) +// .setNanos(now.getNano()).build(); +// +// Example 6: Compute Timestamp from current time in Python. +// +// timestamp = Timestamp() +// timestamp.GetCurrentTime() +// +// # JSON Mapping +// +// In JSON format, the Timestamp type is encoded as a string in the +// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the +// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" +// where {year} is always expressed using four digits while {month}, {day}, +// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional +// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), +// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone +// is required. A proto3 JSON serializer should always use UTC (as indicated by +// "Z") when printing the Timestamp type and a proto3 JSON parser should be +// able to accept both UTC and other timezones (as indicated by an offset). +// +// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past +// 01:30 UTC on January 15, 2017. +// +// In JavaScript, one can convert a Date object to this format using the +// standard +// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) +// method. In Python, a standard `datetime.datetime` object can be converted +// to this format using +// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with +// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use +// the Joda Time's [`ISODateTimeFormat.dateTime()`]( +// http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() +// ) to obtain a formatter capable of generating timestamps in this format. +// +message Timestamp { + // Represents seconds of UTC time since Unix epoch + // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + // 9999-12-31T23:59:59Z inclusive. + int64 seconds = 1; + + // Non-negative fractions of a second at nanosecond resolution. Negative + // second values with fractions must still have non-negative nanos values + // that count forward in time. Must be from 0 to 999,999,999 + // inclusive. + int32 nanos = 2; +}