@radicaltools/mcp 0.3.0 → 0.3.1
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.
- package/dist/{chunk-Z7THA3L5.js → chunk-2SZDTOYJ.js} +65 -33
- package/dist/{elkLayout-TAUBPPVN.js → elkLayout-VYJDCCIT.js} +1 -1
- package/dist/hub-catalogue/concern/concern-api-collections.radical +1136 -0
- package/dist/hub-catalogue/concern/concern-api-errors.radical +1180 -0
- package/dist/hub-catalogue/concern/concern-api-evolution.radical +449 -210
- package/dist/hub-catalogue/concern/concern-api-idempotency.radical +1218 -0
- package/dist/hub-catalogue/concern/concern-api-resource-design.radical +1102 -0
- package/dist/hub-catalogue/concern/concern-api-style-guide.radical +1210 -0
- package/dist/hub-catalogue/concern/concern-architecture-style.radical +287 -131
- package/dist/hub-catalogue/concern/concern-audit-trail.radical +1096 -0
- package/dist/hub-catalogue/concern/concern-authentication.radical +247 -37
- package/dist/hub-catalogue/concern/concern-authorization.radical +311 -89
- package/dist/hub-catalogue/concern/concern-availability.radical +287 -63
- package/dist/hub-catalogue/concern/concern-backend-stack.radical +300 -381
- package/dist/hub-catalogue/concern/concern-backup-recovery.radical +385 -129
- package/dist/hub-catalogue/concern/concern-caching.radical +1294 -0
- package/dist/hub-catalogue/concern/concern-capacity.radical +194 -81
- package/dist/hub-catalogue/concern/concern-code-documentation.radical +1397 -0
- package/dist/hub-catalogue/concern/concern-code-quality-gate.radical +1409 -0
- package/dist/hub-catalogue/concern/concern-code-review-branching.radical +1416 -0
- package/dist/hub-catalogue/concern/concern-code-style.radical +1058 -0
- package/dist/hub-catalogue/concern/concern-communication-style.radical +473 -167
- package/dist/hub-catalogue/concern/concern-data-classification.radical +970 -0
- package/dist/hub-catalogue/concern/concern-data-consistency.radical +339 -308
- package/dist/hub-catalogue/concern/concern-data-store.radical +480 -158
- package/dist/hub-catalogue/concern/concern-decomposition.radical +260 -85
- package/dist/hub-catalogue/concern/concern-definition-of-done.radical +1214 -0
- package/dist/hub-catalogue/concern/concern-delivery-metrics.radical +966 -0
- package/dist/hub-catalogue/concern/concern-dependency-hygiene.radical +1345 -0
- package/dist/hub-catalogue/concern/concern-deployment.radical +343 -92
- package/dist/hub-catalogue/concern/concern-encryption.radical +339 -76
- package/dist/hub-catalogue/concern/concern-error-handling-logging.radical +1197 -0
- package/dist/hub-catalogue/concern/concern-eu-dora.radical +1321 -0
- package/dist/hub-catalogue/concern/concern-frontend-stack.radical +467 -160
- package/dist/hub-catalogue/concern/concern-incident-management.radical +1204 -0
- package/dist/hub-catalogue/concern/concern-infrastructure.radical +1300 -268
- package/dist/hub-catalogue/concern/concern-integration-resilience.radical +88 -51
- package/dist/hub-catalogue/concern/concern-messaging.radical +173 -140
- package/dist/hub-catalogue/concern/concern-module-boundaries.radical +162 -159
- package/dist/hub-catalogue/concern/concern-observability.radical +224 -275
- package/dist/hub-catalogue/concern/concern-operational-readiness.radical +1249 -0
- package/dist/hub-catalogue/concern/concern-personal-data.radical +637 -122
- package/dist/hub-catalogue/concern/concern-quality-priorities.radical +1091 -0
- package/dist/hub-catalogue/concern/concern-rate-limiting.radical +433 -141
- package/dist/hub-catalogue/concern/concern-release-versioning.radical +1358 -0
- package/dist/hub-catalogue/concern/concern-retention.radical +1399 -0
- package/dist/hub-catalogue/concern/concern-secrets.radical +332 -74
- package/dist/hub-catalogue/concern/concern-secure-coding.radical +1379 -0
- package/dist/hub-catalogue/concern/concern-secure-development.radical +1245 -0
- package/dist/hub-catalogue/concern/concern-security-detection.radical +1153 -0
- package/dist/hub-catalogue/concern/concern-supply-chain.radical +257 -183
- package/dist/hub-catalogue/concern/concern-technical-debt.radical +1450 -0
- package/dist/hub-catalogue/concern/concern-technology-lifecycle.radical +1145 -0
- package/dist/hub-catalogue/concern/concern-tenant-isolation.radical +271 -137
- package/dist/hub-catalogue/concern/concern-test-strategy.radical +243 -224
- package/dist/hub-catalogue/concern/concern-threat-modelling.radical +1143 -0
- package/dist/index.js +1001 -230
- package/package.json +1 -1
|
@@ -0,0 +1,1218 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hub": {
|
|
3
|
+
"id": "concern-api-idempotency",
|
|
4
|
+
"category": "concern",
|
|
5
|
+
"name": "Idempotency and concurrency",
|
|
6
|
+
"description": "The operations an HTTP API offers: how a client retries a request that changes something without doing it twice, and how two clients are kept from silently overwriting each other's changes. The snippets are for a Node service with Vitest, supertest and Spectral; each tool line names the JVM equivalent. Retries of the calls this element makes to others are decided in the Integration resilience pack.",
|
|
7
|
+
"tags": [
|
|
8
|
+
"api",
|
|
9
|
+
"idempotency",
|
|
10
|
+
"retries",
|
|
11
|
+
"concurrency",
|
|
12
|
+
"etag",
|
|
13
|
+
"optimistic-locking"
|
|
14
|
+
],
|
|
15
|
+
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
16
|
+
"concern": {
|
|
17
|
+
"id": "api-idempotency",
|
|
18
|
+
"trigger": "LIST RELATIONS WHERE source.type != \"person\" AND target.external != true AND (target.type = \"container\" OR target.type = \"component\")",
|
|
19
|
+
"applyTo": "target",
|
|
20
|
+
"why": "other elements and systems call these elements' APIs to change things, so how a retried request is kept from acting twice, and how concurrent changes are kept from overwriting each other, has to be decided.",
|
|
21
|
+
"group": "api"
|
|
22
|
+
},
|
|
23
|
+
"sources": [
|
|
24
|
+
{
|
|
25
|
+
"title": "IETF httpapi Internet-Draft, The Idempotency-Key HTTP Header Field (draft-ietf-httpapi-idempotency-key-header, not an RFC)",
|
|
26
|
+
"url": "https://datatracker.ietf.org/doc/draft-ietf-httpapi-idempotency-key-header/"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"title": "RFC 9110, HTTP Semantics (9.2.2 idempotent methods, 8.8.3 ETag, 13.1.1 If-Match, 15.5 client error status codes)",
|
|
30
|
+
"url": "https://www.rfc-editor.org/rfc/rfc9110"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"title": "RFC 6585, Additional HTTP Status Codes (3. 428 Precondition Required)",
|
|
34
|
+
"url": "https://www.rfc-editor.org/rfc/rfc6585"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"title": "RFC 7396, JSON Merge Patch",
|
|
38
|
+
"url": "https://www.rfc-editor.org/rfc/rfc7396"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"title": "Stripe API reference: Idempotent requests",
|
|
42
|
+
"url": "https://docs.stripe.com/api/idempotent_requests"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"title": "Microsoft REST API Guidelines, Azure (exactly-once behaviour, conditional requests)",
|
|
46
|
+
"url": "https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"title": "Zalando RESTful API Guidelines (rules 182, 229, 230 and 231)",
|
|
50
|
+
"url": "https://opensource.zalando.com/restful-api-guidelines/"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"title": "Google AIP-154, Resource freshness validation",
|
|
54
|
+
"url": "https://google.aip.dev/154"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"title": "Redis documentation: Key eviction (maxmemory-policy)",
|
|
58
|
+
"url": "https://redis.io/docs/latest/develop/reference/eviction/"
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"templateParams": [
|
|
62
|
+
{
|
|
63
|
+
"key": "IDEMPOTENCY",
|
|
64
|
+
"title": "Retries",
|
|
65
|
+
"label": "How is a retried request that changes something kept from acting twice?",
|
|
66
|
+
"hint": "POST and PATCH are not idempotent in HTTP: a client that retries one after a timeout may create or change something twice. PUT and DELETE are idempotent by definition (RFC 9110). This decides what the API offers its callers; retries of the calls this element makes to others are decided in the Integration resilience pack.",
|
|
67
|
+
"defaultValue": "key",
|
|
68
|
+
"options": [
|
|
69
|
+
{
|
|
70
|
+
"value": "key",
|
|
71
|
+
"label": "an Idempotency-Key header on POST and PATCH",
|
|
72
|
+
"description": "The client sends a unique key with each POST and PATCH and the same key on every retry; the API keeps the first response and replays it for a repeat. The IETF httpapi working group's draft defines the header; Stripe works this way. Pick it when the API has commands and creations that do not map to a PUT (payments, orders, sending a message) and its callers retry automatically."
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"value": "put",
|
|
76
|
+
"label": "client-chosen ids with PUT create-or-replace",
|
|
77
|
+
"description": "Clients create a resource with a PUT to a URI whose id they chose, and change it with PUT or JSON Merge Patch, so every change can be repeated with the same result and nothing extra is stored. Pick it for resource-shaped APIs where every operation can be expressed as a state to reach, and the callers can generate ids (UUIDs)."
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"value": "none",
|
|
81
|
+
"label": "no protection, unsafe requests not retried",
|
|
82
|
+
"description": "Nothing is stored and nothing is added to the API; the contract tells callers that POST and PATCH are not safe to retry and how to look up whether a request that timed out took effect. Pick it only while a duplicate is cheap and visible (a draft, a note) and no caller retries automatically; the decision records the risk."
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"key": "STORE",
|
|
88
|
+
"title": "Key store",
|
|
89
|
+
"label": "Where are the idempotency keys and their responses kept?",
|
|
90
|
+
"hint": "Only when idempotency keys are used (an Idempotency-Key header on POST and PATCH); with the other answers nothing is stored. Kept in the change's own transaction, a key cannot be lost while the change is kept; kept apart, a crash between the two leaves a gap.",
|
|
91
|
+
"defaultValue": "database",
|
|
92
|
+
"options": [
|
|
93
|
+
{
|
|
94
|
+
"value": "database",
|
|
95
|
+
"label": "a table in the element's own database, in the change's transaction",
|
|
96
|
+
"description": "The key, a fingerprint of the request and the response are written in the same transaction as the change, so both commit or neither does; a scheduled job deletes old rows. Pick it when the element writes its changes to one relational database it owns (PostgreSQL, MySQL, SQL Server)."
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"value": "redis",
|
|
100
|
+
"label": "a shared Redis with an expiry on every key",
|
|
101
|
+
"description": "The key is claimed in Redis before the change runs and replaced by the response after it, each with an expiry, so Redis removes old keys itself. Pick it when the changes do not land in one relational database (a document store, several stores) or several services share one key store."
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"key": "CONCURRENCY",
|
|
107
|
+
"title": "Concurrent edits",
|
|
108
|
+
"label": "How are two clients kept from silently overwriting each other's changes?",
|
|
109
|
+
"hint": "A client that reads a resource, changes it and writes it back overwrites whatever another client wrote in between (the lost update). This decides how a client tells the API which version it changed; how the database checks it in one atomic step is decided in the Data consistency pack.",
|
|
110
|
+
"defaultValue": "etag",
|
|
111
|
+
"options": [
|
|
112
|
+
{
|
|
113
|
+
"value": "etag",
|
|
114
|
+
"label": "ETag and If-Match, 412 on a stale version",
|
|
115
|
+
"description": "Every response that carries a resource carries an ETag; a change must send it back in If-Match, a stale one is refused with 412 Precondition Failed and a missing one with 428 Precondition Required. HTTP's own mechanism (RFC 9110, RFC 6585). Pick it for HTTP APIs whose callers can read and send headers, which is nearly all of them."
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"value": "version",
|
|
119
|
+
"label": "a version field in the body, 409 on a stale version",
|
|
120
|
+
"description": "Each representation carries a version field that a change must send back; a stale one is refused with 409 Conflict. Google AIP-154 keeps its etag in the body this way. Pick it when callers or tools in between cannot set headers (low-code platforms, some form builders), or the same API is also served over gRPC."
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"value": "lww",
|
|
124
|
+
"label": "last write wins",
|
|
125
|
+
"description": "Changes carry no version; the write that commits last is kept, and the representation shows who wrote it and when. Pick it only for resources that one person or system edits at a time (a user's own settings); the decision records that concurrent edits are lost."
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"key": "KEY_HOURS",
|
|
131
|
+
"label": "How long are idempotency keys and their responses kept (hours)? (idempotency keys only)",
|
|
132
|
+
"defaultValue": "24",
|
|
133
|
+
"type": "number"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"key": "LOCK_SECONDS",
|
|
137
|
+
"label": "How long may a request with an idempotency key take at most (seconds)? A repeat waits this long for it, and a claim on a key lasts this long. (idempotency keys only)",
|
|
138
|
+
"defaultValue": "30",
|
|
139
|
+
"type": "number"
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
"nodes": [
|
|
144
|
+
{
|
|
145
|
+
"id": "need",
|
|
146
|
+
"type": "need",
|
|
147
|
+
"label": "A retried request does not act twice",
|
|
148
|
+
"x": 0,
|
|
149
|
+
"y": 0,
|
|
150
|
+
"kind": "brief",
|
|
151
|
+
"source": "Hub concern pack: Idempotency and concurrency",
|
|
152
|
+
"description": "Callers of this element's API retry when a connection drops or an answer is late, and several callers change the same resources. A retry must not create a second order or charge a second time, and a change made from a stale copy must not silently overwrite someone else's. The snippets assume a Node service: the HTTP app exported from src/app, the OpenAPI document at openapi.yaml, HTTP tests with Vitest and supertest under tests/api, a database client in tests/db, a fixture createOrder() in tests/api/fixtures that creates an order the way the API does, and an orders resource at /orders/{id} that answers GET and PUT."
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"id": "req-key-replay",
|
|
156
|
+
"type": "requirement",
|
|
157
|
+
"label": "A repeat gets the first answer",
|
|
158
|
+
"x": 260,
|
|
159
|
+
"y": 0,
|
|
160
|
+
"ears_type": "event-driven",
|
|
161
|
+
"trigger": "a POST or PATCH arrives with an Idempotency-Key and the same request fingerprint as a request of the same client that completed within the last {{KEY_HOURS}} hours",
|
|
162
|
+
"action": "return the stored status code and body of that first request, before evaluating any precondition, without performing the operation again",
|
|
163
|
+
"rationale": "A timeout does not tell the client whether the change happened; replaying the first response makes the retry safe (IETF Idempotency-Key draft, 2.6; Stripe, Idempotent requests).",
|
|
164
|
+
"hubWhen": {
|
|
165
|
+
"IDEMPOTENCY": [
|
|
166
|
+
"key"
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"id": "req-key-required",
|
|
172
|
+
"type": "requirement",
|
|
173
|
+
"label": "Unsafe requests carry a key",
|
|
174
|
+
"x": 260,
|
|
175
|
+
"y": 130,
|
|
176
|
+
"ears_type": "unwanted-behaviour",
|
|
177
|
+
"unwanted_condition": "a POST or PATCH arrives without an Idempotency-Key",
|
|
178
|
+
"action": "refuse it with 400 Bad Request before any part of it runs, and declare the header as required, with the 400 and 422 answers, on every POST and PATCH in the OpenAPI document",
|
|
179
|
+
"rationale": "An optional key protects only the careful callers; the draft asks a resource that requires the header to answer its absence with 400 and to publish its idempotency rules (IETF Idempotency-Key draft, 2.5.2 and 2.7).",
|
|
180
|
+
"hubWhen": {
|
|
181
|
+
"IDEMPOTENCY": [
|
|
182
|
+
"key"
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"id": "req-key-mismatch",
|
|
188
|
+
"type": "requirement",
|
|
189
|
+
"label": "A key is not reused for another request",
|
|
190
|
+
"x": 260,
|
|
191
|
+
"y": 260,
|
|
192
|
+
"ears_type": "unwanted-behaviour",
|
|
193
|
+
"unwanted_condition": "a request reuses an Idempotency-Key of the same client with a different method, path or body",
|
|
194
|
+
"action": "refuse it with 422 Unprocessable Content and perform nothing",
|
|
195
|
+
"rationale": "A key reused for another request is a client bug; replaying the first answer would hide it and running the request would break the key's promise (IETF Idempotency-Key draft, 2.2 and 2.7; Zalando rule 230 answers 400 instead, the draft's 422 is used here).",
|
|
196
|
+
"hubWhen": {
|
|
197
|
+
"IDEMPOTENCY": [
|
|
198
|
+
"key"
|
|
199
|
+
]
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"id": "req-key-concurrent",
|
|
204
|
+
"type": "requirement",
|
|
205
|
+
"label": "Overlapping repeats run once",
|
|
206
|
+
"x": 260,
|
|
207
|
+
"y": 390,
|
|
208
|
+
"ears_type": "unwanted-behaviour",
|
|
209
|
+
"unwanted_condition": "a request arrives with an Idempotency-Key whose first request is still running",
|
|
210
|
+
"action": "never run it a second time: wait at most {{LOCK_SECONDS}} seconds for the first and return its response, or refuse it with 409 Conflict",
|
|
211
|
+
"rationale": "A client that times out quickly retries while the first attempt is still running; without a claim on the key both run (IETF Idempotency-Key draft, 2.6 and 2.7: a concurrent request gets a conflict).",
|
|
212
|
+
"hubWhen": {
|
|
213
|
+
"IDEMPOTENCY": [
|
|
214
|
+
"key"
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"id": "req-key-expiry",
|
|
220
|
+
"type": "requirement",
|
|
221
|
+
"label": "Keys are kept, then removed",
|
|
222
|
+
"x": 260,
|
|
223
|
+
"y": 520,
|
|
224
|
+
"ears_type": "ubiquitous",
|
|
225
|
+
"action": "keep each Idempotency-Key with its response for at least {{KEY_HOURS}} hours and remove it within one hour after that",
|
|
226
|
+
"rationale": "Clients retry for minutes or hours, not forever; a bounded retention keeps the store small and must be published (IETF Idempotency-Key draft, 2.3; Stripe and Zalando rule 230 keep keys for 24 hours).",
|
|
227
|
+
"hubWhen": {
|
|
228
|
+
"IDEMPOTENCY": [
|
|
229
|
+
"key"
|
|
230
|
+
]
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"id": "req-key-atomic",
|
|
235
|
+
"type": "requirement",
|
|
236
|
+
"label": "Key and change commit together",
|
|
237
|
+
"x": 260,
|
|
238
|
+
"y": 650,
|
|
239
|
+
"ears_type": "unwanted-behaviour",
|
|
240
|
+
"unwanted_condition": "the change of a request with an Idempotency-Key fails or is rolled back",
|
|
241
|
+
"action": "leave no record of the key, so that a retry with the same key performs the operation anew; the key, its response and the change commit in one database transaction",
|
|
242
|
+
"rationale": "A key stored without its change makes every retry replay a change that never happened; a change stored without its key lets a retry do it twice. One transaction rules out both.",
|
|
243
|
+
"hubWhen": {
|
|
244
|
+
"IDEMPOTENCY": [
|
|
245
|
+
"key"
|
|
246
|
+
],
|
|
247
|
+
"STORE": [
|
|
248
|
+
"database"
|
|
249
|
+
]
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"id": "req-key-redis",
|
|
254
|
+
"type": "requirement",
|
|
255
|
+
"label": "Redis keeps every key for its time",
|
|
256
|
+
"x": 260,
|
|
257
|
+
"y": 780,
|
|
258
|
+
"ears_type": "ubiquitous",
|
|
259
|
+
"action": "claim each Idempotency-Key in Redis with an atomic set-if-absent and an expiry of {{LOCK_SECONDS}} seconds before the operation runs, keep the response with an expiry of {{KEY_HOURS}} hours, and run that Redis with maxmemory-policy noeviction, so that no key lives without an expiry or is evicted before it",
|
|
260
|
+
"rationale": "A key Redis evicts under memory pressure turns the next retry into a duplicate; noeviction makes Redis refuse writes instead of dropping keys (Redis documentation, Key eviction).",
|
|
261
|
+
"hubWhen": {
|
|
262
|
+
"IDEMPOTENCY": [
|
|
263
|
+
"key"
|
|
264
|
+
],
|
|
265
|
+
"STORE": [
|
|
266
|
+
"redis"
|
|
267
|
+
]
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"id": "req-put-create",
|
|
272
|
+
"type": "requirement",
|
|
273
|
+
"label": "A repeated PUT changes nothing",
|
|
274
|
+
"x": 260,
|
|
275
|
+
"y": 910,
|
|
276
|
+
"ears_type": "event-driven",
|
|
277
|
+
"trigger": "a client sends the same PUT to a URI whose id it chose more than once",
|
|
278
|
+
"action": "keep exactly one resource with that representation: answer the first with 201 Created and every repeat with 200 OK, changing nothing",
|
|
279
|
+
"rationale": "PUT is idempotent by definition, so a client that chooses the id can retry a creation like any other PUT; a repeat whose change is already reflected may be answered with success (RFC 9110, 9.2.2, 9.3.4 and 13.1.1; Microsoft REST API Guidelines: PUT to create or replace).",
|
|
280
|
+
"hubWhen": {
|
|
281
|
+
"IDEMPOTENCY": [
|
|
282
|
+
"put"
|
|
283
|
+
]
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"id": "req-put-no-post",
|
|
288
|
+
"type": "requirement",
|
|
289
|
+
"label": "No POST changes state",
|
|
290
|
+
"x": 260,
|
|
291
|
+
"y": 1040,
|
|
292
|
+
"ears_type": "ubiquitous",
|
|
293
|
+
"action": "offer no POST operation, and accept partial changes only as JSON Merge Patch (application/merge-patch+json), so that every request that changes state can be repeated with the same result",
|
|
294
|
+
"rationale": "One POST left in the API is one operation a retry can do twice; a merge patch sets values instead of adding to them, so applying it again gives the same document (RFC 7396).",
|
|
295
|
+
"hubWhen": {
|
|
296
|
+
"IDEMPOTENCY": [
|
|
297
|
+
"put"
|
|
298
|
+
]
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"id": "req-none-retry",
|
|
303
|
+
"type": "requirement",
|
|
304
|
+
"label": "Callers are told not to retry",
|
|
305
|
+
"x": 260,
|
|
306
|
+
"y": 1170,
|
|
307
|
+
"ears_type": "ubiquitous",
|
|
308
|
+
"action": "mark every POST and PATCH operation in the OpenAPI document as not safe to retry (x-retry-safe: false) and say in its description how a caller finds out whether a request that timed out took effect",
|
|
309
|
+
"rationale": "A client should not retry a non-idempotent request automatically unless it knows it is safe (RFC 9110, 9.2.2); with no protection in the API, the contract is the only place that tells callers so.",
|
|
310
|
+
"hubWhen": {
|
|
311
|
+
"IDEMPOTENCY": [
|
|
312
|
+
"none"
|
|
313
|
+
]
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"id": "req-etag",
|
|
318
|
+
"type": "requirement",
|
|
319
|
+
"label": "Changes only from the current version",
|
|
320
|
+
"x": 260,
|
|
321
|
+
"y": 1300,
|
|
322
|
+
"ears_type": "ubiquitous",
|
|
323
|
+
"action": "send a strong ETag with every response that carries a resource, and apply a PUT, PATCH or DELETE that would change an existing resource only when its If-Match matches the current ETag, refusing any other with 412 Precondition Failed and changing nothing",
|
|
324
|
+
"rationale": "If-Match makes a change conditional on the version the client saw, which prevents the lost update; the comparison is strong (RFC 9110, 8.8.3 and 13.1.1; Microsoft REST API Guidelines, Conditional requests; Zalando rule 182).",
|
|
325
|
+
"hubWhen": {
|
|
326
|
+
"CONCURRENCY": [
|
|
327
|
+
"etag"
|
|
328
|
+
]
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"id": "req-etag-required",
|
|
333
|
+
"type": "requirement",
|
|
334
|
+
"label": "Changes must be conditional",
|
|
335
|
+
"x": 260,
|
|
336
|
+
"y": 1430,
|
|
337
|
+
"ears_type": "unwanted-behaviour",
|
|
338
|
+
"unwanted_condition": "a PUT, PATCH or DELETE that would change an existing resource carries no If-Match",
|
|
339
|
+
"action": "refuse it with 428 Precondition Required and change nothing",
|
|
340
|
+
"rationale": "An optional If-Match protects only the clients that send it; 428 tells the others to read first (RFC 6585, 3).",
|
|
341
|
+
"hubWhen": {
|
|
342
|
+
"CONCURRENCY": [
|
|
343
|
+
"etag"
|
|
344
|
+
]
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"id": "req-version",
|
|
349
|
+
"type": "requirement",
|
|
350
|
+
"label": "Stale versions refused",
|
|
351
|
+
"x": 260,
|
|
352
|
+
"y": 1560,
|
|
353
|
+
"ears_type": "unwanted-behaviour",
|
|
354
|
+
"unwanted_condition": "a PUT or PATCH that would change an existing resource carries a version other than the resource's current version",
|
|
355
|
+
"action": "refuse it with 409 Conflict and change nothing; every representation carries the current version, which changes with every change",
|
|
356
|
+
"rationale": "The version the client read, sent back with the change, is what tells a stale write from a current one; AIP-154 answers a mismatch with ABORTED, which is HTTP 409 (Google AIP-154).",
|
|
357
|
+
"hubWhen": {
|
|
358
|
+
"CONCURRENCY": [
|
|
359
|
+
"version"
|
|
360
|
+
]
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"id": "req-lww",
|
|
365
|
+
"type": "requirement",
|
|
366
|
+
"label": "The last write is kept and traceable",
|
|
367
|
+
"x": 260,
|
|
368
|
+
"y": 1690,
|
|
369
|
+
"ears_type": "ubiquitous",
|
|
370
|
+
"action": "apply a PUT or PATCH without any precondition, keep the write that commits last, and show in every representation when and by whom the resource was last changed (updatedAt, updatedBy)",
|
|
371
|
+
"rationale": "With no version check an overwrite cannot be prevented, only traced; the record of the last writer is what a person needs to find a lost change.",
|
|
372
|
+
"hubWhen": {
|
|
373
|
+
"CONCURRENCY": [
|
|
374
|
+
"lww"
|
|
375
|
+
]
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"id": "sc-key-replay",
|
|
380
|
+
"type": "scenario",
|
|
381
|
+
"label": "Repeated order",
|
|
382
|
+
"x": 520,
|
|
383
|
+
"y": 0,
|
|
384
|
+
"given": "an order created with POST /orders and Idempotency-Key K",
|
|
385
|
+
"when": "the same request with K is sent again",
|
|
386
|
+
"then": "the second answer has the first one's status and body, and one order exists",
|
|
387
|
+
"hubWhen": {
|
|
388
|
+
"IDEMPOTENCY": [
|
|
389
|
+
"key"
|
|
390
|
+
]
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"id": "sc-key-required",
|
|
395
|
+
"type": "scenario",
|
|
396
|
+
"label": "Order without a key",
|
|
397
|
+
"x": 520,
|
|
398
|
+
"y": 130,
|
|
399
|
+
"given": "the orders API",
|
|
400
|
+
"when": "POST /orders is sent without an Idempotency-Key",
|
|
401
|
+
"then": "it is refused with 400, no order is created, and the OpenAPI document lists the header as required",
|
|
402
|
+
"hubWhen": {
|
|
403
|
+
"IDEMPOTENCY": [
|
|
404
|
+
"key"
|
|
405
|
+
]
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"id": "sc-key-mismatch",
|
|
410
|
+
"type": "scenario",
|
|
411
|
+
"label": "Key reused with another body",
|
|
412
|
+
"x": 520,
|
|
413
|
+
"y": 260,
|
|
414
|
+
"given": "an order created with Idempotency-Key K and quantity 2",
|
|
415
|
+
"when": "POST /orders is sent with K and quantity 3",
|
|
416
|
+
"then": "it is refused with 422 and the first order is unchanged",
|
|
417
|
+
"hubWhen": {
|
|
418
|
+
"IDEMPOTENCY": [
|
|
419
|
+
"key"
|
|
420
|
+
]
|
|
421
|
+
}
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"id": "sc-key-concurrent",
|
|
425
|
+
"type": "scenario",
|
|
426
|
+
"label": "Two overlapping attempts",
|
|
427
|
+
"x": 520,
|
|
428
|
+
"y": 390,
|
|
429
|
+
"given": "an order request that takes 500 ms",
|
|
430
|
+
"when": "the same request with the same key is sent twice at once",
|
|
431
|
+
"then": "one order exists, and the second answer is either the first one's or 409",
|
|
432
|
+
"hubWhen": {
|
|
433
|
+
"IDEMPOTENCY": [
|
|
434
|
+
"key"
|
|
435
|
+
]
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
"id": "sc-key-expiry",
|
|
440
|
+
"type": "scenario",
|
|
441
|
+
"label": "Old keys removed",
|
|
442
|
+
"x": 520,
|
|
443
|
+
"y": 520,
|
|
444
|
+
"given": "keys stored over the last two days",
|
|
445
|
+
"when": "the clean-up has run",
|
|
446
|
+
"then": "no key older than {{KEY_HOURS}} hours plus one is left, and every younger key is still there",
|
|
447
|
+
"hubWhen": {
|
|
448
|
+
"IDEMPOTENCY": [
|
|
449
|
+
"key"
|
|
450
|
+
]
|
|
451
|
+
}
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"id": "sc-key-atomic",
|
|
455
|
+
"type": "scenario",
|
|
456
|
+
"label": "Failed order leaves no key",
|
|
457
|
+
"x": 520,
|
|
458
|
+
"y": 650,
|
|
459
|
+
"given": "an order request whose second write fails",
|
|
460
|
+
"when": "it is sent with key K and then retried with K",
|
|
461
|
+
"then": "the first leaves neither an order nor K behind, and the retry creates the order",
|
|
462
|
+
"hubWhen": {
|
|
463
|
+
"IDEMPOTENCY": [
|
|
464
|
+
"key"
|
|
465
|
+
],
|
|
466
|
+
"STORE": [
|
|
467
|
+
"database"
|
|
468
|
+
]
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
"id": "sc-key-redis",
|
|
473
|
+
"type": "scenario",
|
|
474
|
+
"label": "Keys expire, never evicted",
|
|
475
|
+
"x": 520,
|
|
476
|
+
"y": 780,
|
|
477
|
+
"given": "the Redis that holds the keys",
|
|
478
|
+
"when": "its configuration and keys are read",
|
|
479
|
+
"then": "maxmemory-policy is noeviction and every key has an expiry of at most {{KEY_HOURS}} hours",
|
|
480
|
+
"hubWhen": {
|
|
481
|
+
"IDEMPOTENCY": [
|
|
482
|
+
"key"
|
|
483
|
+
],
|
|
484
|
+
"STORE": [
|
|
485
|
+
"redis"
|
|
486
|
+
]
|
|
487
|
+
}
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"id": "sc-put-create",
|
|
491
|
+
"type": "scenario",
|
|
492
|
+
"label": "Order PUT twice",
|
|
493
|
+
"x": 520,
|
|
494
|
+
"y": 910,
|
|
495
|
+
"given": "a new UUID chosen by the client",
|
|
496
|
+
"when": "PUT /orders/{that id} is sent twice with the same body",
|
|
497
|
+
"then": "the first answer is 201, the second 200 with the same body, and one order exists",
|
|
498
|
+
"hubWhen": {
|
|
499
|
+
"IDEMPOTENCY": [
|
|
500
|
+
"put"
|
|
501
|
+
]
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
"id": "sc-put-no-post",
|
|
506
|
+
"type": "scenario",
|
|
507
|
+
"label": "Contract without POST",
|
|
508
|
+
"x": 520,
|
|
509
|
+
"y": 1040,
|
|
510
|
+
"given": "the OpenAPI document",
|
|
511
|
+
"when": "it is linted",
|
|
512
|
+
"then": "it has no POST operation and every PATCH accepts only application/merge-patch+json",
|
|
513
|
+
"hubWhen": {
|
|
514
|
+
"IDEMPOTENCY": [
|
|
515
|
+
"put"
|
|
516
|
+
]
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
"id": "sc-none-retry",
|
|
521
|
+
"type": "scenario",
|
|
522
|
+
"label": "Unsafe operations marked",
|
|
523
|
+
"x": 520,
|
|
524
|
+
"y": 1170,
|
|
525
|
+
"given": "the OpenAPI document",
|
|
526
|
+
"when": "it is linted",
|
|
527
|
+
"then": "every POST and PATCH has x-retry-safe: false and a description of how to look the result up",
|
|
528
|
+
"hubWhen": {
|
|
529
|
+
"IDEMPOTENCY": [
|
|
530
|
+
"none"
|
|
531
|
+
]
|
|
532
|
+
}
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
"id": "sc-etag",
|
|
536
|
+
"type": "scenario",
|
|
537
|
+
"label": "Stale If-Match refused",
|
|
538
|
+
"x": 520,
|
|
539
|
+
"y": 1300,
|
|
540
|
+
"given": "an order read with ETag E and changed since by another client",
|
|
541
|
+
"when": "a PUT with If-Match E is sent",
|
|
542
|
+
"then": "it is refused with 412 and the order keeps the other client's change",
|
|
543
|
+
"hubWhen": {
|
|
544
|
+
"CONCURRENCY": [
|
|
545
|
+
"etag"
|
|
546
|
+
]
|
|
547
|
+
}
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
"id": "sc-etag-required",
|
|
551
|
+
"type": "scenario",
|
|
552
|
+
"label": "Unconditional change refused",
|
|
553
|
+
"x": 520,
|
|
554
|
+
"y": 1430,
|
|
555
|
+
"given": "an existing order",
|
|
556
|
+
"when": "a PUT that changes it is sent without If-Match",
|
|
557
|
+
"then": "it is refused with 428 and the order is unchanged",
|
|
558
|
+
"hubWhen": {
|
|
559
|
+
"CONCURRENCY": [
|
|
560
|
+
"etag"
|
|
561
|
+
]
|
|
562
|
+
}
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
"id": "sc-version",
|
|
566
|
+
"type": "scenario",
|
|
567
|
+
"label": "Stale version refused",
|
|
568
|
+
"x": 520,
|
|
569
|
+
"y": 1560,
|
|
570
|
+
"given": "an order read at version 7 and saved since at version 8",
|
|
571
|
+
"when": "a PUT carrying version 7 is sent",
|
|
572
|
+
"then": "it is refused with 409 and the order stays at version 8",
|
|
573
|
+
"hubWhen": {
|
|
574
|
+
"CONCURRENCY": [
|
|
575
|
+
"version"
|
|
576
|
+
]
|
|
577
|
+
}
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
"id": "sc-lww",
|
|
581
|
+
"type": "scenario",
|
|
582
|
+
"label": "Second write kept",
|
|
583
|
+
"x": 520,
|
|
584
|
+
"y": 1690,
|
|
585
|
+
"given": "an order read by Alice and by Bob",
|
|
586
|
+
"when": "Alice saves quantity 3 and then Bob saves quantity 5 from his copy",
|
|
587
|
+
"then": "the order has quantity 5 and shows Bob as its last writer",
|
|
588
|
+
"hubWhen": {
|
|
589
|
+
"CONCURRENCY": [
|
|
590
|
+
"lww"
|
|
591
|
+
]
|
|
592
|
+
}
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
"id": "adr-key",
|
|
596
|
+
"type": "adr",
|
|
597
|
+
"label": "Idempotency keys on unsafe requests",
|
|
598
|
+
"x": 780,
|
|
599
|
+
"y": 0,
|
|
600
|
+
"concern": "api-idempotency",
|
|
601
|
+
"status": "accepted",
|
|
602
|
+
"date": "",
|
|
603
|
+
"context": "Other elements, partners and browsers call this element's HTTP API to change things, over networks that drop connections. The forces: a timeout does not tell the caller whether the change happened, and gateways, SDKs, mobile apps and impatient users try again, so an order, a payment or a message is made twice; POST and PATCH are not idempotent in HTTP, while PUT and DELETE are; remembering requests costs a store, an expiry and a write on every call; two clients that read the same resource and write it back overwrite each other without either knowing (the lost update); and preventing that asks every client to keep and send a version. Retries of the calls this element makes to others are decided in the Integration resilience pack, duplicate messages in the Messaging pack, transactions and isolation in the Data consistency pack, and the body of every error answer in the Errors pack of the API Guidelines.",
|
|
604
|
+
"decision": "Every POST and PATCH the API offers takes an Idempotency-Key request header as the IETF httpapi working group's Internet-Draft \"The Idempotency-Key HTTP Header Field\" defines it (a draft, not an RFC: pin the draft version the API follows in its documentation). The value is a Structured Field String, a UUID v4 the client generates once per intended change and sends again on every retry of it. The header is required: a request without it is refused with 400. One middleware in front of every POST and PATCH handler, not code in each handler, keeps per calling client (its authenticated identity or API key) the key, a fingerprint of the request (method, path and the SHA-256 of the body) and the response of every request that completed, for {{KEY_HOURS}} hours. A repeat with the same key and fingerprint gets the stored response before any precondition is evaluated; the same key with another fingerprint gets 422; a repeat while the first is still running never runs: it waits at most {{LOCK_SECONDS}} seconds for the first, or gets 409. Keys and responses are kept in {{STORE}}. The OpenAPI document declares the header on every POST and PATCH and states the retention. GET, HEAD, OPTIONS, PUT and DELETE take no key: they are idempotent by definition (RFC 9110, 9.2.2). The bodies of the 400, 409 and 422 answers follow the Errors pack.",
|
|
605
|
+
"consequences": "• A client may retry any request after a timeout or a dropped connection without doing it twice; SDKs and gateways can retry POST safely.\n• Every POST and PATCH costs a write and a read of the key store, and the stored responses take space.\n• After {{KEY_HOURS}} hours a key is gone and a retry runs again: clients must stop retrying before then.\n• The client must keep the key across its own restarts; a client that makes a new key per attempt gets no protection.\n• The draft may still change (status codes, syntax); following a pinned version keeps callers' expectations stable.",
|
|
606
|
+
"alternatives": "1. Client-chosen ids with PUT: nothing to store, but every operation must be expressed as a PUT to a known URI.\n2. A secondary key in the body with a unique constraint (Zalando rule 231): a duplicate creation fails with 409 instead of replaying the first answer, and it covers creations only.\n3. The Repeatability-Request-ID and Repeatability-First-Sent headers of the Microsoft REST API Guidelines: the same idea, rarely seen outside Azure.\n4. No protection: simpler, and every timeout becomes a question for a person.",
|
|
607
|
+
"hubWhen": {
|
|
608
|
+
"IDEMPOTENCY": [
|
|
609
|
+
"key"
|
|
610
|
+
]
|
|
611
|
+
}
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
"id": "adr-put",
|
|
615
|
+
"type": "adr",
|
|
616
|
+
"label": "Client-chosen ids with PUT",
|
|
617
|
+
"x": 780,
|
|
618
|
+
"y": 130,
|
|
619
|
+
"concern": "api-idempotency",
|
|
620
|
+
"status": "accepted",
|
|
621
|
+
"date": "",
|
|
622
|
+
"context": "Other elements, partners and browsers call this element's HTTP API to change things, over networks that drop connections. The forces: a timeout does not tell the caller whether the change happened, and gateways, SDKs, mobile apps and impatient users try again, so an order, a payment or a message is made twice; POST and PATCH are not idempotent in HTTP, while PUT and DELETE are; remembering requests costs a store, an expiry and a write on every call; two clients that read the same resource and write it back overwrite each other without either knowing (the lost update); and preventing that asks every client to keep and send a version. Retries of the calls this element makes to others are decided in the Integration resilience pack, duplicate messages in the Messaging pack, transactions and isolation in the Data consistency pack, and the body of every error answer in the Errors pack of the API Guidelines.",
|
|
623
|
+
"decision": "Every resource is created with a PUT to a URI whose id the client chose (a UUID v4, or a key from the client's own system such as its order number): the first PUT creates it with 201, a repeat with the same representation changes nothing and gets 200 (RFC 9110, 9.3.4; Microsoft REST API Guidelines: PUT to create or replace). Changes are a PUT of the whole representation or a JSON Merge Patch (RFC 7396, application/merge-patch+json), both of which leave the same state when repeated; an action such as cancelling or shipping is a PUT or merge patch of a state field, or a PUT of a resource of its own (PUT /payments/{id}), never a POST. The API offers no POST. A repeat whose change is already reflected in the current state is answered with success even when its precondition no longer holds, as RFC 9110 13.1.1 allows. Ids from clients are validated like any input (a UUID, or the pattern the contract states), and authorisation decides whether a client may create under that URI. Nothing extra is stored: the resource itself records the change.",
|
|
624
|
+
"consequences": "• No key store and no expiry: a retry a week later is as harmless as one a second later.\n• Every operation must be shaped as a state to reach; commands (a payment, an e-mail, an increment) need a resource of their own.\n• A client that reuses an id by mistake replaces another resource; the concurrent-edits decision decides whether that is refused.\n• Side effects of a change (an event, an e-mail) must be emitted only when the state actually changed, or a repeat emits them again.",
|
|
625
|
+
"alternatives": "1. An Idempotency-Key header: keeps POST and commands, at the cost of a key store and an expiry.\n2. POST with a client id in the body and a unique constraint (Zalando rule 231): a repeat gets 409 and the client must read the resource to learn it was its own.\n3. No protection: nothing to build, and every timeout risks a duplicate.",
|
|
626
|
+
"hubWhen": {
|
|
627
|
+
"IDEMPOTENCY": [
|
|
628
|
+
"put"
|
|
629
|
+
]
|
|
630
|
+
}
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
"id": "adr-none",
|
|
634
|
+
"type": "adr",
|
|
635
|
+
"label": "No idempotency for unsafe requests",
|
|
636
|
+
"x": 780,
|
|
637
|
+
"y": 260,
|
|
638
|
+
"concern": "api-idempotency",
|
|
639
|
+
"status": "accepted",
|
|
640
|
+
"date": "",
|
|
641
|
+
"context": "Other elements, partners and browsers call this element's HTTP API to change things, over networks that drop connections. The forces: a timeout does not tell the caller whether the change happened, and gateways, SDKs, mobile apps and impatient users try again, so an order, a payment or a message is made twice; POST and PATCH are not idempotent in HTTP, while PUT and DELETE are; remembering requests costs a store, an expiry and a write on every call; two clients that read the same resource and write it back overwrite each other without either knowing (the lost update); and preventing that asks every client to keep and send a version. Retries of the calls this element makes to others are decided in the Integration resilience pack, duplicate messages in the Messaging pack, transactions and isolation in the Data consistency pack, and the body of every error answer in the Errors pack of the API Guidelines. Here a duplicate is cheap and a person sees it: nothing the API creates moves money or reaches a customer.",
|
|
642
|
+
"decision": "POST and PATCH are not made idempotent: the API stores no keys and takes no client-chosen ids. The OpenAPI document marks every POST and PATCH with x-retry-safe: false, an extension of our own whose name the API style guide pack keeps, and its description tells the caller how to find out after a timeout whether the request took effect (a GET filtered by a reference the caller sent) before trying again. Clients the team builds do not retry POST or PATCH automatically, and the proxies in front keep their defaults that do not pass a POST or PATCH to another upstream (in NGINX, no non_idempotent in proxy_next_upstream). This holds while a duplicate is cheap and visible; the first operation whose duplicate costs money or trust (a payment, an order, a message to a customer) supersedes this decision.",
|
|
643
|
+
"consequences": "• Nothing to build, store or expire.\n• A timeout leaves the caller not knowing whether the change happened; users pressing the button again and third-party clients that retry create duplicates.\n• Duplicates are found and removed by people.\n• The first operation that cannot afford a duplicate needs this decision superseded, not an exception.",
|
|
644
|
+
"alternatives": "1. An Idempotency-Key header on POST and PATCH.\n2. Client-chosen ids with PUT.\n3. A unique constraint on a natural key per resource (Zalando rule 231): duplicates refused with 409, creations only.",
|
|
645
|
+
"hubWhen": {
|
|
646
|
+
"IDEMPOTENCY": [
|
|
647
|
+
"none"
|
|
648
|
+
]
|
|
649
|
+
}
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
"id": "adr-store-db",
|
|
653
|
+
"type": "adr",
|
|
654
|
+
"label": "Idempotency keys in the change's transaction",
|
|
655
|
+
"x": 780,
|
|
656
|
+
"y": 390,
|
|
657
|
+
"concern": "api-idempotency",
|
|
658
|
+
"status": "accepted",
|
|
659
|
+
"date": "",
|
|
660
|
+
"context": "Other elements, partners and browsers call this element's HTTP API to change things, over networks that drop connections. The forces: a timeout does not tell the caller whether the change happened, and gateways, SDKs, mobile apps and impatient users try again, so an order, a payment or a message is made twice; POST and PATCH are not idempotent in HTTP, while PUT and DELETE are; remembering requests costs a store, an expiry and a write on every call; two clients that read the same resource and write it back overwrite each other without either knowing (the lost update); and preventing that asks every client to keep and send a version. Retries of the calls this element makes to others are decided in the Integration resilience pack, duplicate messages in the Messaging pack, transactions and isolation in the Data consistency pack, and the body of every error answer in the Errors pack of the API Guidelines.",
|
|
661
|
+
"decision": "Idempotency keys and responses are kept in a table idempotency_keys in the element's own database (client, key, fingerprint, response status, response body, created_at; primary key client and key), written in the same transaction as the change: the middleware opens the transaction, sets lock_timeout to {{LOCK_SECONDS}} seconds, inserts the key row with INSERT ... ON CONFLICT DO NOTHING, runs the handler inside the transaction, writes the response into the row and commits. A second request with the same key waits on the first one's uncommitted row; once the first commits it reads and returns the stored response, if the first rolls back it runs itself, and past the lock timeout it gets 409. A request whose transaction rolls back leaves no key, so its retry runs anew. Every hour a pg_cron job (a scheduled job outside PostgreSQL) deletes the rows older than {{KEY_HOURS}} hours.",
|
|
662
|
+
"consequences": "• The key and the change commit or roll back together: no window where one exists without the other.\n• No new infrastructure, and the keys are backed up with the data.\n• One more insert and update per unsafe request on the hot path, and a table that holds every response body for {{KEY_HOURS}} hours.\n• Only a change inside this database is protected; a call to another system inside the request needs its own idempotency (the Integration resilience pack).\n• A waiting repeat holds a database connection for up to {{LOCK_SECONDS}} seconds; the draft asks for an immediate 409, waiting briefly gives the caller the answer instead.",
|
|
663
|
+
"alternatives": "1. Redis with an expiry: shared across services and fast, but outside the change's transaction.\n2. A unique column on the resource itself: protects creations only and replays nothing.",
|
|
664
|
+
"hubWhen": {
|
|
665
|
+
"IDEMPOTENCY": [
|
|
666
|
+
"key"
|
|
667
|
+
],
|
|
668
|
+
"STORE": [
|
|
669
|
+
"database"
|
|
670
|
+
]
|
|
671
|
+
}
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
"id": "adr-store-redis",
|
|
675
|
+
"type": "adr",
|
|
676
|
+
"label": "Idempotency keys in Redis",
|
|
677
|
+
"x": 780,
|
|
678
|
+
"y": 520,
|
|
679
|
+
"concern": "api-idempotency",
|
|
680
|
+
"status": "accepted",
|
|
681
|
+
"date": "",
|
|
682
|
+
"context": "Other elements, partners and browsers call this element's HTTP API to change things, over networks that drop connections. The forces: a timeout does not tell the caller whether the change happened, and gateways, SDKs, mobile apps and impatient users try again, so an order, a payment or a message is made twice; POST and PATCH are not idempotent in HTTP, while PUT and DELETE are; remembering requests costs a store, an expiry and a write on every call; two clients that read the same resource and write it back overwrite each other without either knowing (the lost update); and preventing that asks every client to keep and send a version. Retries of the calls this element makes to others are decided in the Integration resilience pack, duplicate messages in the Messaging pack, transactions and isolation in the Data consistency pack, and the body of every error answer in the Errors pack of the API Guidelines.",
|
|
683
|
+
"decision": "Idempotency keys and responses are kept in one Redis shared by every instance (managed: Amazon ElastiCache, Azure Cache for Redis or Google Memorystore; Valkey works the same). Before the handler runs, the middleware claims the key with SET idem:<client>:<key> <in-progress marker with the fingerprint> NX EX {{LOCK_SECONDS}}; a request that finds a claim gets 409, or the stored response once there is one. When the handler completes, the response replaces the marker with an expiry of {{KEY_HOURS}} hours; when it fails before changing anything, the claim is deleted so the retry runs. Redis runs with maxmemory-policy noeviction and AOF persistence (appendonly yes), with an alert on memory use, so a key is never evicted early.",
|
|
684
|
+
"consequences": "• Fast, and one store for every element that offers keys; Redis expires old keys itself.\n• Not in the change's transaction: if the process dies after the change commits and before the response is stored, the claim expires after {{LOCK_SECONDS}} seconds and the next retry runs the change again; where such a duplicate costs money, add a unique constraint on a natural key as well.\n• noeviction makes Redis refuse writes when full, so unsafe requests fail instead of losing keys: size it and alert on memory.\n• Replication is asynchronous: a failover can lose the last keys written.\n• One more stateful service to run and secure; managed Redis may block CONFIG, so the check reads the setting from the provider instead.",
|
|
685
|
+
"alternatives": "1. A table in the element's own database, in the change's transaction: no gap between key and change.\n2. Redis with an eviction policy: cheaper memory, but evicted keys turn retries into duplicates.",
|
|
686
|
+
"hubWhen": {
|
|
687
|
+
"IDEMPOTENCY": [
|
|
688
|
+
"key"
|
|
689
|
+
],
|
|
690
|
+
"STORE": [
|
|
691
|
+
"redis"
|
|
692
|
+
]
|
|
693
|
+
}
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
"id": "adr-etag",
|
|
697
|
+
"type": "adr",
|
|
698
|
+
"label": "ETag and If-Match for concurrent edits",
|
|
699
|
+
"x": 780,
|
|
700
|
+
"y": 650,
|
|
701
|
+
"concern": "api-idempotency",
|
|
702
|
+
"status": "accepted",
|
|
703
|
+
"date": "",
|
|
704
|
+
"context": "Other elements, partners and browsers call this element's HTTP API to change things, over networks that drop connections. The forces: a timeout does not tell the caller whether the change happened, and gateways, SDKs, mobile apps and impatient users try again, so an order, a payment or a message is made twice; POST and PATCH are not idempotent in HTTP, while PUT and DELETE are; remembering requests costs a store, an expiry and a write on every call; two clients that read the same resource and write it back overwrite each other without either knowing (the lost update); and preventing that asks every client to keep and send a version. Retries of the calls this element makes to others are decided in the Integration resilience pack, duplicate messages in the Messaging pack, transactions and isolation in the Data consistency pack, and the body of every error answer in the Errors pack of the API Guidelines.",
|
|
705
|
+
"decision": "Concurrent edits are caught with HTTP conditional requests (RFC 9110, section 13). Every response that carries a resource carries a strong ETag (quoted, never W/), computed as a hash of the stored representation as the Microsoft REST API Guidelines recommend, and every successful change returns the new one. A PUT, PATCH or DELETE that would change an existing resource must carry If-Match with the ETag the client last saw: a mismatch is refused with 412 Precondition Failed and a missing If-Match with 428 Precondition Required (RFC 6585), both changing nothing. A creation with PUT may send If-None-Match: * to refuse overwriting an existing resource, and GET answers If-None-Match with 304. The comparison and the write are one atomic step, in the way the Data consistency pack decides (a version checked in the UPDATE's WHERE clause). The OpenAPI document declares If-Match on every PUT, PATCH and DELETE with its 412 and 428 answers, whose bodies follow the Errors pack.",
|
|
706
|
+
"consequences": "• Two clients can no longer silently overwrite each other: the second one learns of the first.\n• Every client must read before it writes and keep the ETag; scripts and simple integrations must learn to send If-Match.\n• A 412 needs a path in the client: read again, merge or ask the user.\n• The ETag must change with every change visible in the representation, embedded parts included; a hash of the representation does so by construction.\n• Caches and CDNs can use the same ETags to revalidate.",
|
|
707
|
+
"alternatives": "1. A version field in the body with 409: works where headers are dropped, but outside HTTP's own semantics.\n2. Last write wins: nothing to send, and concurrent changes are lost silently.\n3. Pessimistic locks (a lock resource held while a person edits): held across thinking time and left behind by crashed clients.",
|
|
708
|
+
"hubWhen": {
|
|
709
|
+
"CONCURRENCY": [
|
|
710
|
+
"etag"
|
|
711
|
+
]
|
|
712
|
+
}
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
"id": "adr-version",
|
|
716
|
+
"type": "adr",
|
|
717
|
+
"label": "A version field for concurrent edits",
|
|
718
|
+
"x": 780,
|
|
719
|
+
"y": 780,
|
|
720
|
+
"concern": "api-idempotency",
|
|
721
|
+
"status": "accepted",
|
|
722
|
+
"date": "",
|
|
723
|
+
"context": "Other elements, partners and browsers call this element's HTTP API to change things, over networks that drop connections. The forces: a timeout does not tell the caller whether the change happened, and gateways, SDKs, mobile apps and impatient users try again, so an order, a payment or a message is made twice; POST and PATCH are not idempotent in HTTP, while PUT and DELETE are; remembering requests costs a store, an expiry and a write on every call; two clients that read the same resource and write it back overwrite each other without either knowing (the lost update); and preventing that asks every client to keep and send a version. Retries of the calls this element makes to others are decided in the Integration resilience pack, duplicate messages in the Messaging pack, transactions and isolation in the Data consistency pack, and the body of every error answer in the Errors pack of the API Guidelines.",
|
|
724
|
+
"decision": "Each representation carries a field version (an integer increased with every change, or an opaque string), the way Google AIP-154 keeps an etag field in the resource. A PUT or PATCH that would change an existing resource must send the version it read, a required field of the request body; a version other than the current one is refused with 409 Conflict and changes nothing, and the client reads the resource again. DELETE takes the version as a query parameter. The comparison and the write are one atomic step (version = the expected value in the UPDATE's WHERE clause), in the way the Data consistency pack decides. The error body of the 409 says that the version was stale, apart from other conflicts, as the Errors pack shapes it.",
|
|
725
|
+
"consequences": "• Lost updates are refused with nothing but JSON: it works where headers are dropped and in APIs also served over gRPC.\n• HTTP caches and generic clients do not understand it: no 304 revalidation, no 412 or 428.\n• 409 also means other conflicts, so clients must read the error type to know a stale version from a duplicate.\n• The version is part of every schema that changes a resource.",
|
|
726
|
+
"alternatives": "1. ETag and If-Match: HTTP's own mechanism, understood by caches and tools.\n2. Last write wins: nothing to send, concurrent changes lost.",
|
|
727
|
+
"hubWhen": {
|
|
728
|
+
"CONCURRENCY": [
|
|
729
|
+
"version"
|
|
730
|
+
]
|
|
731
|
+
}
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
"id": "adr-lww",
|
|
735
|
+
"type": "adr",
|
|
736
|
+
"label": "Last write wins",
|
|
737
|
+
"x": 780,
|
|
738
|
+
"y": 910,
|
|
739
|
+
"concern": "api-idempotency",
|
|
740
|
+
"status": "accepted",
|
|
741
|
+
"date": "",
|
|
742
|
+
"context": "Other elements, partners and browsers call this element's HTTP API to change things, over networks that drop connections. The forces: a timeout does not tell the caller whether the change happened, and gateways, SDKs, mobile apps and impatient users try again, so an order, a payment or a message is made twice; POST and PATCH are not idempotent in HTTP, while PUT and DELETE are; remembering requests costs a store, an expiry and a write on every call; two clients that read the same resource and write it back overwrite each other without either knowing (the lost update); and preventing that asks every client to keep and send a version. Retries of the calls this element makes to others are decided in the Integration resilience pack, duplicate messages in the Messaging pack, transactions and isolation in the Data consistency pack, and the body of every error answer in the Errors pack of the API Guidelines. Here each resource is changed by one person or system at a time, so concurrent edits are rare.",
|
|
743
|
+
"decision": "PUT and PATCH carry no precondition and no version: the write that commits last is the one kept. Each representation shows when and by whom it was last changed (updatedAt, updatedBy), so an overwrite can be traced. This holds while each resource is edited by one person or system at a time (a user's own settings, records one integration owns); the first resource that several people edit at once supersedes this decision for it.",
|
|
744
|
+
"consequences": "• Nothing for clients to keep or send.\n• Two concurrent edits lose one of them silently; only updatedBy and the logs show who was overwritten.\n• A PATCH limits the damage to the fields it sends; a PUT overwrites every field.",
|
|
745
|
+
"alternatives": "1. ETag and If-Match with 412.\n2. A version field in the body with 409.",
|
|
746
|
+
"hubWhen": {
|
|
747
|
+
"CONCURRENCY": [
|
|
748
|
+
"lww"
|
|
749
|
+
]
|
|
750
|
+
}
|
|
751
|
+
},
|
|
752
|
+
{
|
|
753
|
+
"id": "ff-key-http",
|
|
754
|
+
"type": "fitness-fn",
|
|
755
|
+
"label": "Repeats replay, misuse is refused",
|
|
756
|
+
"x": 1040,
|
|
757
|
+
"y": 0,
|
|
758
|
+
"characteristic": "reliability",
|
|
759
|
+
"scope": "atomic",
|
|
760
|
+
"cadence": "triggered",
|
|
761
|
+
"trigger": "pull-request",
|
|
762
|
+
"invocation": "automated",
|
|
763
|
+
"description": "An HTTP test sends one order twice with the same key and compares the answers and the orders stored, then reuses the key with another body and sends one without a key. Each test uses a fresh UUID as its key and as the order's reference, so tests in parallel do not see each other's orders.\n\nThreshold: A repeat with the same key gets the first status and body and creates 0 more orders; a reused key with another body gets 422; a POST without a key gets 400\n\nTool: Vitest with supertest (or the test runner and HTTP client of your stack: JUnit with MockMvc or REST Assured, xUnit with WebApplicationFactory)\n\n```ts\nimport request from 'supertest'\nimport { app } from '../../src/app'\nimport { db } from '../db'\n\nconst post = (body: object, key?: string) => {\n const req = request(app).post('/orders')\n return (key ? req.set('Idempotency-Key', `\"${key}\"`) : req).send(body) // a Structured Field String\n}\nconst stored = async (ref: string) => (await db.query('select count(*)::int as n from orders where reference = $1', [ref])).rows[0].n\n\nit('performs a repeated request once and replays its answer', async () => {\n const key = crypto.randomUUID(), order = { sku: 'SKU-1', quantity: 2, reference: key }\n const first = await post(order, key)\n const again = await post(order, key)\n expect(first.status).toBe(201)\n expect([again.status, again.body]).toEqual([first.status, first.body])\n expect(await stored(key)).toBe(1)\n})\n\nit('refuses a reused key with another body (422) and a missing key (400)', async () => {\n const key = crypto.randomUUID(), order = { sku: 'SKU-1', quantity: 2, reference: key }\n await post(order, key).expect(201)\n await post({ ...order, quantity: 3 }, key).expect(422)\n await post({ ...order, reference: crypto.randomUUID() }).expect(400)\n})\n```",
|
|
764
|
+
"hubWhen": {
|
|
765
|
+
"IDEMPOTENCY": [
|
|
766
|
+
"key"
|
|
767
|
+
]
|
|
768
|
+
}
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
"id": "ff-key-concurrent",
|
|
772
|
+
"type": "fitness-fn",
|
|
773
|
+
"label": "Overlapping repeats run once",
|
|
774
|
+
"x": 1040,
|
|
775
|
+
"y": 130,
|
|
776
|
+
"characteristic": "reliability",
|
|
777
|
+
"scope": "atomic",
|
|
778
|
+
"cadence": "triggered",
|
|
779
|
+
"trigger": "pull-request",
|
|
780
|
+
"invocation": "automated",
|
|
781
|
+
"description": "The test app holds every order change for 500 ms through a test hook, so the two requests overlap; whether the second waits for the first or is refused with 409 depends on the key store, and the test accepts either, but never a second order.\n\nThreshold: In 10 runs of two overlapping requests with one key, each run stores 1 order, and the second answer is the first one's or 409\n\nTool: Vitest with supertest, the app built by a test fixture with a 500 ms hold in the order handler (on the JVM: JUnit with REST Assured and a CompletableFuture pair)\n\n```ts\nimport request from 'supertest'\nimport { appHoldingOrders } from './fixtures' // the app with a test hook that holds each order change for 500 ms\nimport { db } from '../db'\n\nit.each([...Array(10).keys()])('never runs two overlapping requests with one key twice (run %i)', async () => {\n const key = crypto.randomUUID()\n const order = { sku: 'SKU-1', quantity: 2, reference: key }\n const send = () => request(appHoldingOrders).post('/orders').set('Idempotency-Key', `\"${key}\"`).send(order)\n const [first, second] = (await Promise.all([send(), send()])).sort((a, b) => a.status - b.status)\n expect(first.status).toBe(201)\n if (second.status !== 409) expect([second.status, second.body]).toEqual([first.status, first.body])\n const { rows } = await db.query('select count(*)::int as n from orders where reference = $1', [key])\n expect(rows[0].n).toBe(1)\n})\n```",
|
|
782
|
+
"hubWhen": {
|
|
783
|
+
"IDEMPOTENCY": [
|
|
784
|
+
"key"
|
|
785
|
+
]
|
|
786
|
+
}
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
"id": "ff-key-contract",
|
|
790
|
+
"type": "fitness-fn",
|
|
791
|
+
"label": "The contract requires the key",
|
|
792
|
+
"x": 1040,
|
|
793
|
+
"y": 260,
|
|
794
|
+
"characteristic": "compatibility",
|
|
795
|
+
"scope": "atomic",
|
|
796
|
+
"cadence": "triggered",
|
|
797
|
+
"trigger": "pull-request",
|
|
798
|
+
"invocation": "automated",
|
|
799
|
+
"description": "A Spectral rule over the OpenAPI document fails the build when a POST or PATCH does not declare the Idempotency-Key header as required or does not document the 400 and 422 answers; references to shared parameters are resolved. A new operation fails until it takes the key. Add the rule to the ruleset the API style guide keeps.\n\nThreshold: 0 POST or PATCH operations in openapi.yaml without a required Idempotency-Key header parameter and documented 400 and 422 answers\n\nTool: Spectral (npx @stoplight/spectral-cli lint openapi.yaml --ruleset .spectral.yaml --fail-severity error); for a Java build the same CLI runs in the pipeline\n\n```yaml\n# .spectral.yaml\nextends: [[spectral:oas, off]]\nrules:\n idempotency-key-required:\n description: Every POST and PATCH takes a required Idempotency-Key header and documents 400 and 422 (ADR Idempotency keys on unsafe requests)\n message: \"{{path}}: declare a required Idempotency-Key header parameter and the 400 and 422 answers\"\n severity: error\n given: $.paths[*][post,patch]\n then:\n function: schema\n functionOptions:\n schema:\n type: object\n required: [parameters, responses]\n properties:\n parameters:\n type: array\n contains:\n type: object\n required: [name, in, required]\n properties: { name: { const: Idempotency-Key }, in: { const: header }, required: { const: true } }\n responses: { type: object, required: ['400', '422'] }\n```",
|
|
800
|
+
"hubWhen": {
|
|
801
|
+
"IDEMPOTENCY": [
|
|
802
|
+
"key"
|
|
803
|
+
]
|
|
804
|
+
}
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
"id": "ff-key-atomic",
|
|
808
|
+
"type": "fitness-fn",
|
|
809
|
+
"label": "A failed change leaves no key",
|
|
810
|
+
"x": 1040,
|
|
811
|
+
"y": 390,
|
|
812
|
+
"characteristic": "reliability",
|
|
813
|
+
"scope": "atomic",
|
|
814
|
+
"cadence": "triggered",
|
|
815
|
+
"trigger": "pull-request",
|
|
816
|
+
"invocation": "automated",
|
|
817
|
+
"description": "An integration test against the real database makes the second write of an order fail once, then checks that neither the order nor the key was kept and that the retry with the same key creates the order.\n\nThreshold: After a request whose second write fails: 0 rows in idempotency_keys and 0 orders for its key; the retry with the same key answers 201\n\nTool: Vitest with supertest against PostgreSQL in a container (Testcontainers); for the JVM: JUnit with Testcontainers and a Mockito spy on the repository\n\n```ts\nimport request from 'supertest'\nimport { vi } from 'vitest'\nimport { app } from '../../src/app'\nimport { orderLines } from '../../src/orders/repository' // the second write of an order, inside its transaction\nimport { db } from '../db'\n\nit('a change that rolls back leaves no key, so the retry runs', async () => {\n const key = crypto.randomUUID()\n const order = { sku: 'SKU-1', quantity: 2, reference: key }\n const post = () => request(app).post('/orders').set('Idempotency-Key', `\"${key}\"`).send(order)\n vi.spyOn(orderLines, 'insert').mockRejectedValueOnce(new Error('disk full'))\n expect((await post()).status).toBeGreaterThanOrEqual(500)\n expect((await db.query('select 1 from idempotency_keys where key = $1', [key])).rowCount).toBe(0)\n expect((await db.query('select 1 from orders where reference = $1', [key])).rowCount).toBe(0)\n expect((await post()).status).toBe(201)\n})\n```",
|
|
818
|
+
"hubWhen": {
|
|
819
|
+
"IDEMPOTENCY": [
|
|
820
|
+
"key"
|
|
821
|
+
],
|
|
822
|
+
"STORE": [
|
|
823
|
+
"database"
|
|
824
|
+
]
|
|
825
|
+
}
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
"id": "ff-key-table",
|
|
829
|
+
"type": "fitness-fn",
|
|
830
|
+
"label": "Old keys are cleaned up",
|
|
831
|
+
"x": 1040,
|
|
832
|
+
"y": 520,
|
|
833
|
+
"characteristic": "reliability",
|
|
834
|
+
"scope": "atomic",
|
|
835
|
+
"cadence": "continual",
|
|
836
|
+
"invocation": "automated",
|
|
837
|
+
"description": "A query run every hour by the monitoring job against the element's database returns one row per problem; any row with a count above 0 raises an alert. The clean-up itself is a pg_cron job created once by a migration (shown in the comment).\n\nThreshold: 0 keys older than {{KEY_HOURS}} hours plus one; 1 clean-up job scheduled; 0 failed clean-up runs in the last day\n\nTool: PostgreSQL with pg_cron (cron.job, cron.job_run_details), the query run by the monitoring job; on another database the scheduler's own job history\n\n```sql\n-- the clean-up, created once by a migration:\n-- SELECT cron.schedule('idempotency-keys-cleanup', '0 * * * *',\n-- $$DELETE FROM idempotency_keys WHERE created_at < now() - interval '{{KEY_HOURS}} hours'$$);\n-- the check, hourly: alert on any row with n > 0\nSELECT 'keys kept too long' AS problem, count(*) AS n\nFROM idempotency_keys\nWHERE created_at < now() - interval '{{KEY_HOURS}} hours' - interval '1 hour'\nUNION ALL\nSELECT 'clean-up not scheduled', CASE WHEN count(*) = 0 THEN 1 ELSE 0 END\nFROM cron.job\nWHERE command ILIKE '%DELETE FROM idempotency_keys%'\nUNION ALL\nSELECT 'clean-up failed in the last day', count(*)\nFROM cron.job_run_details d JOIN cron.job j USING (jobid)\nWHERE j.command ILIKE '%DELETE FROM idempotency_keys%'\n AND d.status = 'failed' AND d.start_time > now() - interval '1 day';\n```",
|
|
838
|
+
"hubWhen": {
|
|
839
|
+
"IDEMPOTENCY": [
|
|
840
|
+
"key"
|
|
841
|
+
],
|
|
842
|
+
"STORE": [
|
|
843
|
+
"database"
|
|
844
|
+
]
|
|
845
|
+
}
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
"id": "ff-key-redis",
|
|
849
|
+
"type": "fitness-fn",
|
|
850
|
+
"label": "Redis keys expire, never evicted",
|
|
851
|
+
"x": 1040,
|
|
852
|
+
"y": 650,
|
|
853
|
+
"characteristic": "reliability",
|
|
854
|
+
"scope": "atomic",
|
|
855
|
+
"cadence": "continual",
|
|
856
|
+
"invocation": "automated",
|
|
857
|
+
"description": "A script run after every deploy and hourly by the monitoring job reads the eviction policy and scans the idempotency keys without blocking Redis (SCAN), failing on a key with no expiry or a longer one. Managed Redis that blocks CONFIG (some ElastiCache setups) has its policy read from the provider's parameter group instead.\n\nThreshold: maxmemory-policy is noeviction; 0 idem:* keys without an expiry or with one above {{KEY_HOURS}} hours\n\nTool: redis-cli in a shell step (REDIS_URL points at the key store)\n\n```bash\n#!/usr/bin/env bash\nset -euo pipefail\nmax=$(( {{KEY_HOURS}} * 3600 ))\npolicy=$(redis-cli -u \"$REDIS_URL\" --raw CONFIG GET maxmemory-policy | tail -n 1)\n[ \"$policy\" = noeviction ] || { echo \"maxmemory-policy is $policy, not noeviction\"; exit 1; }\nbad=0\nwhile read -r key; do\n ttl=$(redis-cli -u \"$REDIS_URL\" --raw TTL \"$key\" < /dev/null)\n [ \"$ttl\" -eq -2 ] && continue # expired since the scan\n if [ \"$ttl\" -lt 0 ] || [ \"$ttl\" -gt \"$max\" ]; then echo \"$key: TTL $ttl\"; bad=$((bad + 1)); fi\ndone < <(redis-cli -u \"$REDIS_URL\" --scan --pattern 'idem:*')\n[ \"$bad\" -eq 0 ] || { echo \"$bad idempotency keys without a valid expiry\"; exit 1; }\n```",
|
|
858
|
+
"hubWhen": {
|
|
859
|
+
"IDEMPOTENCY": [
|
|
860
|
+
"key"
|
|
861
|
+
],
|
|
862
|
+
"STORE": [
|
|
863
|
+
"redis"
|
|
864
|
+
]
|
|
865
|
+
}
|
|
866
|
+
},
|
|
867
|
+
{
|
|
868
|
+
"id": "ff-put-repeat",
|
|
869
|
+
"type": "fitness-fn",
|
|
870
|
+
"label": "A repeated PUT changes nothing",
|
|
871
|
+
"x": 1040,
|
|
872
|
+
"y": 780,
|
|
873
|
+
"characteristic": "reliability",
|
|
874
|
+
"scope": "atomic",
|
|
875
|
+
"cadence": "triggered",
|
|
876
|
+
"trigger": "pull-request",
|
|
877
|
+
"invocation": "automated",
|
|
878
|
+
"description": "An HTTP test creates an order with a PUT to a fresh UUID, repeats the same request, and checks the answers and the rows stored.\n\nThreshold: The first PUT to a new id answers 201, the repeat 200 with the same body; 1 order stored for the id\n\nTool: Vitest with supertest (or the test runner and HTTP client of your stack: JUnit with MockMvc or REST Assured)\n\n```ts\nimport request from 'supertest'\nimport { app } from '../../src/app'\nimport { db } from '../db'\n\nit('a repeated PUT leaves one resource and changes nothing', async () => {\n const id = crypto.randomUUID()\n const order = { sku: 'SKU-1', quantity: 2 }\n const first = await request(app).put(`/orders/${id}`).send(order).expect(201)\n const again = await request(app).put(`/orders/${id}`).send(order).expect(200)\n expect(again.body).toEqual(first.body)\n const { rows } = await db.query('select count(*)::int as n from orders where id = $1', [id])\n expect(rows[0].n).toBe(1)\n})\n```",
|
|
879
|
+
"hubWhen": {
|
|
880
|
+
"IDEMPOTENCY": [
|
|
881
|
+
"put"
|
|
882
|
+
]
|
|
883
|
+
}
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
"id": "ff-put-contract",
|
|
887
|
+
"type": "fitness-fn",
|
|
888
|
+
"label": "No POST in the contract",
|
|
889
|
+
"x": 1040,
|
|
890
|
+
"y": 910,
|
|
891
|
+
"characteristic": "compatibility",
|
|
892
|
+
"scope": "atomic",
|
|
893
|
+
"cadence": "triggered",
|
|
894
|
+
"trigger": "pull-request",
|
|
895
|
+
"invocation": "automated",
|
|
896
|
+
"description": "Two Spectral rules over the OpenAPI document fail the build on any POST and on a PATCH that accepts another media type. A POST that only reads (a search with a large body) is exempted by name in the ruleset's overrides, where the exception is visible in review.\n\nThreshold: 0 POST operations and 0 PATCH request bodies other than application/merge-patch+json in openapi.yaml\n\nTool: Spectral (npx @stoplight/spectral-cli lint openapi.yaml --ruleset .spectral.yaml --fail-severity error)\n\n```yaml\n# .spectral.yaml\nextends: [[spectral:oas, off]]\nrules:\n no-post:\n description: State is created and changed with PUT and JSON Merge Patch, never POST (ADR Client-chosen ids with PUT)\n message: \"{{path}}: replace POST with a PUT to a URI whose id the client chooses\"\n severity: error\n given: $.paths[*]\n then: { field: post, function: undefined }\n patch-is-merge-patch:\n description: A PATCH accepts only application/merge-patch+json (RFC 7396), which repeats with the same result\n message: \"{{path}}: a PATCH body is application/merge-patch+json only\"\n severity: error\n given: $.paths[*].patch.requestBody.content\n then:\n function: schema\n functionOptions:\n schema: { type: object, minProperties: 1, propertyNames: { const: application/merge-patch+json } }\n```",
|
|
897
|
+
"hubWhen": {
|
|
898
|
+
"IDEMPOTENCY": [
|
|
899
|
+
"put"
|
|
900
|
+
]
|
|
901
|
+
}
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
"id": "ff-none-contract",
|
|
905
|
+
"type": "fitness-fn",
|
|
906
|
+
"label": "Unsafe operations marked",
|
|
907
|
+
"x": 1040,
|
|
908
|
+
"y": 1040,
|
|
909
|
+
"characteristic": "compatibility",
|
|
910
|
+
"scope": "atomic",
|
|
911
|
+
"cadence": "triggered",
|
|
912
|
+
"trigger": "pull-request",
|
|
913
|
+
"invocation": "automated",
|
|
914
|
+
"description": "A Spectral rule over the OpenAPI document fails the build when a POST or PATCH is not marked as unsafe to retry or has no description to tell the caller how to look the result up. Generated clients and the API portal read the extension.\n\nThreshold: 0 POST or PATCH operations in openapi.yaml without x-retry-safe: false and a description of at least 20 characters\n\nTool: Spectral (npx @stoplight/spectral-cli lint openapi.yaml --ruleset .spectral.yaml --fail-severity error)\n\n```yaml\n# .spectral.yaml\nextends: [[spectral:oas, off]]\nrules:\n unsafe-not-retry-safe:\n description: Every POST and PATCH is marked as not safe to retry and says how to look the result up (ADR No idempotency for unsafe requests)\n message: \"{{path}}: set x-retry-safe: false and describe how a caller finds out whether a request that timed out took effect\"\n severity: error\n given: $.paths[*][post,patch]\n then:\n function: schema\n functionOptions:\n schema:\n type: object\n required: [x-retry-safe, description]\n properties:\n x-retry-safe: { const: false }\n description: { type: string, minLength: 20 }\n```",
|
|
915
|
+
"hubWhen": {
|
|
916
|
+
"IDEMPOTENCY": [
|
|
917
|
+
"none"
|
|
918
|
+
]
|
|
919
|
+
}
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
"id": "ff-etag",
|
|
923
|
+
"type": "fitness-fn",
|
|
924
|
+
"label": "Changes only from the current ETag",
|
|
925
|
+
"x": 1040,
|
|
926
|
+
"y": 1170,
|
|
927
|
+
"characteristic": "functional-suitability",
|
|
928
|
+
"scope": "atomic",
|
|
929
|
+
"cadence": "triggered",
|
|
930
|
+
"trigger": "pull-request",
|
|
931
|
+
"invocation": "automated",
|
|
932
|
+
"description": "An HTTP test reads an order, tries to change it without If-Match, changes it with the ETag it read, and then tries again with that now stale ETag, checking the stored quantity at the end.\n\nThreshold: A GET answers a strong ETag; a change without If-Match gets 428, with a stale one 412, with the current one 200 and a new ETag; the refused changes leave the order unchanged\n\nTool: Vitest with supertest (or the test runner and HTTP client of your stack: JUnit with MockMvc or REST Assured)\n\n```ts\nimport request from 'supertest'\nimport { app } from '../../src/app'\nimport { createOrder } from './fixtures'\n\nit('changes a resource only from the version the client saw', async () => {\n const url = `/orders/${(await createOrder()).id}`\n const read = await request(app).get(url).expect(200)\n const etag = read.headers.etag\n expect(etag).toMatch(/^\"[^\"]*\"$/) // strong: quoted, no W/ prefix\n const change = (quantity: number) => request(app).put(url).send({ ...read.body, quantity })\n await change(3).expect(428) // no If-Match\n const saved = await change(3).set('If-Match', etag).expect(200)\n expect(saved.headers.etag).not.toBe(etag)\n await change(4).set('If-Match', etag).expect(412) // stale: the order changed since\n expect((await request(app).get(url)).body.quantity).toBe(3)\n})\n```",
|
|
933
|
+
"hubWhen": {
|
|
934
|
+
"CONCURRENCY": [
|
|
935
|
+
"etag"
|
|
936
|
+
]
|
|
937
|
+
}
|
|
938
|
+
},
|
|
939
|
+
{
|
|
940
|
+
"id": "ff-version",
|
|
941
|
+
"type": "fitness-fn",
|
|
942
|
+
"label": "Stale versions refused",
|
|
943
|
+
"x": 1040,
|
|
944
|
+
"y": 1300,
|
|
945
|
+
"characteristic": "functional-suitability",
|
|
946
|
+
"scope": "atomic",
|
|
947
|
+
"cadence": "triggered",
|
|
948
|
+
"trigger": "pull-request",
|
|
949
|
+
"invocation": "automated",
|
|
950
|
+
"description": "An HTTP test reads an order with its version, saves a change from it, and saves another change from the same, now stale, copy.\n\nThreshold: A change from the current version answers 200 with a new version; a change from the old version answers 409 and leaves the order unchanged\n\nTool: Vitest with supertest (or the test runner and HTTP client of your stack: JUnit with MockMvc or REST Assured)\n\n```ts\nimport request from 'supertest'\nimport { app } from '../../src/app'\nimport { createOrder } from './fixtures'\n\nit('refuses a change made from a stale version with 409', async () => {\n const url = `/orders/${(await createOrder()).id}`\n const seen = (await request(app).get(url).expect(200)).body\n expect(seen.version).toBeDefined()\n const saved = await request(app).put(url).send({ ...seen, quantity: 3 }).expect(200)\n expect(saved.body.version).not.toEqual(seen.version)\n await request(app).put(url).send({ ...seen, quantity: 4 }).expect(409) // seen.version is stale now\n expect((await request(app).get(url)).body).toMatchObject({ quantity: 3, version: saved.body.version })\n})\n```",
|
|
951
|
+
"hubWhen": {
|
|
952
|
+
"CONCURRENCY": [
|
|
953
|
+
"version"
|
|
954
|
+
]
|
|
955
|
+
}
|
|
956
|
+
},
|
|
957
|
+
{
|
|
958
|
+
"id": "ff-lww",
|
|
959
|
+
"type": "fitness-fn",
|
|
960
|
+
"label": "The last writer is shown",
|
|
961
|
+
"x": 1040,
|
|
962
|
+
"y": 1430,
|
|
963
|
+
"characteristic": "functional-suitability",
|
|
964
|
+
"scope": "atomic",
|
|
965
|
+
"cadence": "triggered",
|
|
966
|
+
"trigger": "pull-request",
|
|
967
|
+
"invocation": "automated",
|
|
968
|
+
"description": "An HTTP test has two users change the same order from the same copy, one after the other, and checks that the second write is kept and that the representation names its writer.\n\nThreshold: Two changes from the same copy both answer 200; the order holds the second one's quantity, its writer in updatedBy and a valid updatedAt\n\nTool: Vitest with supertest (or the test runner and HTTP client of your stack: JUnit with MockMvc or REST Assured)\n\n```ts\nimport request from 'supertest'\nimport { app } from '../../src/app'\nimport { asUser, createOrder } from './fixtures' // asUser: a supertest agent signed in as that user\n\nit('keeps the last write and shows who made it', async () => {\n const url = `/orders/${(await createOrder()).id}`\n const seen = (await request(app).get(url).expect(200)).body\n const [alice, bob] = await Promise.all([asUser('alice'), asUser('bob')])\n await alice.put(url).send({ ...seen, quantity: 3 }).expect(200)\n await bob.put(url).send({ ...seen, quantity: 5 }).expect(200) // from the same copy: no precondition\n const now = (await request(app).get(url).expect(200)).body\n expect(now).toMatchObject({ quantity: 5, updatedBy: 'bob' })\n expect(Number.isNaN(Date.parse(now.updatedAt))).toBe(false)\n})\n```",
|
|
969
|
+
"hubWhen": {
|
|
970
|
+
"CONCURRENCY": [
|
|
971
|
+
"lww"
|
|
972
|
+
]
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
],
|
|
976
|
+
"relations": [
|
|
977
|
+
{
|
|
978
|
+
"id": "req-key-replay--derives--need",
|
|
979
|
+
"sourceId": "req-key-replay",
|
|
980
|
+
"targetId": "need",
|
|
981
|
+
"relationType": "derives"
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
"id": "req-key-required--derives--need",
|
|
985
|
+
"sourceId": "req-key-required",
|
|
986
|
+
"targetId": "need",
|
|
987
|
+
"relationType": "derives"
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
"id": "req-key-mismatch--derives--need",
|
|
991
|
+
"sourceId": "req-key-mismatch",
|
|
992
|
+
"targetId": "need",
|
|
993
|
+
"relationType": "derives"
|
|
994
|
+
},
|
|
995
|
+
{
|
|
996
|
+
"id": "req-key-concurrent--derives--need",
|
|
997
|
+
"sourceId": "req-key-concurrent",
|
|
998
|
+
"targetId": "need",
|
|
999
|
+
"relationType": "derives"
|
|
1000
|
+
},
|
|
1001
|
+
{
|
|
1002
|
+
"id": "req-key-expiry--derives--need",
|
|
1003
|
+
"sourceId": "req-key-expiry",
|
|
1004
|
+
"targetId": "need",
|
|
1005
|
+
"relationType": "derives"
|
|
1006
|
+
},
|
|
1007
|
+
{
|
|
1008
|
+
"id": "req-key-atomic--derives--need",
|
|
1009
|
+
"sourceId": "req-key-atomic",
|
|
1010
|
+
"targetId": "need",
|
|
1011
|
+
"relationType": "derives"
|
|
1012
|
+
},
|
|
1013
|
+
{
|
|
1014
|
+
"id": "req-key-redis--derives--need",
|
|
1015
|
+
"sourceId": "req-key-redis",
|
|
1016
|
+
"targetId": "need",
|
|
1017
|
+
"relationType": "derives"
|
|
1018
|
+
},
|
|
1019
|
+
{
|
|
1020
|
+
"id": "req-put-create--derives--need",
|
|
1021
|
+
"sourceId": "req-put-create",
|
|
1022
|
+
"targetId": "need",
|
|
1023
|
+
"relationType": "derives"
|
|
1024
|
+
},
|
|
1025
|
+
{
|
|
1026
|
+
"id": "req-put-no-post--derives--need",
|
|
1027
|
+
"sourceId": "req-put-no-post",
|
|
1028
|
+
"targetId": "need",
|
|
1029
|
+
"relationType": "derives"
|
|
1030
|
+
},
|
|
1031
|
+
{
|
|
1032
|
+
"id": "req-none-retry--derives--need",
|
|
1033
|
+
"sourceId": "req-none-retry",
|
|
1034
|
+
"targetId": "need",
|
|
1035
|
+
"relationType": "derives"
|
|
1036
|
+
},
|
|
1037
|
+
{
|
|
1038
|
+
"id": "req-etag--derives--need",
|
|
1039
|
+
"sourceId": "req-etag",
|
|
1040
|
+
"targetId": "need",
|
|
1041
|
+
"relationType": "derives"
|
|
1042
|
+
},
|
|
1043
|
+
{
|
|
1044
|
+
"id": "req-etag-required--derives--need",
|
|
1045
|
+
"sourceId": "req-etag-required",
|
|
1046
|
+
"targetId": "need",
|
|
1047
|
+
"relationType": "derives"
|
|
1048
|
+
},
|
|
1049
|
+
{
|
|
1050
|
+
"id": "req-version--derives--need",
|
|
1051
|
+
"sourceId": "req-version",
|
|
1052
|
+
"targetId": "need",
|
|
1053
|
+
"relationType": "derives"
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
"id": "req-lww--derives--need",
|
|
1057
|
+
"sourceId": "req-lww",
|
|
1058
|
+
"targetId": "need",
|
|
1059
|
+
"relationType": "derives"
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
"id": "sc-key-replay--verifies--req-key-replay",
|
|
1063
|
+
"sourceId": "sc-key-replay",
|
|
1064
|
+
"targetId": "req-key-replay",
|
|
1065
|
+
"relationType": "verifies"
|
|
1066
|
+
},
|
|
1067
|
+
{
|
|
1068
|
+
"id": "sc-key-required--verifies--req-key-required",
|
|
1069
|
+
"sourceId": "sc-key-required",
|
|
1070
|
+
"targetId": "req-key-required",
|
|
1071
|
+
"relationType": "verifies"
|
|
1072
|
+
},
|
|
1073
|
+
{
|
|
1074
|
+
"id": "sc-key-mismatch--verifies--req-key-mismatch",
|
|
1075
|
+
"sourceId": "sc-key-mismatch",
|
|
1076
|
+
"targetId": "req-key-mismatch",
|
|
1077
|
+
"relationType": "verifies"
|
|
1078
|
+
},
|
|
1079
|
+
{
|
|
1080
|
+
"id": "sc-key-concurrent--verifies--req-key-concurrent",
|
|
1081
|
+
"sourceId": "sc-key-concurrent",
|
|
1082
|
+
"targetId": "req-key-concurrent",
|
|
1083
|
+
"relationType": "verifies"
|
|
1084
|
+
},
|
|
1085
|
+
{
|
|
1086
|
+
"id": "sc-key-expiry--verifies--req-key-expiry",
|
|
1087
|
+
"sourceId": "sc-key-expiry",
|
|
1088
|
+
"targetId": "req-key-expiry",
|
|
1089
|
+
"relationType": "verifies"
|
|
1090
|
+
},
|
|
1091
|
+
{
|
|
1092
|
+
"id": "sc-key-atomic--verifies--req-key-atomic",
|
|
1093
|
+
"sourceId": "sc-key-atomic",
|
|
1094
|
+
"targetId": "req-key-atomic",
|
|
1095
|
+
"relationType": "verifies"
|
|
1096
|
+
},
|
|
1097
|
+
{
|
|
1098
|
+
"id": "sc-key-redis--verifies--req-key-redis",
|
|
1099
|
+
"sourceId": "sc-key-redis",
|
|
1100
|
+
"targetId": "req-key-redis",
|
|
1101
|
+
"relationType": "verifies"
|
|
1102
|
+
},
|
|
1103
|
+
{
|
|
1104
|
+
"id": "sc-put-create--verifies--req-put-create",
|
|
1105
|
+
"sourceId": "sc-put-create",
|
|
1106
|
+
"targetId": "req-put-create",
|
|
1107
|
+
"relationType": "verifies"
|
|
1108
|
+
},
|
|
1109
|
+
{
|
|
1110
|
+
"id": "sc-put-no-post--verifies--req-put-no-post",
|
|
1111
|
+
"sourceId": "sc-put-no-post",
|
|
1112
|
+
"targetId": "req-put-no-post",
|
|
1113
|
+
"relationType": "verifies"
|
|
1114
|
+
},
|
|
1115
|
+
{
|
|
1116
|
+
"id": "sc-none-retry--verifies--req-none-retry",
|
|
1117
|
+
"sourceId": "sc-none-retry",
|
|
1118
|
+
"targetId": "req-none-retry",
|
|
1119
|
+
"relationType": "verifies"
|
|
1120
|
+
},
|
|
1121
|
+
{
|
|
1122
|
+
"id": "sc-etag--verifies--req-etag",
|
|
1123
|
+
"sourceId": "sc-etag",
|
|
1124
|
+
"targetId": "req-etag",
|
|
1125
|
+
"relationType": "verifies"
|
|
1126
|
+
},
|
|
1127
|
+
{
|
|
1128
|
+
"id": "sc-etag-required--verifies--req-etag-required",
|
|
1129
|
+
"sourceId": "sc-etag-required",
|
|
1130
|
+
"targetId": "req-etag-required",
|
|
1131
|
+
"relationType": "verifies"
|
|
1132
|
+
},
|
|
1133
|
+
{
|
|
1134
|
+
"id": "sc-version--verifies--req-version",
|
|
1135
|
+
"sourceId": "sc-version",
|
|
1136
|
+
"targetId": "req-version",
|
|
1137
|
+
"relationType": "verifies"
|
|
1138
|
+
},
|
|
1139
|
+
{
|
|
1140
|
+
"id": "sc-lww--verifies--req-lww",
|
|
1141
|
+
"sourceId": "sc-lww",
|
|
1142
|
+
"targetId": "req-lww",
|
|
1143
|
+
"relationType": "verifies"
|
|
1144
|
+
},
|
|
1145
|
+
{
|
|
1146
|
+
"id": "ff-key-http--implements--adr-key",
|
|
1147
|
+
"sourceId": "ff-key-http",
|
|
1148
|
+
"targetId": "adr-key",
|
|
1149
|
+
"relationType": "implements"
|
|
1150
|
+
},
|
|
1151
|
+
{
|
|
1152
|
+
"id": "ff-key-concurrent--implements--adr-key",
|
|
1153
|
+
"sourceId": "ff-key-concurrent",
|
|
1154
|
+
"targetId": "adr-key",
|
|
1155
|
+
"relationType": "implements"
|
|
1156
|
+
},
|
|
1157
|
+
{
|
|
1158
|
+
"id": "ff-key-contract--implements--adr-key",
|
|
1159
|
+
"sourceId": "ff-key-contract",
|
|
1160
|
+
"targetId": "adr-key",
|
|
1161
|
+
"relationType": "implements"
|
|
1162
|
+
},
|
|
1163
|
+
{
|
|
1164
|
+
"id": "ff-key-atomic--implements--adr-store-db",
|
|
1165
|
+
"sourceId": "ff-key-atomic",
|
|
1166
|
+
"targetId": "adr-store-db",
|
|
1167
|
+
"relationType": "implements"
|
|
1168
|
+
},
|
|
1169
|
+
{
|
|
1170
|
+
"id": "ff-key-table--implements--adr-store-db",
|
|
1171
|
+
"sourceId": "ff-key-table",
|
|
1172
|
+
"targetId": "adr-store-db",
|
|
1173
|
+
"relationType": "implements"
|
|
1174
|
+
},
|
|
1175
|
+
{
|
|
1176
|
+
"id": "ff-key-redis--implements--adr-store-redis",
|
|
1177
|
+
"sourceId": "ff-key-redis",
|
|
1178
|
+
"targetId": "adr-store-redis",
|
|
1179
|
+
"relationType": "implements"
|
|
1180
|
+
},
|
|
1181
|
+
{
|
|
1182
|
+
"id": "ff-put-repeat--implements--adr-put",
|
|
1183
|
+
"sourceId": "ff-put-repeat",
|
|
1184
|
+
"targetId": "adr-put",
|
|
1185
|
+
"relationType": "implements"
|
|
1186
|
+
},
|
|
1187
|
+
{
|
|
1188
|
+
"id": "ff-put-contract--implements--adr-put",
|
|
1189
|
+
"sourceId": "ff-put-contract",
|
|
1190
|
+
"targetId": "adr-put",
|
|
1191
|
+
"relationType": "implements"
|
|
1192
|
+
},
|
|
1193
|
+
{
|
|
1194
|
+
"id": "ff-none-contract--implements--adr-none",
|
|
1195
|
+
"sourceId": "ff-none-contract",
|
|
1196
|
+
"targetId": "adr-none",
|
|
1197
|
+
"relationType": "implements"
|
|
1198
|
+
},
|
|
1199
|
+
{
|
|
1200
|
+
"id": "ff-etag--implements--adr-etag",
|
|
1201
|
+
"sourceId": "ff-etag",
|
|
1202
|
+
"targetId": "adr-etag",
|
|
1203
|
+
"relationType": "implements"
|
|
1204
|
+
},
|
|
1205
|
+
{
|
|
1206
|
+
"id": "ff-version--implements--adr-version",
|
|
1207
|
+
"sourceId": "ff-version",
|
|
1208
|
+
"targetId": "adr-version",
|
|
1209
|
+
"relationType": "implements"
|
|
1210
|
+
},
|
|
1211
|
+
{
|
|
1212
|
+
"id": "ff-lww--implements--adr-lww",
|
|
1213
|
+
"sourceId": "ff-lww",
|
|
1214
|
+
"targetId": "adr-lww",
|
|
1215
|
+
"relationType": "implements"
|
|
1216
|
+
}
|
|
1217
|
+
]
|
|
1218
|
+
}
|