├── .github └── workflows │ ├── pubsub-api-conformance.yaml │ └── statestore-api-conformance.yaml ├── .gitignore ├── CODEOWNERS ├── LICENSE ├── README.md ├── pubsub-api ├── README.md ├── portman │ ├── portman-cli-options.json │ └── portman.config.pubsub.json ├── postman │ └── pubsub.postman_globals.json └── pubsub.yaml ├── statestore-api ├── README.md ├── portman │ ├── portman-cli-options.json │ └── portman.config.statestore.json ├── postman │ └── statestore.postman_globals.json └── statestore.yaml ├── tck ├── components │ ├── pubsub.yaml │ └── statestore.yaml └── docker-compose.yaml └── www └── index.html /.github/workflows/pubsub-api-conformance.yaml: -------------------------------------------------------------------------------- 1 | name: PubSub API Conformance Tests 2 | on: 3 | push: 4 | pull_request: 5 | 6 | jobs: 7 | api-conformance-test: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Check out Git repositor 11 | uses: actions/checkout@v1 12 | - name: Set up Node.js 13 | uses: actions/setup-node@v1 14 | with: 15 | node-version: 12.x 16 | registry-url: https://registry.npmjs.org/ 17 | - name: Install portman and newman 18 | run: npm install -g @apideck/portman && npm install -g newman 19 | - name: Start the stack 20 | run: docker-compose -f tck/docker-compose.yaml up -d 21 | - name: Run API conformance tests 22 | run: portman --cliOptionsFile pubsub-api/portman/portman-cli-options.json 23 | - name: Shutdown the stack 24 | run: docker-compose -f tck/docker-compose.yaml down -------------------------------------------------------------------------------- /.github/workflows/statestore-api-conformance.yaml: -------------------------------------------------------------------------------- 1 | name: Statestore API Conformance Tests 2 | on: 3 | push: 4 | pull_request: 5 | 6 | jobs: 7 | api-conformance-test: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Check out Git repositor 11 | uses: actions/checkout@v1 12 | - name: Set up Node.js 13 | uses: actions/setup-node@v1 14 | with: 15 | node-version: 12.x 16 | registry-url: https://registry.npmjs.org/ 17 | - name: Install portman and newman 18 | run: npm install -g @apideck/portman && npm install -g newman 19 | - name: Start the stack 20 | run: docker-compose -f tck/docker-compose.yaml up -d 21 | - name: Run API conformance tests 22 | run: portman --cliOptionsFile statestore-api/portman/portman-cli-options.json 23 | - name: Shutdown the stack 24 | run: docker-compose -f tck/docker-compose.yaml down -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | statestore-api/postman/statestore.postman.json 2 | tmp/ 3 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # The following users are co-chairs of the API specification SIG. 2 | 3 | @seeflood 4 | @kevinten10 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # API Specification 2 | 3 | This repository contains the documents, discussions and implementations of the API specification for Dapr. 4 | 5 | ## Structure 6 | 7 | The Open API definitions for Dapr Components can be found in the following directories: 8 | - [Dapr Statestore Component APIs](statestore-api/) 9 | - [Dapr PubSub Component APIs](pubsub-api/) 10 | 11 | This repository also includes a Technology Compatibility Kit (TCK for short) which tests the Open APIs specification by creating Postman collections including Contract, Content and Variation tests using [Portman](https://github.com/apideck-libraries/portman) and then run all the tests against `daprd` which is started using [Docker Compose](tck/docker-compose.yaml). These tests are automated using GitHub Actions that you can find inside the [`.github/workflows`](.github/workflows/) directory, and use [Newman](https://github.com/postmanlabs/newman) to execute the generated tests. 12 | 13 | 14 | 15 | ## Contact 16 | 17 | If you have a general question or suggestion regarding the work done in this special interest group, please open a GitHub issue in this repository. 18 | 19 | * [API Spec Discord Channel](https://discord.com/channels/778680217417809931/935578420589522984) 20 | * [Owners](CODEOWNERS) 21 | -------------------------------------------------------------------------------- /pubsub-api/README.md: -------------------------------------------------------------------------------- 1 | # PubSub APIs Open Specification v3 2 | 3 | Specification generated based on the [PubSub API Docs](https://docs.dapr.io/reference/api/pubsub_api/) 4 | 5 | ## Coverage: 6 | - [POST /v1.0/publish/{pubsub}/{topic}]() 7 | 8 | ## Contract Testing: 9 | - Success 10 | - Headers Present 11 | - Max response time 12 | 13 | 14 | ## Content Testing 15 | 16 | (TBD) 17 | 18 | ## Variation Testing 19 | 20 | (TBD) 21 | 22 | ## Other 23 | 24 | Inside this directory you can find the Portman and Postman configurations to automatically create Postman collections with tests that can be executed with Newman. 25 | 26 | [Portman CLI configurations](portman/) 27 | [Postman Globals configurations](postman/) -------------------------------------------------------------------------------- /pubsub-api/portman/portman-cli-options.json: -------------------------------------------------------------------------------- 1 | { 2 | "local": "pubsub-api/pubsub.yaml", 3 | "baseUrl": "http://127.0.0.1:3500", 4 | "output": "pubsub-api/postman/pubsub.postman.json", 5 | "portmanConfigFile": "pubsub-api/portman/portman.config.pubsub.json", 6 | "envFile": "pubsub-api/postman/pubsub.postman_globals.json", 7 | "includeTests": true, 8 | "syncPostman": false, 9 | "runNewman": true, 10 | "newmanRunOptions": { 11 | "environment": "pubsub-api/postman/pubsub.postman_globals.json", 12 | "iteration-count": 5, 13 | "ignore-redirects": true, 14 | "insecure": true 15 | } 16 | } -------------------------------------------------------------------------------- /pubsub-api/portman/portman.config.pubsub.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1.0, 3 | "tests": { 4 | "contractTests": [ 5 | { 6 | "openApiOperation": "*::/*", 7 | "statusSuccess": { 8 | "enabled": true 9 | } 10 | }, 11 | { 12 | "openApiOperation": "*::/*", 13 | "responseTime": { 14 | "enabled": false, 15 | "maxMs": 300 16 | } 17 | }, 18 | 19 | { 20 | "openApiOperation": "*::/*", 21 | "headersPresent": { 22 | "enabled": true 23 | } 24 | } 25 | ], 26 | "contentTests": [], 27 | "extendTests": [], 28 | "variationTests": [] 29 | }, 30 | "assignVariables": [], 31 | "overwrites": [ 32 | { 33 | "openApiOperation": "POST::/v1.0/publish/*", 34 | "overwriteRequestPathVariables": [ 35 | { 36 | "key": "pubsub", 37 | "value": "{{pubsub}}", 38 | "overwrite": true 39 | }, 40 | { 41 | "key": "topic", 42 | "value": "{{topic}}", 43 | "overwrite": true 44 | } 45 | ], 46 | "overwriteRequestHeaders": [ 47 | { 48 | "key": "dapr-app-id", 49 | "value": "{{dapr-app-id}}", 50 | "overwrite": true 51 | } 52 | ] 53 | } 54 | 55 | 56 | ], 57 | "globals": { 58 | "collectionPreRequestScripts": [], 59 | "keyValueReplacements": {}, 60 | "valueReplacements": {}, 61 | "rawReplacements": [], 62 | "orderOfOperations": [ 63 | "POST::/v1.0/publis/{pubsub}/{topic}" 64 | 65 | ] 66 | } 67 | 68 | 69 | } -------------------------------------------------------------------------------- /pubsub-api/postman/pubsub.postman_globals.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "e0fb6cf9-38fa-4eb8-81d0-d326e64cd208", 3 | "values": [ 4 | { 5 | "key": "pubsub", 6 | "value": "pubsub", 7 | "type": "default", 8 | "enabled": true 9 | }, 10 | { 11 | "key": "topic", 12 | "value": "topic", 13 | "type": "default", 14 | "enabled": true 15 | } 16 | ], 17 | "name": "Globals", 18 | "_postman_variable_scope": "globals", 19 | "_postman_exported_at": "2023-07-11T11:10:13.657Z", 20 | "_postman_exported_using": "Postman/10.15.8" 21 | } -------------------------------------------------------------------------------- /pubsub-api/pubsub.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.3 2 | info: 3 | title: Dapr PubSub APIs 4 | description: |- 5 | This is the PubSub Dapr Component API specification. 6 | termsOfService: https://dapr.io/ 7 | contact: 8 | email: salaboy@diagrid.io 9 | license: 10 | name: Apache 2.0 11 | url: http://www.apache.org/licenses/LICENSE-2.0.html 12 | version: 1.0.0 13 | externalDocs: 14 | description: Find out more about Dapr 15 | url: https://dapr.io/ 16 | servers: 17 | - url: http://localhost:3500/api/ 18 | tags: 19 | - name: state 20 | description: PubSub APIs 21 | externalDocs: 22 | description: Find out more the Statestore API 23 | url: https://docs.dapr.io/reference/api/pubsub_api/ 24 | paths: 25 | /v1.0/publish/{pubsub}/{topic}: 26 | post: 27 | tags: 28 | - pubsub 29 | summary: Publish a message 30 | description: Publish a message to a given topic 31 | operationId: post-publish-message 32 | parameters: 33 | - in: path 34 | name: pubsub 35 | description: PubSub component to use 36 | required: true 37 | schema: 38 | type: string 39 | - in: path 40 | name: topic 41 | description: Topic in the PubSub to publish the message 42 | required: true 43 | schema: 44 | type: string 45 | requestBody: 46 | description: Message to publish 47 | content: 48 | application/json: 49 | schema: 50 | $ref: "#/components/schemas/Message" 51 | responses: 52 | '204': 53 | description: "Message delivered" 54 | '403': 55 | description: "Message forbidden by access controls" 56 | '404': 57 | description: "No pubsub name or topic given" 58 | '500': 59 | description: "Delivery failed" 60 | components: 61 | schemas: 62 | Message: 63 | type: "object" -------------------------------------------------------------------------------- /statestore-api/README.md: -------------------------------------------------------------------------------- 1 | # Statestore APIs Open Specification v3 2 | 3 | Specification generated based on the [Statestore API Docs](https://docs.dapr.io/reference/api/state_api/) 4 | 5 | Coverage: 6 | - [GET /v1.0/state/{statestore}/{key}]() 7 | - [DELETE /v1.0/state/{statestore}/{key}]() 8 | - [POST /v1.0/state/{statestore}]() 9 | - [PUT /v1.0/state/{statestore}]() 10 | - [POST /v1.0/state/{statestore}/bulk]() 11 | - [PUT /v1.0/state/{statestore}/bulk]() 12 | 13 | ## Contract Testing: 14 | - Success 15 | - Headers Present 16 | - Max response time 17 | 18 | 19 | ## Content Testing 20 | 21 | (TBD) 22 | 23 | ## Variation Testing 24 | 25 | (TBD) 26 | 27 | ## Other 28 | 29 | Inside this directory you can find the Portman and Postman configurations to automatically create Postman collections with tests that can be executed with Newman. 30 | 31 | [Portman CLI configurations](portman/) 32 | [Postman Globals configurations](postman/) -------------------------------------------------------------------------------- /statestore-api/portman/portman-cli-options.json: -------------------------------------------------------------------------------- 1 | { 2 | "local": "statestore-api/statestore.yaml", 3 | "baseUrl": "http://127.0.0.1:3500", 4 | "output": "statestore-api/postman/statestore.postman.json", 5 | "portmanConfigFile": "statestore-api/portman/portman.config.statestore.json", 6 | "envFile": "statestore-api/postman/statestore.postman_globals.json", 7 | "includeTests": true, 8 | "syncPostman": false, 9 | "runNewman": true, 10 | "newmanRunOptions": { 11 | "environment": "statestore-api/postman/statestore.postman_globals.json", 12 | "iteration-count": 5, 13 | "ignore-redirects": true, 14 | "insecure": true 15 | } 16 | } -------------------------------------------------------------------------------- /statestore-api/portman/portman.config.statestore.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1.0, 3 | "tests": { 4 | "contractTests": [ 5 | { 6 | "openApiOperation": "*::/*", 7 | "statusSuccess": { 8 | "enabled": true 9 | } 10 | }, 11 | { 12 | "openApiOperation": "*::/*", 13 | "responseTime": { 14 | "enabled": false, 15 | "maxMs": 300 16 | } 17 | }, 18 | 19 | { 20 | "openApiOperation": "*::/*", 21 | "headersPresent": { 22 | "enabled": true 23 | } 24 | } 25 | ], 26 | "contentTests": [], 27 | "extendTests": [], 28 | "variationTests": [] 29 | }, 30 | "assignVariables": [], 31 | "overwrites": [ 32 | { 33 | "openApiOperation": "POST::/v1.0/state/*", 34 | "overwriteRequestPathVariables": [ 35 | { 36 | "key": "statestore", 37 | "value": "{{statestore}}", 38 | "overwrite": true 39 | } 40 | ], 41 | "overwriteRequestHeaders": [ 42 | { 43 | "key": "dapr-app-id", 44 | "value": "{{dapr-app-id}}", 45 | "overwrite": true 46 | } 47 | ] 48 | }, 49 | { 50 | "openApiOperation": "PUT::/v1.0/state/*", 51 | "overwriteRequestPathVariables": [ 52 | { 53 | "key": "statestore", 54 | "value": "{{statestore}}", 55 | "overwrite": true 56 | } 57 | ], 58 | "overwriteRequestHeaders": [ 59 | { 60 | "key": "dapr-app-id", 61 | "value": "{{dapr-app-id}}", 62 | "overwrite": true 63 | } 64 | ] 65 | }, 66 | { 67 | "openApiOperation": "DELETE::/v1.0/state/*", 68 | "overwriteRequestPathVariables": [ 69 | { 70 | "key": "statestore", 71 | "value": "{{statestore}}", 72 | "overwrite": true 73 | }, 74 | { 75 | "key": "key", 76 | "value": "{{key}}", 77 | "overwrite": false 78 | } 79 | ], 80 | "overwriteRequestHeaders": [ 81 | { 82 | "key": "dapr-app-id", 83 | "value": "{{dapr-app-id}}", 84 | "overwrite": true 85 | } 86 | ] 87 | }, 88 | { 89 | "openApiOperation": "GET::/v1.0/state/*", 90 | "overwriteRequestPathVariables": [ 91 | { 92 | "key": "statestore", 93 | "value": "{{statestore}}", 94 | "overwrite": true 95 | }, 96 | { 97 | "key": "key", 98 | "value": "{{key}}", 99 | "overwrite": false 100 | } 101 | ], 102 | "overwriteRequestHeaders": [ 103 | { 104 | "key": "dapr-app-id", 105 | "value": "{{dapr-app-id}}", 106 | "overwrite": true 107 | } 108 | ] 109 | } 110 | 111 | ], 112 | "globals": { 113 | "collectionPreRequestScripts": [], 114 | "keyValueReplacements": {}, 115 | "valueReplacements": {}, 116 | "rawReplacements": [], 117 | "orderOfOperations": [ 118 | "POST::/v1.0/state/{statestore}", 119 | "PUT::/v1.0/state/{statestore}", 120 | "GET::/v1.0/state/{statestore}/{key}", 121 | "DELETE::/v1.0/state/{statestore}/{key}", 122 | "GET::/v1.0/state/{statestore}/{key}", 123 | "POST::/v1.0/state/{statestore}/bulk", 124 | "PUT::/v1.0/state/{statestore}/bulk", 125 | "POST::/v1.0/state/{statestore}/transaction", 126 | "PUT::/v1.0/state/{statestore}/transaction" 127 | ] 128 | } 129 | 130 | 131 | } -------------------------------------------------------------------------------- /statestore-api/postman/statestore.postman_globals.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "e0fb6cf9-38fa-4eb8-81d0-d326e64cd208", 3 | "values": [ 4 | { 5 | "key": "statestore", 6 | "value": "statestore", 7 | "type": "default", 8 | "enabled": true 9 | }, 10 | { 11 | "key": "key", 12 | "value": "order", 13 | "type": "default", 14 | "enabled": true 15 | } 16 | ], 17 | "name": "Globals", 18 | "_postman_variable_scope": "globals", 19 | "_postman_exported_at": "2023-07-11T11:10:13.657Z", 20 | "_postman_exported_using": "Postman/10.15.8" 21 | } -------------------------------------------------------------------------------- /statestore-api/statestore.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.3 2 | info: 3 | title: Dapr Statestore APIs 4 | description: |- 5 | This is the Statestore Dapr Component API specification. 6 | termsOfService: https://dapr.io/ 7 | contact: 8 | email: salaboy@diagrid.io 9 | license: 10 | name: Apache 2.0 11 | url: http://www.apache.org/licenses/LICENSE-2.0.html 12 | version: 1.0.0 13 | externalDocs: 14 | description: Find out more about Dapr 15 | url: https://dapr.io/ 16 | servers: 17 | - url: http://localhost:3500/api/ 18 | tags: 19 | - name: state 20 | description: Statestore APIs 21 | externalDocs: 22 | description: Find out more the Statestore API 23 | url: https://docs.dapr.io/reference/api/state_api/ 24 | paths: 25 | /v1.0/state/{statestore}/{key}: 26 | get: 27 | tags: 28 | - state 29 | summary: Get state From Statestore 30 | description: Get stored state from the Dapr Statestore Component 31 | operationId: get-state 32 | parameters: 33 | - in: path 34 | name: statestore 35 | description: Statestore from where to retrieve data 36 | required: true 37 | schema: 38 | type: string 39 | - in: path 40 | required: true 41 | schema: 42 | type: string 43 | name: key 44 | description: "the key of the desired state" 45 | - in: "query" 46 | name: consistency 47 | description: "read consistency mode" 48 | schema: 49 | type: string 50 | enum: [strong, eventual] 51 | - in: "query" 52 | name: metadata 53 | description: "metadata as query parameters to the state store" 54 | schema: 55 | type: object 56 | style: form 57 | explode: true 58 | example: '{ "metadata.partitionKey": "mypartitionKey" }' 59 | responses: 60 | "200": 61 | description: "State retrieved successfully" 62 | content: 63 | application/json: 64 | schema: 65 | $ref: "#/components/schemas/StateGetResponse" 66 | "204": 67 | description: "State Key is not found" 68 | "400": 69 | description: "State store is missing or misconfigured" 70 | "500": 71 | description: "An error occurred, check the Dapr logs" 72 | delete: 73 | tags: 74 | - state 75 | summary: Delete state from the Statestore 76 | description: Delete state from teh Dapr Statestore Component 77 | operationId: delete-state 78 | parameters: 79 | - in: "path" 80 | required: true 81 | schema: 82 | type: string 83 | name: statestore 84 | description: metadata.name field in the user configured state store component yaml. Please refer Dapr State Store configuration structure mentioned above. 85 | - in: "path" 86 | required: true 87 | schema: 88 | type: string 89 | name: key 90 | description: "the key of the desired state" 91 | responses: 92 | "204": 93 | description: "Deleted Key successfully" 94 | "400": 95 | description: "State store is missing or misconfigured" 96 | "500": 97 | description: "An error occurred, check the Dapr logs" 98 | /v1.0/state/{statestore}: 99 | post: 100 | tags: 101 | - state 102 | summary: Store state to the Statestore 103 | description: Store state to the Dapr Statestore Component 104 | operationId: post-store-state 105 | parameters: 106 | - in: path 107 | name: statestore 108 | description: Statestore from where to retrieve data 109 | required: true 110 | schema: 111 | type: string 112 | requestBody: 113 | description: Values to store 114 | content: 115 | application/json: 116 | schema: 117 | $ref: "#/components/schemas/StateRequestArray" 118 | responses: 119 | '204': 120 | description: "State saved" 121 | '400': 122 | description: "State store is missing or misconfigured" 123 | '500': 124 | description: "An error occurred, check the Dapr logs" 125 | put: 126 | tags: 127 | - state 128 | summary: Store state to the Statestore 129 | description: Store state to the Dapr Statestore Component 130 | operationId: put-store-state 131 | parameters: 132 | - in: path 133 | name: statestore 134 | description: Statestore from where to retrieve data 135 | required: true 136 | schema: 137 | type: string 138 | requestBody: 139 | description: Values to store 140 | content: 141 | application/json: 142 | schema: 143 | $ref: "#/components/schemas/StateRequestArray" 144 | responses: 145 | '204': 146 | description: "State saved" 147 | '400': 148 | description: "State store is missing or misconfigured" 149 | '500': 150 | description: "An error occurred, check the Dapr logs" 151 | /v1.0/state/{statestore}/bulk: 152 | post: 153 | tags: 154 | - state 155 | summary: Get Bulk state from the Statestore 156 | description: This endpoint lets you get a list of values for a given list of keys. 157 | operationId: post-bulk-get-state 158 | parameters: 159 | - in: path 160 | name: statestore 161 | description: Statestore from where to retrieve data 162 | required: true 163 | schema: 164 | type: string 165 | requestBody: 166 | description: Values to store 167 | content: 168 | application/json: 169 | schema: 170 | $ref: "#/components/schemas/BulkStateRequest" 171 | responses: 172 | "200": 173 | description: "State retrieved successfully" 174 | content: 175 | application/json: 176 | schema: 177 | $ref: "#/components/schemas/StateGetResponse" 178 | "204": 179 | description: "State Key is not found" 180 | "400": 181 | description: "State store is missing or misconfigured" 182 | "500": 183 | description: "An error occurred, check the Dapr logs" 184 | put: 185 | tags: 186 | - state 187 | summary: Get Bulk state from the Statestore 188 | description: This endpoint lets you get a list of values for a given list of keys. 189 | operationId: put-bulk-get-state 190 | parameters: 191 | - in: path 192 | name: statestore 193 | description: Statestore from where to retrieve data 194 | required: true 195 | schema: 196 | type: string 197 | requestBody: 198 | description: Values to store 199 | content: 200 | application/json: 201 | schema: 202 | $ref: "#/components/schemas/BulkStateRequest" 203 | responses: 204 | "200": 205 | description: "State retrieved successfully" 206 | content: 207 | application/json: 208 | schema: 209 | $ref: "#/components/schemas/StateGetResponse" 210 | "204": 211 | description: "State Key is not found" 212 | "400": 213 | description: "State store is missing or misconfigured" 214 | "500": 215 | description: "An error occurred, check the Dapr logs" 216 | components: 217 | schemas: 218 | StateRequest: 219 | type: "object" 220 | required: 221 | - key 222 | - value 223 | properties: 224 | key: 225 | type: "string" 226 | description: "state key" 227 | value: 228 | type: "string" 229 | description: "state value, which can be any byte array" 230 | StateRequestArray: 231 | type: "array" 232 | items: 233 | $ref: "#/components/schemas/StateRequest" 234 | StateGetResponse: 235 | type: "object" 236 | BulkStateRequest: 237 | type: "object" 238 | required: 239 | - keys 240 | properties: 241 | keys: 242 | type: "array" 243 | description: "keys to fetch" 244 | TransactionalOperationsRequest: 245 | type: "array" 246 | items: 247 | $ref: "#/components/schemas/TransactionalOperationRequest" 248 | TransactionalOperationRequest: 249 | type: "object" 250 | -------------------------------------------------------------------------------- /tck/components/pubsub.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: pubsub 5 | spec: 6 | type: pubsub.redis 7 | version: v1 8 | metadata: 9 | - name: redisHost 10 | value: redis:6379 11 | - name: redisPassword 12 | value: "" 13 | -------------------------------------------------------------------------------- /tck/components/statestore.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: statestore 5 | spec: 6 | type: state.redis 7 | version: v1 8 | metadata: 9 | - name: redisHost 10 | value: redis:6379 11 | - name: redisPassword 12 | value: "" -------------------------------------------------------------------------------- /tck/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | ############################ 4 | # Redis state store and pubsub 5 | ############################ 6 | redis: 7 | image: "redis:alpine" 8 | ports: 9 | - "6379:6379" 10 | healthcheck: 11 | test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ] 12 | tck-dapr: 13 | image: "daprio/daprd:edge" 14 | depends_on: 15 | redis: 16 | condition: service_healthy 17 | ports: 18 | - "3500:3500" 19 | command: ["./daprd", 20 | "-app-id", "tck-app", 21 | "-app-port", "8080", 22 | "-app-channel-address", "127.0.0.1", 23 | "-components-path", "/components"] 24 | volumes: 25 | - "./components/:/components" 26 | -------------------------------------------------------------------------------- /www/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |