@pipeline-builder/api-core 7.1.0 → 7.2.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/lib/contracts/pipeline.d.ts +49 -6
- package/lib/contracts/pipeline.js +44 -1
- package/lib/contracts/platform.d.ts +39 -7
- package/lib/contracts/platform.js +43 -11
- package/lib/middleware/permission-gates.js +2 -13
- package/lib/middleware/step-up.js +11 -9
- package/lib/services/index.d.ts +0 -1
- package/lib/services/index.js +1 -2
- package/lib/services/org-ai-client.js +14 -5
- package/lib/services/scheduler.d.ts +7 -0
- package/lib/services/scheduler.js +8 -3
- package/lib/services/service-keys.d.ts +10 -0
- package/lib/services/service-keys.js +11 -11
- package/lib/types/error-codes.d.ts +14 -0
- package/lib/types/error-codes.js +21 -1
- package/lib/types/feature-flags.d.ts +3 -2
- package/lib/types/feature-flags.js +5 -14
- package/lib/types/index.d.ts +2 -1
- package/lib/types/index.js +3 -2
- package/lib/types/pipeline-runners.d.ts +434 -8
- package/lib/types/pipeline-runners.js +275 -9
- package/lib/types/plugin-catalog.d.ts +27 -0
- package/lib/types/plugin-catalog.js +17 -1
- package/lib/types/plugin-secret-files.d.ts +96 -0
- package/lib/types/plugin-secret-files.js +160 -0
- package/lib/types/remote-audit-actions.d.ts +1 -1
- package/lib/types/remote-audit-actions.js +28 -1
- package/lib/types/wire-vocabulary.d.ts +21 -0
- package/lib/types/wire-vocabulary.js +15 -1
- package/lib/utils/logger.js +31 -7
- package/lib/utils/response.d.ts +3 -0
- package/lib/utils/response.js +23 -2
- package/lib/utils/ssrf.js +21 -5
- package/lib/validation/ai-schemas.js +18 -5
- package/package.json +1 -1
- package/lib/services/org-features-client.d.ts +0 -6
- package/lib/services/org-features-client.js +0 -38
|
@@ -1,9 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The cross-account pipeline runner CONTRACT — the one vocabulary the pipeline
|
|
3
|
+
* service (signer + dispatcher), the runner Lambda (verifier + responder), the
|
|
4
|
+
* `pipeline-manager infra setup-runner` CLI and the dashboard all speak.
|
|
5
|
+
*
|
|
6
|
+
* Dependency-free on purpose (type-only imports at most): the browser imports it
|
|
7
|
+
* through the `@pipeline-builder/api-core/pipeline-runners` subpath, and the
|
|
8
|
+
* runner Lambda bundle (one self-contained file that may import only
|
|
9
|
+
* `@aws-sdk/*` and `node:*`) has esbuild inline it. A value added here reaches
|
|
10
|
+
* every exhaustive map keyed by these unions as a compile error.
|
|
11
|
+
*
|
|
12
|
+
* Wire-format note: every string below is ON THE WIRE (signed claims, HTTP
|
|
13
|
+
* bodies, stored rows). Renaming one is a protocol change, not a refactor.
|
|
14
|
+
*/
|
|
3
15
|
/** The tag every platform-deployed pipeline carries — the runner's proof of identity. */
|
|
4
16
|
export declare const PIPELINE_ID_TAG = "pb.pipeline-id";
|
|
5
|
-
/**
|
|
6
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Where one runner fetches the public keys its run requests are signed with
|
|
19
|
+
* (appended to PLATFORM_BASE_URL): the next, active and retiring keys of the
|
|
20
|
+
* runner's owning org's EFFECTIVE key org. Keyed by the runner's own id, so
|
|
21
|
+
* the runner needs no new setting and no org id ever appears in a URL. An
|
|
22
|
+
* unknown, pending-and-unknown or revoked runner gets 404 (the runner fails
|
|
23
|
+
* closed); a pending runner IS served, so its activation ping verifies.
|
|
24
|
+
*/
|
|
25
|
+
export declare function runnerJwksPath(runnerId: string): string;
|
|
7
26
|
/** `pending`: registered, its endpoint has not answered the platform's ping yet. */
|
|
8
27
|
export declare const RUNNER_STATUSES: readonly ['pending', 'active', 'revoked'];
|
|
9
28
|
export type RunnerStatus = (typeof RUNNER_STATUSES)[number];
|
|
@@ -40,7 +59,11 @@ export type RunnerErrorCategory = 'platform' | 'runner' | 'recorded';
|
|
|
40
59
|
export interface RunnerErrorMeta {
|
|
41
60
|
/** The HTTP status it is answered with; null for a `recorded` code. */
|
|
42
61
|
readonly httpStatus: number | null;
|
|
43
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* The dispatcher delivers again on this code in a runner's 4xx answer (vs.
|
|
64
|
+
* failing the request). Any 5xx is retried as a transport failure, whatever
|
|
65
|
+
* its body says.
|
|
66
|
+
*/
|
|
44
67
|
readonly retryable: boolean;
|
|
45
68
|
readonly category: RunnerErrorCategory;
|
|
46
69
|
}
|
|
@@ -106,11 +129,60 @@ export declare const RUNNER_ERRORS: {
|
|
|
106
129
|
readonly retryable: false;
|
|
107
130
|
readonly category: 'platform';
|
|
108
131
|
};
|
|
109
|
-
|
|
132
|
+
/** The org's effective signing key exists but cannot be decrypted (wrong master, rotated KMS key). That org only. */
|
|
133
|
+
readonly RUNNER_KEY_UNREADABLE: {
|
|
134
|
+
readonly httpStatus: 409;
|
|
135
|
+
readonly retryable: false;
|
|
136
|
+
readonly category: 'platform';
|
|
137
|
+
};
|
|
138
|
+
/** The org has no effective signing key (no shared key to fall back to). */
|
|
139
|
+
readonly RUNNER_KEY_MISSING: {
|
|
140
|
+
readonly httpStatus: 409;
|
|
141
|
+
readonly retryable: false;
|
|
142
|
+
readonly category: 'platform';
|
|
143
|
+
};
|
|
144
|
+
/** Generate: the org already has a key. */
|
|
145
|
+
readonly RUNNER_KEY_EXISTS: {
|
|
146
|
+
readonly httpStatus: 409;
|
|
147
|
+
readonly retryable: false;
|
|
148
|
+
readonly category: 'platform';
|
|
149
|
+
};
|
|
150
|
+
/** Rotate / mode switch / revoke while a rotation (a next or retiring key) or a mode switch is in progress. */
|
|
151
|
+
readonly RUNNER_KEY_TRANSITION_IN_PROGRESS: {
|
|
152
|
+
readonly httpStatus: 409;
|
|
153
|
+
readonly retryable: false;
|
|
154
|
+
readonly category: 'platform';
|
|
155
|
+
};
|
|
156
|
+
/** Cancel with no next key, or finish with no retiring key. */
|
|
157
|
+
readonly RUNNER_KEY_NO_ROTATION: {
|
|
158
|
+
readonly httpStatus: 409;
|
|
159
|
+
readonly retryable: false;
|
|
160
|
+
readonly category: 'platform';
|
|
161
|
+
};
|
|
162
|
+
/** Finish before the retiring key's retire_after. */
|
|
163
|
+
readonly RUNNER_KEY_RETIRE_TOO_EARLY: {
|
|
110
164
|
readonly httpStatus: 409;
|
|
111
165
|
readonly retryable: false;
|
|
112
166
|
readonly category: 'platform';
|
|
113
167
|
};
|
|
168
|
+
/** A key write (generate / rotate / finish / cancel / revoke) on an org in inherit mode. */
|
|
169
|
+
readonly RUNNER_KEY_INHERITED: {
|
|
170
|
+
readonly httpStatus: 409;
|
|
171
|
+
readonly retryable: false;
|
|
172
|
+
readonly category: 'platform';
|
|
173
|
+
};
|
|
174
|
+
/** A key-mode change on a root org (root orgs are always `own`). */
|
|
175
|
+
readonly RUNNER_KEY_MODE_ROOT_ORG: {
|
|
176
|
+
readonly httpStatus: 409;
|
|
177
|
+
readonly retryable: false;
|
|
178
|
+
readonly category: 'platform';
|
|
179
|
+
};
|
|
180
|
+
/** Revoke: the typed confirmation is not the last {@link RUNNER_KEY_REVOKE_CONFIRM_CHARS} characters of the active kid. */
|
|
181
|
+
readonly RUNNER_KEY_CONFIRMATION_MISMATCH: {
|
|
182
|
+
readonly httpStatus: 400;
|
|
183
|
+
readonly retryable: false;
|
|
184
|
+
readonly category: 'platform';
|
|
185
|
+
};
|
|
114
186
|
readonly SIGNATURE_INVALID: {
|
|
115
187
|
readonly httpStatus: 401;
|
|
116
188
|
readonly retryable: false;
|
|
@@ -158,10 +230,16 @@ export declare const RUNNER_ERRORS: {
|
|
|
158
230
|
readonly retryable: true;
|
|
159
231
|
readonly category: 'runner';
|
|
160
232
|
};
|
|
161
|
-
/**
|
|
233
|
+
/**
|
|
234
|
+
* Anything unexpected inside the runner, or a reply the platform can't use
|
|
235
|
+
* (an unknown code, a non-JSON 4xx). Final: a runner's own 4xx reply fails
|
|
236
|
+
* the request. The runner answers it with a bare 500, which — like every
|
|
237
|
+
* 5xx — the dispatcher retries as a transport failure (`http_5xx`), not by
|
|
238
|
+
* this code.
|
|
239
|
+
*/
|
|
162
240
|
readonly RUNNER_ERROR: {
|
|
163
241
|
readonly httpStatus: 500;
|
|
164
|
-
readonly retryable:
|
|
242
|
+
readonly retryable: false;
|
|
165
243
|
readonly category: 'runner';
|
|
166
244
|
};
|
|
167
245
|
/** Not delivered within the request's lifetime. */
|
|
@@ -176,6 +254,18 @@ export declare const RUNNER_ERRORS: {
|
|
|
176
254
|
readonly retryable: false;
|
|
177
255
|
readonly category: 'recorded';
|
|
178
256
|
};
|
|
257
|
+
/**
|
|
258
|
+
* The runner a queued request was routed to is no longer one its org may use
|
|
259
|
+
* (an ancestor's runner un-shared from teams, or the team moved under another
|
|
260
|
+
* parent): re-checked just before delivery, the request fails instead of
|
|
261
|
+
* being sent, and the pipeline's stale link is cleared (the next run
|
|
262
|
+
* rediscovers).
|
|
263
|
+
*/
|
|
264
|
+
readonly RUNNER_NOT_ELIGIBLE: {
|
|
265
|
+
readonly httpStatus: null;
|
|
266
|
+
readonly retryable: false;
|
|
267
|
+
readonly category: 'recorded';
|
|
268
|
+
};
|
|
179
269
|
};
|
|
180
270
|
export type RunnerErrorCode = keyof typeof RUNNER_ERRORS;
|
|
181
271
|
type CodesIn<C extends RunnerErrorCategory> = {
|
|
@@ -240,4 +330,340 @@ export interface RunClaims {
|
|
|
240
330
|
executionId?: string;
|
|
241
331
|
requestedBy: string;
|
|
242
332
|
}
|
|
333
|
+
/**
|
|
334
|
+
* A signing key's lifecycle (`pipeline_runner_signing_keys.state`):
|
|
335
|
+
* - `next` — published in the JWKS, not signing yet (signs from `activates_at`);
|
|
336
|
+
* - `active` — signs every run request of the org (at most one per org);
|
|
337
|
+
* - `retiring` — published only, until `retire_after`;
|
|
338
|
+
* - `retired` — gone from the JWKS; the row is kept for audit with its private key wiped.
|
|
339
|
+
* At most one `next`, one `active` and one `retiring` per org (partial unique indexes).
|
|
340
|
+
*/
|
|
341
|
+
export declare const RUNNER_KEY_STATES: readonly ['next', 'active', 'retiring', 'retired'];
|
|
342
|
+
export type RunnerKeyState = (typeof RUNNER_KEY_STATES)[number];
|
|
343
|
+
/** The states a JWKS publishes (everything but `retired`). */
|
|
344
|
+
export declare const PUBLISHED_RUNNER_KEY_STATES: readonly ["next", "active", "retiring"];
|
|
345
|
+
export type PublishedRunnerKeyState = (typeof PUBLISHED_RUNNER_KEY_STATES)[number];
|
|
346
|
+
/** Why a key became `retired` (`pipeline_runner_signing_keys.retired_reason`). */
|
|
347
|
+
export declare const RUNNER_KEY_RETIRED_REASONS: readonly ['finished', 'revoked', 'cancelled', 'mode_switch'];
|
|
348
|
+
export type RunnerKeyRetiredReason = (typeof RUNNER_KEY_RETIRED_REASONS)[number];
|
|
349
|
+
/**
|
|
350
|
+
* An org's key mode (`pipeline_runner_key_settings.mode`). `own`: the org signs
|
|
351
|
+
* with its own keys. `inherit`: with its nearest `own` ancestor's. A missing
|
|
352
|
+
* settings row means `inherit` for a sub-organization and `own` for a root org;
|
|
353
|
+
* a root org is always `own`.
|
|
354
|
+
*/
|
|
355
|
+
export declare const RUNNER_KEY_MODES: readonly ['inherit', 'own'];
|
|
356
|
+
export type RunnerKeyMode = (typeof RUNNER_KEY_MODES)[number];
|
|
357
|
+
/** Where an org's own keys are in a rotation: none, a `next` key waiting to sign, or a `retiring` key still published. */
|
|
358
|
+
export declare const RUNNER_KEY_ROTATION_STATES: readonly ['none', 'pending', 'overlap'];
|
|
359
|
+
export type RunnerKeyRotationState = (typeof RUNNER_KEY_ROTATION_STATES)[number];
|
|
360
|
+
/** What a key-mode transition is (`pipeline_runner_key_settings.transition_kind`). */
|
|
361
|
+
export declare const RUNNER_KEY_TRANSITION_KINDS: readonly ['to_own', 'to_inherit', 'ancestry'];
|
|
362
|
+
export type RunnerKeyTransitionKind = (typeof RUNNER_KEY_TRANSITION_KINDS)[number];
|
|
363
|
+
/** A rotated-in `next` key starts signing this long after it is created (covers the runner's 10-minute JWKS cache and the route's 60 s cache). */
|
|
364
|
+
export declare const RUNNER_KEY_ACTIVATION_DELAY_MS: number;
|
|
365
|
+
/** A key stays published (`retiring`) this long after it stops signing. */
|
|
366
|
+
export declare const RUNNER_KEY_RETIRE_WINDOW_MS: number;
|
|
367
|
+
/** Each replica's decrypted-key cache re-checks the org's key version this often (the pub/sub backstop). */
|
|
368
|
+
export declare const RUNNER_KEY_CACHE_MS = 60000;
|
|
369
|
+
/** The per-runner JWKS response is cached this long (`Cache-Control: public, max-age=60`, and server-side). */
|
|
370
|
+
export declare const RUNNER_JWKS_CACHE_SECONDS = 60;
|
|
371
|
+
/** Per-runner-id limit on the public JWKS route. */
|
|
372
|
+
export declare const RUNNER_JWKS_REQUESTS_PER_MINUTE = 10;
|
|
373
|
+
/** The per-IP backstop on the public JWKS route (generous: Lambdas share AWS egress addresses). */
|
|
374
|
+
export declare const RUNNER_JWKS_IP_REQUESTS_PER_MINUTE = 600;
|
|
375
|
+
/** Key writes (generate, rotate, cancel, finish, revoke, mode) per org per hour. */
|
|
376
|
+
export declare const RUNNER_KEY_WRITES_PER_HOUR = 5;
|
|
377
|
+
/** Revoke's typed confirmation: the last this-many characters of the active key id. */
|
|
378
|
+
export declare const RUNNER_KEY_REVOKE_CONFIRM_CHARS = 6;
|
|
379
|
+
/** The second age reminder is sent this many days after the first (which is sent at RUNNER_KEY_MAX_AGE_DAYS). */
|
|
380
|
+
export declare const RUNNER_KEY_AGE_FOLLOWUP_DAYS = 30;
|
|
381
|
+
/** The typed confirmation revoke requires for `kid`. */
|
|
382
|
+
export declare function runnerKeyRevokeConfirmation(kid: string): string;
|
|
383
|
+
/** Whole days from `since` to `now` (never negative; 0 when either date is unparseable). */
|
|
384
|
+
export declare function runnerKeyAgeDays(since: Date | string, now?: Date | number): number;
|
|
385
|
+
/**
|
|
386
|
+
* How a pipeline is linked to a runner:
|
|
387
|
+
* - `linked` — `runner_id` is set (exactly one match, or a verified run);
|
|
388
|
+
* - `unlinked` — never probed (a new registry row);
|
|
389
|
+
* - `not_found` — the last probe matched no runner (or the org has none);
|
|
390
|
+
* - `ambiguous` — the last probe matched two runners at the same level;
|
|
391
|
+
* - `checking` — a probe is running.
|
|
392
|
+
* A refresh that does not end in a single match keeps the old `runner_id` and
|
|
393
|
+
* records its result in the detail; the status then names that result.
|
|
394
|
+
*/
|
|
395
|
+
export declare const RUNNER_LINK_STATUSES: readonly ['linked', 'unlinked', 'not_found', 'ambiguous', 'checking'];
|
|
396
|
+
export type RunnerLinkStatus = (typeof RUNNER_LINK_STATUSES)[number];
|
|
397
|
+
/** `pipeline_registry.runner_link_detail` — runner LABELS only, never an account id or a URL. */
|
|
398
|
+
export interface RunnerLinkDetail {
|
|
399
|
+
/** Labels of the runners the last probe asked. */
|
|
400
|
+
runnersChecked: string[];
|
|
401
|
+
/** Labels of the runners that matched (two or more = ambiguous). */
|
|
402
|
+
matched: string[];
|
|
403
|
+
/** The code that ended the last probe without a single match (NO_RUNNER, AMBIGUOUS_RUNNER, PIPELINE_NOT_FOUND_IN_RUNNERS, …), else null. */
|
|
404
|
+
errorCode: RunnerErrorCode | null;
|
|
405
|
+
}
|
|
406
|
+
/** Link-refresh requests per org per minute. */
|
|
407
|
+
export declare const RUNNER_LINK_REFRESHES_PER_MINUTE = 5;
|
|
408
|
+
/** Consecutive failed deliveries that mark a runner unreachable. */
|
|
409
|
+
export declare const UNREACHABLE_AFTER_FAILURES = 3;
|
|
410
|
+
/**
|
|
411
|
+
* Each tunable runner limit's env name and default, as the env string a deploy
|
|
412
|
+
* target declares (the deploy-contracts suite can read this literal). The
|
|
413
|
+
* pipeline service parses them; each must be a whole number >= its minimum in
|
|
414
|
+
* {@link RUNNER_TUNABLE_MINIMUMS}, else the default applies.
|
|
415
|
+
* - RUN_REQUESTS_PER_MINUTE — user start/stop requests per pipeline per minute;
|
|
416
|
+
* - MAX_PENDING_PER_ORG — pending (queued|delivering) user-initiated requests per org (429 TOO_MANY_PENDING above it; system-initiated runs queue past it);
|
|
417
|
+
* - MAX_IN_FLIGHT_PER_RUNNER — deliveries in flight to one runner;
|
|
418
|
+
* - RUNNER_HEALTH_PING_INTERVAL_SECONDS — every active runner is pinged this often;
|
|
419
|
+
* - RUNNER_UNHEALTHY_AFTER_PINGS — consecutive failed pings that mark it unreachable (a SIGNATURE_INVALID or RUNNER_REFUSED reply does at once);
|
|
420
|
+
* - RUNNER_KEY_MAX_AGE_DAYS — an active key this old earns an age reminder (and the badge).
|
|
421
|
+
*/
|
|
422
|
+
export declare const RUNNER_TUNABLE_DEFAULTS: {
|
|
423
|
+
readonly RUN_REQUESTS_PER_MINUTE: '6';
|
|
424
|
+
readonly MAX_PENDING_PER_ORG: '500';
|
|
425
|
+
readonly MAX_IN_FLIGHT_PER_RUNNER: '8';
|
|
426
|
+
readonly RUNNER_HEALTH_PING_INTERVAL_SECONDS: '60';
|
|
427
|
+
readonly RUNNER_UNHEALTHY_AFTER_PINGS: '2';
|
|
428
|
+
readonly RUNNER_KEY_MAX_AGE_DAYS: '365';
|
|
429
|
+
};
|
|
430
|
+
export type RunnerTunableEnv = keyof typeof RUNNER_TUNABLE_DEFAULTS;
|
|
431
|
+
/** The smallest value each tunable accepts. */
|
|
432
|
+
export declare const RUNNER_TUNABLE_MINIMUMS: Readonly<Record<RunnerTunableEnv, number>>;
|
|
433
|
+
/**
|
|
434
|
+
* Read one tunable from `env`: a whole number written in digits only
|
|
435
|
+
* (`/^\d+$/` after trimming) at or above its minimum. Unset or blank is the
|
|
436
|
+
* default; anything else (a fraction, sign, exponent, hex, unit, or a value
|
|
437
|
+
* below the minimum) is the default too, with one `warn` per distinct value.
|
|
438
|
+
*/
|
|
439
|
+
export declare function runnerTunable(name: RunnerTunableEnv, env: Readonly<Record<string, string | undefined>>, warn?: (message: string) => void): number;
|
|
440
|
+
/** The Redis pub/sub channel every pipeline replica subscribes to for key and pause changes. */
|
|
441
|
+
export declare const RUNNER_KEY_INVALIDATION_CHANNEL = "runner-keys:invalidate";
|
|
442
|
+
/**
|
|
443
|
+
* One invalidation message (JSON on {@link RUNNER_KEY_INVALIDATION_CHANNEL}),
|
|
444
|
+
* published after the change COMMITS. Never carries key material.
|
|
445
|
+
* - `keys` — drop the signer and JWKS cache entries of every org in `orgIds`
|
|
446
|
+
* (the changed org plus every descendant whose effective key org it is);
|
|
447
|
+
* - `pause` — the platform pause toggle changed; re-read it.
|
|
448
|
+
*/
|
|
449
|
+
export type RunnerKeyInvalidation = {
|
|
450
|
+
v: 1;
|
|
451
|
+
kind: 'keys';
|
|
452
|
+
origin: string;
|
|
453
|
+
orgIds: string[];
|
|
454
|
+
} | {
|
|
455
|
+
v: 1;
|
|
456
|
+
kind: 'pause';
|
|
457
|
+
origin: string;
|
|
458
|
+
paused: boolean;
|
|
459
|
+
};
|
|
460
|
+
/** Parse one channel message; null for anything malformed (ignored by subscribers). */
|
|
461
|
+
export declare function parseRunnerKeyInvalidation(raw: string): RunnerKeyInvalidation | null;
|
|
462
|
+
/** Metric names the key store, the sweep and the alert rules share. */
|
|
463
|
+
export declare const RUNNER_KEY_METRICS: {
|
|
464
|
+
/** Gauge `{state}`: key rows per state across the deployment (retired included). */
|
|
465
|
+
readonly keys: 'pipeline_runner_signing_keys';
|
|
466
|
+
/** Gauge: age in days of the OLDEST active key (no org label). */
|
|
467
|
+
readonly ageDays: 'pipeline_runner_signing_key_age_days';
|
|
468
|
+
/** Gauge: active keys older than RUNNER_KEY_MAX_AGE_DAYS. */
|
|
469
|
+
readonly overAge: 'pipeline_runner_signing_keys_over_age';
|
|
470
|
+
/** Gauge: orgs whose effective key could not be decrypted at the last attempt (the operator alert). */
|
|
471
|
+
readonly unreadable: 'pipeline_runner_signing_keys_unreadable';
|
|
472
|
+
/** Counter `{source}`: cache entries dropped, source `pubsub` | `poll`. */
|
|
473
|
+
readonly invalidations: 'pipeline_runner_signing_key_invalidations_total';
|
|
474
|
+
};
|
|
475
|
+
/** One of an org's published keys. Never key material: id, state and dates only. */
|
|
476
|
+
export interface RunnerSigningKeySummary {
|
|
477
|
+
/** RFC 7638 thumbprint (the JWK `kid`). */
|
|
478
|
+
kid: string;
|
|
479
|
+
state: PublishedRunnerKeyState;
|
|
480
|
+
createdAt: string;
|
|
481
|
+
/** User id of whoever created it (the registering user for an auto-created first key); null when unknown. */
|
|
482
|
+
createdBy: string | null;
|
|
483
|
+
/** `next`: when it starts signing. `active` / `retiring`: when it started signing. */
|
|
484
|
+
activatesAt: string;
|
|
485
|
+
/** `retiring` only: when it leaves the JWKS (and Finish now is allowed). */
|
|
486
|
+
retireAfter: string | null;
|
|
487
|
+
/** Whole days since `activatesAt` (0 for `next`). */
|
|
488
|
+
ageDays: number;
|
|
489
|
+
}
|
|
490
|
+
/** `signingKey` on `GET /pipelines/runners`. */
|
|
491
|
+
export interface RunnerSigningKeyDto {
|
|
492
|
+
mode: RunnerKeyMode;
|
|
493
|
+
/** True for a root org (always `own`; no mode switch). */
|
|
494
|
+
isRootOrg: boolean;
|
|
495
|
+
/** This org's OWN keys (all null in inherit mode outside a transition). */
|
|
496
|
+
active: RunnerSigningKeySummary | null;
|
|
497
|
+
next: RunnerSigningKeySummary | null;
|
|
498
|
+
retiring: RunnerSigningKeySummary | null;
|
|
499
|
+
rotation: RunnerKeyRotationState;
|
|
500
|
+
/** In inherit mode: the effective key org (nearest `own` ancestor). Null in own mode. */
|
|
501
|
+
inheritedFrom: {
|
|
502
|
+
orgId: string;
|
|
503
|
+
orgName: string;
|
|
504
|
+
activeKid: string | null;
|
|
505
|
+
rotation: RunnerKeyRotationState;
|
|
506
|
+
} | null;
|
|
507
|
+
/** Descendant teams whose effective key org is this org (a parent's card: "Used by 3 teams"). */
|
|
508
|
+
inheritingTeams: number;
|
|
509
|
+
/** Their names, for the rotate / revoke / mode dialogs. */
|
|
510
|
+
inheritingTeamNames: string[];
|
|
511
|
+
/** Runners (own + those teams') that verify with this org's keys. */
|
|
512
|
+
inheritingRunners: number;
|
|
513
|
+
/** A mode switch or ancestry change in progress, else null. */
|
|
514
|
+
transition: {
|
|
515
|
+
kind: RunnerKeyTransitionKind;
|
|
516
|
+
switchAt: string;
|
|
517
|
+
until: string;
|
|
518
|
+
} | null;
|
|
519
|
+
/** The effective key cannot be decrypted: no actions, the operator must fix it. */
|
|
520
|
+
unreadable: boolean;
|
|
521
|
+
/** RUNNER_KEY_MAX_AGE_DAYS as configured (the badge threshold). */
|
|
522
|
+
maxAgeDays: number;
|
|
523
|
+
}
|
|
524
|
+
/** Where a {@link RunnerKeyServiceUnavailableError} came from: the org's KMS config lookup, or KMS itself. */
|
|
525
|
+
export declare const RUNNER_KEY_SERVICE_SOURCES: readonly ['kms_config', 'kms'];
|
|
526
|
+
export type RunnerKeyServiceSource = (typeof RUNNER_KEY_SERVICE_SOURCES)[number];
|
|
527
|
+
/**
|
|
528
|
+
* A signing key could not be USED for a reason that is not the key: the
|
|
529
|
+
* per-org KMS config lookup (platform) failed, or KMS could not be reached
|
|
530
|
+
* (network, throttling, a 5xx). Transient — it says nothing about the stored
|
|
531
|
+
* ciphertext, so it is never RUNNER_KEY_UNREADABLE (no unreadable gauge, no
|
|
532
|
+
* operator notice): the caller answers 409 RUNNERS_UNAVAILABLE and a queued
|
|
533
|
+
* request stays queued. Only a real decrypt failure of the ciphertext (wrong
|
|
534
|
+
* master, tampered or wrong-org blob, a KMS key that refuses it) is
|
|
535
|
+
* RUNNER_KEY_UNREADABLE.
|
|
536
|
+
*/
|
|
537
|
+
export declare class RunnerKeyServiceUnavailableError extends Error {
|
|
538
|
+
readonly source: RunnerKeyServiceSource;
|
|
539
|
+
/** The catalog code this maps to. */
|
|
540
|
+
readonly code: "RUNNERS_UNAVAILABLE";
|
|
541
|
+
/** The unavailable reason it answers with (`details.reason`): never the operator pause. */
|
|
542
|
+
readonly reason: "key_service";
|
|
543
|
+
constructor(source: RunnerKeyServiceSource, message: string, options?: {
|
|
544
|
+
cause?: unknown;
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
/** Whether `err` is a {@link RunnerKeyServiceUnavailableError} (by name too: bundles may carry their own copy of the class). */
|
|
548
|
+
export declare function isRunnerKeyServiceUnavailable(err: unknown): err is RunnerKeyServiceUnavailableError;
|
|
549
|
+
/**
|
|
550
|
+
* Why runners are unavailable (`available: false`, and `details.reason` of a
|
|
551
|
+
* 409 RUNNERS_UNAVAILABLE): `paused` — the operator's pause toggle;
|
|
552
|
+
* `encryption_not_configured` / `tables_missing` — the deployment is not set
|
|
553
|
+
* up; `key_service` — a transient key-service failure (the org's KMS config
|
|
554
|
+
* lookup or KMS itself, {@link RunnerKeyServiceUnavailableError}) while
|
|
555
|
+
* resolving a signing key: queued runs retry on their own. Only the first
|
|
556
|
+
* three are ever a deployment-wide `available: false`.
|
|
557
|
+
*/
|
|
558
|
+
export declare const RUNNERS_UNAVAILABLE_REASONS: readonly ['paused', 'encryption_not_configured', 'tables_missing', 'key_service'];
|
|
559
|
+
export type RunnersUnavailableReason = (typeof RUNNERS_UNAVAILABLE_REASONS)[number];
|
|
560
|
+
/** One runner on `GET /pipelines/runners`. Never an AWS account id. */
|
|
561
|
+
export interface PipelineRunnerDto {
|
|
562
|
+
id: string;
|
|
563
|
+
orgId: string;
|
|
564
|
+
label: string;
|
|
565
|
+
/** Only for the OWNING org's admins (null everywhere else). A secret. */
|
|
566
|
+
functionUrl: string | null;
|
|
567
|
+
shareWithTeams: boolean;
|
|
568
|
+
version: string | null;
|
|
569
|
+
regions: string[];
|
|
570
|
+
health: RunnerHealth;
|
|
571
|
+
status: RunnerStatus;
|
|
572
|
+
lastDeliveryAt: string | null;
|
|
573
|
+
createdAt: string;
|
|
574
|
+
updateRequired: boolean;
|
|
575
|
+
/** Absolute: PLATFORM_BASE_URL + {@link runnerJwksPath}(id). */
|
|
576
|
+
jwksUrl: string;
|
|
577
|
+
/** Pipelines linked to this runner (`pipeline_registry.runner_id`). */
|
|
578
|
+
pipelineCount: number;
|
|
579
|
+
}
|
|
580
|
+
/** A parent org's runner shared with this team (signed with the parent's effective key). */
|
|
581
|
+
export interface InheritedPipelineRunnerDto extends PipelineRunnerDto {
|
|
582
|
+
fromOrgId: string;
|
|
583
|
+
fromOrgName: string;
|
|
584
|
+
}
|
|
585
|
+
/** `GET /pipelines/runners`. */
|
|
586
|
+
export interface PipelineRunnersListDto {
|
|
587
|
+
available: boolean;
|
|
588
|
+
unavailableReason: RunnersUnavailableReason | null;
|
|
589
|
+
platformEgressIps: string[] | null;
|
|
590
|
+
own: PipelineRunnerDto[];
|
|
591
|
+
inherited: InheritedPipelineRunnerDto[];
|
|
592
|
+
/** Null while runners are unavailable. */
|
|
593
|
+
signingKey: RunnerSigningKeyDto | null;
|
|
594
|
+
}
|
|
595
|
+
/** `GET /pipelines/:pipelineId/runner-link` (and the 202 of `POST …/runner-link/refresh`, with `status: 'checking'`). */
|
|
596
|
+
export interface RunnerLinkDto {
|
|
597
|
+
pipelineId: string;
|
|
598
|
+
status: RunnerLinkStatus;
|
|
599
|
+
/**
|
|
600
|
+
* The linked runner, when `runner_id` is set (it may be kept through a failed refresh).
|
|
601
|
+
* `isOwn`: the caller's org owns it (false for an ancestor's shared runner) — what
|
|
602
|
+
* decides "shared by …" and the Test action, never inferred from `ownerOrgName`.
|
|
603
|
+
* `ownerOrgName` is set for every runner that is not the caller's own.
|
|
604
|
+
*/
|
|
605
|
+
runner: {
|
|
606
|
+
id: string;
|
|
607
|
+
label: string;
|
|
608
|
+
health: RunnerHealth;
|
|
609
|
+
lastDeliveryAt: string | null;
|
|
610
|
+
ownerOrgName: string | null;
|
|
611
|
+
isOwn: boolean;
|
|
612
|
+
} | null;
|
|
613
|
+
checkedAt: string | null;
|
|
614
|
+
detail: RunnerLinkDetail | null;
|
|
615
|
+
/** The platform pause toggle is on (the pipeline page's banner). */
|
|
616
|
+
deliveriesPaused: boolean;
|
|
617
|
+
}
|
|
618
|
+
/** One row of `GET /pipelines/admin/runner-signing-keys` (operators). Never key material. */
|
|
619
|
+
export interface RunnerKeyStatusRow {
|
|
620
|
+
orgId: string;
|
|
621
|
+
orgName: string | null;
|
|
622
|
+
mode: RunnerKeyMode;
|
|
623
|
+
inheritedFrom: {
|
|
624
|
+
orgId: string;
|
|
625
|
+
orgName: string | null;
|
|
626
|
+
} | null;
|
|
627
|
+
/** The org's own active key (null in inherit mode or before the first key). */
|
|
628
|
+
activeKid: string | null;
|
|
629
|
+
keyAgeDays: number | null;
|
|
630
|
+
rotation: RunnerKeyRotationState;
|
|
631
|
+
/** A mode switch or ancestry change is in progress. */
|
|
632
|
+
inTransition: boolean;
|
|
633
|
+
overAge: boolean;
|
|
634
|
+
unreadable: boolean;
|
|
635
|
+
/** The org's own non-revoked runners. */
|
|
636
|
+
runnerCount: number;
|
|
637
|
+
}
|
|
638
|
+
/** `GET|PUT /pipelines/admin/runner-deliveries` — the platform pause toggle. */
|
|
639
|
+
export interface RunnerDeliveriesDto {
|
|
640
|
+
paused: boolean;
|
|
641
|
+
pausedAt: string | null;
|
|
642
|
+
pausedBy: string | null;
|
|
643
|
+
reason: string | null;
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* THE answer of Run (`POST /pipelines/:id/executions`, 202), Stop
|
|
647
|
+
* (`POST /pipelines/:id/executions/:executionId/stop`, 202) and plugin-upgrade's
|
|
648
|
+
* redeploy (`redeploy` of each upgraded pipeline). Poll
|
|
649
|
+
* `GET /pipelines/:id/run-requests/:requestId` for progress.
|
|
650
|
+
*/
|
|
651
|
+
export interface QueuedRunRequestDto {
|
|
652
|
+
requestId: string;
|
|
653
|
+
status: PendingRunRequestStatus;
|
|
654
|
+
runnerLabel: string;
|
|
655
|
+
}
|
|
656
|
+
/** One key the per-runner JWKS publishes. */
|
|
657
|
+
export interface RunnerPublicJwk {
|
|
658
|
+
kty: 'OKP';
|
|
659
|
+
crv: 'Ed25519';
|
|
660
|
+
x: string;
|
|
661
|
+
kid: string;
|
|
662
|
+
use: 'sig';
|
|
663
|
+
alg: 'EdDSA';
|
|
664
|
+
}
|
|
665
|
+
/** `GET /pipelines/runner/runners/:runnerId/jwks.json`. */
|
|
666
|
+
export interface RunnerJwksDto {
|
|
667
|
+
keys: RunnerPublicJwk[];
|
|
668
|
+
}
|
|
243
669
|
export {};
|