@substrat-run/control-plane-api 0.160.0 → 0.162.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/dist/api.d.ts +8 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +142 -9
- package/dist/api.js.map +1 -1
- package/dist/cf-observability.d.ts.map +1 -1
- package/dist/cf-observability.js +31 -8
- package/dist/cf-observability.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/observability.d.ts +6 -2
- package/dist/observability.d.ts.map +1 -1
- package/dist/observability.js +1 -1
- package/dist/observability.js.map +1 -1
- package/dist/platform-drain.d.ts +26 -2
- package/dist/platform-drain.d.ts.map +1 -1
- package/dist/platform-drain.js +203 -88
- package/dist/platform-drain.js.map +1 -1
- package/dist/platform-wire.d.ts +2 -1
- package/dist/platform-wire.d.ts.map +1 -1
- package/dist/platform-wire.js +23 -3
- package/dist/platform-wire.js.map +1 -1
- package/dist/scope-copy-cleanup.js +1 -1
- package/dist/scope-copy-cleanup.js.map +1 -1
- package/dist/vertical-client.d.ts +58 -2
- package/dist/vertical-client.d.ts.map +1 -1
- package/dist/vertical-client.js +224 -21
- package/dist/vertical-client.js.map +1 -1
- package/dist/wire-readiness.d.ts +149 -0
- package/dist/wire-readiness.d.ts.map +1 -0
- package/dist/wire-readiness.js +250 -0
- package/dist/wire-readiness.js.map +1 -0
- package/dist/wire-settings.d.ts +77 -0
- package/dist/wire-settings.d.ts.map +1 -0
- package/dist/wire-settings.js +155 -0
- package/dist/wire-settings.js.map +1 -0
- package/dist/wire-upload.d.ts +26 -0
- package/dist/wire-upload.d.ts.map +1 -1
- package/dist/wire-upload.js +29 -2
- package/dist/wire-upload.js.map +1 -1
- package/dist/wire-walk.d.ts +161 -0
- package/dist/wire-walk.d.ts.map +1 -0
- package/dist/wire-walk.js +345 -0
- package/dist/wire-walk.js.map +1 -0
- package/package.json +8 -8
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The fleet walk's one write (RFC wire-signing follow-on 4): bring a deployed script's four
|
|
3
|
+
* `SUBSTRAT_WIRE_*` settings to what the control plane gives now, through the namespace's
|
|
4
|
+
* script-settings endpoint, without uploading the script again.
|
|
5
|
+
*
|
|
6
|
+
* Only those four are ever changed. Every other binding goes back exactly as it was read, and a
|
|
7
|
+
* secret is never read back at all: the endpoint answers a secret's name and type without its value,
|
|
8
|
+
* so secrets ride `keep_bindings`, as the store patcher's do (`createWfpBindingsPatcher`). Nothing
|
|
9
|
+
* here logs, stores or echoes a binding's value; a failure names the script, the status, and binding
|
|
10
|
+
* NAMES only.
|
|
11
|
+
*
|
|
12
|
+
* It writes nothing when the four already match. Otherwise it re-reads before it writes and verifies
|
|
13
|
+
* after.
|
|
14
|
+
*
|
|
15
|
+
* A script's bindings are also written by its uploads and by a store attached to one of its scopes.
|
|
16
|
+
* The walk is not run while a push or promote of the same vertical is in flight, and every walk ends
|
|
17
|
+
* with a confirming pass, which is mandatory.
|
|
18
|
+
*/
|
|
19
|
+
import { WIRE_AUDIENCE_VAR, WIRE_PLATFORM_KEYS_VAR, WIRE_ROUTER_KEYS_VAR, WIRE_STATE_VAR } from '@substrat-run/contracts/wire-signing';
|
|
20
|
+
/** The four settings the walk owns, and no other. */
|
|
21
|
+
const WIRE_SETTING_NAMES = Object.freeze([WIRE_ROUTER_KEYS_VAR, WIRE_PLATFORM_KEYS_VAR, WIRE_AUDIENCE_VAR, WIRE_STATE_VAR]);
|
|
22
|
+
const OWNED = new Set(WIRE_SETTING_NAMES);
|
|
23
|
+
/** Binding types whose values the endpoint never returns: carried by `keep_bindings`, never sent. */
|
|
24
|
+
export const SECRET_BINDING_TYPES = Object.freeze(['secret_text', 'secret_key']);
|
|
25
|
+
const SECRET = new Set(SECRET_BINDING_TYPES);
|
|
26
|
+
/** The version a script runs, as its upload injected it (#1242). */
|
|
27
|
+
export const VERSION_ID_VAR = 'SUBSTRAT_VERSION_ID';
|
|
28
|
+
/** How many times a change between the two reads is retried from the newer read. */
|
|
29
|
+
export const CONCURRENT_RETRIES = 3;
|
|
30
|
+
/** A binding's identity: its type and name. Two bindings of one name and different types are two. */
|
|
31
|
+
const keyOf = (b) => `${b.type}:${b.name}`;
|
|
32
|
+
/** The plain-text value of one of the four, or `undefined` when the script does not carry it as plain text. */
|
|
33
|
+
function plainText(bindings, name) {
|
|
34
|
+
const b = bindings.find((x) => x.name === name);
|
|
35
|
+
return b && b.type === 'plain_text' && typeof b['text'] === 'string' ? b['text'] : undefined;
|
|
36
|
+
}
|
|
37
|
+
/** The names among the four whose value (or presence, or type) differs from what is wanted. */
|
|
38
|
+
export function wireSettingsChanges(bindings, wanted) {
|
|
39
|
+
const want = new Map(wanted.map((w) => [w.name, w.text]));
|
|
40
|
+
const changes = [];
|
|
41
|
+
for (const name of WIRE_SETTING_NAMES) {
|
|
42
|
+
const present = bindings.filter((b) => b.name === name);
|
|
43
|
+
const text = want.get(name);
|
|
44
|
+
if (text === undefined ? present.length > 0 : present.length !== 1 || plainText(bindings, name) !== text)
|
|
45
|
+
changes.push(name);
|
|
46
|
+
}
|
|
47
|
+
return changes;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* A comparable form of what was read: every binding by identity, a non-secret one with all its
|
|
51
|
+
* fields, a secret one by name and type alone (its value is never in the answer, and never used).
|
|
52
|
+
*/
|
|
53
|
+
function snapshot(bindings) {
|
|
54
|
+
const out = new Map();
|
|
55
|
+
for (const b of bindings) {
|
|
56
|
+
out.set(keyOf(b), SECRET.has(b.type) ? '' : JSON.stringify(Object.keys(b).sort().map((k) => [k, b[k]])));
|
|
57
|
+
}
|
|
58
|
+
return out;
|
|
59
|
+
}
|
|
60
|
+
const sameSnapshot = (a, b) => a.size === b.size && [...a].every(([k, v]) => b.get(k) === v);
|
|
61
|
+
/** The binding names whose snapshot differs between two reads, a name once. */
|
|
62
|
+
function differingNames(before, after) {
|
|
63
|
+
const names = new Set();
|
|
64
|
+
for (const [k, v] of before)
|
|
65
|
+
if (after.get(k) !== v)
|
|
66
|
+
names.add(k.slice(k.indexOf(':') + 1));
|
|
67
|
+
for (const k of after.keys())
|
|
68
|
+
if (!before.has(k))
|
|
69
|
+
names.add(k.slice(k.indexOf(':') + 1));
|
|
70
|
+
return [...names].sort();
|
|
71
|
+
}
|
|
72
|
+
/** The write body: every non-secret binding as read but the four, then the four as wanted. */
|
|
73
|
+
function bodyOf(bindings, wanted) {
|
|
74
|
+
return {
|
|
75
|
+
bindings: [
|
|
76
|
+
...bindings.filter((b) => !SECRET.has(b.type) && !OWNED.has(b.name)),
|
|
77
|
+
...wanted.map((w) => ({ type: 'plain_text', name: w.name, text: w.text })),
|
|
78
|
+
],
|
|
79
|
+
keep_bindings: SECRET_BINDING_TYPES,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Bring `script`'s four settings to `wanted` (all four, or none to withdraw them). With `apply`
|
|
84
|
+
* false it only reads: the write is unreachable. With `servedVersion`, the script is a serving
|
|
85
|
+
* script and that is the version the directory says it serves; `servedVersionAfter` reads the
|
|
86
|
+
* directory again after the write.
|
|
87
|
+
*/
|
|
88
|
+
export async function applyWireSettings(api, script, wanted, opts) {
|
|
89
|
+
const servesOther = (bindings) => opts.servedVersion !== undefined && plainText(bindings, VERSION_ID_VAR) !== opts.servedVersion;
|
|
90
|
+
let current = await api.read(script);
|
|
91
|
+
if (servesOther(current))
|
|
92
|
+
return { outcome: 'serve-in-flight', written: false };
|
|
93
|
+
let changes = wireSettingsChanges(current, wanted);
|
|
94
|
+
if (changes.length === 0)
|
|
95
|
+
return { outcome: 'unchanged' };
|
|
96
|
+
if (!opts.apply)
|
|
97
|
+
return { outcome: 'would-change', changes };
|
|
98
|
+
for (let attempt = 1;; attempt++) {
|
|
99
|
+
const again = await api.read(script);
|
|
100
|
+
if (sameSnapshot(snapshot(current), snapshot(again)))
|
|
101
|
+
break;
|
|
102
|
+
if (attempt >= CONCURRENT_RETRIES)
|
|
103
|
+
return { outcome: 'concurrent-change' };
|
|
104
|
+
current = again;
|
|
105
|
+
if (servesOther(current))
|
|
106
|
+
return { outcome: 'serve-in-flight', written: false };
|
|
107
|
+
changes = wireSettingsChanges(current, wanted);
|
|
108
|
+
if (changes.length === 0)
|
|
109
|
+
return { outcome: 'unchanged' };
|
|
110
|
+
}
|
|
111
|
+
const body = bodyOf(current, wanted);
|
|
112
|
+
await api.write(script, body);
|
|
113
|
+
const after = await api.read(script);
|
|
114
|
+
// What the read after must hold: the body as sent, and every secret read before (kept, not sent).
|
|
115
|
+
const expected = snapshot([...body.bindings, ...current.filter((b) => SECRET.has(b.type))]);
|
|
116
|
+
const differing = differingNames(expected, snapshot(after));
|
|
117
|
+
if (differing.length > 0)
|
|
118
|
+
return { outcome: 'verify', bindings: differing };
|
|
119
|
+
if (opts.servedVersionAfter && (await opts.servedVersionAfter()) !== opts.servedVersion)
|
|
120
|
+
return { outcome: 'serve-in-flight', written: true };
|
|
121
|
+
return { outcome: 'updated', changes };
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The `WireSettingsApi` over the namespace's script-settings endpoint. A failure names the script and
|
|
125
|
+
* the status only, never a response body: the body of a settings answer holds binding values.
|
|
126
|
+
*/
|
|
127
|
+
export function createWfpWireSettingsApi(opts) {
|
|
128
|
+
const urlOf = (script) => `https://api.cloudflare.com/client/v4/accounts/${opts.accountId}` +
|
|
129
|
+
`/workers/dispatch/namespaces/${opts.namespace}/scripts/${encodeURIComponent(script)}/settings`;
|
|
130
|
+
const auth = { authorization: `Bearer ${opts.apiToken}` };
|
|
131
|
+
return {
|
|
132
|
+
async read(script) {
|
|
133
|
+
const res = await fetch(urlOf(script), { headers: auth });
|
|
134
|
+
if (!res.ok) {
|
|
135
|
+
await res.body?.cancel();
|
|
136
|
+
throw new Error(`the settings of '${script}' could not be read (${res.status})`);
|
|
137
|
+
}
|
|
138
|
+
const parsed = (await res.json().catch(() => null));
|
|
139
|
+
const bindings = parsed?.result?.bindings ?? parsed?.bindings;
|
|
140
|
+
if (!Array.isArray(bindings) || !bindings.every((b) => b && typeof b === 'object' && typeof b.type === 'string' && typeof b.name === 'string')) {
|
|
141
|
+
throw new Error(`the settings of '${script}' did not read as a list of bindings`);
|
|
142
|
+
}
|
|
143
|
+
return bindings;
|
|
144
|
+
},
|
|
145
|
+
async write(script, body) {
|
|
146
|
+
const form = new FormData();
|
|
147
|
+
form.set('settings', new Blob([JSON.stringify(body)], { type: 'application/json' }), 'settings.json');
|
|
148
|
+
const res = await fetch(urlOf(script), { method: 'PATCH', headers: auth, body: form });
|
|
149
|
+
await res.body?.cancel();
|
|
150
|
+
if (!res.ok)
|
|
151
|
+
throw new Error(`the settings of '${script}' could not be written (${res.status})`);
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=wire-settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire-settings.js","sourceRoot":"","sources":["../src/wire-settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEvI,qDAAqD;AACrD,MAAM,kBAAkB,GAAsB,MAAM,CAAC,MAAM,CAAC,CAAC,oBAAoB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,cAAc,CAAC,CAAC,CAAC;AAC/I,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,kBAAkB,CAAC,CAAC;AAE1C,qGAAqG;AACrG,MAAM,CAAC,MAAM,oBAAoB,GAAsB,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC;AACpG,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,oBAAoB,CAAC,CAAC;AAE7C,oEAAoE;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AG,CAAC,EAAE;gBAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,MAAM,2BAA2B,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;QACnG,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/wire-upload.d.ts
CHANGED
|
@@ -71,4 +71,30 @@ export declare function wireUploadFor(settings: WireUploadSettings | undefined,
|
|
|
71
71
|
readonly deploymentRef: string;
|
|
72
72
|
readonly bundle: Pick<VerticalBundle, 'entry' | 'modules'>;
|
|
73
73
|
}): Promise<WireUpload>;
|
|
74
|
+
/** Whether a bundle carries the platform's entry, which holds the verifier, as a record states it. */
|
|
75
|
+
export declare function wireEntryOf(bundle: Pick<VerticalBundle, 'entry' | 'modules'>): WireEntry;
|
|
76
|
+
/** The record's half that is a fact about the bundle: its envelope version, or why the entry was left off. */
|
|
77
|
+
export type WireEntry = Pick<WireAuthRecord, 'envelope' | 'entrySkipped'>;
|
|
78
|
+
/**
|
|
79
|
+
* `wireUploadFor` from a bundle's entry state already known (`wireEntryOf`, or a record of the
|
|
80
|
+
* script's upload): what the settings give the script now, and the record of it. The fleet walk's
|
|
81
|
+
* reading of the same rule, so a walked script and an uploaded one are given the same.
|
|
82
|
+
*/
|
|
83
|
+
export declare function wireUploadGiven(settings: WireUploadSettings | undefined, upload: {
|
|
84
|
+
readonly vertical: string;
|
|
85
|
+
readonly deploymentRef: string;
|
|
86
|
+
readonly entry: WireEntry;
|
|
87
|
+
}): Promise<WireUpload>;
|
|
88
|
+
/**
|
|
89
|
+
* Whether the settings themselves are refused: the rollout setting does not parse, or, where it gives
|
|
90
|
+
* lists to anything, the lists do not load. `null` when they are usable, `off` included. An upload under
|
|
91
|
+
* refused settings gives nothing and says why; the fleet walk refuses the whole pass instead, since
|
|
92
|
+
* giving nothing to every script would withdraw the lists fleet-wide. The decision is the uploader's
|
|
93
|
+
* own (`wireUploadGiven`, asked for a deployment inside the rollout), so the two cannot drift; the
|
|
94
|
+
* reason names the setting, never a key.
|
|
95
|
+
*/
|
|
96
|
+
export declare function wireSettingsRefusal(settings: WireUploadSettings | undefined): Promise<{
|
|
97
|
+
readonly withheld: 'rollout-refused' | 'lists-refused';
|
|
98
|
+
readonly reason: string;
|
|
99
|
+
} | null>;
|
|
74
100
|
//# sourceMappingURL=wire-upload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wire-upload.d.ts","sourceRoot":"","sources":["../src/wire-upload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAG5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,yFAAyF;AACzF,MAAM,WAAW,kBAAkB;IACjC,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,4EAA4E;IAC5E,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,qFAAqF;IACrF,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,kDAAkD;AAClD,MAAM,MAAM,eAAe,GACvB;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAA;CAAE,GACxB;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACtD;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAI/B;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAWhG;AAED,kEAAkE;AAClE,MAAM,WAAW,UAAU;IACzB,sDAAsD;IACtD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,8FAA8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AC;AAE1E;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,kBAAkB,GAAG,SAAS,EACxC,MAAM,EAAE;IAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GAC/F,OAAO,CAAC,UAAU,CAAC,CA8BrB;AAED;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,kBAAkB,GAAG,SAAS,GACvC,OAAO,CAAC;IAAE,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,GAAG,eAAe,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAMrG"}
|
package/dist/wire-upload.js
CHANGED
|
@@ -52,9 +52,21 @@ export function wireKeysRolloutOf(value) {
|
|
|
52
52
|
* vertical out, while the setting cannot be read, or while the lists would not load.
|
|
53
53
|
*/
|
|
54
54
|
export async function wireUploadFor(settings, upload) {
|
|
55
|
+
return wireUploadGiven(settings, { vertical: upload.vertical, deploymentRef: upload.deploymentRef, entry: wireEntryOf(upload.bundle) });
|
|
56
|
+
}
|
|
57
|
+
/** Whether a bundle carries the platform's entry, which holds the verifier, as a record states it. */
|
|
58
|
+
export function wireEntryOf(bundle) {
|
|
59
|
+
const skipped = platformEntrySkipReason(bundle) ?? null;
|
|
60
|
+
return { envelope: skipped === null ? WIRE_ENVELOPE_VERSION : null, entrySkipped: skipped };
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* `wireUploadFor` from a bundle's entry state already known (`wireEntryOf`, or a record of the
|
|
64
|
+
* script's upload): what the settings give the script now, and the record of it. The fleet walk's
|
|
65
|
+
* reading of the same rule, so a walked script and an uploaded one are given the same.
|
|
66
|
+
*/
|
|
67
|
+
export async function wireUploadGiven(settings, upload) {
|
|
55
68
|
const { vertical, deploymentRef } = upload;
|
|
56
|
-
const
|
|
57
|
-
const entry = { envelope: skipped === null ? WIRE_ENVELOPE_VERSION : null, entrySkipped: skipped };
|
|
69
|
+
const entry = { envelope: upload.entry.envelope, entrySkipped: upload.entry.entrySkipped };
|
|
58
70
|
const nothing = (withheld, refusal = null) => ({
|
|
59
71
|
vertical,
|
|
60
72
|
deploymentRef,
|
|
@@ -87,6 +99,21 @@ export async function wireUploadFor(settings, upload) {
|
|
|
87
99
|
return nothing('lists-refused', await refusedList(settings, error));
|
|
88
100
|
}
|
|
89
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Whether the settings themselves are refused: the rollout setting does not parse, or, where it gives
|
|
104
|
+
* lists to anything, the lists do not load. `null` when they are usable, `off` included. An upload under
|
|
105
|
+
* refused settings gives nothing and says why; the fleet walk refuses the whole pass instead, since
|
|
106
|
+
* giving nothing to every script would withdraw the lists fleet-wide. The decision is the uploader's
|
|
107
|
+
* own (`wireUploadGiven`, asked for a deployment inside the rollout), so the two cannot drift; the
|
|
108
|
+
* reason names the setting, never a key.
|
|
109
|
+
*/
|
|
110
|
+
export async function wireSettingsRefusal(settings) {
|
|
111
|
+
const rollout = wireKeysRolloutOf(settings?.rollout);
|
|
112
|
+
const vertical = 'refused' in rollout || rollout.kind !== 'canary' ? 'wire-settings-check' : rollout.vertical;
|
|
113
|
+
const given = await wireUploadGiven(settings, { vertical, deploymentRef: 'wire-settings-check', entry: { envelope: 1, entrySkipped: null } });
|
|
114
|
+
const withheld = given.record.withheld;
|
|
115
|
+
return given.refusal !== null && (withheld === 'rollout-refused' || withheld === 'lists-refused') ? { withheld, reason: given.refusal } : null;
|
|
116
|
+
}
|
|
90
117
|
/**
|
|
91
118
|
* Why the lists were refused, naming the setting to fix: each list is loaded alone, and the first
|
|
92
119
|
* that fails is named with its problem. When each loads alone (a key in both, or an audience the
|
package/dist/wire-upload.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wire-upload.js","sourceRoot":"","sources":["../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C,2BAA2B,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,CAAC;KACxD,EAAE,CAAC;QACX,MAAM,IAAI,GAAG,MAAM,IAAI,QAAQ,CAAC;QAChC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE;YAAE,OAAO,GAAG,IAAI,eAAe,CAAC;QACjD,IAAI,CAAC;YACH,MAAM,oBAAoB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;QACnD,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,GAAG,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QAClC,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The fleet walk (RFC wire-signing follow-on 4): bring every deployed script's key lists, audience
|
|
3
|
+
* and state to what the control plane gives now, so that a key listed, rotated, dropped or withdrawn
|
|
4
|
+
* reaches every script, not only the ones an upload happens to reach. A vertical's serving script is
|
|
5
|
+
* uploaded again at each promote, but a version's own script (its archive script, which a preview is
|
|
6
|
+
* routed to) is uploaded once, at its push, and nothing else ever rewrites it.
|
|
7
|
+
*
|
|
8
|
+
* A person runs it, a pass at a time, and it reports before it changes anything:
|
|
9
|
+
*
|
|
10
|
+
* - **Dry run by default.** Without `apply` a pass only reads: the settings write is unreachable, no
|
|
11
|
+
* operational failure is filed and no hold is released.
|
|
12
|
+
* - **Bounded and resumable.** A pass walks at most `limit` scripts in a fixed order (verticals by
|
|
13
|
+
* slug; each one's serving script, then its versions' scripts by id) and answers the cursor the next
|
|
14
|
+
* pass starts from, `null` when the fleet is done. A vertical deleted since it was listed, or named by
|
|
15
|
+
* a saved cursor, is passed over.
|
|
16
|
+
* - **Only scripts it can attribute.** The inventory is the registry's: a vertical's serving script and
|
|
17
|
+
* each of its versions' scripts. A script the registry does not name is never touched, nor is one
|
|
18
|
+
* whose name is the platform's own.
|
|
19
|
+
* - **No call it does not need.** A script whose record already says it was given what the settings give
|
|
20
|
+
* now is not read. A script with no record, which the settings give nothing, is not read either: in an
|
|
21
|
+
* environment where the rollout was never set, a pass makes no call to the runtime at all. A
|
|
22
|
+
* **confirming** pass (`confirm`) reads every recorded script instead, trusting no record; a held
|
|
23
|
+
* script, and one with no record that nothing is given or that is skipped, it leaves unread as well.
|
|
24
|
+
* - **Only a script that verifies is given lists by it.** A script with no record is read back first, on
|
|
25
|
+
* every pass that reaches it (no verdict is kept between passes: pushing it again gives it a record);
|
|
26
|
+
* one that runs without the platform's entry is skipped (`no-entry`), never recorded as verifying.
|
|
27
|
+
* - **One script's failure is that script's.** It is reported, recorded as an operational failure by
|
|
28
|
+
* reason, and the pass goes on.
|
|
29
|
+
* - **A script it cannot vouch for is held.** When the read after an update differs, or the serve moved
|
|
30
|
+
* under it, the script's record is marked held, with the binding names that differed, and later passes
|
|
31
|
+
* leave it alone until a person names it in `release`, or an upload of it writes a fresh record.
|
|
32
|
+
*
|
|
33
|
+
* Each script it changes writes its capability record and that record's admin row in one directory
|
|
34
|
+
* transaction (`recordWireAuth`), and each pass writes one `walkWireAuth` row. The settings write is
|
|
35
|
+
* `wire-settings.ts`. Do not run the walk while a push or promote of the same vertical is in flight,
|
|
36
|
+
* and end with a confirming pass.
|
|
37
|
+
*/
|
|
38
|
+
import { type DeploymentWireAuth, type PlatformActorId, type WireAuthRecord } from '@substrat-run/contracts';
|
|
39
|
+
import type { HostAdmin } from '@substrat-run/kernel';
|
|
40
|
+
import type { FetchVerticalModulesFn } from './deploy.js';
|
|
41
|
+
import { type WireSettingsApi } from './wire-settings.js';
|
|
42
|
+
import { type WireUploadSettings } from './wire-upload.js';
|
|
43
|
+
/** A pass walks this many scripts when it names no limit. */
|
|
44
|
+
export declare const WIRE_WALK_LIMIT_DEFAULT = 25;
|
|
45
|
+
/** A pass walks at most this many scripts. */
|
|
46
|
+
export declare const WIRE_WALK_LIMIT_MAX = 50;
|
|
47
|
+
/** A pass releases at most this many held scripts. */
|
|
48
|
+
export declare const WIRE_WALK_RELEASE_MAX = 50;
|
|
49
|
+
/**
|
|
50
|
+
* Where a pass starts: inside a vertical, after its serving script (`after` empty) or after one of its
|
|
51
|
+
* versions (`after` that version's id, whatever its spelling: the publish route takes any id).
|
|
52
|
+
*/
|
|
53
|
+
export interface WireWalkCursor {
|
|
54
|
+
readonly vertical: string;
|
|
55
|
+
readonly after: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* A cursor as a pass answers it, or `null` for one that is not one. Opaque to a caller. A slug never
|
|
59
|
+
* holds a `|`, so the first one ends it, and everything after it is the position.
|
|
60
|
+
*/
|
|
61
|
+
export declare function parseWireWalkCursor(text: string): WireWalkCursor | null;
|
|
62
|
+
/** What a pass did, or in a dry run would do, with one script. */
|
|
63
|
+
export type WireWalkAction =
|
|
64
|
+
/** Its record says it was given what the settings give now: not read. */
|
|
65
|
+
'current'
|
|
66
|
+
/** No record, and the settings give it nothing: not read. */
|
|
67
|
+
| 'unrecorded'
|
|
68
|
+
/** Held by an earlier pass and not released: not read. */
|
|
69
|
+
| 'held'
|
|
70
|
+
/** Not given lists, for `reason`: `no-entry`, a script with no record that runs without the platform's entry. */
|
|
71
|
+
| 'skipped'
|
|
72
|
+
/** Read: it already carries what the settings give now. Applied, its record is refreshed. */
|
|
73
|
+
| 'unchanged'
|
|
74
|
+
/** A dry run: these settings would change. */
|
|
75
|
+
| 'would-change'
|
|
76
|
+
/** Updated, verified and recorded. */
|
|
77
|
+
| 'updated'
|
|
78
|
+
/** Not done, for `reason`; held as well when the reason says the script could not be vouched for. */
|
|
79
|
+
| 'failed';
|
|
80
|
+
export interface WireWalkScript {
|
|
81
|
+
readonly deploymentRef: string;
|
|
82
|
+
readonly vertical: string;
|
|
83
|
+
readonly versionId: string | null;
|
|
84
|
+
readonly kind: 'serving' | 'version';
|
|
85
|
+
readonly action: WireWalkAction;
|
|
86
|
+
/** The settings that differ (`would-change`, `updated`), by name. */
|
|
87
|
+
readonly changes?: readonly string[];
|
|
88
|
+
/**
|
|
89
|
+
* Why it failed (`concurrent-change`, `serve-in-flight`, `verify`, `entry-unknown`, `settings`,
|
|
90
|
+
* `settings-refused` or `record`), or was skipped (`no-entry`).
|
|
91
|
+
*/
|
|
92
|
+
readonly reason?: string;
|
|
93
|
+
/** For `verify`: the binding names that differed. Never a value. */
|
|
94
|
+
readonly bindings?: readonly string[];
|
|
95
|
+
/** For `verify`: how many more bindings differed than `bindings` names (it keeps the first `WALK_HOLD_BINDINGS_MAX`). */
|
|
96
|
+
readonly more?: number;
|
|
97
|
+
/** Whether the pass left the script held. */
|
|
98
|
+
readonly held?: true;
|
|
99
|
+
/** Whether it was held and a person released it for this pass. */
|
|
100
|
+
readonly released?: true;
|
|
101
|
+
}
|
|
102
|
+
export interface WireWalkPass {
|
|
103
|
+
readonly apply: boolean;
|
|
104
|
+
/** The cursor the pass started from, `null` for the start of the fleet. */
|
|
105
|
+
readonly from: string | null;
|
|
106
|
+
/** Where the next pass starts, or `null` when this one reached the end of the fleet. */
|
|
107
|
+
readonly next: string | null;
|
|
108
|
+
readonly scripts: readonly WireWalkScript[];
|
|
109
|
+
}
|
|
110
|
+
export interface WireWalkDeps {
|
|
111
|
+
readonly admin: HostAdmin;
|
|
112
|
+
readonly actor: PlatformActorId;
|
|
113
|
+
readonly settings: WireUploadSettings | undefined;
|
|
114
|
+
readonly api: WireSettingsApi;
|
|
115
|
+
/** Reads a script's modules back, to learn whether a script with no record carries the platform's entry. */
|
|
116
|
+
readonly fetchModules?: FetchVerticalModulesFn;
|
|
117
|
+
/** Records a script's failure as an operational failure: names, reasons and binding names only. */
|
|
118
|
+
readonly fail: (entry: {
|
|
119
|
+
readonly vertical: string;
|
|
120
|
+
readonly version: string | null;
|
|
121
|
+
readonly stage: string;
|
|
122
|
+
readonly message: string;
|
|
123
|
+
}) => void;
|
|
124
|
+
readonly now?: () => Date;
|
|
125
|
+
}
|
|
126
|
+
/** One script the registry names, as the walk and the readiness report reach it. */
|
|
127
|
+
export interface InventoryScript {
|
|
128
|
+
readonly vertical: string;
|
|
129
|
+
readonly deploymentRef: string;
|
|
130
|
+
readonly versionId: string | null;
|
|
131
|
+
readonly kind: 'serving' | 'version';
|
|
132
|
+
/** Where a pass that ends on this script answers the next one starts. */
|
|
133
|
+
readonly cursor: string;
|
|
134
|
+
}
|
|
135
|
+
/** Every capability record of one vertical's scripts, by script name, read a page at a time. */
|
|
136
|
+
export declare function wireAuthRecordsOf(admin: HostAdmin, actor: PlatformActorId, vertical: string): Promise<Map<string, DeploymentWireAuth>>;
|
|
137
|
+
/**
|
|
138
|
+
* Hand each script from `fleet` to `each` in order, at most `limit` of them, answering where the next pass starts:
|
|
139
|
+
* `null` when the last one handled was the fleet's last. Looks one ahead, so the pass that ends on the
|
|
140
|
+
* fleet's last script already answers `null`; a look that fails does not undo a pass that is done.
|
|
141
|
+
*/
|
|
142
|
+
export declare function wireInventoryPass<T>(fleet: AsyncGenerator<InventoryScript>, limit: number, each: (script: InventoryScript) => Promise<T>, out: T[]): Promise<string | null>;
|
|
143
|
+
/** The registry's scripts in walk order, from `from` on: each vertical's serving script, then its versions' scripts. */
|
|
144
|
+
export declare function wireInventory(admin: HostAdmin, actor: PlatformActorId, from: WireWalkCursor | null): AsyncGenerator<InventoryScript>;
|
|
145
|
+
/** Whether a record already holds what a given record says, in what a script carries: the state, the audience and the key ids. */
|
|
146
|
+
export declare function carriesAlready(stored: WireAuthRecord, given: WireAuthRecord): boolean;
|
|
147
|
+
/** Run one pass. Never throws for one script's failure; throws only for a directory read that fails. */
|
|
148
|
+
export declare function runWireWalk(deps: WireWalkDeps, input: {
|
|
149
|
+
readonly apply: boolean;
|
|
150
|
+
readonly cursor: WireWalkCursor | null;
|
|
151
|
+
readonly limit: number;
|
|
152
|
+
readonly release: readonly string[];
|
|
153
|
+
/** A confirming pass: read every recorded script, never trusting its record (no `current`). */
|
|
154
|
+
readonly confirm?: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Where each script's result is put as soon as it is known: the caller's, so a pass that ends in a
|
|
157
|
+
* throw still says what it did. Defaults to a fresh list.
|
|
158
|
+
*/
|
|
159
|
+
readonly sink?: WireWalkScript[];
|
|
160
|
+
}): Promise<WireWalkPass>;
|
|
161
|
+
//# sourceMappingURL=wire-walk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire-walk.d.ts","sourceRoot":"","sources":["../src/wire-walk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAQL,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,EAAyC,KAAK,eAAe,EAA4B,MAAM,oBAAoB,CAAC;AAC3H,OAAO,EAAgD,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEzG,6DAA6D;AAC7D,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAC1C,8CAA8C;AAC9C,eAAO,MAAM,mBAAmB,KAAK,CAAC;AACtC,sDAAsD;AACtD,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAOxC;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAMvE;AAGD,kEAAkE;AAClE,MAAM,MAAM,cAAc;AACxB,yEAAyE;AACvE,SAAS;AACX,6DAA6D;GAC3D,YAAY;AACd,0DAA0D;GACxD,MAAM;AACR,iHAA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