@rentnerproxy/app-contracts 0.0.0-stage → 1.1.0
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/LICENSE +21 -0
- package/README.md +39 -2
- package/contracts.schema.json +4007 -0
- package/dist/Types/contract.types.d.ts +15 -0
- package/dist/Types/contract.types.js +1 -0
- package/dist/catalog.d.ts +352 -0
- package/dist/catalog.js +54 -0
- package/dist/client.d.ts +31 -0
- package/dist/client.js +66 -0
- package/dist/http-operations.d.ts +333 -0
- package/dist/http-operations.generated.d.ts +299 -0
- package/dist/http-operations.generated.js +300 -0
- package/dist/http-operations.js +17 -0
- package/dist/http.d.ts +127 -0
- package/dist/http.js +142 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4 -0
- package/dist/manifest.d.ts +90 -0
- package/dist/manifest.js +106 -0
- package/dist/platform-api.d.ts +282 -0
- package/dist/platform-api.js +287 -0
- package/dist/primitives.d.ts +33 -0
- package/dist/primitives.js +87 -0
- package/dist/provider-api.d.ts +221 -0
- package/dist/provider-api.js +227 -0
- package/dist/public-schemas.d.ts +4 -0
- package/dist/public-schemas.js +6 -0
- package/dist/publication.d.ts +410 -0
- package/dist/publication.js +50 -0
- package/dist/runtime.d.ts +75 -0
- package/dist/runtime.js +88 -0
- package/dist/schemas.d.ts +926 -0
- package/dist/schemas.js +114 -0
- package/dist/ui-bridge.d.ts +81 -0
- package/dist/ui-bridge.js +92 -0
- package/dist/validation.d.ts +784 -0
- package/dist/validation.js +245 -0
- package/dist/wire.d.ts +31 -0
- package/dist/wire.js +54 -0
- package/fixtures.json +1094 -0
- package/http-fixtures.json +829 -0
- package/openapi.json +2557 -0
- package/package.json +60 -5
- package/protocol-fixtures.json +1804 -0
- package/upstream-probe-fixtures.json +852 -0
|
@@ -0,0 +1,829 @@
|
|
|
1
|
+
{
|
|
2
|
+
"requests": [
|
|
3
|
+
{
|
|
4
|
+
"title": "readiness uses the app socket",
|
|
5
|
+
"operation": "getAppReadiness",
|
|
6
|
+
"options": {},
|
|
7
|
+
"expected": {
|
|
8
|
+
"method": "GET",
|
|
9
|
+
"socket": "app.sock",
|
|
10
|
+
"path": "/app/v1/ready"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"title": "authorization uses the core socket and a JSON body",
|
|
15
|
+
"operation": "checkAuthorization",
|
|
16
|
+
"options": {
|
|
17
|
+
"body": {
|
|
18
|
+
"capability": {
|
|
19
|
+
"id": "proxy.hosts.read.v1",
|
|
20
|
+
"scope": "proxyHosts"
|
|
21
|
+
},
|
|
22
|
+
"resourceId": "host-1"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"expected": {
|
|
26
|
+
"method": "POST",
|
|
27
|
+
"socket": "core.sock",
|
|
28
|
+
"path": "/platform/v1/authorization"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"title": "authorization requires a body",
|
|
33
|
+
"operation": "checkAuthorization",
|
|
34
|
+
"options": {}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"title": "authorization validates the admitted body",
|
|
38
|
+
"operation": "checkAuthorization",
|
|
39
|
+
"options": { "body": { "resourceId": "host-1" } }
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"title": "null is a body even on a bodyless request",
|
|
43
|
+
"operation": "getAppReadiness",
|
|
44
|
+
"options": { "body": null }
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"title": "cancellation uses a validated path parameter and idempotency key",
|
|
48
|
+
"operation": "cancelOperation",
|
|
49
|
+
"options": {
|
|
50
|
+
"pathParameter": "operation-1",
|
|
51
|
+
"idempotencyKey": "cancel_1"
|
|
52
|
+
},
|
|
53
|
+
"expected": {
|
|
54
|
+
"method": "POST",
|
|
55
|
+
"socket": "core.sock",
|
|
56
|
+
"path": "/platform/v1/operations/operation-1/cancel"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"title": "cancellation requires a path parameter",
|
|
61
|
+
"operation": "cancelOperation",
|
|
62
|
+
"options": { "idempotencyKey": "cancel_1" }
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"title": "a path parameter cannot add URL syntax",
|
|
66
|
+
"operation": "cancelOperation",
|
|
67
|
+
"options": {
|
|
68
|
+
"pathParameter": "%2Fother?x=1",
|
|
69
|
+
"idempotencyKey": "cancel_1"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"title": "a path parameter cannot be supplied to readiness",
|
|
74
|
+
"operation": "getAppReadiness",
|
|
75
|
+
"options": { "pathParameter": "operation-1" }
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"title": "cancellation requires an idempotency key",
|
|
79
|
+
"operation": "cancelOperation",
|
|
80
|
+
"options": { "pathParameter": "operation-1" }
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"title": "a line break is invalid in an idempotency key",
|
|
84
|
+
"operation": "cancelOperation",
|
|
85
|
+
"options": {
|
|
86
|
+
"pathParameter": "operation-1",
|
|
87
|
+
"idempotencyKey": "cancel_1\n"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"title": "an idempotency key cannot be supplied to readiness",
|
|
92
|
+
"operation": "getAppReadiness",
|
|
93
|
+
"options": { "idempotencyKey": "readiness-1" }
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"title": "an event subscription can start without a cursor",
|
|
97
|
+
"operation": "subscribeToEvents",
|
|
98
|
+
"options": {},
|
|
99
|
+
"expected": {
|
|
100
|
+
"method": "GET",
|
|
101
|
+
"socket": "core.sock",
|
|
102
|
+
"path": "/platform/v1/events"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"title": "an event subscription can resume with a cursor",
|
|
107
|
+
"operation": "subscribeToEvents",
|
|
108
|
+
"options": { "resumeCursor": "Cursor_01" },
|
|
109
|
+
"expected": {
|
|
110
|
+
"method": "GET",
|
|
111
|
+
"socket": "core.sock",
|
|
112
|
+
"path": "/platform/v1/events"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"title": "a supplied cursor must be nonempty",
|
|
117
|
+
"operation": "subscribeToEvents",
|
|
118
|
+
"options": { "resumeCursor": "" }
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"title": "a resume cursor cannot be supplied to readiness",
|
|
122
|
+
"operation": "getAppReadiness",
|
|
123
|
+
"options": { "resumeCursor": "Cursor_01" }
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"title": "owned host creation explicitly requires no existing revision",
|
|
127
|
+
"operation": "updateOwnedProxyHost",
|
|
128
|
+
"options": {
|
|
129
|
+
"idempotencyKey": "host-change-1",
|
|
130
|
+
"body": {
|
|
131
|
+
"action": "upsert",
|
|
132
|
+
"hostId": "host-1",
|
|
133
|
+
"expectedRevision": null,
|
|
134
|
+
"hostname": "app.example.net",
|
|
135
|
+
"upstream": {
|
|
136
|
+
"scheme": "https",
|
|
137
|
+
"address": "192.0.2.1",
|
|
138
|
+
"port": 8443
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"expected": {
|
|
143
|
+
"method": "POST",
|
|
144
|
+
"socket": "core.sock",
|
|
145
|
+
"path": "/platform/v1/proxy-hosts/owned"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"title": "owned host removal requires a revision",
|
|
150
|
+
"operation": "updateOwnedProxyHost",
|
|
151
|
+
"options": {
|
|
152
|
+
"idempotencyKey": "host-change-1",
|
|
153
|
+
"body": {
|
|
154
|
+
"action": "remove",
|
|
155
|
+
"hostId": "host-1",
|
|
156
|
+
"expectedRevision": null
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"title": "a probe batch names each host with a listed domain",
|
|
162
|
+
"operation": "probeUpstreams",
|
|
163
|
+
"options": {
|
|
164
|
+
"body": {
|
|
165
|
+
"probes": [
|
|
166
|
+
{
|
|
167
|
+
"hostId": "host-1",
|
|
168
|
+
"domain": "app.example.net",
|
|
169
|
+
"timeoutMs": 3000
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"hostId": "host-2",
|
|
173
|
+
"domain": "api.example.net",
|
|
174
|
+
"timeoutMs": 8000
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"expected": {
|
|
180
|
+
"method": "POST",
|
|
181
|
+
"socket": "core.sock",
|
|
182
|
+
"path": "/platform/v1/diagnostics/upstream/batch"
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"title": "a probe batch probes each host once",
|
|
187
|
+
"operation": "probeUpstreams",
|
|
188
|
+
"options": {
|
|
189
|
+
"body": {
|
|
190
|
+
"probes": [
|
|
191
|
+
{
|
|
192
|
+
"hostId": "host-1",
|
|
193
|
+
"domain": "app.example.net",
|
|
194
|
+
"timeoutMs": 3000
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"hostId": "host-1",
|
|
198
|
+
"domain": "www.example.net",
|
|
199
|
+
"timeoutMs": 3000
|
|
200
|
+
}
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"title": "an incident is set by its key with an idempotency key",
|
|
207
|
+
"operation": "setIncident",
|
|
208
|
+
"options": {
|
|
209
|
+
"pathParameter": "host-availability-host-1",
|
|
210
|
+
"idempotencyKey": "incident-1",
|
|
211
|
+
"body": {
|
|
212
|
+
"status": "open",
|
|
213
|
+
"category": "host-availability",
|
|
214
|
+
"severity": "error",
|
|
215
|
+
"title": "app.example.net is unreachable",
|
|
216
|
+
"message": "The upstream did not answer within 3 seconds after 3 checks.",
|
|
217
|
+
"resourceId": "host-1"
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"expected": {
|
|
221
|
+
"method": "POST",
|
|
222
|
+
"socket": "core.sock",
|
|
223
|
+
"path": "/platform/v1/incidents/host-availability-host-1"
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"title": "an incident change requires an idempotency key",
|
|
228
|
+
"operation": "setIncident",
|
|
229
|
+
"options": {
|
|
230
|
+
"pathParameter": "host-availability-host-1",
|
|
231
|
+
"body": {
|
|
232
|
+
"status": "resolved"
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"title": "an incident key cannot add URL syntax",
|
|
238
|
+
"operation": "setIncident",
|
|
239
|
+
"options": {
|
|
240
|
+
"pathParameter": "host/1",
|
|
241
|
+
"idempotencyKey": "incident-1",
|
|
242
|
+
"body": {
|
|
243
|
+
"status": "resolved"
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"title": "an app-owned operation accepts a nested JSON object",
|
|
249
|
+
"operation": "callAppApi",
|
|
250
|
+
"options": {
|
|
251
|
+
"pathParameter": "update-settings",
|
|
252
|
+
"idempotencyKey": "settings-1",
|
|
253
|
+
"body": { "items": [null, { "enabled": true, "count": 3 }] }
|
|
254
|
+
},
|
|
255
|
+
"expected": {
|
|
256
|
+
"method": "POST",
|
|
257
|
+
"socket": "app.sock",
|
|
258
|
+
"path": "/app/v1/api/update-settings"
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"title": "an app-owned operation requires a JSON object at the top level",
|
|
263
|
+
"operation": "callAppApi",
|
|
264
|
+
"options": {
|
|
265
|
+
"pathParameter": "update-settings",
|
|
266
|
+
"idempotencyKey": "settings-1",
|
|
267
|
+
"body": [null, { "enabled": true, "count": 3 }]
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"title": "a legacy handoff status names its domain in the path",
|
|
272
|
+
"operation": "getLegacyHandoff",
|
|
273
|
+
"options": { "pathParameter": "monitoring" },
|
|
274
|
+
"expected": {
|
|
275
|
+
"method": "GET",
|
|
276
|
+
"socket": "core.sock",
|
|
277
|
+
"path": "/platform/v1/legacy-handoffs/monitoring"
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"title": "a legacy handoff domain must be a provider profile",
|
|
282
|
+
"operation": "getLegacyHandoff",
|
|
283
|
+
"options": { "pathParameter": "proxy-hosts" }
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"title": "a legacy handoff domain cannot add URL syntax",
|
|
287
|
+
"operation": "getLegacyHandoff",
|
|
288
|
+
"options": { "pathParameter": "monitoring/begin" }
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"title": "a legacy handoff begins with an idempotency key and no body",
|
|
292
|
+
"operation": "beginLegacyHandoff",
|
|
293
|
+
"options": {
|
|
294
|
+
"pathParameter": "docker-discovery",
|
|
295
|
+
"idempotencyKey": "begin-1"
|
|
296
|
+
},
|
|
297
|
+
"expected": {
|
|
298
|
+
"method": "POST",
|
|
299
|
+
"socket": "core.sock",
|
|
300
|
+
"path": "/platform/v1/legacy-handoffs/docker-discovery/begin"
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"title": "a legacy handoff begin requires an idempotency key",
|
|
305
|
+
"operation": "beginLegacyHandoff",
|
|
306
|
+
"options": { "pathParameter": "docker-discovery" }
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"title": "a legacy handoff begin carries no body",
|
|
310
|
+
"operation": "beginLegacyHandoff",
|
|
311
|
+
"options": {
|
|
312
|
+
"pathParameter": "docker-discovery",
|
|
313
|
+
"idempotencyKey": "begin-1",
|
|
314
|
+
"body": {}
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"title": "a legacy handoff part is read by export digest and sequence",
|
|
319
|
+
"operation": "readLegacyHandoffPart",
|
|
320
|
+
"options": {
|
|
321
|
+
"pathParameter": "load-balancer",
|
|
322
|
+
"body": {
|
|
323
|
+
"digest": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
|
|
324
|
+
"sequence": 0
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
"expected": {
|
|
328
|
+
"method": "POST",
|
|
329
|
+
"socket": "core.sock",
|
|
330
|
+
"path": "/platform/v1/legacy-handoffs/load-balancer/parts"
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"title": "a legacy handoff part read is bound to an export digest",
|
|
335
|
+
"operation": "readLegacyHandoffPart",
|
|
336
|
+
"options": {
|
|
337
|
+
"pathParameter": "load-balancer",
|
|
338
|
+
"body": { "sequence": 0 }
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"title": "a legacy handoff part sequence stays within the journal",
|
|
343
|
+
"operation": "readLegacyHandoffPart",
|
|
344
|
+
"options": {
|
|
345
|
+
"pathParameter": "load-balancer",
|
|
346
|
+
"body": {
|
|
347
|
+
"digest": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
|
|
348
|
+
"sequence": 1024
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
"title": "a legacy handoff part request rejects unknown members",
|
|
354
|
+
"operation": "readLegacyHandoffPart",
|
|
355
|
+
"options": {
|
|
356
|
+
"pathParameter": "load-balancer",
|
|
357
|
+
"body": {
|
|
358
|
+
"digest": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
|
|
359
|
+
"sequence": 0,
|
|
360
|
+
"partCount": 2
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"title": "a legacy handoff part read takes no idempotency key",
|
|
366
|
+
"operation": "readLegacyHandoffPart",
|
|
367
|
+
"options": {
|
|
368
|
+
"pathParameter": "load-balancer",
|
|
369
|
+
"idempotencyKey": "part-1",
|
|
370
|
+
"body": {
|
|
371
|
+
"digest": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
|
|
372
|
+
"sequence": 0
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
"title": "a legacy handoff commits the exported digest",
|
|
378
|
+
"operation": "commitLegacyHandoff",
|
|
379
|
+
"options": {
|
|
380
|
+
"pathParameter": "crowdsec",
|
|
381
|
+
"idempotencyKey": "commit-1",
|
|
382
|
+
"body": {
|
|
383
|
+
"digest": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
"expected": {
|
|
387
|
+
"method": "POST",
|
|
388
|
+
"socket": "core.sock",
|
|
389
|
+
"path": "/platform/v1/legacy-handoffs/crowdsec/commit"
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
"title": "a legacy handoff commit rejects a malformed digest",
|
|
394
|
+
"operation": "commitLegacyHandoff",
|
|
395
|
+
"options": {
|
|
396
|
+
"pathParameter": "crowdsec",
|
|
397
|
+
"idempotencyKey": "commit-1",
|
|
398
|
+
"body": { "digest": "not-a-digest" }
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"title": "a legacy handoff commit rejects a domain outside the provider profiles",
|
|
403
|
+
"operation": "commitLegacyHandoff",
|
|
404
|
+
"options": {
|
|
405
|
+
"pathParameter": "crowdsec-bouncer",
|
|
406
|
+
"idempotencyKey": "commit-1",
|
|
407
|
+
"body": {
|
|
408
|
+
"digest": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
"title": "a legacy handoff commit requires an idempotency key",
|
|
414
|
+
"operation": "commitLegacyHandoff",
|
|
415
|
+
"options": {
|
|
416
|
+
"pathParameter": "crowdsec",
|
|
417
|
+
"body": {
|
|
418
|
+
"digest": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
],
|
|
423
|
+
"responses": [
|
|
424
|
+
{
|
|
425
|
+
"title": "readiness accepts compatible metadata",
|
|
426
|
+
"operation": "getAppReadiness",
|
|
427
|
+
"status": 200,
|
|
428
|
+
"body": {
|
|
429
|
+
"ready": true,
|
|
430
|
+
"protocolVersion": "1.0.0",
|
|
431
|
+
"providers": [],
|
|
432
|
+
"metadata": { "label": "fixture" }
|
|
433
|
+
},
|
|
434
|
+
"valid": true
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
"title": "readiness requires the declared JSON body",
|
|
438
|
+
"operation": "getAppReadiness",
|
|
439
|
+
"status": 200,
|
|
440
|
+
"valid": false
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"title": "cancellation returns an operation at its declared success status",
|
|
444
|
+
"operation": "cancelOperation",
|
|
445
|
+
"status": 202,
|
|
446
|
+
"body": { "id": "operation-1", "status": "cancelling" },
|
|
447
|
+
"valid": true
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
"title": "cancellation rejects a different success status",
|
|
451
|
+
"operation": "cancelOperation",
|
|
452
|
+
"status": 200,
|
|
453
|
+
"body": { "id": "operation-1", "status": "cancelling" },
|
|
454
|
+
"valid": false
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
"title": "an activation success carries no body",
|
|
458
|
+
"operation": "activateApp",
|
|
459
|
+
"status": 204,
|
|
460
|
+
"valid": true
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
"title": "an activation success rejects a null body",
|
|
464
|
+
"operation": "activateApp",
|
|
465
|
+
"status": 204,
|
|
466
|
+
"body": null,
|
|
467
|
+
"valid": false
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"title": "an event stream opens without a JSON body",
|
|
471
|
+
"operation": "subscribeToEvents",
|
|
472
|
+
"status": 200,
|
|
473
|
+
"valid": true
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
"title": "an event stream opening rejects a null body",
|
|
477
|
+
"operation": "subscribeToEvents",
|
|
478
|
+
"status": 200,
|
|
479
|
+
"body": null,
|
|
480
|
+
"valid": false
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
"title": "failure carries a matching problem status",
|
|
484
|
+
"operation": "subscribeToEvents",
|
|
485
|
+
"status": 410,
|
|
486
|
+
"body": {
|
|
487
|
+
"type": "urn:rentnerproxy:problem:cursorExpired",
|
|
488
|
+
"title": "The cursor expired",
|
|
489
|
+
"status": 410,
|
|
490
|
+
"code": "cursorExpired",
|
|
491
|
+
"requestId": "request-1"
|
|
492
|
+
},
|
|
493
|
+
"valid": true
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
"title": "failure rejects a mismatched problem status",
|
|
497
|
+
"operation": "subscribeToEvents",
|
|
498
|
+
"status": 403,
|
|
499
|
+
"body": {
|
|
500
|
+
"type": "urn:rentnerproxy:problem:cursorExpired",
|
|
501
|
+
"title": "The cursor expired",
|
|
502
|
+
"status": 410,
|
|
503
|
+
"code": "cursorExpired",
|
|
504
|
+
"requestId": "request-1"
|
|
505
|
+
},
|
|
506
|
+
"valid": false
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"title": "failure rejects an absent problem",
|
|
510
|
+
"operation": "getAppReadiness",
|
|
511
|
+
"status": 503,
|
|
512
|
+
"valid": false
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
"title": "failure rejects a mismatched problem type and code",
|
|
516
|
+
"operation": "getAppReadiness",
|
|
517
|
+
"status": 503,
|
|
518
|
+
"body": {
|
|
519
|
+
"type": "urn:rentnerproxy:problem:unavailable",
|
|
520
|
+
"title": "The app is unavailable",
|
|
521
|
+
"status": 503,
|
|
522
|
+
"code": "unexpectedCode",
|
|
523
|
+
"requestId": "request-1"
|
|
524
|
+
},
|
|
525
|
+
"valid": false
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
"title": "redirections are outside the operation contract",
|
|
529
|
+
"operation": "getAppReadiness",
|
|
530
|
+
"status": 302,
|
|
531
|
+
"valid": false
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"title": "a probe batch returns a stage result or an explicit outcome per host",
|
|
535
|
+
"operation": "probeUpstreams",
|
|
536
|
+
"status": 200,
|
|
537
|
+
"body": {
|
|
538
|
+
"results": [
|
|
539
|
+
{
|
|
540
|
+
"outcome": "probed",
|
|
541
|
+
"hostId": "host-1",
|
|
542
|
+
"domain": "app.example.net",
|
|
543
|
+
"probeRevision": "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae",
|
|
544
|
+
"durationMs": 42,
|
|
545
|
+
"httpStatus": 204,
|
|
546
|
+
"failure": null
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
"outcome": "probed",
|
|
550
|
+
"hostId": "host-2",
|
|
551
|
+
"domain": "api.example.net",
|
|
552
|
+
"probeRevision": "fcde2b2edba56bf408601fb721fe9b5c338d10ee429ea04fae5511b68fbf8fb9",
|
|
553
|
+
"durationMs": 8000,
|
|
554
|
+
"httpStatus": null,
|
|
555
|
+
"failure": {
|
|
556
|
+
"stage": "upstream",
|
|
557
|
+
"code": "upstream_timeout"
|
|
558
|
+
}
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
"outcome": "hostDisabled",
|
|
562
|
+
"hostId": "host-3",
|
|
563
|
+
"domain": "old.example.net"
|
|
564
|
+
}
|
|
565
|
+
]
|
|
566
|
+
},
|
|
567
|
+
"valid": true
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
"title": "a probe batch result rejects an unknown outcome",
|
|
571
|
+
"operation": "probeUpstreams",
|
|
572
|
+
"status": 200,
|
|
573
|
+
"body": {
|
|
574
|
+
"results": [
|
|
575
|
+
{
|
|
576
|
+
"outcome": "skipped",
|
|
577
|
+
"hostId": "host-1",
|
|
578
|
+
"domain": "app.example.net"
|
|
579
|
+
}
|
|
580
|
+
]
|
|
581
|
+
},
|
|
582
|
+
"valid": false
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
"title": "an incident change succeeds without a body",
|
|
586
|
+
"operation": "setIncident",
|
|
587
|
+
"status": 204,
|
|
588
|
+
"valid": true
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
"title": "a legacy handoff status reports platform ownership",
|
|
592
|
+
"operation": "getLegacyHandoff",
|
|
593
|
+
"status": 200,
|
|
594
|
+
"body": { "domain": "monitoring", "state": "platform" },
|
|
595
|
+
"valid": true
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
"title": "a legacy handoff status rejects an export digest under platform ownership",
|
|
599
|
+
"operation": "getLegacyHandoff",
|
|
600
|
+
"status": 200,
|
|
601
|
+
"body": {
|
|
602
|
+
"domain": "monitoring",
|
|
603
|
+
"state": "platform",
|
|
604
|
+
"digest": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
|
|
605
|
+
},
|
|
606
|
+
"valid": false
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
"title": "a legacy handoff status failure reports a stale generation",
|
|
610
|
+
"operation": "getLegacyHandoff",
|
|
611
|
+
"status": 401,
|
|
612
|
+
"body": {
|
|
613
|
+
"type": "urn:rentnerproxy:problem:unauthorized",
|
|
614
|
+
"title": "App API credential is invalid.",
|
|
615
|
+
"status": 401,
|
|
616
|
+
"code": "unauthorized",
|
|
617
|
+
"requestId": "request-1"
|
|
618
|
+
},
|
|
619
|
+
"valid": true
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
"title": "a legacy handoff begin returns the fixed export",
|
|
623
|
+
"operation": "beginLegacyHandoff",
|
|
624
|
+
"status": 200,
|
|
625
|
+
"body": {
|
|
626
|
+
"domain": "docker-discovery",
|
|
627
|
+
"state": "exported",
|
|
628
|
+
"digest": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
|
|
629
|
+
"partCount": 2
|
|
630
|
+
},
|
|
631
|
+
"valid": true
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
"title": "a legacy handoff begin rejects unknown members",
|
|
635
|
+
"operation": "beginLegacyHandoff",
|
|
636
|
+
"status": 200,
|
|
637
|
+
"body": {
|
|
638
|
+
"domain": "docker-discovery",
|
|
639
|
+
"state": "exported",
|
|
640
|
+
"digest": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
|
|
641
|
+
"partCount": 2,
|
|
642
|
+
"installationId": "install-1"
|
|
643
|
+
},
|
|
644
|
+
"valid": false
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
"title": "a legacy handoff begin after commit returns the committed digest",
|
|
648
|
+
"operation": "beginLegacyHandoff",
|
|
649
|
+
"status": 200,
|
|
650
|
+
"body": {
|
|
651
|
+
"domain": "docker-discovery",
|
|
652
|
+
"state": "committed",
|
|
653
|
+
"digest": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
|
|
654
|
+
},
|
|
655
|
+
"valid": true
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
"title": "a legacy handoff begin never succeeds with platform ownership",
|
|
659
|
+
"operation": "beginLegacyHandoff",
|
|
660
|
+
"status": 200,
|
|
661
|
+
"body": { "domain": "docker-discovery", "state": "platform" },
|
|
662
|
+
"valid": false
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
"title": "a legacy handoff begin reports another holder as a conflict",
|
|
666
|
+
"operation": "beginLegacyHandoff",
|
|
667
|
+
"status": 409,
|
|
668
|
+
"body": {
|
|
669
|
+
"type": "urn:rentnerproxy:problem:conflict",
|
|
670
|
+
"title": "App operation conflicts with current state.",
|
|
671
|
+
"status": 409,
|
|
672
|
+
"code": "conflict",
|
|
673
|
+
"requestId": "request-1"
|
|
674
|
+
},
|
|
675
|
+
"valid": true
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
"title": "a legacy handoff part returns its sequence and content",
|
|
679
|
+
"operation": "readLegacyHandoffPart",
|
|
680
|
+
"status": 200,
|
|
681
|
+
"body": {
|
|
682
|
+
"sequence": 1,
|
|
683
|
+
"part": { "monitors": [{ "id": "monitor-1" }] }
|
|
684
|
+
},
|
|
685
|
+
"valid": true
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
"title": "a legacy handoff part rejects a sequence beyond the journal",
|
|
689
|
+
"operation": "readLegacyHandoffPart",
|
|
690
|
+
"status": 200,
|
|
691
|
+
"body": { "sequence": 1024, "part": {} },
|
|
692
|
+
"valid": false
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
"title": "a legacy handoff part reports an unknown sequence",
|
|
696
|
+
"operation": "readLegacyHandoffPart",
|
|
697
|
+
"status": 404,
|
|
698
|
+
"body": {
|
|
699
|
+
"type": "urn:rentnerproxy:problem:notFound",
|
|
700
|
+
"title": "App resource is unavailable.",
|
|
701
|
+
"status": 404,
|
|
702
|
+
"code": "notFound",
|
|
703
|
+
"requestId": "request-1"
|
|
704
|
+
},
|
|
705
|
+
"valid": true
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
"title": "a legacy handoff part read of a replaced export is a conflict",
|
|
709
|
+
"operation": "readLegacyHandoffPart",
|
|
710
|
+
"status": 409,
|
|
711
|
+
"body": {
|
|
712
|
+
"type": "urn:rentnerproxy:problem:conflict",
|
|
713
|
+
"title": "App operation conflicts with current state.",
|
|
714
|
+
"status": 409,
|
|
715
|
+
"code": "conflict",
|
|
716
|
+
"requestId": "request-1"
|
|
717
|
+
},
|
|
718
|
+
"valid": true
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
"title": "a legacy handoff part reports an unreadable part",
|
|
722
|
+
"operation": "readLegacyHandoffPart",
|
|
723
|
+
"status": 503,
|
|
724
|
+
"body": {
|
|
725
|
+
"type": "urn:rentnerproxy:problem:unavailable",
|
|
726
|
+
"title": "App API is unavailable.",
|
|
727
|
+
"status": 503,
|
|
728
|
+
"code": "unavailable",
|
|
729
|
+
"requestId": "request-1"
|
|
730
|
+
},
|
|
731
|
+
"valid": true
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
"title": "a legacy handoff commit transfers ownership",
|
|
735
|
+
"operation": "commitLegacyHandoff",
|
|
736
|
+
"status": 200,
|
|
737
|
+
"body": {
|
|
738
|
+
"domain": "crowdsec",
|
|
739
|
+
"state": "committed",
|
|
740
|
+
"digest": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
|
|
741
|
+
},
|
|
742
|
+
"valid": true
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
"title": "a legacy handoff commit rejects a part count after ownership moved",
|
|
746
|
+
"operation": "commitLegacyHandoff",
|
|
747
|
+
"status": 200,
|
|
748
|
+
"body": {
|
|
749
|
+
"domain": "crowdsec",
|
|
750
|
+
"state": "committed",
|
|
751
|
+
"digest": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
|
|
752
|
+
"partCount": 2
|
|
753
|
+
},
|
|
754
|
+
"valid": false
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
"title": "a legacy handoff commit never succeeds with an open export",
|
|
758
|
+
"operation": "commitLegacyHandoff",
|
|
759
|
+
"status": 200,
|
|
760
|
+
"body": {
|
|
761
|
+
"domain": "crowdsec",
|
|
762
|
+
"state": "exported",
|
|
763
|
+
"digest": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
|
|
764
|
+
"partCount": 2
|
|
765
|
+
},
|
|
766
|
+
"valid": false
|
|
767
|
+
},
|
|
768
|
+
{
|
|
769
|
+
"title": "a legacy handoff commit rejects a domain outside the provider profiles",
|
|
770
|
+
"operation": "commitLegacyHandoff",
|
|
771
|
+
"status": 200,
|
|
772
|
+
"body": {
|
|
773
|
+
"domain": "proxy-hosts",
|
|
774
|
+
"state": "committed",
|
|
775
|
+
"digest": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
|
|
776
|
+
},
|
|
777
|
+
"valid": false
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
"title": "a legacy handoff commit reports a digest mismatch as a conflict",
|
|
781
|
+
"operation": "commitLegacyHandoff",
|
|
782
|
+
"status": 409,
|
|
783
|
+
"body": {
|
|
784
|
+
"type": "urn:rentnerproxy:problem:conflict",
|
|
785
|
+
"title": "App operation conflicts with current state.",
|
|
786
|
+
"status": 409,
|
|
787
|
+
"code": "conflict",
|
|
788
|
+
"requestId": "request-1"
|
|
789
|
+
},
|
|
790
|
+
"valid": true
|
|
791
|
+
}
|
|
792
|
+
],
|
|
793
|
+
"events": [
|
|
794
|
+
{
|
|
795
|
+
"title": "a decoded event validates against its own schema",
|
|
796
|
+
"operation": "subscribeToEvents",
|
|
797
|
+
"body": {
|
|
798
|
+
"id": "event-1",
|
|
799
|
+
"cursor": "Cursor_01",
|
|
800
|
+
"type": "proxyHostChanged",
|
|
801
|
+
"occurredAt": "2026-11-17T10:00:00.000Z",
|
|
802
|
+
"resourceId": "host-1",
|
|
803
|
+
"revision": "revision-1"
|
|
804
|
+
},
|
|
805
|
+
"valid": true
|
|
806
|
+
},
|
|
807
|
+
{
|
|
808
|
+
"title": "an event requires its resume cursor",
|
|
809
|
+
"operation": "subscribeToEvents",
|
|
810
|
+
"body": {
|
|
811
|
+
"id": "event-1",
|
|
812
|
+
"type": "proxyHostChanged",
|
|
813
|
+
"occurredAt": "2026-11-17T10:00:00.000Z"
|
|
814
|
+
},
|
|
815
|
+
"valid": false
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
"title": "a nonstreaming operation cannot validate events",
|
|
819
|
+
"operation": "getAppReadiness",
|
|
820
|
+
"body": {
|
|
821
|
+
"id": "event-1",
|
|
822
|
+
"cursor": "Cursor_01",
|
|
823
|
+
"type": "proxyHostChanged",
|
|
824
|
+
"occurredAt": "2026-11-17T10:00:00.000Z"
|
|
825
|
+
},
|
|
826
|
+
"valid": false
|
|
827
|
+
}
|
|
828
|
+
]
|
|
829
|
+
}
|