sendproof-core 0.1.0a1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. sendproof_core/__init__.py +56 -0
  2. sendproof_core/assets.py +71 -0
  3. sendproof_core/capture.py +416 -0
  4. sendproof_core/effects.py +79 -0
  5. sendproof_core/identity.py +22 -0
  6. sendproof_core/jsonsafe.py +103 -0
  7. sendproof_core/limits.py +24 -0
  8. sendproof_core/marker.py +131 -0
  9. sendproof_core/options.py +129 -0
  10. sendproof_core/protocol.py +132 -0
  11. sendproof_core/provider.py +121 -0
  12. sendproof_core/py.typed +0 -0
  13. sendproof_core/redaction.py +88 -0
  14. sendproof_core/scope.py +146 -0
  15. sendproof_core/stores/__init__.py +119 -0
  16. sendproof_core/stores/base.py +99 -0
  17. sendproof_core/stores/cassandra_hook.py +173 -0
  18. sendproof_core/stores/classify.py +153 -0
  19. sendproof_core/stores/classify_batch_two.py +397 -0
  20. sendproof_core/stores/cosmos_hook.py +214 -0
  21. sendproof_core/stores/dynamodb_hook.py +214 -0
  22. sendproof_core/stores/elasticsearch_hook.py +248 -0
  23. sendproof_core/stores/firestore_hook.py +459 -0
  24. sendproof_core/stores/guard.py +205 -0
  25. sendproof_core/stores/mongo_hook.py +1406 -0
  26. sendproof_core/stores/redis_hook.py +536 -0
  27. sendproof_core/stores/tables.py +1486 -0
  28. sendproof_core/stores/versions.py +46 -0
  29. sendproof_core/sync_engine.py +308 -0
  30. sendproof_core/trace_store.py +92 -0
  31. sendproof_core/txguard.py +237 -0
  32. sendproof_core/ui/action-bar.js +91 -0
  33. sendproof_core/ui/api.js +239 -0
  34. sendproof_core/ui/app.css +848 -0
  35. sendproof_core/ui/app.js +742 -0
  36. sendproof_core/ui/autofill.js +137 -0
  37. sendproof_core/ui/code-copy.js +71 -0
  38. sendproof_core/ui/code-picker.js +149 -0
  39. sendproof_core/ui/commands.js +197 -0
  40. sendproof_core/ui/components.js +77 -0
  41. sendproof_core/ui/context-bar.js +82 -0
  42. sendproof_core/ui/copy.js +92 -0
  43. sendproof_core/ui/coverage-popover.js +35 -0
  44. sendproof_core/ui/crumb-fit.js +80 -0
  45. sendproof_core/ui/deprecation.js +164 -0
  46. sendproof_core/ui/display-settings.js +175 -0
  47. sendproof_core/ui/doc-diff.js +209 -0
  48. sendproof_core/ui/docs-view.js +347 -0
  49. sendproof_core/ui/favicon.png +0 -0
  50. sendproof_core/ui/favicon.svg +1 -0
  51. sendproof_core/ui/field-help.js +52 -0
  52. sendproof_core/ui/field-modules.js +23 -0
  53. sendproof_core/ui/fields/controls.js +179 -0
  54. sendproof_core/ui/fields/dom.js +36 -0
  55. sendproof_core/ui/fields/infer.js +71 -0
  56. sendproof_core/ui/fields/lookup-source.js +63 -0
  57. sendproof_core/ui/fields/lookup.js +285 -0
  58. sendproof_core/ui/fields/render.js +496 -0
  59. sendproof_core/ui/fields/select.js +175 -0
  60. sendproof_core/ui/fields/validate.js +363 -0
  61. sendproof_core/ui/fields/validation-formats.js +164 -0
  62. sendproof_core/ui/fields/validation-references.js +68 -0
  63. sendproof_core/ui/fields/validation-values.js +137 -0
  64. sendproof_core/ui/generate-menu.js +44 -0
  65. sendproof_core/ui/generate.js +184 -0
  66. sendproof_core/ui/header-editor.js +777 -0
  67. sendproof_core/ui/headers.js +188 -0
  68. sendproof_core/ui/highlight.js +257 -0
  69. sendproof_core/ui/history-popover.js +24 -0
  70. sendproof_core/ui/i18n.js +253 -0
  71. sendproof_core/ui/icons.js +87 -0
  72. sendproof_core/ui/index.html +70 -0
  73. sendproof_core/ui/issues.js +187 -0
  74. sendproof_core/ui/json-view.js +166 -0
  75. sendproof_core/ui/lang-icons.js +62 -0
  76. sendproof_core/ui/layout.js +262 -0
  77. sendproof_core/ui/listbox.js +334 -0
  78. sendproof_core/ui/locales/ar-capture.js +366 -0
  79. sendproof_core/ui/locales/ar-stores.js +116 -0
  80. sendproof_core/ui/locales/ar.js +561 -0
  81. sendproof_core/ui/locales/cs-capture.js +442 -0
  82. sendproof_core/ui/locales/cs-stores.js +116 -0
  83. sendproof_core/ui/locales/cs.js +689 -0
  84. sendproof_core/ui/locales/da-capture.js +347 -0
  85. sendproof_core/ui/locales/da-stores.js +116 -0
  86. sendproof_core/ui/locales/da.js +522 -0
  87. sendproof_core/ui/locales/de-capture.js +347 -0
  88. sendproof_core/ui/locales/de-stores.js +116 -0
  89. sendproof_core/ui/locales/de.js +519 -0
  90. sendproof_core/ui/locales/el-capture.js +347 -0
  91. sendproof_core/ui/locales/el-stores.js +116 -0
  92. sendproof_core/ui/locales/el.js +520 -0
  93. sendproof_core/ui/locales/en-capture.js +349 -0
  94. sendproof_core/ui/locales/en-stores.js +95 -0
  95. sendproof_core/ui/locales/en.js +522 -0
  96. sendproof_core/ui/locales/es-capture.js +353 -0
  97. sendproof_core/ui/locales/es-stores.js +116 -0
  98. sendproof_core/ui/locales/es.js +525 -0
  99. sendproof_core/ui/locales/fa-capture.js +348 -0
  100. sendproof_core/ui/locales/fa-stores.js +116 -0
  101. sendproof_core/ui/locales/fa.js +521 -0
  102. sendproof_core/ui/locales/fi-capture.js +347 -0
  103. sendproof_core/ui/locales/fi-stores.js +116 -0
  104. sendproof_core/ui/locales/fi.js +523 -0
  105. sendproof_core/ui/locales/fr-capture.js +353 -0
  106. sendproof_core/ui/locales/fr-stores.js +116 -0
  107. sendproof_core/ui/locales/fr.js +525 -0
  108. sendproof_core/ui/locales/he-capture.js +358 -0
  109. sendproof_core/ui/locales/he-stores.js +116 -0
  110. sendproof_core/ui/locales/he.js +529 -0
  111. sendproof_core/ui/locales/hi-capture.js +348 -0
  112. sendproof_core/ui/locales/hi-stores.js +116 -0
  113. sendproof_core/ui/locales/hi.js +523 -0
  114. sendproof_core/ui/locales/id-capture.js +347 -0
  115. sendproof_core/ui/locales/id-stores.js +116 -0
  116. sendproof_core/ui/locales/id.js +521 -0
  117. sendproof_core/ui/locales/it-capture.js +361 -0
  118. sendproof_core/ui/locales/it-stores.js +116 -0
  119. sendproof_core/ui/locales/it.js +523 -0
  120. sendproof_core/ui/locales/ja-capture.js +346 -0
  121. sendproof_core/ui/locales/ja-stores.js +116 -0
  122. sendproof_core/ui/locales/ja.js +521 -0
  123. sendproof_core/ui/locales/ko-capture.js +346 -0
  124. sendproof_core/ui/locales/ko-stores.js +116 -0
  125. sendproof_core/ui/locales/ko.js +522 -0
  126. sendproof_core/ui/locales/nb-capture.js +349 -0
  127. sendproof_core/ui/locales/nb-stores.js +116 -0
  128. sendproof_core/ui/locales/nb.js +521 -0
  129. sendproof_core/ui/locales/nl-capture.js +355 -0
  130. sendproof_core/ui/locales/nl-stores.js +116 -0
  131. sendproof_core/ui/locales/nl.js +520 -0
  132. sendproof_core/ui/locales/pl-capture.js +432 -0
  133. sendproof_core/ui/locales/pl-stores.js +116 -0
  134. sendproof_core/ui/locales/pl.js +528 -0
  135. sendproof_core/ui/locales/pt-BR-capture.js +350 -0
  136. sendproof_core/ui/locales/pt-BR-stores.js +116 -0
  137. sendproof_core/ui/locales/pt-BR.js +523 -0
  138. sendproof_core/ui/locales/pt-PT-capture.js +350 -0
  139. sendproof_core/ui/locales/pt-PT-stores.js +116 -0
  140. sendproof_core/ui/locales/pt-PT.js +523 -0
  141. sendproof_core/ui/locales/ru-capture.js +437 -0
  142. sendproof_core/ui/locales/ru-stores.js +116 -0
  143. sendproof_core/ui/locales/ru.js +624 -0
  144. sendproof_core/ui/locales/sv-capture.js +349 -0
  145. sendproof_core/ui/locales/sv-stores.js +116 -0
  146. sendproof_core/ui/locales/sv.js +518 -0
  147. sendproof_core/ui/locales/th-capture.js +347 -0
  148. sendproof_core/ui/locales/th-stores.js +116 -0
  149. sendproof_core/ui/locales/th.js +521 -0
  150. sendproof_core/ui/locales/tr-capture.js +348 -0
  151. sendproof_core/ui/locales/tr-stores.js +116 -0
  152. sendproof_core/ui/locales/tr.js +521 -0
  153. sendproof_core/ui/locales/uk-capture.js +442 -0
  154. sendproof_core/ui/locales/uk-stores.js +116 -0
  155. sendproof_core/ui/locales/uk.js +630 -0
  156. sendproof_core/ui/locales/vi-capture.js +346 -0
  157. sendproof_core/ui/locales/vi-stores.js +116 -0
  158. sendproof_core/ui/locales/vi.js +523 -0
  159. sendproof_core/ui/locales/zh-Hans-capture.js +347 -0
  160. sendproof_core/ui/locales/zh-Hans-stores.js +116 -0
  161. sendproof_core/ui/locales/zh-Hans.js +523 -0
  162. sendproof_core/ui/locales/zh-Hant-capture.js +346 -0
  163. sendproof_core/ui/locales/zh-Hant-stores.js +116 -0
  164. sendproof_core/ui/locales/zh-Hant.js +522 -0
  165. sendproof_core/ui/manifest.json +866 -0
  166. sendproof_core/ui/markdown.js +39 -0
  167. sendproof_core/ui/model-view.js +182 -0
  168. sendproof_core/ui/navigation.js +233 -0
  169. sendproof_core/ui/operation-header.js +76 -0
  170. sendproof_core/ui/operations.js +7 -0
  171. sendproof_core/ui/overview-view.js +63 -0
  172. sendproof_core/ui/personas.js +59 -0
  173. sendproof_core/ui/popover.js +71 -0
  174. sendproof_core/ui/preview-false.js +108 -0
  175. sendproof_core/ui/request-editor.js +496 -0
  176. sendproof_core/ui/response-metadata.js +354 -0
  177. sendproof_core/ui/response-viewer.js +618 -0
  178. sendproof_core/ui/result-blocked.js +155 -0
  179. sendproof_core/ui/result-capture.js +25 -0
  180. sendproof_core/ui/result-database.js +185 -0
  181. sendproof_core/ui/result-effects.js +176 -0
  182. sendproof_core/ui/result-headers.js +106 -0
  183. sendproof_core/ui/result-logs.js +408 -0
  184. sendproof_core/ui/result-states.js +213 -0
  185. sendproof_core/ui/results.js +371 -0
  186. sendproof_core/ui/router.js +118 -0
  187. sendproof_core/ui/schema-model.js +336 -0
  188. sendproof_core/ui/schema-tree.js +344 -0
  189. sendproof_core/ui/schema.js +397 -0
  190. sendproof_core/ui/security.js +31 -0
  191. sendproof_core/ui/seeded-menu.js +69 -0
  192. sendproof_core/ui/settings.js +93 -0
  193. sendproof_core/ui/shortcuts-sheet.js +73 -0
  194. sendproof_core/ui/shortcuts.js +190 -0
  195. sendproof_core/ui/sidebar.js +289 -0
  196. sendproof_core/ui/signin.js +259 -0
  197. sendproof_core/ui/snippets.js +530 -0
  198. sendproof_core/ui/store-marks.js +47 -0
  199. sendproof_core/ui/stores.js +131 -0
  200. sendproof_core/ui/styles.css +971 -0
  201. sendproof_core/ui/toggletip.js +53 -0
  202. sendproof_core/ui/uuid.js +10 -0
  203. sendproof_core/ui/view.js +122 -0
  204. sendproof_core/ui/views.css +653 -0
  205. sendproof_core/workbench.py +310 -0
  206. sendproof_core-0.1.0a1.dist-info/METADATA +116 -0
  207. sendproof_core-0.1.0a1.dist-info/RECORD +209 -0
  208. sendproof_core-0.1.0a1.dist-info/WHEEL +4 -0
  209. sendproof_core-0.1.0a1.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,1486 @@
1
+ """The shared write-classification tables of spec/data-stores/, embedded unchanged.
2
+
3
+ Generated by ``adapters/python/scripts/embed_store_tables.py``. Do not edit by hand: a unit
4
+ test fails when this copy differs from the spec tables.
5
+ """
6
+
7
+ import json
8
+
9
+ #: The shared redis table, embedded from spec/data-stores/redis.json.
10
+ REDIS_TABLE = json.loads(r'''{
11
+ "$comment": "Write-guard classification for Redis, shared by every binding. Generated from COMMAND on Redis 7.4 (readonly flag without write), plus session commands (including CLIENT MAINT_NOTIFICATIONS, which Redis 8 clients such as go-redis 9.23 send on connect) and common module reads. Anything not listed is a write. See spec/data-stores.md.",
12
+ "store": "redis",
13
+ "version": 1,
14
+ "source": "redis 7.4 COMMAND flags",
15
+ "default": "write",
16
+ "keyFormat": "Upper-case command name; a container command and its subcommand are joined with a vertical bar, as in OBJECT|ENCODING.",
17
+ "read": [
18
+ "BITCOUNT",
19
+ "BITFIELD_RO",
20
+ "BITPOS",
21
+ "DBSIZE",
22
+ "DUMP",
23
+ "EVALSHA_RO",
24
+ "EVAL_RO",
25
+ "EXISTS",
26
+ "EXPIRETIME",
27
+ "FCALL_RO",
28
+ "GEODIST",
29
+ "GEOHASH",
30
+ "GEOPOS",
31
+ "GEORADIUSBYMEMBER_RO",
32
+ "GEORADIUS_RO",
33
+ "GEOSEARCH",
34
+ "GET",
35
+ "GETBIT",
36
+ "GETRANGE",
37
+ "HEXISTS",
38
+ "HEXPIRETIME",
39
+ "HGET",
40
+ "HGETALL",
41
+ "HKEYS",
42
+ "HLEN",
43
+ "HMGET",
44
+ "HPEXPIRETIME",
45
+ "HPTTL",
46
+ "HRANDFIELD",
47
+ "HSCAN",
48
+ "HSTRLEN",
49
+ "HTTL",
50
+ "HVALS",
51
+ "KEYS",
52
+ "LCS",
53
+ "LINDEX",
54
+ "LLEN",
55
+ "LOLWUT",
56
+ "LPOS",
57
+ "LRANGE",
58
+ "MEMORY|USAGE",
59
+ "MGET",
60
+ "OBJECT|ENCODING",
61
+ "OBJECT|FREQ",
62
+ "OBJECT|IDLETIME",
63
+ "OBJECT|REFCOUNT",
64
+ "PEXPIRETIME",
65
+ "PFCOUNT",
66
+ "PTTL",
67
+ "RANDOMKEY",
68
+ "SCAN",
69
+ "SCARD",
70
+ "SDIFF",
71
+ "SINTER",
72
+ "SINTERCARD",
73
+ "SISMEMBER",
74
+ "SMEMBERS",
75
+ "SMISMEMBER",
76
+ "SORT_RO",
77
+ "SRANDMEMBER",
78
+ "SSCAN",
79
+ "STRLEN",
80
+ "SUBSTR",
81
+ "SUNION",
82
+ "TOUCH",
83
+ "TTL",
84
+ "TYPE",
85
+ "XINFO|CONSUMERS",
86
+ "XINFO|GROUPS",
87
+ "XINFO|STREAM",
88
+ "XLEN",
89
+ "XPENDING",
90
+ "XRANGE",
91
+ "XREAD",
92
+ "XREVRANGE",
93
+ "ZCARD",
94
+ "ZCOUNT",
95
+ "ZDIFF",
96
+ "ZINTER",
97
+ "ZINTERCARD",
98
+ "ZLEXCOUNT",
99
+ "ZMSCORE",
100
+ "ZRANDMEMBER",
101
+ "ZRANGE",
102
+ "ZRANGEBYLEX",
103
+ "ZRANGEBYSCORE",
104
+ "ZRANK",
105
+ "ZREVRANGE",
106
+ "ZREVRANGEBYLEX",
107
+ "ZREVRANGEBYSCORE",
108
+ "ZREVRANK",
109
+ "ZSCAN",
110
+ "ZSCORE",
111
+ "ZUNION"
112
+ ],
113
+ "moduleRead": [
114
+ "BF.CARD",
115
+ "BF.EXISTS",
116
+ "BF.INFO",
117
+ "BF.MEXISTS",
118
+ "CF.COUNT",
119
+ "CF.EXISTS",
120
+ "CF.INFO",
121
+ "CF.MEXISTS",
122
+ "FT._LIST",
123
+ "FT.AGGREGATE",
124
+ "FT.EXPLAIN",
125
+ "FT.INFO",
126
+ "FT.SEARCH",
127
+ "FT.SPELLCHECK",
128
+ "FT.SUGGET",
129
+ "FT.SUGLEN",
130
+ "FT.TAGVALS",
131
+ "JSON.ARRINDEX",
132
+ "JSON.ARRLEN",
133
+ "JSON.GET",
134
+ "JSON.MGET",
135
+ "JSON.OBJKEYS",
136
+ "JSON.OBJLEN",
137
+ "JSON.RESP",
138
+ "JSON.STRLEN",
139
+ "JSON.TYPE",
140
+ "TS.GET",
141
+ "TS.INFO",
142
+ "TS.MGET",
143
+ "TS.MRANGE",
144
+ "TS.MREVRANGE",
145
+ "TS.QUERYINDEX",
146
+ "TS.RANGE",
147
+ "TS.REVRANGE"
148
+ ],
149
+ "session": [
150
+ "ASKING",
151
+ "AUTH",
152
+ "CLIENT|GETNAME",
153
+ "CLIENT|ID",
154
+ "CLIENT|INFO",
155
+ "CLIENT|MAINT_NOTIFICATIONS",
156
+ "CLIENT|SETINFO",
157
+ "CLIENT|SETNAME",
158
+ "COMMAND",
159
+ "COMMAND|COUNT",
160
+ "COMMAND|DOCS",
161
+ "COMMAND|INFO",
162
+ "COMMAND|LIST",
163
+ "ECHO",
164
+ "HELLO",
165
+ "INFO",
166
+ "LASTSAVE",
167
+ "PING",
168
+ "QUIT",
169
+ "READONLY",
170
+ "READWRITE",
171
+ "RESET",
172
+ "ROLE",
173
+ "SELECT",
174
+ "TIME",
175
+ "WAIT",
176
+ "WAITAOF"
177
+ ],
178
+ "transaction": [
179
+ "MULTI",
180
+ "EXEC",
181
+ "DISCARD",
182
+ "WATCH",
183
+ "UNWATCH"
184
+ ],
185
+ "notes": {
186
+ "EVAL, EVALSHA, FCALL": "Writes: a script can write. EVAL_RO, EVALSHA_RO and FCALL_RO are reads because the server refuses writes inside them.",
187
+ "GETEX, GETDEL": "Writes: GETEX can change a TTL and GETDEL deletes the key.",
188
+ "SORT, GEORADIUS, GEORADIUSBYMEMBER": "Writes: each accepts STORE. Their _RO variants are reads.",
189
+ "XREADGROUP": "Write: it moves entries into a consumer group pending list. XREAD is a read.",
190
+ "PUBLISH, SPUBLISH, SUBSCRIBE": "Writes: delivery to subscribers cannot be undone.",
191
+ "SCRIPT LOAD, FUNCTION LOAD": "Writes: they change server state.",
192
+ "MULTI": "MULTI, EXEC and DISCARD are allowed, but each queued command is classified on its own. A queued write blocks the Preview before EXEC is sent; the binding then sends DISCARD or closes the connection, so nothing queued runs."
193
+ }
194
+ }''')
195
+
196
+ #: The shared mongodb table, embedded from spec/data-stores/mongodb.json.
197
+ MONGODB_TABLE = json.loads(r'''{
198
+ "$comment": "Write-guard and Preview classification for MongoDB, shared by every binding. Command names are the first key of the command document, compared case-insensitively. Anything not listed is a write. See spec/data-stores.md.",
199
+ "store": "mongodb",
200
+ "version": 1,
201
+ "source": "MongoDB 8.2 database commands; transaction limits checked against mongo:8.2 in tests/conformance/compose.yml",
202
+ "default": "write",
203
+ "read": [
204
+ "aggregate",
205
+ "collStats",
206
+ "count",
207
+ "dataSize",
208
+ "dbStats",
209
+ "distinct",
210
+ "explain",
211
+ "find",
212
+ "getMore",
213
+ "killCursors",
214
+ "listCollections",
215
+ "listDatabases",
216
+ "listIndexes"
217
+ ],
218
+ "session": [
219
+ "abortTransaction",
220
+ "authenticate",
221
+ "buildInfo",
222
+ "connectionStatus",
223
+ "endSessions",
224
+ "getParameter",
225
+ "hello",
226
+ "isMaster",
227
+ "ismaster",
228
+ "logout",
229
+ "ping",
230
+ "saslContinue",
231
+ "saslStart",
232
+ "serverStatus",
233
+ "startSession"
234
+ ],
235
+ "conditional": {
236
+ "aggregate": "A write when any stage, at any depth of the pipeline, is $out or $merge.",
237
+ "explain": "Classified as the command inside its explain field.",
238
+ "findAndModify": "Always a write, including findOneAndUpdate, findOneAndReplace and findOneAndDelete with no match.",
239
+ "abortTransaction": "Allowed for a transaction the handler started itself. In Preview the binding owns the transaction and refuses a handler's abortTransaction or commitTransaction for it."
240
+ },
241
+ "notInTransaction": {
242
+ "$comment": "Refused by the server inside a multi-document transaction. In Preview mode a binding blocks these before sending, with the reason below.",
243
+ "commands": [
244
+ "count",
245
+ "create",
246
+ "listCollections",
247
+ "listIndexes",
248
+ "drop",
249
+ "dropDatabase",
250
+ "dropIndexes",
251
+ "renameCollection",
252
+ "collMod",
253
+ "convertToCapped",
254
+ "cloneCollectionAsCapped",
255
+ "mapReduce",
256
+ "createUser",
257
+ "dropUser",
258
+ "createRole"
259
+ ],
260
+ "stages": [
261
+ "$out",
262
+ "$merge",
263
+ "$collStats",
264
+ "$currentOp",
265
+ "$indexStats",
266
+ "$listSessions",
267
+ "$planCacheStats"
268
+ ],
269
+ "rules": [
270
+ "createIndexes on a collection that existed before the transaction",
271
+ "any write to a capped collection",
272
+ "any operation on the admin, config or local database, or on a system.* collection"
273
+ ],
274
+ "reason": "Preview unavailable: MongoDB can't run {operation} inside a transaction"
275
+ }
276
+ }''')
277
+
278
+ #: The shared dynamodb table, embedded from spec/data-stores/dynamodb.json.
279
+ DYNAMODB_TABLE = json.loads(r'''{
280
+ "$comment": "Write-guard classification for DynamoDB, shared by every binding. Operation names are the API action names (the X-Amz-Target suffix). Anything not listed is a write. See spec/data-stores.md.",
281
+ "store": "dynamodb",
282
+ "version": 1,
283
+ "source": "Amazon DynamoDB API reference, DynamoDB_20120810",
284
+ "default": "write",
285
+ "read": [
286
+ "BatchGetItem",
287
+ "DescribeContinuousBackups",
288
+ "DescribeContributorInsights",
289
+ "DescribeEndpoints",
290
+ "DescribeGlobalTable",
291
+ "DescribeGlobalTableSettings",
292
+ "DescribeKinesisStreamingDestination",
293
+ "DescribeLimits",
294
+ "DescribeTable",
295
+ "DescribeTableReplicaAutoScaling",
296
+ "DescribeTimeToLive",
297
+ "GetItem",
298
+ "GetResourcePolicy",
299
+ "ListBackups",
300
+ "ListContributorInsights",
301
+ "ListExports",
302
+ "ListGlobalTables",
303
+ "ListImports",
304
+ "ListTables",
305
+ "ListTagsOfResource",
306
+ "Query",
307
+ "Scan",
308
+ "TransactGetItems"
309
+ ],
310
+ "partiql": {
311
+ "operations": [
312
+ "ExecuteStatement",
313
+ "BatchExecuteStatement",
314
+ "ExecuteTransaction"
315
+ ],
316
+ "rule": "A read only when every statement in the request is a SELECT: after skipping whitespace, -- line comments and /* */ block comments, the first word, compared case-insensitively, is SELECT. Any other statement (INSERT, UPDATE, DELETE, EXISTS checks inside a write transaction, or text that can't be parsed) makes the whole request a write."
317
+ },
318
+ "notes": {
319
+ "UpdateItem": "Always a write, whatever its ReturnValues or condition.",
320
+ "PutItem, DeleteItem": "Always writes, including conditional writes whose condition fails.",
321
+ "TransactWriteItems, BatchWriteItem": "Always writes; a ConditionCheck-only transaction is still classified as a write."
322
+ }
323
+ }''')
324
+
325
+ #: The shared cassandra table, embedded from spec/data-stores/cassandra.json.
326
+ CASSANDRA_TABLE = json.loads(r'''{
327
+ "$comment": "Write-guard classification for Apache Cassandra (and ScyllaDB, which speaks the same CQL and native protocol), shared by every binding. Sourced from the Apache Cassandra 5.0 CQL reference (cassandra.apache.org/doc/5.0/cassandra/developing/cql/, statement grammar in Cql.g) and the CQL native protocol v4 and v5 specifications (native_protocol_v4.spec, native_protocol_v5.spec). The unit is a CQL statement's first keyword; protocol messages that carry no statement are listed separately. Anything not listed is a write. See spec/data-stores.md.",
328
+ "store": "cassandra",
329
+ "version": 1,
330
+ "source": "Apache Cassandra 5.0 CQL reference and CQL native protocol v4/v5",
331
+ "default": "write",
332
+ "keyFormat": "The statement's first keyword in upper case, after skipping whitespace, -- and // line comments and /* */ block comments. LIST takes its next word too (LIST ROLES, LIST ALL). The write list is for reference only: anything that is not a read is a write.",
333
+ "read": [
334
+ "SELECT",
335
+ "USE",
336
+ "DESCRIBE",
337
+ "DESC",
338
+ "LIST ROLES",
339
+ "LIST USERS",
340
+ "LIST PERMISSIONS",
341
+ "LIST ALL",
342
+ "LIST SUPERUSERS"
343
+ ],
344
+ "write": [
345
+ "INSERT",
346
+ "UPDATE",
347
+ "DELETE",
348
+ "BATCH",
349
+ "TRUNCATE",
350
+ "CREATE",
351
+ "ALTER",
352
+ "DROP",
353
+ "GRANT",
354
+ "REVOKE",
355
+ "ADD"
356
+ ],
357
+ "operationName": {
358
+ "rule": "db.operation.name is the key above; a statement that starts with BEGIN (BEGIN BATCH, BEGIN UNLOGGED BATCH, BEGIN COUNTER BATCH) is named BATCH, and the BATCH protocol message is named BATCH. Text the binding can't read is named by its first word, or UNKNOWN when there is none."
359
+ },
360
+ "protocol": {
361
+ "$comment": "Native protocol messages. A hook below the statement API (a driver request handler or a wire wrapper) classifies the message first.",
362
+ "session": [
363
+ "STARTUP",
364
+ "OPTIONS",
365
+ "REGISTER",
366
+ "AUTH_RESPONSE",
367
+ "PREPARE"
368
+ ],
369
+ "statement": {
370
+ "QUERY": "Classify the statement text.",
371
+ "EXECUTE": "Classify the text the binding saw when the id was prepared. An id the binding never saw prepared is a write."
372
+ },
373
+ "write": [
374
+ "BATCH"
375
+ ]
376
+ },
377
+ "rules": [
378
+ "A read only when the whole text is one statement whose key is listed under read. A second statement after a semicolon (outside quotes, comments and $$ strings) makes the text a write.",
379
+ "Every BATCH is a write: a batch can only hold INSERT, UPDATE and DELETE, and an empty batch is still refused. This covers BEGIN BATCH text sent as a QUERY and the BATCH protocol message, whose inner statements may be prepared ids the hook can't read.",
380
+ "A lightweight transaction (INSERT ... IF NOT EXISTS, UPDATE ... IF, DELETE ... IF) is a write even when its condition fails and nothing is applied.",
381
+ "USE only changes the connection's keyspace, so it is allowed and logged like a read.",
382
+ "SELECT ... JSON and SELECT with user-defined functions or aggregates are reads: CQL functions can't write."
383
+ ],
384
+ "notes": {
385
+ "Preview": "Cassandra has no rollback, so it runs in guard mode only. A logged batch makes its statements all-or-nothing; it can't be held back and discarded.",
386
+ "DDL": "CREATE, ALTER and DROP of keyspaces, tables, indexes, materialized views, types, functions, aggregates, triggers, roles and users are writes, as are GRANT, REVOKE and Cassandra 5's ADD IDENTITY and DROP IDENTITY."
387
+ }
388
+ }''')
389
+
390
+ #: The shared elasticsearch table, embedded from spec/data-stores/elasticsearch.json.
391
+ ELASTICSEARCH_TABLE = json.loads(r'''{
392
+ "$comment": "Write-guard classification for Elasticsearch and OpenSearch, shared by every binding. Sourced from the Elasticsearch 8 REST API reference and its machine-readable specification (elastic/elasticsearch-specification, whose endpoint ids are the operation names here) and the OpenSearch 2.x REST API reference (opensearch.org/docs/latest/api-reference/, including the SQL, PPL, point-in-time and asynchronous-search plugins). The unit is the HTTP method and path the client's transport sends. Anything not listed is a write, except GET and HEAD, which only read. See spec/data-stores.md.",
393
+ "store": "elasticsearch",
394
+ "stores": [
395
+ "elasticsearch",
396
+ "opensearch"
397
+ ],
398
+ "version": 1,
399
+ "source": "Elasticsearch 8 REST API specification; OpenSearch 2.19 REST API reference",
400
+ "default": "write",
401
+ "methodDefault": {
402
+ "GET": "read",
403
+ "HEAD": "read"
404
+ },
405
+ "keyFormat": "Match the upper-case HTTP method and the path without its query string, after removing any path prefix the client is configured with, collapsing repeated slashes and dropping a trailing slash. Compare each segment after percent-decoding it.",
406
+ "segments": {
407
+ "{index}": "One segment naming indices, aliases or data streams: it doesn't start with an underscore, and it may hold commas and wildcards (logs-*,metrics).",
408
+ "{id}": "Any one non-empty segment.",
409
+ "literal": "Any other segment must be equal, case-sensitively."
410
+ },
411
+ "matching": "Entries are tried in order and the first entry whose methods and one of whose paths match decides. When none matches, methodDefault decides, and otherwise default. db.operation.name is the entry's name. Without an entry, the name is the method and the path with every segment that doesn't start with an underscore replaced by {}, as in \"PUT /{}\".",
412
+ "endpoints": [
413
+ {
414
+ "kind": "read",
415
+ "name": "search",
416
+ "methods": [
417
+ "GET",
418
+ "POST"
419
+ ],
420
+ "paths": [
421
+ "/_search",
422
+ "/{index}/_search"
423
+ ]
424
+ },
425
+ {
426
+ "kind": "read",
427
+ "name": "search_template",
428
+ "methods": [
429
+ "GET",
430
+ "POST"
431
+ ],
432
+ "paths": [
433
+ "/_search/template",
434
+ "/{index}/_search/template"
435
+ ]
436
+ },
437
+ {
438
+ "kind": "read",
439
+ "name": "msearch",
440
+ "methods": [
441
+ "GET",
442
+ "POST"
443
+ ],
444
+ "paths": [
445
+ "/_msearch",
446
+ "/{index}/_msearch"
447
+ ]
448
+ },
449
+ {
450
+ "kind": "read",
451
+ "name": "msearch_template",
452
+ "methods": [
453
+ "GET",
454
+ "POST"
455
+ ],
456
+ "paths": [
457
+ "/_msearch/template",
458
+ "/{index}/_msearch/template"
459
+ ]
460
+ },
461
+ {
462
+ "kind": "read",
463
+ "name": "render_search_template",
464
+ "methods": [
465
+ "GET",
466
+ "POST"
467
+ ],
468
+ "paths": [
469
+ "/_render/template",
470
+ "/_render/template/{id}"
471
+ ]
472
+ },
473
+ {
474
+ "kind": "read",
475
+ "name": "scroll",
476
+ "methods": [
477
+ "GET",
478
+ "POST"
479
+ ],
480
+ "paths": [
481
+ "/_search/scroll",
482
+ "/_search/scroll/{id}"
483
+ ]
484
+ },
485
+ {
486
+ "kind": "session",
487
+ "name": "clear_scroll",
488
+ "methods": [
489
+ "DELETE"
490
+ ],
491
+ "paths": [
492
+ "/_search/scroll",
493
+ "/_search/scroll/{id}"
494
+ ]
495
+ },
496
+ {
497
+ "kind": "read",
498
+ "name": "count",
499
+ "methods": [
500
+ "GET",
501
+ "POST"
502
+ ],
503
+ "paths": [
504
+ "/_count",
505
+ "/{index}/_count"
506
+ ]
507
+ },
508
+ {
509
+ "kind": "read",
510
+ "name": "mget",
511
+ "methods": [
512
+ "GET",
513
+ "POST"
514
+ ],
515
+ "paths": [
516
+ "/_mget",
517
+ "/{index}/_mget"
518
+ ]
519
+ },
520
+ {
521
+ "kind": "read",
522
+ "name": "field_caps",
523
+ "methods": [
524
+ "GET",
525
+ "POST"
526
+ ],
527
+ "paths": [
528
+ "/_field_caps",
529
+ "/{index}/_field_caps"
530
+ ]
531
+ },
532
+ {
533
+ "kind": "read",
534
+ "name": "explain",
535
+ "methods": [
536
+ "GET",
537
+ "POST"
538
+ ],
539
+ "paths": [
540
+ "/{index}/_explain/{id}"
541
+ ]
542
+ },
543
+ {
544
+ "kind": "read",
545
+ "name": "indices.validate_query",
546
+ "methods": [
547
+ "GET",
548
+ "POST"
549
+ ],
550
+ "paths": [
551
+ "/_validate/query",
552
+ "/{index}/_validate/query"
553
+ ]
554
+ },
555
+ {
556
+ "kind": "read",
557
+ "name": "indices.analyze",
558
+ "methods": [
559
+ "GET",
560
+ "POST"
561
+ ],
562
+ "paths": [
563
+ "/_analyze",
564
+ "/{index}/_analyze"
565
+ ]
566
+ },
567
+ {
568
+ "kind": "read",
569
+ "name": "termvectors",
570
+ "methods": [
571
+ "GET",
572
+ "POST"
573
+ ],
574
+ "paths": [
575
+ "/{index}/_termvectors",
576
+ "/{index}/_termvectors/{id}"
577
+ ]
578
+ },
579
+ {
580
+ "kind": "read",
581
+ "name": "mtermvectors",
582
+ "methods": [
583
+ "GET",
584
+ "POST"
585
+ ],
586
+ "paths": [
587
+ "/_mtermvectors",
588
+ "/{index}/_mtermvectors"
589
+ ]
590
+ },
591
+ {
592
+ "kind": "read",
593
+ "name": "rank_eval",
594
+ "methods": [
595
+ "GET",
596
+ "POST"
597
+ ],
598
+ "paths": [
599
+ "/_rank_eval",
600
+ "/{index}/_rank_eval"
601
+ ]
602
+ },
603
+ {
604
+ "kind": "read",
605
+ "name": "knn_search",
606
+ "methods": [
607
+ "GET",
608
+ "POST"
609
+ ],
610
+ "paths": [
611
+ "/{index}/_knn_search"
612
+ ]
613
+ },
614
+ {
615
+ "kind": "read",
616
+ "name": "terms_enum",
617
+ "methods": [
618
+ "GET",
619
+ "POST"
620
+ ],
621
+ "paths": [
622
+ "/{index}/_terms_enum"
623
+ ]
624
+ },
625
+ {
626
+ "kind": "read",
627
+ "name": "search_shards",
628
+ "methods": [
629
+ "GET",
630
+ "POST"
631
+ ],
632
+ "paths": [
633
+ "/_search_shards",
634
+ "/{index}/_search_shards"
635
+ ]
636
+ },
637
+ {
638
+ "kind": "session",
639
+ "name": "open_point_in_time",
640
+ "methods": [
641
+ "POST"
642
+ ],
643
+ "paths": [
644
+ "/{index}/_pit"
645
+ ]
646
+ },
647
+ {
648
+ "kind": "session",
649
+ "name": "close_point_in_time",
650
+ "methods": [
651
+ "DELETE"
652
+ ],
653
+ "paths": [
654
+ "/_pit"
655
+ ]
656
+ },
657
+ {
658
+ "kind": "session",
659
+ "name": "create_pit",
660
+ "methods": [
661
+ "POST"
662
+ ],
663
+ "paths": [
664
+ "/{index}/_search/point_in_time"
665
+ ]
666
+ },
667
+ {
668
+ "kind": "session",
669
+ "name": "delete_pit",
670
+ "methods": [
671
+ "DELETE"
672
+ ],
673
+ "paths": [
674
+ "/_search/point_in_time",
675
+ "/_search/point_in_time/_all"
676
+ ]
677
+ },
678
+ {
679
+ "kind": "read",
680
+ "name": "async_search.submit",
681
+ "methods": [
682
+ "POST"
683
+ ],
684
+ "paths": [
685
+ "/_async_search",
686
+ "/{index}/_async_search"
687
+ ]
688
+ },
689
+ {
690
+ "kind": "session",
691
+ "name": "async_search.delete",
692
+ "methods": [
693
+ "DELETE"
694
+ ],
695
+ "paths": [
696
+ "/_async_search/{id}"
697
+ ]
698
+ },
699
+ {
700
+ "kind": "read",
701
+ "name": "asynchronous_search.search",
702
+ "methods": [
703
+ "POST"
704
+ ],
705
+ "paths": [
706
+ "/_plugins/_asynchronous_search"
707
+ ]
708
+ },
709
+ {
710
+ "kind": "session",
711
+ "name": "asynchronous_search.delete",
712
+ "methods": [
713
+ "DELETE"
714
+ ],
715
+ "paths": [
716
+ "/_plugins/_asynchronous_search/{id}"
717
+ ]
718
+ },
719
+ {
720
+ "kind": "read",
721
+ "name": "eql.search",
722
+ "methods": [
723
+ "GET",
724
+ "POST"
725
+ ],
726
+ "paths": [
727
+ "/{index}/_eql/search"
728
+ ]
729
+ },
730
+ {
731
+ "kind": "session",
732
+ "name": "eql.delete",
733
+ "methods": [
734
+ "DELETE"
735
+ ],
736
+ "paths": [
737
+ "/_eql/search/{id}"
738
+ ]
739
+ },
740
+ {
741
+ "kind": "read",
742
+ "name": "esql.query",
743
+ "methods": [
744
+ "POST"
745
+ ],
746
+ "paths": [
747
+ "/_query"
748
+ ]
749
+ },
750
+ {
751
+ "kind": "read",
752
+ "name": "esql.async_query",
753
+ "methods": [
754
+ "POST"
755
+ ],
756
+ "paths": [
757
+ "/_query/async"
758
+ ]
759
+ },
760
+ {
761
+ "kind": "session",
762
+ "name": "esql.async_query_delete",
763
+ "methods": [
764
+ "DELETE"
765
+ ],
766
+ "paths": [
767
+ "/_query/async/{id}"
768
+ ]
769
+ },
770
+ {
771
+ "kind": "sql",
772
+ "name": "sql.query",
773
+ "methods": [
774
+ "GET",
775
+ "POST"
776
+ ],
777
+ "paths": [
778
+ "/_sql"
779
+ ]
780
+ },
781
+ {
782
+ "kind": "read",
783
+ "name": "sql.translate",
784
+ "methods": [
785
+ "GET",
786
+ "POST"
787
+ ],
788
+ "paths": [
789
+ "/_sql/translate"
790
+ ]
791
+ },
792
+ {
793
+ "kind": "session",
794
+ "name": "sql.clear_cursor",
795
+ "methods": [
796
+ "POST"
797
+ ],
798
+ "paths": [
799
+ "/_sql/close"
800
+ ]
801
+ },
802
+ {
803
+ "kind": "session",
804
+ "name": "sql.delete_async",
805
+ "methods": [
806
+ "DELETE"
807
+ ],
808
+ "paths": [
809
+ "/_sql/async/delete/{id}"
810
+ ]
811
+ },
812
+ {
813
+ "kind": "sql",
814
+ "name": "sql.query",
815
+ "methods": [
816
+ "GET",
817
+ "POST"
818
+ ],
819
+ "paths": [
820
+ "/_plugins/_sql",
821
+ "/_opendistro/_sql"
822
+ ]
823
+ },
824
+ {
825
+ "kind": "read",
826
+ "name": "sql.explain",
827
+ "methods": [
828
+ "GET",
829
+ "POST"
830
+ ],
831
+ "paths": [
832
+ "/_plugins/_sql/_explain",
833
+ "/_opendistro/_sql/_explain"
834
+ ]
835
+ },
836
+ {
837
+ "kind": "session",
838
+ "name": "sql.close",
839
+ "methods": [
840
+ "POST"
841
+ ],
842
+ "paths": [
843
+ "/_plugins/_sql/close",
844
+ "/_opendistro/_sql/close"
845
+ ]
846
+ },
847
+ {
848
+ "kind": "read",
849
+ "name": "ppl.query",
850
+ "methods": [
851
+ "GET",
852
+ "POST"
853
+ ],
854
+ "paths": [
855
+ "/_plugins/_ppl",
856
+ "/_opendistro/_ppl"
857
+ ]
858
+ },
859
+ {
860
+ "kind": "read",
861
+ "name": "ppl.explain",
862
+ "methods": [
863
+ "GET",
864
+ "POST"
865
+ ],
866
+ "paths": [
867
+ "/_plugins/_ppl/_explain",
868
+ "/_opendistro/_ppl/_explain"
869
+ ]
870
+ },
871
+ {
872
+ "kind": "read",
873
+ "name": "scripts_painless_execute",
874
+ "methods": [
875
+ "GET",
876
+ "POST"
877
+ ],
878
+ "paths": [
879
+ "/_scripts/painless/_execute"
880
+ ]
881
+ },
882
+ {
883
+ "kind": "read",
884
+ "name": "ingest.simulate",
885
+ "methods": [
886
+ "GET",
887
+ "POST"
888
+ ],
889
+ "paths": [
890
+ "/_ingest/pipeline/_simulate",
891
+ "/_ingest/pipeline/{id}/_simulate",
892
+ "/_ingest/_simulate",
893
+ "/_ingest/{index}/_simulate"
894
+ ]
895
+ },
896
+ {
897
+ "kind": "read",
898
+ "name": "indices.simulate_template",
899
+ "methods": [
900
+ "POST"
901
+ ],
902
+ "paths": [
903
+ "/_index_template/_simulate",
904
+ "/_index_template/_simulate/{id}"
905
+ ]
906
+ },
907
+ {
908
+ "kind": "read",
909
+ "name": "indices.simulate_index_template",
910
+ "methods": [
911
+ "POST"
912
+ ],
913
+ "paths": [
914
+ "/_index_template/_simulate_index/{id}"
915
+ ]
916
+ },
917
+ {
918
+ "kind": "read",
919
+ "name": "get",
920
+ "methods": [
921
+ "GET"
922
+ ],
923
+ "paths": [
924
+ "/{index}/_doc/{id}"
925
+ ]
926
+ },
927
+ {
928
+ "kind": "read",
929
+ "name": "exists",
930
+ "methods": [
931
+ "HEAD"
932
+ ],
933
+ "paths": [
934
+ "/{index}/_doc/{id}"
935
+ ]
936
+ },
937
+ {
938
+ "kind": "read",
939
+ "name": "get_source",
940
+ "methods": [
941
+ "GET"
942
+ ],
943
+ "paths": [
944
+ "/{index}/_source/{id}"
945
+ ]
946
+ },
947
+ {
948
+ "kind": "read",
949
+ "name": "exists_source",
950
+ "methods": [
951
+ "HEAD"
952
+ ],
953
+ "paths": [
954
+ "/{index}/_source/{id}"
955
+ ]
956
+ },
957
+ {
958
+ "kind": "write",
959
+ "name": "bulk",
960
+ "methods": [
961
+ "POST",
962
+ "PUT"
963
+ ],
964
+ "paths": [
965
+ "/_bulk",
966
+ "/{index}/_bulk"
967
+ ]
968
+ },
969
+ {
970
+ "kind": "write",
971
+ "name": "index",
972
+ "methods": [
973
+ "POST",
974
+ "PUT"
975
+ ],
976
+ "paths": [
977
+ "/{index}/_doc",
978
+ "/{index}/_doc/{id}"
979
+ ]
980
+ },
981
+ {
982
+ "kind": "write",
983
+ "name": "create",
984
+ "methods": [
985
+ "POST",
986
+ "PUT"
987
+ ],
988
+ "paths": [
989
+ "/{index}/_create/{id}"
990
+ ]
991
+ },
992
+ {
993
+ "kind": "write",
994
+ "name": "update",
995
+ "methods": [
996
+ "POST"
997
+ ],
998
+ "paths": [
999
+ "/{index}/_update/{id}"
1000
+ ]
1001
+ },
1002
+ {
1003
+ "kind": "write",
1004
+ "name": "delete",
1005
+ "methods": [
1006
+ "DELETE"
1007
+ ],
1008
+ "paths": [
1009
+ "/{index}/_doc/{id}"
1010
+ ]
1011
+ },
1012
+ {
1013
+ "kind": "write",
1014
+ "name": "update_by_query",
1015
+ "methods": [
1016
+ "POST"
1017
+ ],
1018
+ "paths": [
1019
+ "/{index}/_update_by_query"
1020
+ ]
1021
+ },
1022
+ {
1023
+ "kind": "write",
1024
+ "name": "delete_by_query",
1025
+ "methods": [
1026
+ "POST"
1027
+ ],
1028
+ "paths": [
1029
+ "/{index}/_delete_by_query"
1030
+ ]
1031
+ },
1032
+ {
1033
+ "kind": "write",
1034
+ "name": "reindex",
1035
+ "methods": [
1036
+ "POST"
1037
+ ],
1038
+ "paths": [
1039
+ "/_reindex"
1040
+ ]
1041
+ },
1042
+ {
1043
+ "kind": "write",
1044
+ "name": "put_script",
1045
+ "methods": [
1046
+ "POST",
1047
+ "PUT"
1048
+ ],
1049
+ "paths": [
1050
+ "/_scripts/{id}",
1051
+ "/_scripts/{id}/{id}"
1052
+ ]
1053
+ },
1054
+ {
1055
+ "kind": "write",
1056
+ "name": "delete_script",
1057
+ "methods": [
1058
+ "DELETE"
1059
+ ],
1060
+ "paths": [
1061
+ "/_scripts/{id}"
1062
+ ]
1063
+ },
1064
+ {
1065
+ "kind": "write",
1066
+ "name": "indices.create",
1067
+ "methods": [
1068
+ "PUT"
1069
+ ],
1070
+ "paths": [
1071
+ "/{index}"
1072
+ ]
1073
+ },
1074
+ {
1075
+ "kind": "write",
1076
+ "name": "indices.delete",
1077
+ "methods": [
1078
+ "DELETE"
1079
+ ],
1080
+ "paths": [
1081
+ "/{index}"
1082
+ ]
1083
+ },
1084
+ {
1085
+ "kind": "write",
1086
+ "name": "indices.put_mapping",
1087
+ "methods": [
1088
+ "POST",
1089
+ "PUT"
1090
+ ],
1091
+ "paths": [
1092
+ "/{index}/_mapping"
1093
+ ]
1094
+ },
1095
+ {
1096
+ "kind": "write",
1097
+ "name": "indices.put_settings",
1098
+ "methods": [
1099
+ "PUT"
1100
+ ],
1101
+ "paths": [
1102
+ "/_settings",
1103
+ "/{index}/_settings"
1104
+ ]
1105
+ },
1106
+ {
1107
+ "kind": "write",
1108
+ "name": "indices.put_alias",
1109
+ "methods": [
1110
+ "POST",
1111
+ "PUT"
1112
+ ],
1113
+ "paths": [
1114
+ "/{index}/_alias/{id}",
1115
+ "/{index}/_aliases/{id}"
1116
+ ]
1117
+ },
1118
+ {
1119
+ "kind": "write",
1120
+ "name": "indices.delete_alias",
1121
+ "methods": [
1122
+ "DELETE"
1123
+ ],
1124
+ "paths": [
1125
+ "/{index}/_alias/{id}",
1126
+ "/{index}/_aliases/{id}"
1127
+ ]
1128
+ },
1129
+ {
1130
+ "kind": "write",
1131
+ "name": "indices.update_aliases",
1132
+ "methods": [
1133
+ "POST"
1134
+ ],
1135
+ "paths": [
1136
+ "/_aliases"
1137
+ ]
1138
+ },
1139
+ {
1140
+ "kind": "write",
1141
+ "name": "indices.put_index_template",
1142
+ "methods": [
1143
+ "POST",
1144
+ "PUT"
1145
+ ],
1146
+ "paths": [
1147
+ "/_index_template/{id}"
1148
+ ]
1149
+ },
1150
+ {
1151
+ "kind": "write",
1152
+ "name": "indices.delete_index_template",
1153
+ "methods": [
1154
+ "DELETE"
1155
+ ],
1156
+ "paths": [
1157
+ "/_index_template/{id}"
1158
+ ]
1159
+ },
1160
+ {
1161
+ "kind": "write",
1162
+ "name": "indices.put_template",
1163
+ "methods": [
1164
+ "POST",
1165
+ "PUT"
1166
+ ],
1167
+ "paths": [
1168
+ "/_template/{id}"
1169
+ ]
1170
+ },
1171
+ {
1172
+ "kind": "write",
1173
+ "name": "indices.delete_template",
1174
+ "methods": [
1175
+ "DELETE"
1176
+ ],
1177
+ "paths": [
1178
+ "/_template/{id}"
1179
+ ]
1180
+ },
1181
+ {
1182
+ "kind": "write",
1183
+ "name": "cluster.put_component_template",
1184
+ "methods": [
1185
+ "POST",
1186
+ "PUT"
1187
+ ],
1188
+ "paths": [
1189
+ "/_component_template/{id}"
1190
+ ]
1191
+ },
1192
+ {
1193
+ "kind": "write",
1194
+ "name": "cluster.delete_component_template",
1195
+ "methods": [
1196
+ "DELETE"
1197
+ ],
1198
+ "paths": [
1199
+ "/_component_template/{id}"
1200
+ ]
1201
+ },
1202
+ {
1203
+ "kind": "write",
1204
+ "name": "indices.open",
1205
+ "methods": [
1206
+ "POST"
1207
+ ],
1208
+ "paths": [
1209
+ "/{index}/_open"
1210
+ ]
1211
+ },
1212
+ {
1213
+ "kind": "write",
1214
+ "name": "indices.close",
1215
+ "methods": [
1216
+ "POST"
1217
+ ],
1218
+ "paths": [
1219
+ "/{index}/_close"
1220
+ ]
1221
+ },
1222
+ {
1223
+ "kind": "write",
1224
+ "name": "indices.rollover",
1225
+ "methods": [
1226
+ "POST"
1227
+ ],
1228
+ "paths": [
1229
+ "/{index}/_rollover",
1230
+ "/{index}/_rollover/{id}"
1231
+ ]
1232
+ },
1233
+ {
1234
+ "kind": "write",
1235
+ "name": "ingest.put_pipeline",
1236
+ "methods": [
1237
+ "PUT"
1238
+ ],
1239
+ "paths": [
1240
+ "/_ingest/pipeline/{id}"
1241
+ ]
1242
+ },
1243
+ {
1244
+ "kind": "write",
1245
+ "name": "ingest.delete_pipeline",
1246
+ "methods": [
1247
+ "DELETE"
1248
+ ],
1249
+ "paths": [
1250
+ "/_ingest/pipeline/{id}"
1251
+ ]
1252
+ }
1253
+ ],
1254
+ "sql": {
1255
+ "rule": "A sql endpoint is a read only when the JSON body's query field holds one statement whose first word, after whitespace and -- and /* */ comments, is SELECT, SHOW, DESCRIBE or DESC (case-insensitive), with nothing but whitespace, comments and one optional semicolon after it outside quotes; or when the body has a cursor and no query (the next page of an earlier read). Anything else, including a query passed only in the URL, is a write. OpenSearch's legacy SQL engine can run DELETE statements, which is why this is not a plain read.",
1256
+ "readWords": [
1257
+ "SELECT",
1258
+ "SHOW",
1259
+ "DESCRIBE",
1260
+ "DESC"
1261
+ ]
1262
+ },
1263
+ "rules": [
1264
+ "GET and HEAD are reads on every path, because neither engine changes data on them.",
1265
+ "POST is not a write by itself: _search, _msearch, _count, _mget, _field_caps and the other read entries take their query in a POST body.",
1266
+ "_bulk is always a write, even when every action in it would fail. So are _update_by_query, _delete_by_query and _reindex, including requests whose query matches nothing, and every PUT.",
1267
+ "Search requests that carry scripts (script_fields, script queries, runtime_mappings) are still reads: search scripts can't write. Storing a script (PUT or POST _scripts/{id}) is a write.",
1268
+ "Point-in-time, scroll, async-search and SQL cursor handles are session state, not data: opening and closing them is allowed."
1269
+ ],
1270
+ "notes": {
1271
+ "Preview": "Neither engine has a rollback, so both run in guard mode only.",
1272
+ "Index, alias and template management": "Creating, deleting, opening, closing, rolling over and remapping indices, aliases, index templates, component templates, ingest pipelines and cluster settings are writes."
1273
+ }
1274
+ }''')
1275
+
1276
+ #: The shared cosmosdb table, embedded from spec/data-stores/cosmosdb.json.
1277
+ COSMOSDB_TABLE = json.loads(r'''{
1278
+ "$comment": "Write-guard classification for Azure Cosmos DB for NoSQL, shared by every binding. Sourced from the Azure Cosmos DB REST API reference (learn.microsoft.com/rest/api/cosmos-db/: common request headers, documents, stored procedures, triggers, transactional batch, patch, change feed and query plan) and the operation types the SDKs expose (Node @azure/cosmos OperationType, .NET and Java OperationType). The unit is the operation type; a hook that sees only the HTTP request derives the operation type with the rules under fromRequest. Anything not listed is a write. See spec/data-stores.md.",
1279
+ "store": "cosmosdb",
1280
+ "version": 1,
1281
+ "source": "Azure Cosmos DB REST API reference (x-ms-version 2018-12-31 and later); SDK OperationType enums",
1282
+ "default": "write",
1283
+ "keyFormat": "The operation type name, compared case-insensitively and reported with the spelling below: Node's @azure/cosmos spells them in lower case (read, query, execute). Node's Execute is .NET and Java's ExecuteJavaScript, and Node's Query covers .NET's SqlQuery. Node sends its query-plan request as a read and its change-feed request as a query; both are reads either way.",
1284
+ "read": [
1285
+ "Read",
1286
+ "ReadFeed",
1287
+ "Query",
1288
+ "SqlQuery",
1289
+ "QueryPlan",
1290
+ "Head",
1291
+ "HeadFeed"
1292
+ ],
1293
+ "write": [
1294
+ "Create",
1295
+ "Upsert",
1296
+ "Replace",
1297
+ "Patch",
1298
+ "Delete",
1299
+ "Batch",
1300
+ "Execute",
1301
+ "ExecuteJavaScript"
1302
+ ],
1303
+ "rules": [
1304
+ "A request that names a pre-trigger or post-trigger (x-ms-documentdb-pre-trigger-include or x-ms-documentdb-post-trigger-include, the SDKs' preTriggerInclude and postTriggerInclude options) is a write whatever its operation type: triggers run only around writes, and their code can write.",
1305
+ "Executing a stored procedure (Execute, ExecuteJavaScript) is a write, even when the procedure only reads: the guard can't see its code.",
1306
+ "Batch is a write. It covers transactional batches and the SDKs' bulk mode, which sends batch requests with x-ms-cosmos-batch-atomic: false.",
1307
+ "Patch is a write, including a conditional patch whose filter predicate fails.",
1308
+ "Query, ReadFeed (including the change feed) and QueryPlan are reads: the Cosmos DB query language can't write.",
1309
+ "Reading or querying databases, containers, offers, partition key ranges, stored procedures, triggers and user-defined functions is a read. Creating, replacing or deleting any of them is a write.",
1310
+ "x-ms-cosmos-allow-tentative-writes is sent on every request, reads included, and says nothing about the operation."
1311
+ ],
1312
+ "fromRequest": {
1313
+ "$comment": "For hooks on the HTTP pipeline (Python and Go policies), which see the request rather than the SDK's operation type. Header names are case-insensitive; boolean header values compare case-insensitively with True.",
1314
+ "path": "The resource path alternates resource types and ids: /dbs/{db}/colls/{coll}/docs/{doc}. A path with an even number of segments addresses one resource; an odd number addresses a feed of the last resource type. The root path / reads the database account.",
1315
+ "order": [
1316
+ {
1317
+ "when": "a trigger header is present",
1318
+ "operation": "the derived type below, classified as a write"
1319
+ },
1320
+ {
1321
+ "when": "method GET, one resource",
1322
+ "operation": "Read"
1323
+ },
1324
+ {
1325
+ "when": "method GET, a feed or the account root",
1326
+ "operation": "ReadFeed"
1327
+ },
1328
+ {
1329
+ "when": "method HEAD, one resource",
1330
+ "operation": "Head"
1331
+ },
1332
+ {
1333
+ "when": "method HEAD, a feed",
1334
+ "operation": "HeadFeed"
1335
+ },
1336
+ {
1337
+ "when": "method POST and x-ms-cosmos-is-query-plan-request: True",
1338
+ "operation": "QueryPlan"
1339
+ },
1340
+ {
1341
+ "when": "method POST and x-ms-documentdb-isquery: True, or Content-Type application/query+json",
1342
+ "operation": "Query"
1343
+ },
1344
+ {
1345
+ "when": "method POST and x-ms-cosmos-is-batch-request: True",
1346
+ "operation": "Batch"
1347
+ },
1348
+ {
1349
+ "when": "method POST on one resource under sprocs (/dbs/{db}/colls/{coll}/sprocs/{sproc})",
1350
+ "operation": "ExecuteJavaScript"
1351
+ },
1352
+ {
1353
+ "when": "method POST and x-ms-documentdb-is-upsert: True",
1354
+ "operation": "Upsert"
1355
+ },
1356
+ {
1357
+ "when": "method POST, otherwise",
1358
+ "operation": "Create"
1359
+ },
1360
+ {
1361
+ "when": "method PUT",
1362
+ "operation": "Replace"
1363
+ },
1364
+ {
1365
+ "when": "method PATCH",
1366
+ "operation": "Patch"
1367
+ },
1368
+ {
1369
+ "when": "method DELETE",
1370
+ "operation": "Delete"
1371
+ },
1372
+ {
1373
+ "when": "anything else",
1374
+ "operation": "the method name, which is a write"
1375
+ }
1376
+ ],
1377
+ "target": "db.collection.name is the container id: the segment after colls. db.namespace is the database id: the segment after dbs."
1378
+ },
1379
+ "notes": {
1380
+ "Preview": "Cosmos DB can only roll back inside one logical partition, through a transactional batch the client builds up front. An arbitrary handler's writes can't be held back and discarded, so Cosmos DB runs in guard mode only.",
1381
+ "Credentials": "The authorization header (a master-key signature or an Entra ID token) and the account key are never captured."
1382
+ }
1383
+ }''')
1384
+
1385
+ #: The shared firestore table, embedded from spec/data-stores/firestore.json.
1386
+ FIRESTORE_TABLE = json.loads(r'''{
1387
+ "$comment": "Write-guard classification for Google Cloud Firestore (native mode), shared by every binding. Sourced from the Firestore RPC reference for google.firestore.v1.Firestore and google.firestore.admin.v1.FirestoreAdmin (cloud.google.com/firestore/docs/reference/rpc, firestore.proto and its google.api.http REST bindings). The unit is the RPC method name; a hook on the REST transport derives it with the rules under fromRest. Anything not listed is a write. See spec/data-stores.md.",
1388
+ "store": "firestore",
1389
+ "version": 1,
1390
+ "source": "google.firestore.v1 and google.firestore.admin.v1 RPC reference",
1391
+ "default": "write",
1392
+ "keyFormat": "The RPC method name, case-sensitive, from the gRPC path /google.firestore.v1.Firestore/<Method>. A method of any other service is a write unless listed under services.",
1393
+ "services": {
1394
+ "google.firestore.v1.Firestore": {
1395
+ "read": [
1396
+ "GetDocument",
1397
+ "ListDocuments",
1398
+ "BatchGetDocuments",
1399
+ "RunQuery",
1400
+ "RunAggregationQuery",
1401
+ "PartitionQuery",
1402
+ "Listen",
1403
+ "ListCollectionIds"
1404
+ ],
1405
+ "session": [
1406
+ "BeginTransaction",
1407
+ "Rollback"
1408
+ ],
1409
+ "write": [
1410
+ "CreateDocument",
1411
+ "UpdateDocument",
1412
+ "DeleteDocument",
1413
+ "Commit",
1414
+ "BatchWrite",
1415
+ "Write"
1416
+ ]
1417
+ },
1418
+ "google.firestore.admin.v1.FirestoreAdmin": {
1419
+ "readPrefixes": [
1420
+ "Get",
1421
+ "List"
1422
+ ],
1423
+ "rule": "A method whose name starts with Get or List is a read; every other admin method (CreateIndex, DeleteIndex, UpdateField, ExportDocuments, ImportDocuments, CreateDatabase, DeleteDatabase, RestoreDatabase, BulkDeleteDocuments and the rest) is a write."
1424
+ }
1425
+ },
1426
+ "conditional": {
1427
+ "Commit": "A write when its writes list has at least one entry. A Commit with no writes only ends a transaction that read and wrote nothing, so it is session. A hook that can't read the request message treats every Commit as a write."
1428
+ },
1429
+ "rules": [
1430
+ "Listen and RunQuery are reads even when they stream for a long time, and RunQuery, BatchGetDocuments and RunAggregationQuery stay reads when they begin a transaction (new_transaction).",
1431
+ "BeginTransaction and Rollback are allowed: they hold or release a transaction but change no data. Writes reach the database only through Commit, BatchWrite, Write and the document RPCs.",
1432
+ "Write is a bidirectional stream. Opening it is a write, so the guard refuses the stream before its first message.",
1433
+ "BatchWrite is a write even when every write in it would fail its precondition."
1434
+ ],
1435
+ "fromRest": {
1436
+ "$comment": "For hooks on the REST transport (an SDK's REST fallback, or plain HTTP). Paths start /v1/projects/{project}/databases/{database}/documents.",
1437
+ "verbs": {
1438
+ "batchGet": "BatchGetDocuments",
1439
+ "beginTransaction": "BeginTransaction",
1440
+ "commit": "Commit",
1441
+ "rollback": "Rollback",
1442
+ "runQuery": "RunQuery",
1443
+ "runAggregationQuery": "RunAggregationQuery",
1444
+ "partitionQuery": "PartitionQuery",
1445
+ "write": "Write",
1446
+ "listen": "Listen",
1447
+ "listCollectionIds": "ListCollectionIds",
1448
+ "batchWrite": "BatchWrite"
1449
+ },
1450
+ "order": [
1451
+ {
1452
+ "when": "the last path segment ends in :<verb>",
1453
+ "rpc": "the verbs entry for <verb>; an unknown verb is a write"
1454
+ },
1455
+ {
1456
+ "when": "method GET on a document (an even number of segments after documents)",
1457
+ "rpc": "GetDocument"
1458
+ },
1459
+ {
1460
+ "when": "method GET on a collection (an odd number of segments after documents)",
1461
+ "rpc": "ListDocuments"
1462
+ },
1463
+ {
1464
+ "when": "method PATCH",
1465
+ "rpc": "UpdateDocument"
1466
+ },
1467
+ {
1468
+ "when": "method DELETE",
1469
+ "rpc": "DeleteDocument"
1470
+ },
1471
+ {
1472
+ "when": "method POST on a collection",
1473
+ "rpc": "CreateDocument"
1474
+ },
1475
+ {
1476
+ "when": "anything else",
1477
+ "rpc": "the method name, which is a write"
1478
+ }
1479
+ ],
1480
+ "target": "db.collection.name is the collection id: the segment before the document id, or the last segment of a collection path. For a batch or query RPC it is the collection the request names (structuredQuery.from[0].collectionId), when there is one."
1481
+ },
1482
+ "notes": {
1483
+ "Preview": "A Firestore transaction can be rolled back, but it must do every read before its first write and its reads don't see its own buffered writes. Arbitrary handlers break both rules, so Firestore runs in guard mode only.",
1484
+ "Credentials": "OAuth access tokens, the authorization metadata and service-account keys are never captured."
1485
+ }
1486
+ }''')