@radicaltools/cli 0.6.0 → 0.6.2
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/README.md +46 -7
- package/dist/{chunk-CWKX2ULF.js → chunk-5EK2V6G3.js} +1 -1
- package/dist/{dist-KTTOUFHF.js → dist-BJQ35APN.js} +2 -2
- package/dist/hub-catalogue/concern/concern-accessibility.radical +85 -1
- package/dist/hub-catalogue/concern/concern-api-collections.radical +78 -1
- package/dist/hub-catalogue/concern/concern-api-errors.radical +78 -1
- package/dist/hub-catalogue/concern/concern-api-evolution.radical +78 -1
- package/dist/hub-catalogue/concern/concern-api-idempotency.radical +121 -3
- package/dist/hub-catalogue/concern/concern-api-resource-design.radical +78 -1
- package/dist/hub-catalogue/concern/concern-api-style-guide.radical +78 -1
- package/dist/hub-catalogue/concern/concern-architecture-style.radical +83 -7
- package/dist/hub-catalogue/concern/concern-audit-trail.radical +77 -1
- package/dist/hub-catalogue/concern/concern-authentication.radical +178 -8
- package/dist/hub-catalogue/concern/concern-authorization.radical +133 -7
- package/dist/hub-catalogue/concern/concern-availability.radical +156 -6
- package/dist/hub-catalogue/concern/concern-backend-stack.radical +71 -8
- package/dist/hub-catalogue/concern/concern-backup-recovery.radical +136 -6
- package/dist/hub-catalogue/concern/concern-caching.radical +73 -1
- package/dist/hub-catalogue/concern/concern-capacity.radical +124 -5
- package/dist/hub-catalogue/concern/concern-ci-cd-pipeline.radical +154 -15
- package/dist/hub-catalogue/concern/concern-code-documentation.radical +131 -13
- package/dist/hub-catalogue/concern/concern-code-quality-gate.radical +116 -7
- package/dist/hub-catalogue/concern/concern-code-review-branching.radical +174 -13
- package/dist/hub-catalogue/concern/concern-code-style.radical +148 -16
- package/dist/hub-catalogue/concern/concern-communication-style.radical +94 -7
- package/dist/hub-catalogue/concern/concern-data-classification.radical +77 -1
- package/dist/hub-catalogue/concern/concern-data-consistency.radical +87 -5
- package/dist/hub-catalogue/concern/concern-data-store.radical +87 -5
- package/dist/hub-catalogue/concern/concern-decomposition.radical +78 -1
- package/dist/hub-catalogue/concern/concern-definition-of-done.radical +150 -11
- package/dist/hub-catalogue/concern/concern-delivery-metrics.radical +130 -5
- package/dist/hub-catalogue/concern/concern-dependency-hygiene.radical +127 -10
- package/dist/hub-catalogue/concern/concern-deployment.radical +113 -9
- package/dist/hub-catalogue/concern/concern-encryption.radical +146 -5
- package/dist/hub-catalogue/concern/concern-error-handling-logging.radical +118 -12
- package/dist/hub-catalogue/concern/concern-eu-dora.radical +69 -1
- package/dist/hub-catalogue/concern/concern-frontend-stack.radical +148 -9
- package/dist/hub-catalogue/concern/concern-incident-management.radical +122 -1
- package/dist/hub-catalogue/concern/concern-infrastructure.radical +54 -1
- package/dist/hub-catalogue/concern/concern-integration-resilience.radical +110 -5
- package/dist/hub-catalogue/concern/concern-messaging.radical +89 -2
- package/dist/hub-catalogue/concern/concern-mobile-performance.radical +67 -1
- package/dist/hub-catalogue/concern/concern-module-boundaries.radical +92 -5
- package/dist/hub-catalogue/concern/concern-observability.radical +105 -1
- package/dist/hub-catalogue/concern/concern-operational-readiness.radical +140 -5
- package/dist/hub-catalogue/concern/concern-personal-data.radical +206 -7
- package/dist/hub-catalogue/concern/concern-quality-priorities.radical +104 -12
- package/dist/hub-catalogue/concern/concern-rate-limiting.radical +110 -1
- package/dist/hub-catalogue/concern/concern-release-versioning.radical +99 -7
- package/dist/hub-catalogue/concern/concern-retention.radical +130 -9
- package/dist/hub-catalogue/concern/concern-secrets.radical +196 -12
- package/dist/hub-catalogue/concern/concern-secure-coding.radical +122 -1
- package/dist/hub-catalogue/concern/concern-secure-development.radical +118 -1
- package/dist/hub-catalogue/concern/concern-security-detection.radical +124 -1
- package/dist/hub-catalogue/concern/concern-supply-chain.radical +116 -1
- package/dist/hub-catalogue/concern/concern-technical-debt.radical +162 -19
- package/dist/hub-catalogue/concern/concern-technology-lifecycle.radical +152 -18
- package/dist/hub-catalogue/concern/concern-tenant-isolation.radical +111 -1
- package/dist/hub-catalogue/concern/concern-test-strategy.radical +83 -7
- package/dist/hub-catalogue/concern/concern-threat-modelling.radical +120 -1
- package/dist/hub-catalogue/concern/concern-usability.radical +84 -5
- package/dist/index.js +299 -100
- package/dist/{pdfjs-ABY3IR7F.js → pdfjs-4U3YUAVN.js} +1 -1
- package/dist/{undici-7Z7ZFI7Q.js → undici-7IHHEPSO.js} +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -275,7 +275,10 @@ the base Studio compares with follows the branch checked out, and then
|
|
|
275
275
|
`radical check <folder> --from-ci --quiet --detach`, which fetches the test
|
|
276
276
|
results of CI for the commit checked out in the background (a command of its
|
|
277
277
|
own, its output closed: a CLI built before `--from-ci` still saves the
|
|
278
|
-
base, and without the GitHub CLI nothing is fetched).
|
|
278
|
+
base, and without the GitHub CLI nothing is fetched). What it found, or why
|
|
279
|
+
it found nothing, is kept in the model folder's `.state/ci-fetch.json`, which
|
|
280
|
+
the Inspector and `radical setup --status` show; CI has to keep its test
|
|
281
|
+
reports as artifacts (see *Test results from CI*). The line goes
|
|
279
282
|
right after the hook's `#!` line, where an `exit` or `exec` further down
|
|
280
283
|
cannot skip it; what the hooks already do stays. Each model folder of the
|
|
281
284
|
repository has a line of its own, a second install adds nothing (or brings
|
|
@@ -512,14 +515,50 @@ test reports in it. Which artifacts hold reports is set in the repository's
|
|
|
512
515
|
{ "ci": { "artifacts": ["test-reports", "e2e-report"] } }
|
|
513
516
|
```
|
|
514
517
|
|
|
515
|
-
(every artifact of the run without it).
|
|
518
|
+
(every artifact of the run without it). **CI has to keep the reports as
|
|
519
|
+
artifacts of the run**: reports kept elsewhere (S3, say) are not found. A
|
|
520
|
+
GitHub Actions step after the tests:
|
|
521
|
+
|
|
522
|
+
```yaml
|
|
523
|
+
- uses: actions/upload-artifact@v4
|
|
524
|
+
if: always() # failed tests are results too
|
|
525
|
+
with:
|
|
526
|
+
name: test-reports # as "ci": { "artifacts": [...] } names it
|
|
527
|
+
path: reports/ # the Vitest/Jest/Playwright JSON or JUnit XML,
|
|
528
|
+
# and the radical sense --out files
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
The results are kept in
|
|
516
532
|
`.state/test-results.json` with the commit they stand for, the runs, when
|
|
517
533
|
each ran and how many commits HEAD is past it, which the Inspector's *Tests*
|
|
518
|
-
chip shows
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
534
|
+
chip shows (*· CI*, or *· local* for results read with `--report`); the same
|
|
535
|
+
runs a second time download nothing. Results read with `--report` at that
|
|
536
|
+
commit or a later one are kept, and checked. The `radical-metrics/1` files
|
|
537
|
+
in the artifacts (what `radical sense --out` wrote in CI) are added to
|
|
538
|
+
`.state/measurements.json` as `--metrics` adds them, each with the run and
|
|
539
|
+
commit in its context (`ci.run`, `ci.commit`), so metrics measured in CI
|
|
540
|
+
reach Studio too. `--quiet` prints nothing; `--detach` starts the check in
|
|
541
|
+
the background and returns, as the git hooks of `radical hooks install` do
|
|
542
|
+
after every checkout, commit, pull and rebase.
|
|
543
|
+
|
|
544
|
+
What each fetch found is kept in `.state/ci-fetch.json`, with `--quiet` too:
|
|
545
|
+
the runs and what was read, or why nothing was (no `gh`, no run with
|
|
546
|
+
artifacts, no test report in them). The Inspector marks its *Tests* chip
|
|
547
|
+
when the last fetch found no test results and says what it said, and
|
|
548
|
+
`radical setup --status` prints the last fetch.
|
|
549
|
+
|
|
550
|
+
### A check that keeps nothing
|
|
551
|
+
|
|
552
|
+
```sh
|
|
553
|
+
radical check path/to/model --report broken.json --no-keep
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
`--no-keep` reads the reports and measurements given and judges with them,
|
|
557
|
+
but writes nothing beside the model: neither `.state/test-results.json` nor
|
|
558
|
+
`.state/measurements.json` (nor, with `--from-ci`, `.state/ci-fetch.json`).
|
|
559
|
+
For a check used as a gate whose verdict Studio should not show, such as a
|
|
560
|
+
test of the gate on a deliberately broken report. `--evidence`, `--ratchet`
|
|
561
|
+
and `--adopt` still write the file they name.
|
|
523
562
|
|
|
524
563
|
### Measured values
|
|
525
564
|
|
|
@@ -16,7 +16,7 @@ var __commonJS = (cb, mod) => function __require2() {
|
|
|
16
16
|
var define_RADICAL_BUILD_default;
|
|
17
17
|
var init_define_RADICAL_BUILD = __esm({
|
|
18
18
|
"<define:__RADICAL_BUILD__>"() {
|
|
19
|
-
define_RADICAL_BUILD_default = { version: "0.6.
|
|
19
|
+
define_RADICAL_BUILD_default = { version: "0.6.2", commit: "35090d3", date: "2026-11-30", release: true };
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_define_RADICAL_BUILD
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5EK2V6G3.js";
|
|
4
4
|
|
|
5
5
|
// ../../packages/assay/node_modules/unpdf/dist/index.mjs
|
|
6
6
|
init_define_RADICAL_BUILD();
|
|
@@ -41,7 +41,7 @@ async function resolvePDFJSImports(pdfjsResolver, { force = false } = {}) {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
try {
|
|
44
|
-
const { resolvePDFJS } = await import("./pdfjs-
|
|
44
|
+
const { resolvePDFJS } = await import("./pdfjs-4U3YUAVN.js");
|
|
45
45
|
resolvedModule = await resolvePDFJS();
|
|
46
46
|
} catch (error) {
|
|
47
47
|
console.error(error);
|
|
@@ -21,7 +21,91 @@
|
|
|
21
21
|
"trigger": "LIST RELATIONS WHERE source.type = \"person\" AND target.type = \"webapp\" AND target.external != true",
|
|
22
22
|
"applyTo": "target",
|
|
23
23
|
"why": "people use these web front ends, so the accessibility level they conform to, the law they answer to, and how that is tested and stated has to be decided.",
|
|
24
|
-
"group": "ux"
|
|
24
|
+
"group": "ux",
|
|
25
|
+
"scope": {
|
|
26
|
+
"group": "ux",
|
|
27
|
+
"questions": [
|
|
28
|
+
{
|
|
29
|
+
"key": "USERS",
|
|
30
|
+
"label": "Who uses its screens?",
|
|
31
|
+
"default": "staff",
|
|
32
|
+
"hint": "Consumers include people with disabilities and older devices the organisation does not choose.",
|
|
33
|
+
"options": [
|
|
34
|
+
{
|
|
35
|
+
"value": "staff",
|
|
36
|
+
"label": "our staff",
|
|
37
|
+
"description": "Only people who work for the organisation."
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"value": "consumers",
|
|
41
|
+
"label": "customers or the public",
|
|
42
|
+
"description": "Customers, citizens or anyone else outside the organisation."
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"key": "ACCESSIBILITY_LAW",
|
|
48
|
+
"label": "Does a law require it to be accessible?",
|
|
49
|
+
"default": "no",
|
|
50
|
+
"hint": "The European Accessibility Act covers consumer e-commerce and banking from June 2025; public bodies fall under the Web Accessibility Directive.",
|
|
51
|
+
"options": [
|
|
52
|
+
{
|
|
53
|
+
"value": "no",
|
|
54
|
+
"label": "no",
|
|
55
|
+
"description": "No accessibility law applies to it."
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"value": "yes",
|
|
59
|
+
"label": "yes",
|
|
60
|
+
"description": "A public body, or a consumer service under the European Accessibility Act or a like law."
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"key": "MOBILE",
|
|
66
|
+
"label": "Is it used on phones?",
|
|
67
|
+
"default": "rarely",
|
|
68
|
+
"hint": "Phones on slow networks make load time and responsiveness felt.",
|
|
69
|
+
"options": [
|
|
70
|
+
{
|
|
71
|
+
"value": "rarely",
|
|
72
|
+
"label": "rarely",
|
|
73
|
+
"description": "Mostly on desktop computers."
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"value": "phones",
|
|
77
|
+
"label": "often or mostly",
|
|
78
|
+
"description": "Many people use it on phones or tablets."
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"when": [
|
|
84
|
+
{
|
|
85
|
+
"USERS": [
|
|
86
|
+
"consumers"
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"ACCESSIBILITY_LAW": [
|
|
91
|
+
"yes"
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
"scopeAnswers": [
|
|
97
|
+
{
|
|
98
|
+
"when": {
|
|
99
|
+
"ACCESSIBILITY_LAW": [
|
|
100
|
+
"no"
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
"answers": {
|
|
104
|
+
"AT_TESTING": "automated",
|
|
105
|
+
"STATEMENT": "none"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
]
|
|
25
109
|
},
|
|
26
110
|
"sources": [
|
|
27
111
|
{
|
|
@@ -18,7 +18,84 @@
|
|
|
18
18
|
"trigger": "LIST RELATIONS WHERE source.type != \"person\" AND target.external != true AND (target.type = \"container\" OR target.type = \"component\")",
|
|
19
19
|
"applyTo": "target",
|
|
20
20
|
"why": "other parts and systems call these elements, so how their APIs return lists has to be decided.",
|
|
21
|
-
"group": "api"
|
|
21
|
+
"group": "api",
|
|
22
|
+
"scope": {
|
|
23
|
+
"group": "api",
|
|
24
|
+
"questions": [
|
|
25
|
+
{
|
|
26
|
+
"key": "CALLERS",
|
|
27
|
+
"label": "Who calls its APIs?",
|
|
28
|
+
"default": "own",
|
|
29
|
+
"hint": "An API only our own front end calls can change with it; partners and the public hold us to what we published.",
|
|
30
|
+
"options": [
|
|
31
|
+
{
|
|
32
|
+
"value": "own",
|
|
33
|
+
"label": "only our own front ends",
|
|
34
|
+
"description": "Our own web or mobile app is the only caller, released together with the API."
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"value": "partners",
|
|
38
|
+
"label": "partners we know",
|
|
39
|
+
"description": "Systems of partners or other departments call it, under an agreement."
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"value": "public",
|
|
43
|
+
"label": "anyone",
|
|
44
|
+
"description": "A public API that anyone may sign up for and call."
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"key": "LIFETIME",
|
|
50
|
+
"label": "Do callers move to a new version with us?",
|
|
51
|
+
"default": "together",
|
|
52
|
+
"hint": "Callers that stay on an old version need versioning and deprecation rules.",
|
|
53
|
+
"options": [
|
|
54
|
+
{
|
|
55
|
+
"value": "together",
|
|
56
|
+
"label": "yes, together",
|
|
57
|
+
"description": "Every caller is updated when the API changes."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"value": "old",
|
|
61
|
+
"label": "no, some stay on old versions",
|
|
62
|
+
"description": "Some callers (apps people do not update, partners) keep calling an older version for months."
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"key": "TEAMS",
|
|
68
|
+
"label": "How many teams build its APIs?",
|
|
69
|
+
"default": "one",
|
|
70
|
+
"hint": "Several teams need a shared style guide so the APIs look like one.",
|
|
71
|
+
"options": [
|
|
72
|
+
{
|
|
73
|
+
"value": "one",
|
|
74
|
+
"label": "one team",
|
|
75
|
+
"description": "One team designs every API."
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"value": "several",
|
|
79
|
+
"label": "several teams",
|
|
80
|
+
"description": "Several teams each design some of the APIs."
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"when": [
|
|
86
|
+
{
|
|
87
|
+
"CALLERS": [
|
|
88
|
+
"partners",
|
|
89
|
+
"public"
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"TEAMS": [
|
|
94
|
+
"several"
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
22
99
|
},
|
|
23
100
|
"sources": [
|
|
24
101
|
{
|
|
@@ -18,7 +18,84 @@
|
|
|
18
18
|
"trigger": "LIST RELATIONS WHERE source.type != \"person\" AND target.external != true AND (target.type = \"container\" OR target.type = \"component\")",
|
|
19
19
|
"applyTo": "target",
|
|
20
20
|
"why": "other parts of the system or other systems call these elements, so what an error looks like to a caller has to be decided once for every operation they offer.",
|
|
21
|
-
"group": "api"
|
|
21
|
+
"group": "api",
|
|
22
|
+
"scope": {
|
|
23
|
+
"group": "api",
|
|
24
|
+
"questions": [
|
|
25
|
+
{
|
|
26
|
+
"key": "CALLERS",
|
|
27
|
+
"label": "Who calls its APIs?",
|
|
28
|
+
"default": "own",
|
|
29
|
+
"hint": "An API only our own front end calls can change with it; partners and the public hold us to what we published.",
|
|
30
|
+
"options": [
|
|
31
|
+
{
|
|
32
|
+
"value": "own",
|
|
33
|
+
"label": "only our own front ends",
|
|
34
|
+
"description": "Our own web or mobile app is the only caller, released together with the API."
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"value": "partners",
|
|
38
|
+
"label": "partners we know",
|
|
39
|
+
"description": "Systems of partners or other departments call it, under an agreement."
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"value": "public",
|
|
43
|
+
"label": "anyone",
|
|
44
|
+
"description": "A public API that anyone may sign up for and call."
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"key": "LIFETIME",
|
|
50
|
+
"label": "Do callers move to a new version with us?",
|
|
51
|
+
"default": "together",
|
|
52
|
+
"hint": "Callers that stay on an old version need versioning and deprecation rules.",
|
|
53
|
+
"options": [
|
|
54
|
+
{
|
|
55
|
+
"value": "together",
|
|
56
|
+
"label": "yes, together",
|
|
57
|
+
"description": "Every caller is updated when the API changes."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"value": "old",
|
|
61
|
+
"label": "no, some stay on old versions",
|
|
62
|
+
"description": "Some callers (apps people do not update, partners) keep calling an older version for months."
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"key": "TEAMS",
|
|
68
|
+
"label": "How many teams build its APIs?",
|
|
69
|
+
"default": "one",
|
|
70
|
+
"hint": "Several teams need a shared style guide so the APIs look like one.",
|
|
71
|
+
"options": [
|
|
72
|
+
{
|
|
73
|
+
"value": "one",
|
|
74
|
+
"label": "one team",
|
|
75
|
+
"description": "One team designs every API."
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"value": "several",
|
|
79
|
+
"label": "several teams",
|
|
80
|
+
"description": "Several teams each design some of the APIs."
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"when": [
|
|
86
|
+
{
|
|
87
|
+
"CALLERS": [
|
|
88
|
+
"partners",
|
|
89
|
+
"public"
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"TEAMS": [
|
|
94
|
+
"several"
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
22
99
|
},
|
|
23
100
|
"sources": [
|
|
24
101
|
{
|
|
@@ -18,7 +18,84 @@
|
|
|
18
18
|
"trigger": "LIST RELATIONS WHERE source.external = true AND target.external != true AND (target.type = \"system\" OR target.type = \"container\" OR target.type = \"webapp\" OR target.type = \"component\")",
|
|
19
19
|
"applyTo": "target",
|
|
20
20
|
"why": "systems outside yours call these elements, so how their API may change without breaking them has to be decided.",
|
|
21
|
-
"group": "api"
|
|
21
|
+
"group": "api",
|
|
22
|
+
"scope": {
|
|
23
|
+
"group": "api",
|
|
24
|
+
"questions": [
|
|
25
|
+
{
|
|
26
|
+
"key": "CALLERS",
|
|
27
|
+
"label": "Who calls its APIs?",
|
|
28
|
+
"default": "own",
|
|
29
|
+
"hint": "An API only our own front end calls can change with it; partners and the public hold us to what we published.",
|
|
30
|
+
"options": [
|
|
31
|
+
{
|
|
32
|
+
"value": "own",
|
|
33
|
+
"label": "only our own front ends",
|
|
34
|
+
"description": "Our own web or mobile app is the only caller, released together with the API."
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"value": "partners",
|
|
38
|
+
"label": "partners we know",
|
|
39
|
+
"description": "Systems of partners or other departments call it, under an agreement."
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"value": "public",
|
|
43
|
+
"label": "anyone",
|
|
44
|
+
"description": "A public API that anyone may sign up for and call."
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"key": "LIFETIME",
|
|
50
|
+
"label": "Do callers move to a new version with us?",
|
|
51
|
+
"default": "together",
|
|
52
|
+
"hint": "Callers that stay on an old version need versioning and deprecation rules.",
|
|
53
|
+
"options": [
|
|
54
|
+
{
|
|
55
|
+
"value": "together",
|
|
56
|
+
"label": "yes, together",
|
|
57
|
+
"description": "Every caller is updated when the API changes."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"value": "old",
|
|
61
|
+
"label": "no, some stay on old versions",
|
|
62
|
+
"description": "Some callers (apps people do not update, partners) keep calling an older version for months."
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"key": "TEAMS",
|
|
68
|
+
"label": "How many teams build its APIs?",
|
|
69
|
+
"default": "one",
|
|
70
|
+
"hint": "Several teams need a shared style guide so the APIs look like one.",
|
|
71
|
+
"options": [
|
|
72
|
+
{
|
|
73
|
+
"value": "one",
|
|
74
|
+
"label": "one team",
|
|
75
|
+
"description": "One team designs every API."
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"value": "several",
|
|
79
|
+
"label": "several teams",
|
|
80
|
+
"description": "Several teams each design some of the APIs."
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"when": [
|
|
86
|
+
{
|
|
87
|
+
"CALLERS": [
|
|
88
|
+
"partners",
|
|
89
|
+
"public"
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"LIFETIME": [
|
|
94
|
+
"old"
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
22
99
|
},
|
|
23
100
|
"sources": [
|
|
24
101
|
{
|
|
@@ -18,7 +18,71 @@
|
|
|
18
18
|
"trigger": "LIST RELATIONS WHERE source.type != \"person\" AND target.external != true AND (target.type = \"container\" OR target.type = \"component\")",
|
|
19
19
|
"applyTo": "target",
|
|
20
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"
|
|
21
|
+
"group": "api",
|
|
22
|
+
"scope": {
|
|
23
|
+
"group": "api",
|
|
24
|
+
"questions": [
|
|
25
|
+
{
|
|
26
|
+
"key": "CALLERS",
|
|
27
|
+
"label": "Who calls its APIs?",
|
|
28
|
+
"default": "own",
|
|
29
|
+
"hint": "An API only our own front end calls can change with it; partners and the public hold us to what we published.",
|
|
30
|
+
"options": [
|
|
31
|
+
{
|
|
32
|
+
"value": "own",
|
|
33
|
+
"label": "only our own front ends",
|
|
34
|
+
"description": "Our own web or mobile app is the only caller, released together with the API."
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"value": "partners",
|
|
38
|
+
"label": "partners we know",
|
|
39
|
+
"description": "Systems of partners or other departments call it, under an agreement."
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"value": "public",
|
|
43
|
+
"label": "anyone",
|
|
44
|
+
"description": "A public API that anyone may sign up for and call."
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"key": "LIFETIME",
|
|
50
|
+
"label": "Do callers move to a new version with us?",
|
|
51
|
+
"default": "together",
|
|
52
|
+
"hint": "Callers that stay on an old version need versioning and deprecation rules.",
|
|
53
|
+
"options": [
|
|
54
|
+
{
|
|
55
|
+
"value": "together",
|
|
56
|
+
"label": "yes, together",
|
|
57
|
+
"description": "Every caller is updated when the API changes."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"value": "old",
|
|
61
|
+
"label": "no, some stay on old versions",
|
|
62
|
+
"description": "Some callers (apps people do not update, partners) keep calling an older version for months."
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"key": "TEAMS",
|
|
68
|
+
"label": "How many teams build its APIs?",
|
|
69
|
+
"default": "one",
|
|
70
|
+
"hint": "Several teams need a shared style guide so the APIs look like one.",
|
|
71
|
+
"options": [
|
|
72
|
+
{
|
|
73
|
+
"value": "one",
|
|
74
|
+
"label": "one team",
|
|
75
|
+
"description": "One team designs every API."
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"value": "several",
|
|
79
|
+
"label": "several teams",
|
|
80
|
+
"description": "Several teams each design some of the APIs."
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
22
86
|
},
|
|
23
87
|
"sources": [
|
|
24
88
|
{
|
|
@@ -100,7 +164,13 @@
|
|
|
100
164
|
"label": "a shared Redis with an expiry on every key",
|
|
101
165
|
"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
166
|
}
|
|
103
|
-
]
|
|
167
|
+
],
|
|
168
|
+
"scopeWhen": {
|
|
169
|
+
"CALLERS": [
|
|
170
|
+
"partners",
|
|
171
|
+
"public"
|
|
172
|
+
]
|
|
173
|
+
}
|
|
104
174
|
},
|
|
105
175
|
{
|
|
106
176
|
"key": "CONCURRENCY",
|
|
@@ -180,6 +250,10 @@
|
|
|
180
250
|
"hubWhen": {
|
|
181
251
|
"IDEMPOTENCY": [
|
|
182
252
|
"key"
|
|
253
|
+
],
|
|
254
|
+
"STORE": [
|
|
255
|
+
"database",
|
|
256
|
+
"redis"
|
|
183
257
|
]
|
|
184
258
|
}
|
|
185
259
|
},
|
|
@@ -196,6 +270,10 @@
|
|
|
196
270
|
"hubWhen": {
|
|
197
271
|
"IDEMPOTENCY": [
|
|
198
272
|
"key"
|
|
273
|
+
],
|
|
274
|
+
"STORE": [
|
|
275
|
+
"database",
|
|
276
|
+
"redis"
|
|
199
277
|
]
|
|
200
278
|
}
|
|
201
279
|
},
|
|
@@ -212,6 +290,10 @@
|
|
|
212
290
|
"hubWhen": {
|
|
213
291
|
"IDEMPOTENCY": [
|
|
214
292
|
"key"
|
|
293
|
+
],
|
|
294
|
+
"STORE": [
|
|
295
|
+
"database",
|
|
296
|
+
"redis"
|
|
215
297
|
]
|
|
216
298
|
}
|
|
217
299
|
},
|
|
@@ -227,6 +309,10 @@
|
|
|
227
309
|
"hubWhen": {
|
|
228
310
|
"IDEMPOTENCY": [
|
|
229
311
|
"key"
|
|
312
|
+
],
|
|
313
|
+
"STORE": [
|
|
314
|
+
"database",
|
|
315
|
+
"redis"
|
|
230
316
|
]
|
|
231
317
|
}
|
|
232
318
|
},
|
|
@@ -341,6 +427,10 @@
|
|
|
341
427
|
"hubWhen": {
|
|
342
428
|
"CONCURRENCY": [
|
|
343
429
|
"etag"
|
|
430
|
+
],
|
|
431
|
+
"STORE": [
|
|
432
|
+
"database",
|
|
433
|
+
"redis"
|
|
344
434
|
]
|
|
345
435
|
}
|
|
346
436
|
},
|
|
@@ -402,6 +492,10 @@
|
|
|
402
492
|
"hubWhen": {
|
|
403
493
|
"IDEMPOTENCY": [
|
|
404
494
|
"key"
|
|
495
|
+
],
|
|
496
|
+
"STORE": [
|
|
497
|
+
"database",
|
|
498
|
+
"redis"
|
|
405
499
|
]
|
|
406
500
|
}
|
|
407
501
|
},
|
|
@@ -417,6 +511,10 @@
|
|
|
417
511
|
"hubWhen": {
|
|
418
512
|
"IDEMPOTENCY": [
|
|
419
513
|
"key"
|
|
514
|
+
],
|
|
515
|
+
"STORE": [
|
|
516
|
+
"database",
|
|
517
|
+
"redis"
|
|
420
518
|
]
|
|
421
519
|
}
|
|
422
520
|
},
|
|
@@ -432,6 +530,10 @@
|
|
|
432
530
|
"hubWhen": {
|
|
433
531
|
"IDEMPOTENCY": [
|
|
434
532
|
"key"
|
|
533
|
+
],
|
|
534
|
+
"STORE": [
|
|
535
|
+
"database",
|
|
536
|
+
"redis"
|
|
435
537
|
]
|
|
436
538
|
}
|
|
437
539
|
},
|
|
@@ -447,6 +549,10 @@
|
|
|
447
549
|
"hubWhen": {
|
|
448
550
|
"IDEMPOTENCY": [
|
|
449
551
|
"key"
|
|
552
|
+
],
|
|
553
|
+
"STORE": [
|
|
554
|
+
"database",
|
|
555
|
+
"redis"
|
|
450
556
|
]
|
|
451
557
|
}
|
|
452
558
|
},
|
|
@@ -558,6 +664,10 @@
|
|
|
558
664
|
"hubWhen": {
|
|
559
665
|
"CONCURRENCY": [
|
|
560
666
|
"etag"
|
|
667
|
+
],
|
|
668
|
+
"STORE": [
|
|
669
|
+
"database",
|
|
670
|
+
"redis"
|
|
561
671
|
]
|
|
562
672
|
}
|
|
563
673
|
},
|
|
@@ -601,7 +711,7 @@
|
|
|
601
711
|
"status": "accepted",
|
|
602
712
|
"date": "",
|
|
603
713
|
"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.
|
|
714
|
+
"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. 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
715
|
"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
716
|
"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
717
|
"hubWhen": {
|
|
@@ -782,6 +892,10 @@
|
|
|
782
892
|
"hubWhen": {
|
|
783
893
|
"IDEMPOTENCY": [
|
|
784
894
|
"key"
|
|
895
|
+
],
|
|
896
|
+
"STORE": [
|
|
897
|
+
"database",
|
|
898
|
+
"redis"
|
|
785
899
|
]
|
|
786
900
|
}
|
|
787
901
|
},
|
|
@@ -800,6 +914,10 @@
|
|
|
800
914
|
"hubWhen": {
|
|
801
915
|
"IDEMPOTENCY": [
|
|
802
916
|
"key"
|
|
917
|
+
],
|
|
918
|
+
"STORE": [
|
|
919
|
+
"database",
|
|
920
|
+
"redis"
|
|
803
921
|
]
|
|
804
922
|
}
|
|
805
923
|
},
|