@cnc-tools/storm 0.16.0 → 0.18.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/bin/storm.js +54 -40
- package/dist/build-info.js +1 -1
- package/dist/chunks/{chunk-VL7WFTVQ.js → chunk-24UYAK4R.js} +465 -365
- package/dist/chunks/{chunk-DC2CDHNK.js → chunk-2JMWUKH3.js} +2074 -473
- package/dist/chunks/{chunk-FOZWA52V.js → chunk-3VXZONGE.js} +481 -376
- package/dist/chunks/{chunk-ZG3WQ4UF.js → chunk-55O4FCN4.js} +1 -1
- package/dist/chunks/{chunk-CN4EFA5J.js → chunk-72ZFEMAW.js} +1 -1
- package/dist/chunks/chunk-AS37D43E.js +2173 -0
- package/dist/chunks/chunk-CQAY6GLP.js +1260 -0
- package/dist/chunks/chunk-DZLU7BYK.js +340 -0
- package/dist/chunks/{chunk-R7XVBZOY.js → chunk-EEENLQHE.js} +59 -11
- package/dist/chunks/{chunk-TJNFVNKR.js → chunk-EI3XDCEI.js} +1 -1
- package/dist/chunks/{chunk-HVNK3I45.js → chunk-FDUY3BNF.js} +1 -1
- package/dist/chunks/{chunk-FCQUJDA4.js → chunk-GUCCYCIO.js} +4 -189
- package/dist/chunks/{chunk-OIY3DMF2.js → chunk-HBI4LEMH.js} +3 -3
- package/dist/chunks/{chunk-2MAD5NKK.js → chunk-K4MDQPLW.js} +1 -18
- package/dist/chunks/chunk-KK7PAWIZ.js +198 -0
- package/dist/chunks/{chunk-G3PHMXH5.js → chunk-KQ5FXRUD.js} +18 -1
- package/dist/chunks/{chunk-5VXBKPW6.js → chunk-LKXHGGGX.js} +1 -1
- package/dist/chunks/{chunk-P357TZAY.js → chunk-LOGHIUUB.js} +21 -18
- package/dist/chunks/{chunk-CK2GZEPK.js → chunk-OEPFINFT.js} +2 -2
- package/dist/chunks/{chunk-DWEAHX4T.js → chunk-OI4AP6Z7.js} +5 -5
- package/dist/chunks/{chunk-V4IKA3WI.js → chunk-PMBQWVTW.js} +26 -19
- package/dist/chunks/chunk-SZMYIIG2.js +88 -0
- package/dist/chunks/{chunk-5CCP36QQ.js → chunk-TXCOFC7N.js} +1 -1
- package/dist/chunks/{chunk-VUPZH7J2.js → chunk-UXD3TVWM.js} +1 -1
- package/dist/chunks/{chunk-3L52KNQA.js → chunk-WNW2QXQK.js} +8 -8
- package/dist/chunks/{chunk-AWBSONHB.js → chunk-XBDRVFEV.js} +55 -16
- package/dist/chunks/{live-app-WECQOQ4C.js → live-app-UY7BEDUN.js} +17 -13
- package/dist/cli.d.ts +28 -0
- package/dist/cli.js +64 -0
- package/dist/commands/exec/across-sandboxes-outcomes.d.ts +2 -2
- package/dist/commands/exec/across-sandboxes-outcomes.js +3 -3
- package/dist/commands/exec/before-run.d.ts +123 -0
- package/dist/commands/exec/before-run.js +105 -0
- package/dist/commands/exec/command.d.ts +67 -14
- package/dist/commands/exec/command.js +31 -95
- package/dist/commands/exec/driver-plan.d.ts +9 -4
- package/dist/commands/exec/driver-plan.js +8 -8
- package/dist/commands/exec/exec-words.js +1 -1
- package/dist/commands/exec/execute-run.d.ts +39 -0
- package/dist/commands/exec/execute-run.js +325 -0
- package/dist/commands/exec/live-view.d.ts +3 -3
- package/dist/commands/exec/live-view.js +16 -15
- package/dist/commands/exec/metadata.js +1 -1
- package/dist/commands/exec/mint-failed.d.ts +38 -0
- package/dist/commands/exec/mint-failed.js +27 -4
- package/dist/commands/exec/outcomes.d.ts +104 -22
- package/dist/commands/exec/outcomes.js +73 -26
- package/dist/commands/exec/plan-run.d.ts +58 -150
- package/dist/commands/exec/plan-run.js +239 -90
- package/dist/commands/exec/progress.d.ts +10 -6
- package/dist/commands/exec/progress.js +38 -25
- package/dist/commands/exec/run-bin.d.ts +11 -11
- package/dist/commands/exec/run-bin.js +9 -9
- package/dist/commands/exec/run-flags.d.ts +69 -0
- package/dist/commands/exec/run-flags.js +58 -0
- package/dist/commands/exec/run-metadata.js +4 -4
- package/dist/commands/exec/run-summary.d.ts +58 -0
- package/dist/commands/exec/run-summary.js +205 -0
- package/dist/commands/exec/runner-refusals.d.ts +82 -0
- package/dist/commands/exec/runner-refusals.js +71 -0
- package/dist/commands/exec/sandbox-progress.js +3 -0
- package/dist/commands/exec/stopped-outcome.d.ts +12 -0
- package/dist/commands/exec/stopped-outcome.js +77 -0
- package/dist/commands/exec/view.d.ts +20 -11
- package/dist/commands/exec/view.js +103 -47
- package/dist/commands/runs/facts.d.ts +8 -4
- package/dist/commands/runs/facts.js +19 -10
- package/dist/commands/runs/list/command.d.ts +16 -8
- package/dist/commands/runs/list/command.js +10 -10
- package/dist/commands/runs/list/outcomes.d.ts +8 -4
- package/dist/commands/runs/logs/command.js +10 -10
- package/dist/commands/runs/show/command.d.ts +16 -8
- package/dist/commands/runs/show/command.js +31 -29
- package/dist/commands/runs/show/metadata.js +1 -1
- package/dist/commands/runs/show/outcomes.d.ts +8 -4
- package/dist/commands/runs/show/outcomes.js +8 -6
- package/dist/commands/snapshots/access.d.ts +111 -0
- package/dist/commands/snapshots/access.js +96 -0
- package/dist/commands/snapshots/build/command.d.ts +376 -101
- package/dist/commands/snapshots/build/command.js +447 -149
- package/dist/commands/snapshots/build/metadata.d.ts +10 -0
- package/dist/commands/snapshots/build/metadata.js +31 -11
- package/dist/commands/snapshots/build/outcomes.d.ts +242 -47
- package/dist/commands/snapshots/build/outcomes.js +200 -36
- package/dist/commands/snapshots/list/command.d.ts +368 -27
- package/dist/commands/snapshots/list/command.js +298 -68
- package/dist/commands/snapshots/list/metadata.d.ts +16 -0
- package/dist/commands/snapshots/list/metadata.js +29 -6
- package/dist/commands/snapshots/list/outcomes.d.ts +247 -15
- package/dist/commands/snapshots/list/outcomes.js +223 -52
- package/dist/commands/snapshots/metadata.js +1 -1
- package/dist/commands/snapshots/prune/command.d.ts +430 -0
- package/dist/commands/snapshots/prune/command.js +161 -0
- package/dist/commands/snapshots/prune/metadata.d.ts +28 -0
- package/dist/commands/snapshots/prune/metadata.js +39 -0
- package/dist/commands/snapshots/prune/outcomes.d.ts +208 -0
- package/dist/commands/snapshots/prune/outcomes.js +78 -0
- package/dist/commands/suites/list/command.js +17 -17
- package/dist/commands/suites/list/outcomes.js +2 -2
- package/dist/commands/test/command.d.ts +67 -14
- package/dist/commands/test/command.js +49 -252
- package/dist/commands/test/outcomes.d.ts +33 -7
- package/dist/config/check-runner.d.ts +3 -3
- package/dist/config/check-runner.js +8 -7
- package/dist/config/credential-resolver.d.ts +50 -5
- package/dist/config/credential-resolver.js +51 -19
- package/dist/config/credential-settle.d.ts +6 -2
- package/dist/config/credential-settle.js +11 -5
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.js +1 -1
- package/dist/config/runner.d.ts +5 -5
- package/dist/config/runner.js +1 -1
- package/dist/config/schema.d.ts +2 -2
- package/dist/config/schema.js +1 -1
- package/dist/config-file/define.d.ts +1 -1
- package/dist/config-file/define.js +1 -1
- package/dist/config-file/runner.d.ts +5 -5
- package/dist/config-file/toolchain.d.ts +14 -4
- package/dist/config-file/toolchain.js +43 -7
- package/dist/context.d.ts +10 -6
- package/dist/context.js +8 -6
- package/dist/core/across-sandboxes.d.ts +7 -6
- package/dist/core/across-sandboxes.js +123 -152
- package/dist/core/coordinator.d.ts +166 -0
- package/dist/core/coordinator.js +233 -0
- package/dist/core/events.d.ts +2 -2
- package/dist/core/index.d.ts +4 -2
- package/dist/core/index.js +1 -1
- package/dist/core/outcomes.d.ts +148 -0
- package/dist/core/{sandbox-end.js → outcomes.js} +28 -4
- package/dist/core/resources.d.ts +31 -53
- package/dist/core/resources.js +32 -70
- package/dist/core/run-state.d.ts +7 -1
- package/dist/core/run-state.js +2 -0
- package/dist/core/run.d.ts +32 -236
- package/dist/core/run.js +107 -267
- package/dist/core/state-directory.d.ts +1 -1
- package/dist/core/state-directory.js +2 -2
- package/dist/credential/gateways.d.ts +15 -1
- package/dist/credential/index.d.ts +4 -3
- package/dist/credential/index.js +3 -2
- package/dist/credential/live/vercel-cli-gateway.d.ts +1 -1
- package/dist/credential/live/vercel-cli-gateway.js +1 -1
- package/dist/credential/live/vercel-oidc-token-gateway.d.ts +11 -0
- package/dist/credential/live/vercel-oidc-token-gateway.js +16 -0
- package/dist/credential/source.d.ts +73 -6
- package/dist/credential/source.js +55 -2
- package/dist/extension-commands.d.ts +1 -1
- package/dist/extension-commands.js +2 -2
- package/dist/extensions/testserver/commands/pool/create/command.d.ts +35 -2
- package/dist/extensions/testserver/commands/pool/create/command.js +7 -7
- package/dist/extensions/testserver/commands/pool/create/metadata.js +5 -5
- package/dist/extensions/testserver/commands/pool/create/outcomes.d.ts +17 -1
- package/dist/extensions/testserver/commands/pool/list/command.js +4 -4
- package/dist/extensions/testserver/credential-facts.d.ts +6 -2
- package/dist/extensions/testserver/credential-facts.js +29 -11
- package/dist/extensions/testserver/lifecycle.js +7 -1
- package/dist/extensions/testserver/limit.d.ts +3 -0
- package/dist/extensions/testserver/limit.js +3 -0
- package/dist/extensions/testserver/provision.d.ts +8 -1
- package/dist/extensions/testserver/provision.js +8 -3
- package/dist/extensions/testserver/refusals.d.ts +6 -1
- package/dist/extensions/testserver/refusals.js +16 -1
- package/dist/extensions/testserver/resource.d.ts +1 -1
- package/dist/extensions/testserver/resource.js +1 -1
- package/dist/extensions/testserver/result.d.ts +1 -1
- package/dist/extensions/testserver/result.js +9 -4
- package/dist/planning/driver-file-lists.d.ts +0 -15
- package/dist/planning/driver-file-lists.js +2 -21
- package/dist/planning/plan-only.d.ts +3 -14
- package/dist/planning/plan-only.js +11 -20
- package/dist/planning/run-kind-flags.js +2 -2
- package/dist/planning/run-plan.d.ts +45 -12
- package/dist/planning/run-plan.js +4 -3
- package/dist/planning/suites.d.ts +1 -1
- package/dist/planning/suites.js +2 -2
- package/dist/planning/test-plan.d.ts +9 -0
- package/dist/planning/test-plan.js +9 -0
- package/dist/run-directory/recording.js +3 -3
- package/dist/run-directory/run-record.d.ts +26 -11
- package/dist/run-directory/run-record.js +16 -13
- package/dist/runner/base.js +1 -1
- package/dist/runner/build-snapshots.d.ts +60 -29
- package/dist/runner/build-snapshots.js +136 -29
- package/dist/runner/context.d.ts +15 -7
- package/dist/runner/context.js +19 -6
- package/dist/runner/events.d.ts +16 -10
- package/dist/runner/gateways.d.ts +122 -23
- package/dist/runner/gateways.js +1 -1
- package/dist/runner/gh.d.ts +42 -0
- package/dist/runner/gh.js +58 -0
- package/dist/runner/index.d.ts +13 -8
- package/dist/runner/index.js +12 -6
- package/dist/runner/live/checkout-gateway.js +7 -0
- package/dist/runner/live/gh-output.d.ts +17 -0
- package/dist/runner/live/gh-output.js +37 -0
- package/dist/runner/live/gh-token-gateway.d.ts +13 -0
- package/dist/runner/live/gh-token-gateway.js +51 -0
- package/dist/runner/live/sandbox-errors.d.ts +2 -0
- package/dist/runner/live/sandbox-errors.js +4 -0
- package/dist/runner/live/sandbox-gateway.js +140 -4
- package/dist/runner/live/snapshot-index-gateway.d.ts +12 -0
- package/dist/runner/live/{snapshot-cache-gateway.js → snapshot-index-gateway.js} +11 -11
- package/dist/runner/live/snapshot-records.js +12 -12
- package/dist/runner/local-snapshot-index.d.ts +205 -0
- package/dist/runner/local-snapshot-index.js +210 -0
- package/dist/runner/network-policy.d.ts +6 -6
- package/dist/runner/network-policy.js +7 -7
- package/dist/runner/policy-writes.d.ts +1 -1
- package/dist/runner/policy-writes.js +1 -1
- package/dist/runner/prepare.d.ts +14 -14
- package/dist/runner/prepare.js +20 -11
- package/dist/runner/ready.d.ts +19 -11
- package/dist/runner/ready.js +104 -33
- package/dist/runner/sandboxed-command.d.ts +3 -3
- package/dist/runner/sandboxed-command.js +3 -3
- package/dist/runner/scope.d.ts +15 -8
- package/dist/runner/scope.js +16 -5
- package/dist/runner/secrets.d.ts +41 -18
- package/dist/runner/secrets.js +226 -30
- package/dist/runner/session.d.ts +8 -8
- package/dist/runner/session.js +6 -3
- package/dist/runner/shared-snapshot-entry.d.ts +92 -0
- package/dist/runner/shared-snapshot-entry.js +168 -0
- package/dist/runner/shared-snapshot-list.d.ts +81 -0
- package/dist/runner/shared-snapshot-list.js +155 -0
- package/dist/runner/shared-snapshot-lookup.d.ts +51 -0
- package/dist/runner/shared-snapshot-lookup.js +118 -0
- package/dist/runner/shared-snapshot-prune.d.ts +58 -0
- package/dist/runner/shared-snapshot-prune.js +133 -0
- package/dist/runner/snapshot-build.d.ts +42 -14
- package/dist/runner/snapshot-build.js +79 -47
- package/dist/runner/snapshot-choice.js +2 -1
- package/dist/runner/snapshot-inspect.d.ts +39 -40
- package/dist/runner/snapshot-inspect.js +52 -35
- package/dist/runner/snapshot-key.d.ts +32 -17
- package/dist/runner/snapshot-key.js +43 -18
- package/dist/runner/snapshot-source.d.ts +31 -0
- package/dist/runner/snapshot-source.js +122 -0
- package/dist/runner/steps.d.ts +1 -1
- package/dist/runner/steps.js +1 -1
- package/dist/runner/{recipe-check.d.ts → vercel-sandbox-check.d.ts} +4 -2
- package/dist/runner/{recipe-check.js → vercel-sandbox-check.js} +7 -2
- package/dist/runner/{recipe.d.ts → vercel-sandbox-options.d.ts} +59 -28
- package/dist/runner/{recipe.js → vercel-sandbox-options.js} +128 -84
- package/dist/runner/vercel-sandbox-secrets.d.ts +116 -0
- package/dist/runner/{recipe-secrets.js → vercel-sandbox-secrets.js} +159 -26
- package/dist/sdk/extension/credential-diagnosis.d.ts +3 -1
- package/dist/sdk/extension/credential-diagnosis.js +25 -5
- package/dist/sdk/extension/credential-source.d.ts +20 -3
- package/dist/sdk/extension/credential-source.js +4 -4
- package/dist/sdk/extension/index.d.ts +3 -2
- package/dist/sdk/extension/index.js +2 -1
- package/dist/sdk/extension/resource-definition.d.ts +1 -1
- package/dist/sdk/extension/secret-source.d.ts +1 -1
- package/dist/sdk/extension/secret-source.js +1 -1
- package/dist/sdk/extension/vercel-oidc-facts.d.ts +20 -0
- package/dist/sdk/extension/vercel-oidc-facts.js +20 -0
- package/dist/shared/cleanup.d.ts +3 -3
- package/dist/shared/cleanup.js +15 -5
- package/dist/shared/snapshot-text.d.ts +4 -4
- package/dist/shared/snapshot-text.js +11 -11
- package/dist/time/duration.js +1 -1
- package/package.json +5 -3
- package/skills/overview.md +4 -4
- package/skills/plan-runs.md +1 -1
- package/skills/read-run-output.md +6 -6
- package/dist/application.d.ts +0 -21
- package/dist/application.js +0 -30
- package/dist/chunks/chunk-7EENF73W.js +0 -782
- package/dist/chunks/chunk-Z5PBVG3Y.js +0 -2599
- package/dist/commands/exec/across-sandboxes-run.d.ts +0 -180
- package/dist/commands/exec/across-sandboxes-run.js +0 -339
- package/dist/commands/exec/plan-only.d.ts +0 -10
- package/dist/commands/exec/plan-only.js +0 -45
- package/dist/commands/exec/run-command.d.ts +0 -475
- package/dist/commands/exec/run-command.js +0 -603
- package/dist/commands/exec/run-planned.d.ts +0 -20
- package/dist/commands/exec/run-planned.js +0 -22
- package/dist/commands/exec/sandbox-view.d.ts +0 -19
- package/dist/commands/exec/sandbox-view.js +0 -72
- package/dist/commands/test/plan.d.ts +0 -92
- package/dist/commands/test/plan.js +0 -125
- package/dist/core/sandbox-end.d.ts +0 -64
- package/dist/runner/live/snapshot-cache-gateway.d.ts +0 -12
- package/dist/runner/recipe-secrets.d.ts +0 -67
- package/dist/runner/snapshot-cache.d.ts +0 -148
- package/dist/runner/snapshot-cache.js +0 -126
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import type { Credential, CredentialSource, MintFailed, MintTarget } from "../sdk/extension/index.ts";
|
|
1
|
+
import type { Credential, CredentialFailure, CredentialSource, MintFailed, MintTarget, VercelProject } from "../sdk/extension/index.ts";
|
|
2
2
|
import type { CredentialProgress } from "./events.ts";
|
|
3
|
-
import type { CredentialGateway, GitHubActionsTokenGateway, MintOutcome } from "./gateways.ts";
|
|
3
|
+
import type { CredentialGateway, GitHubActionsTokenGateway, MintOutcome, VercelOidcTokenGateway } from "./gateways.ts";
|
|
4
4
|
/** The progress line a GitHub Actions OIDC token request prints as it starts. */
|
|
5
5
|
export declare const REQUESTING_TOKEN_LINE = "Requesting a GitHub Actions OIDC token\u2026";
|
|
6
6
|
/**
|
|
7
|
-
* Which credential source a run or an extension's command gets its credential from, picked with `--credential`: the
|
|
8
|
-
* `target
|
|
7
|
+
* Which credential source a run or an extension's command gets its credential from, picked with `--credential`: the
|
|
8
|
+
* mint, for `target`; a GitHub Actions OIDC token request; or `VERCEL_OIDC_TOKEN`.
|
|
9
9
|
*/
|
|
10
10
|
export type CredentialSourceChoice = {
|
|
11
11
|
readonly source: "mint";
|
|
12
12
|
readonly target: MintTarget;
|
|
13
13
|
} | {
|
|
14
14
|
readonly source: "github-actions";
|
|
15
|
+
} | {
|
|
16
|
+
readonly source: "vercel-oidc";
|
|
15
17
|
};
|
|
16
18
|
/** A clock as a credential source reads it; structural so this module needs no other module's time seams. */
|
|
17
19
|
interface SourceClock {
|
|
@@ -22,12 +24,14 @@ interface SourceTimer {
|
|
|
22
24
|
sleep(ms: number, signal?: AbortSignal): Promise<void>;
|
|
23
25
|
}
|
|
24
26
|
/**
|
|
25
|
-
* What a credential source reaches the world through: the mint, GitHub Actions' OIDC token issuer, the
|
|
26
|
-
* age is read from and the timer a token request's
|
|
27
|
+
* What a credential source reaches the world through: the mint, GitHub Actions' OIDC token issuer, the
|
|
28
|
+
* `VERCEL_OIDC_TOKEN` environment reader, the clock a token's age is read from, and the timer a token request's
|
|
29
|
+
* retries wait on.
|
|
27
30
|
*/
|
|
28
31
|
export interface CredentialContext {
|
|
29
32
|
readonly credentials: CredentialGateway;
|
|
30
33
|
readonly githubActionsTokens: GitHubActionsTokenGateway;
|
|
34
|
+
readonly vercelOidcTokens: VercelOidcTokenGateway;
|
|
31
35
|
readonly clock: SourceClock;
|
|
32
36
|
readonly timer: SourceTimer;
|
|
33
37
|
}
|
|
@@ -41,6 +45,24 @@ export interface MintSource extends CredentialSource {
|
|
|
41
45
|
readonly failure: MintFailed;
|
|
42
46
|
}>;
|
|
43
47
|
}
|
|
48
|
+
/** Why the `VERCEL_OIDC_TOKEN` source obtained no credential. */
|
|
49
|
+
export type VercelOidcFailed = Extract<CredentialFailure, {
|
|
50
|
+
readonly source: "vercel-oidc";
|
|
51
|
+
}>;
|
|
52
|
+
/**
|
|
53
|
+
* `VERCEL_OIDC_TOKEN` as a credential source: it refuses a token that names no team and project, so what it obtains
|
|
54
|
+
* carries them (`project`).
|
|
55
|
+
*/
|
|
56
|
+
export interface VercelOidcSource extends CredentialSource {
|
|
57
|
+
obtain(): Promise<{
|
|
58
|
+
readonly ok: true;
|
|
59
|
+
readonly credential: Credential;
|
|
60
|
+
readonly project: VercelProject;
|
|
61
|
+
} | {
|
|
62
|
+
readonly ok: false;
|
|
63
|
+
readonly failure: VercelOidcFailed;
|
|
64
|
+
}>;
|
|
65
|
+
}
|
|
44
66
|
/**
|
|
45
67
|
* The credential source `choice` names, over `context`, reporting to `progress`: the mint emits `minting` before its
|
|
46
68
|
* one mint and `minted` after it, and a GitHub Actions OIDC token request emits `requesting-token` before each
|
|
@@ -50,6 +72,9 @@ export interface MintSource extends CredentialSource {
|
|
|
50
72
|
export declare function credentialSourceFor(choice: Extract<CredentialSourceChoice, {
|
|
51
73
|
readonly source: "mint";
|
|
52
74
|
}>, context: CredentialContext, progress: CredentialProgress): MintSource;
|
|
75
|
+
export declare function credentialSourceFor(choice: Extract<CredentialSourceChoice, {
|
|
76
|
+
readonly source: "vercel-oidc";
|
|
77
|
+
}>, context: CredentialContext, progress: CredentialProgress): VercelOidcSource;
|
|
53
78
|
export declare function credentialSourceFor(choice: CredentialSourceChoice, context: CredentialContext, progress: CredentialProgress): CredentialSource;
|
|
54
79
|
/**
|
|
55
80
|
* The mint as a credential source: it mints at most once. The first `obtain()` calls `mint`; every later call,
|
|
@@ -76,4 +101,46 @@ export declare function githubActionsSource(context: {
|
|
|
76
101
|
readonly timer: SourceTimer;
|
|
77
102
|
readonly progress: CredentialProgress;
|
|
78
103
|
}): CredentialSource;
|
|
104
|
+
/**
|
|
105
|
+
* A pre-minted Vercel project OIDC token (`VERCEL_OIDC_TOKEN`) as a credential source. The first `obtain()` reads
|
|
106
|
+
* through `gateway` and checks `credential.vercelProject()` (requiring a valid JWT with `owner_id` and `project_id`
|
|
107
|
+
* claims), handing the team and project on with the credential; every later call returns the same outcome. Never
|
|
108
|
+
* logs, prints, or exposes the raw token.
|
|
109
|
+
*/
|
|
110
|
+
export declare function vercelOidcSource(gateway: VercelOidcTokenGateway): VercelOidcSource;
|
|
111
|
+
/**
|
|
112
|
+
* How obtaining a credential for a Vercel Sandbox ended: the credential with the team and project it names; the
|
|
113
|
+
* mint's or `VERCEL_OIDC_TOKEN`'s failure; or `claims-missing`, a minted credential that names no team and project,
|
|
114
|
+
* for the mint's `target`.
|
|
115
|
+
*/
|
|
116
|
+
export type VercelProjectOutcome = {
|
|
117
|
+
readonly ok: true;
|
|
118
|
+
readonly credential: Credential;
|
|
119
|
+
readonly project: VercelProject;
|
|
120
|
+
} | {
|
|
121
|
+
readonly ok: false;
|
|
122
|
+
readonly failure: MintFailed | VercelOidcFailed;
|
|
123
|
+
} | {
|
|
124
|
+
readonly ok: false;
|
|
125
|
+
readonly failure: {
|
|
126
|
+
readonly source: "claims-missing";
|
|
127
|
+
readonly target: MintTarget;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* The credential source a Vercel Sandbox runs with (`source`, which the run's resources share), and `obtain`, which
|
|
132
|
+
* obtains its credential with the team and project it names (`VercelProjectOutcome`).
|
|
133
|
+
*/
|
|
134
|
+
export interface VercelProjectSource {
|
|
135
|
+
readonly source: CredentialSource;
|
|
136
|
+
readonly obtain: () => Promise<VercelProjectOutcome>;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* The credential source `choice` names for a Vercel Sandbox, which needs the team and project a credential names. The
|
|
140
|
+
* `VERCEL_OIDC_TOKEN` source checks them itself; this checks the mint's, the one place a credential without them ends
|
|
141
|
+
* as `claims-missing`.
|
|
142
|
+
*/
|
|
143
|
+
export declare function vercelProjectSource(choice: Extract<CredentialSourceChoice, {
|
|
144
|
+
readonly source: "mint" | "vercel-oidc";
|
|
145
|
+
}>, context: CredentialContext, progress: CredentialProgress): VercelProjectSource;
|
|
79
146
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// The credential sources, built by one factory (`credentialSourceFor`) from the credential choice, over the
|
|
2
|
-
// credential gateways, a clock and a timer, reporting each mint and token request to a `CredentialProgress`.
|
|
3
|
-
//
|
|
2
|
+
// credential gateways, a clock and a timer, reporting each mint and token request to a `CredentialProgress`. A Vercel
|
|
3
|
+
// Sandbox gets its source through `vercelProjectSource`, the one place that checks the team and project a credential
|
|
4
|
+
// names. The mint source and the GitHub Actions source it builds are exported for this module's own tests only.
|
|
4
5
|
/** The progress line a GitHub Actions OIDC token request prints as it starts. */
|
|
5
6
|
export const REQUESTING_TOKEN_LINE = "Requesting a GitHub Actions OIDC token…";
|
|
6
7
|
export function credentialSourceFor(choice, context, progress) {
|
|
@@ -11,6 +12,8 @@ export function credentialSourceFor(choice, context, progress) {
|
|
|
11
12
|
timer: context.timer,
|
|
12
13
|
progress,
|
|
13
14
|
});
|
|
15
|
+
if (choice.source === "vercel-oidc")
|
|
16
|
+
return vercelOidcSource(context.vercelOidcTokens);
|
|
14
17
|
const { target } = choice;
|
|
15
18
|
return mintSource(target, async () => {
|
|
16
19
|
await progress.emit({ kind: "minting", target });
|
|
@@ -117,3 +120,53 @@ function isRetryable(failure) {
|
|
|
117
120
|
return false;
|
|
118
121
|
}
|
|
119
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* A pre-minted Vercel project OIDC token (`VERCEL_OIDC_TOKEN`) as a credential source. The first `obtain()` reads
|
|
125
|
+
* through `gateway` and checks `credential.vercelProject()` (requiring a valid JWT with `owner_id` and `project_id`
|
|
126
|
+
* claims), handing the team and project on with the credential; every later call returns the same outcome. Never
|
|
127
|
+
* logs, prints, or exposes the raw token.
|
|
128
|
+
*/
|
|
129
|
+
export function vercelOidcSource(gateway) {
|
|
130
|
+
let outcome;
|
|
131
|
+
return {
|
|
132
|
+
obtain() {
|
|
133
|
+
outcome ??= (async () => {
|
|
134
|
+
const read = await gateway.read();
|
|
135
|
+
if (!read.ok)
|
|
136
|
+
return { ok: false, failure: { source: "vercel-oidc", failure: read.failure } };
|
|
137
|
+
const project = read.credential.vercelProject();
|
|
138
|
+
if (project === undefined)
|
|
139
|
+
return { ok: false, failure: { source: "vercel-oidc", failure: { kind: "invalid-token" } } };
|
|
140
|
+
return { ok: true, credential: read.credential, project };
|
|
141
|
+
})();
|
|
142
|
+
return outcome;
|
|
143
|
+
},
|
|
144
|
+
origin() {
|
|
145
|
+
return { source: "vercel-oidc" };
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* The credential source `choice` names for a Vercel Sandbox, which needs the team and project a credential names. The
|
|
151
|
+
* `VERCEL_OIDC_TOKEN` source checks them itself; this checks the mint's, the one place a credential without them ends
|
|
152
|
+
* as `claims-missing`.
|
|
153
|
+
*/
|
|
154
|
+
export function vercelProjectSource(choice, context, progress) {
|
|
155
|
+
if (choice.source === "vercel-oidc") {
|
|
156
|
+
const source = credentialSourceFor(choice, context, progress);
|
|
157
|
+
return { source, obtain: () => source.obtain() };
|
|
158
|
+
}
|
|
159
|
+
const source = credentialSourceFor(choice, context, progress);
|
|
160
|
+
return {
|
|
161
|
+
source,
|
|
162
|
+
obtain: async () => {
|
|
163
|
+
const got = await source.obtain();
|
|
164
|
+
if (!got.ok)
|
|
165
|
+
return got;
|
|
166
|
+
const project = got.credential.vercelProject();
|
|
167
|
+
return project === undefined
|
|
168
|
+
? { ok: false, failure: { source: "claims-missing", target: choice.target } }
|
|
169
|
+
: { ok: true, credential: got.credential, project };
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
}
|
|
@@ -14,7 +14,7 @@ export interface ExtensionCommandsEntry {
|
|
|
14
14
|
export declare const EXTENSION_COMMANDS: readonly ExtensionCommandsEntry[];
|
|
15
15
|
/**
|
|
16
16
|
* Every extension's command tree, mounted at its path with its directory under `root`, storm's code root (`src/` or
|
|
17
|
-
* `dist/`), which `
|
|
17
|
+
* `dist/`), which `cli.ts` mounts beside the launcher's own commands (the `ext` group is `commands/ext/`).
|
|
18
18
|
* Clinkr refuses a path that collides with a command of storm's own or another mount.
|
|
19
19
|
*/
|
|
20
20
|
export declare function extensionMounts(root: string): readonly Mount<StormApp>[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// The extensions' own command trees, each with the path `
|
|
1
|
+
// The extensions' own command trees, each with the path `cli.ts` mounts it at. It is the one file besides the
|
|
2
2
|
// extension registry (`src/extensions.ts`) that names an extension, and it imports only each extension's
|
|
3
3
|
// `command-tree.ts`, which loads no resource: help lists `ext testserver` without loading the extension registry, the
|
|
4
4
|
// resources, the runner, or the SDK. This file places each tree, not its extension: the tree of an extension that
|
|
@@ -15,7 +15,7 @@ export const EXTENSION_COMMANDS = [
|
|
|
15
15
|
];
|
|
16
16
|
/**
|
|
17
17
|
* Every extension's command tree, mounted at its path with its directory under `root`, storm's code root (`src/` or
|
|
18
|
-
* `dist/`), which `
|
|
18
|
+
* `dist/`), which `cli.ts` mounts beside the launcher's own commands (the `ext` group is `commands/ext/`).
|
|
19
19
|
* Clinkr refuses a path that collides with a command of storm's own or another mount.
|
|
20
20
|
*/
|
|
21
21
|
export function extensionMounts(root) {
|
|
@@ -30,6 +30,7 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
|
30
30
|
credential: z.ZodDefault<z.ZodEnum<{
|
|
31
31
|
"github-actions": "github-actions";
|
|
32
32
|
mint: "mint";
|
|
33
|
+
"vercel-oidc": "vercel-oidc";
|
|
33
34
|
}>>;
|
|
34
35
|
}, z.core.$strip>, import("@vercel/clinkr").Outcomes<{
|
|
35
36
|
created: z.ZodObject<{
|
|
@@ -113,6 +114,8 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
|
113
114
|
aud: z.ZodString;
|
|
114
115
|
repository: z.ZodString;
|
|
115
116
|
}, z.core.$strip>>;
|
|
117
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
118
|
+
source: z.ZodLiteral<"vercel-oidc">;
|
|
116
119
|
}, z.core.$strip>], "source">;
|
|
117
120
|
fix: z.ZodString;
|
|
118
121
|
status: z.ZodNumber;
|
|
@@ -193,6 +196,11 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
|
193
196
|
detail: string;
|
|
194
197
|
fix: string;
|
|
195
198
|
}]>;
|
|
199
|
+
vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
|
|
200
|
+
cause: "invalid-token" | "missing-token";
|
|
201
|
+
detail: string;
|
|
202
|
+
fix: string;
|
|
203
|
+
}]>;
|
|
196
204
|
}, {
|
|
197
205
|
readonly pullRequestUnreadable: {
|
|
198
206
|
readonly exitCode: 1;
|
|
@@ -343,6 +351,8 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
|
343
351
|
aud: z.ZodString;
|
|
344
352
|
repository: z.ZodString;
|
|
345
353
|
}, z.core.$strip>>;
|
|
354
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
355
|
+
source: z.ZodLiteral<"vercel-oidc">;
|
|
346
356
|
}, z.core.$strip>], "source">;
|
|
347
357
|
fix: z.ZodString;
|
|
348
358
|
status: z.ZodNumber;
|
|
@@ -359,13 +369,15 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
|
359
369
|
aud: string;
|
|
360
370
|
repository: string;
|
|
361
371
|
} | null;
|
|
372
|
+
} | {
|
|
373
|
+
source: "vercel-oidc";
|
|
362
374
|
};
|
|
363
375
|
fix: string;
|
|
364
376
|
status: number;
|
|
365
377
|
vercelId: string | null;
|
|
366
378
|
}) => {
|
|
367
379
|
message: string;
|
|
368
|
-
rows: (readonly ["Project", string] | readonly ["Team", string])[] | (readonly ["aud", string] | readonly ["repository", string])[];
|
|
380
|
+
rows: (readonly ["Credential", "VERCEL_OIDC_TOKEN"])[] | (readonly ["Project", string] | readonly ["Team", string])[] | (readonly ["aud", string] | readonly ["repository", string])[];
|
|
369
381
|
next: {
|
|
370
382
|
type: "text";
|
|
371
383
|
text: string;
|
|
@@ -506,6 +518,11 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
|
506
518
|
detail: string;
|
|
507
519
|
fix: string;
|
|
508
520
|
}]>;
|
|
521
|
+
readonly vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
|
|
522
|
+
cause: "invalid-token" | "missing-token";
|
|
523
|
+
detail: string;
|
|
524
|
+
fix: string;
|
|
525
|
+
}]>;
|
|
509
526
|
}>, import("@vercel/clinkr").OutcomeOf<import("@vercel/clinkr").Outcomes<{
|
|
510
527
|
created: z.ZodObject<{
|
|
511
528
|
testserverUrl: z.ZodString;
|
|
@@ -588,6 +605,8 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
|
588
605
|
aud: z.ZodString;
|
|
589
606
|
repository: z.ZodString;
|
|
590
607
|
}, z.core.$strip>>;
|
|
608
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
609
|
+
source: z.ZodLiteral<"vercel-oidc">;
|
|
591
610
|
}, z.core.$strip>], "source">;
|
|
592
611
|
fix: z.ZodString;
|
|
593
612
|
status: z.ZodNumber;
|
|
@@ -668,6 +687,11 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
|
668
687
|
detail: string;
|
|
669
688
|
fix: string;
|
|
670
689
|
}]>;
|
|
690
|
+
vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
|
|
691
|
+
cause: "invalid-token" | "missing-token";
|
|
692
|
+
detail: string;
|
|
693
|
+
fix: string;
|
|
694
|
+
}]>;
|
|
671
695
|
}, {
|
|
672
696
|
readonly pullRequestUnreadable: {
|
|
673
697
|
readonly exitCode: 1;
|
|
@@ -818,6 +842,8 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
|
818
842
|
aud: z.ZodString;
|
|
819
843
|
repository: z.ZodString;
|
|
820
844
|
}, z.core.$strip>>;
|
|
845
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
846
|
+
source: z.ZodLiteral<"vercel-oidc">;
|
|
821
847
|
}, z.core.$strip>], "source">;
|
|
822
848
|
fix: z.ZodString;
|
|
823
849
|
status: z.ZodNumber;
|
|
@@ -834,13 +860,15 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
|
834
860
|
aud: string;
|
|
835
861
|
repository: string;
|
|
836
862
|
} | null;
|
|
863
|
+
} | {
|
|
864
|
+
source: "vercel-oidc";
|
|
837
865
|
};
|
|
838
866
|
fix: string;
|
|
839
867
|
status: number;
|
|
840
868
|
vercelId: string | null;
|
|
841
869
|
}) => {
|
|
842
870
|
message: string;
|
|
843
|
-
rows: (readonly ["Project", string] | readonly ["Team", string])[] | (readonly ["aud", string] | readonly ["repository", string])[];
|
|
871
|
+
rows: (readonly ["Credential", "VERCEL_OIDC_TOKEN"])[] | (readonly ["Project", string] | readonly ["Team", string])[] | (readonly ["aud", string] | readonly ["repository", string])[];
|
|
844
872
|
next: {
|
|
845
873
|
type: "text";
|
|
846
874
|
text: string;
|
|
@@ -981,5 +1009,10 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
|
981
1009
|
detail: string;
|
|
982
1010
|
fix: string;
|
|
983
1011
|
}]>;
|
|
1012
|
+
readonly vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
|
|
1013
|
+
cause: "invalid-token" | "missing-token";
|
|
1014
|
+
detail: string;
|
|
1015
|
+
fix: string;
|
|
1016
|
+
}]>;
|
|
984
1017
|
}>>, import("../../app.ts").TestserverCommandApp, false>;
|
|
985
1018
|
export default _default;
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
rejectedCredentialShape,
|
|
7
7
|
rejectedCredentialText,
|
|
8
8
|
testserverPoolDefinition
|
|
9
|
-
} from "../../../../../chunks/chunk-
|
|
9
|
+
} from "../../../../../chunks/chunk-EEENLQHE.js";
|
|
10
10
|
import {
|
|
11
11
|
CREATE_ATTEMPTS,
|
|
12
12
|
DEFAULT_TTL_MINUTES,
|
|
@@ -19,20 +19,20 @@ import {
|
|
|
19
19
|
parseTtl,
|
|
20
20
|
resolvePrBuild,
|
|
21
21
|
shortSha
|
|
22
|
-
} from "../../../../../chunks/chunk-
|
|
22
|
+
} from "../../../../../chunks/chunk-72ZFEMAW.js";
|
|
23
23
|
import {
|
|
24
24
|
testserverCommands
|
|
25
|
-
} from "../../../../../chunks/chunk-
|
|
25
|
+
} from "../../../../../chunks/chunk-TXCOFC7N.js";
|
|
26
26
|
import {
|
|
27
27
|
configErrors,
|
|
28
28
|
credentialErrors,
|
|
29
29
|
credentialSourceErrors
|
|
30
|
-
} from "../../../../../chunks/chunk-
|
|
31
|
-
import "../../../../../chunks/chunk-
|
|
30
|
+
} from "../../../../../chunks/chunk-2JMWUKH3.js";
|
|
31
|
+
import "../../../../../chunks/chunk-XBDRVFEV.js";
|
|
32
32
|
import {
|
|
33
33
|
defineOutcomes,
|
|
34
34
|
renderOutcome
|
|
35
|
-
} from "../../../../../chunks/chunk-
|
|
35
|
+
} from "../../../../../chunks/chunk-24UYAK4R.js";
|
|
36
36
|
|
|
37
37
|
// src/extensions/testserver/commands/pool/create/command.ts
|
|
38
38
|
import { z as z2 } from "zod";
|
|
@@ -201,7 +201,7 @@ var command_default = testserverCommands.define({
|
|
|
201
201
|
project: z2.string().min(1).optional(),
|
|
202
202
|
build: z2.string().min(1).optional(),
|
|
203
203
|
ttl: z2.string().optional(),
|
|
204
|
-
credential: z2.enum(["mint", "github-actions"]).default("mint")
|
|
204
|
+
credential: z2.enum(["mint", "github-actions", "vercel-oidc"]).default("mint")
|
|
205
205
|
}),
|
|
206
206
|
cli: { options: { project: { short: "p" } } },
|
|
207
207
|
response: outcomes,
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
// src/extensions/testserver/commands/pool/create/metadata.ts
|
|
2
2
|
var metadata = {
|
|
3
|
-
description: "Get a credential (mint one,
|
|
3
|
+
description: "Get a credential (mint one, read VERCEL_OIDC_TOKEN with --credential vercel-oidc, or request a GitHub Actions OIDC token with --credential github-actions), create one Testserver sandbox with the TTL --ttl gives, and add it to the pool, unleased. Prints its Testserver URL, log viewer URL, and the build it resolved to; for a vercel/api pull request, also the head commit. A flag overrides storm.config.ts, found in the working directory or a parent up to the git worktree's root and checked whole, which overrides the built-in default.",
|
|
4
4
|
help: {
|
|
5
5
|
usages: ["[--build <BUILD>] [--ttl <DURATION>] [--credential <SOURCE>] [--scope <TEAM> --project <PROJECT>]"],
|
|
6
6
|
fields: {
|
|
7
7
|
scope: {
|
|
8
8
|
valueLabel: "TEAM",
|
|
9
|
-
description: "The control plane team: the Vercel team whose project's development OIDC tokens the Testserver control plane trusts. Required with the mint, from this flag or scope in storm.config.ts; unused with --credential github-actions."
|
|
9
|
+
description: "The control plane team: the Vercel team whose project's development OIDC tokens the Testserver control plane trusts. Required with the mint, from this flag or scope in storm.config.ts; unused with --credential vercel-oidc or --credential github-actions."
|
|
10
10
|
},
|
|
11
11
|
project: {
|
|
12
12
|
valueLabel: "PROJECT",
|
|
13
|
-
description: "The control plane project: the Vercel project, within the team, to mint the credential for. Required with the mint, from this flag or project in storm.config.ts; unused with --credential github-actions."
|
|
13
|
+
description: "The control plane project: the Vercel project, within the team, to mint the credential for. Required with the mint, from this flag or project in storm.config.ts; unused with --credential vercel-oidc or --credential github-actions."
|
|
14
14
|
},
|
|
15
15
|
build: {
|
|
16
16
|
valueLabel: "BUILD",
|
|
17
|
-
description: "The build to create the Testserver sandbox on: a build name, the build channel stable or latest_main, or a vercel/api pull request as pr:<N> or its URL. A pull request creates on the newest build made from its head commit, which storm reads from GitHub with GITHUB_TOKEN, GH_TOKEN or gh auth token, or refuses. Default stable, or resources.testserverPool.build in storm.config.ts."
|
|
17
|
+
description: "The build to create the Testserver sandbox on: a build name, the build channel stable or latest_main, or a vercel/api pull request as pr:<N> or its URL. A pull request creates on the newest build made from its head commit, which storm reads from GitHub with GITHUB_TOKEN, GH_TOKEN, or gh auth token, or refuses. Default stable, or resources.testserverPool.build in storm.config.ts."
|
|
18
18
|
},
|
|
19
19
|
ttl: {
|
|
20
20
|
valueLabel: "DURATION",
|
|
@@ -22,7 +22,7 @@ var metadata = {
|
|
|
22
22
|
},
|
|
23
23
|
credential: {
|
|
24
24
|
valueLabel: "SOURCE",
|
|
25
|
-
description: "The credential source: mint, the default, mints one with the vercel CLI for --scope and --project; github-actions requests a GitHub Actions OIDC token, in a GitHub Actions job with permissions id-token: write, and needs no --scope or --project. No config key."
|
|
25
|
+
description: "The credential source: mint, the default, mints one with the vercel CLI for --scope and --project; vercel-oidc reads a pre-minted Vercel project OIDC token from VERCEL_OIDC_TOKEN and needs no --scope or --project; github-actions requests a GitHub Actions OIDC token, in a GitHub Actions job with permissions id-token: write, and needs no --scope or --project. No config key."
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
examples: [
|
|
@@ -82,6 +82,8 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
82
82
|
aud: z.ZodString;
|
|
83
83
|
repository: z.ZodString;
|
|
84
84
|
}, z.core.$strip>>;
|
|
85
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
86
|
+
source: z.ZodLiteral<"vercel-oidc">;
|
|
85
87
|
}, z.core.$strip>], "source">;
|
|
86
88
|
fix: z.ZodString;
|
|
87
89
|
status: z.ZodNumber;
|
|
@@ -162,6 +164,11 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
162
164
|
detail: string;
|
|
163
165
|
fix: string;
|
|
164
166
|
}]>;
|
|
167
|
+
vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
|
|
168
|
+
cause: "invalid-token" | "missing-token";
|
|
169
|
+
detail: string;
|
|
170
|
+
fix: string;
|
|
171
|
+
}]>;
|
|
165
172
|
}, {
|
|
166
173
|
readonly pullRequestUnreadable: {
|
|
167
174
|
readonly exitCode: 1;
|
|
@@ -312,6 +319,8 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
312
319
|
aud: z.ZodString;
|
|
313
320
|
repository: z.ZodString;
|
|
314
321
|
}, z.core.$strip>>;
|
|
322
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
323
|
+
source: z.ZodLiteral<"vercel-oidc">;
|
|
315
324
|
}, z.core.$strip>], "source">;
|
|
316
325
|
fix: z.ZodString;
|
|
317
326
|
status: z.ZodNumber;
|
|
@@ -328,13 +337,15 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
328
337
|
aud: string;
|
|
329
338
|
repository: string;
|
|
330
339
|
} | null;
|
|
340
|
+
} | {
|
|
341
|
+
source: "vercel-oidc";
|
|
331
342
|
};
|
|
332
343
|
fix: string;
|
|
333
344
|
status: number;
|
|
334
345
|
vercelId: string | null;
|
|
335
346
|
}) => {
|
|
336
347
|
message: string;
|
|
337
|
-
rows: (readonly ["Project", string] | readonly ["Team", string])[] | (readonly ["aud", string] | readonly ["repository", string])[];
|
|
348
|
+
rows: (readonly ["Credential", "VERCEL_OIDC_TOKEN"])[] | (readonly ["Project", string] | readonly ["Team", string])[] | (readonly ["aud", string] | readonly ["repository", string])[];
|
|
338
349
|
next: {
|
|
339
350
|
type: "text";
|
|
340
351
|
text: string;
|
|
@@ -475,4 +486,9 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
475
486
|
detail: string;
|
|
476
487
|
fix: string;
|
|
477
488
|
}]>;
|
|
489
|
+
readonly vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
|
|
490
|
+
cause: "invalid-token" | "missing-token";
|
|
491
|
+
detail: string;
|
|
492
|
+
fix: string;
|
|
493
|
+
}]>;
|
|
478
494
|
}>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
inspectPool
|
|
3
|
-
} from "../../../../../chunks/chunk-
|
|
3
|
+
} from "../../../../../chunks/chunk-72ZFEMAW.js";
|
|
4
4
|
import {
|
|
5
5
|
testserverCommands
|
|
6
|
-
} from "../../../../../chunks/chunk-
|
|
7
|
-
import "../../../../../chunks/chunk-
|
|
6
|
+
} from "../../../../../chunks/chunk-TXCOFC7N.js";
|
|
7
|
+
import "../../../../../chunks/chunk-XBDRVFEV.js";
|
|
8
8
|
import {
|
|
9
9
|
defineOutcomes,
|
|
10
10
|
renderOutcome
|
|
11
|
-
} from "../../../../../chunks/chunk-
|
|
11
|
+
} from "../../../../../chunks/chunk-24UYAK4R.js";
|
|
12
12
|
|
|
13
13
|
// src/extensions/testserver/commands/pool/list/command.ts
|
|
14
14
|
import { z as z2 } from "zod";
|
|
@@ -11,6 +11,8 @@ export declare const credentialOriginSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
11
11
|
aud: z.ZodString;
|
|
12
12
|
repository: z.ZodString;
|
|
13
13
|
}, z.core.$strip>>;
|
|
14
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
15
|
+
source: z.ZodLiteral<"vercel-oidc">;
|
|
14
16
|
}, z.core.$strip>], "source">;
|
|
15
17
|
type CredentialOriginFacts = z.infer<typeof credentialOriginSchema>;
|
|
16
18
|
/** The facts of a rejected credential that `credential_rejected` carries: where it came from, and the one fix. */
|
|
@@ -25,8 +27,10 @@ export declare const rejectedCredentialShape: {
|
|
|
25
27
|
aud: z.ZodString;
|
|
26
28
|
repository: z.ZodString;
|
|
27
29
|
}, z.core.$strip>>;
|
|
30
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
31
|
+
source: z.ZodLiteral<"vercel-oidc">;
|
|
28
32
|
}, z.core.$strip>], "source">;
|
|
29
|
-
/** The one fix: a trusted team and project for the mint, a Trusted Source rule for a GitHub Actions OIDC token. */
|
|
33
|
+
/** The one fix: a trusted team and project for the mint, a Trusted Source rule for a GitHub Actions OIDC token, or a trusted project's token for VERCEL_OIDC_TOKEN. */
|
|
30
34
|
fix: z.ZodString;
|
|
31
35
|
};
|
|
32
36
|
/** Where a rejected credential came from, and its fix, as `credential_rejected` reports them. */
|
|
@@ -42,5 +46,5 @@ export declare function rejectedCredentialFix(origin: CredentialOrigin): string;
|
|
|
42
46
|
/** The opening of `credential_rejected`'s message: which credential the Testserver control plane rejected. */
|
|
43
47
|
export declare function rejectedCredentialText(origin: CredentialOriginFacts): string;
|
|
44
48
|
/** The rows `credential_rejected` shows for where the credential came from. */
|
|
45
|
-
export declare function credentialOriginRows(origin: CredentialOriginFacts): (readonly ["Project", string] | readonly ["Team", string])[] | (readonly ["aud", string] | readonly ["repository", string])[];
|
|
49
|
+
export declare function credentialOriginRows(origin: CredentialOriginFacts): (readonly ["Credential", "VERCEL_OIDC_TOKEN"])[] | (readonly ["Project", string] | readonly ["Team", string])[] | (readonly ["aud", string] | readonly ["repository", string])[];
|
|
46
50
|
export {};
|
|
@@ -17,11 +17,15 @@ export const credentialOriginSchema = z.discriminatedUnion("source", [
|
|
|
17
17
|
/** The token's aud and repository claims; null when they can't be read. */
|
|
18
18
|
claims: z.object({ aud: z.string(), repository: z.string() }).nullable(),
|
|
19
19
|
}),
|
|
20
|
+
z.object({
|
|
21
|
+
/** A pre-minted Vercel project OIDC token from VERCEL_OIDC_TOKEN. */
|
|
22
|
+
source: z.literal("vercel-oidc"),
|
|
23
|
+
}),
|
|
20
24
|
]);
|
|
21
25
|
/** The facts of a rejected credential that `credential_rejected` carries: where it came from, and the one fix. */
|
|
22
26
|
export const rejectedCredentialShape = {
|
|
23
27
|
origin: credentialOriginSchema,
|
|
24
|
-
/** The one fix: a trusted team and project for the mint, a Trusted Source rule for a GitHub Actions OIDC token. */
|
|
28
|
+
/** The one fix: a trusted team and project for the mint, a Trusted Source rule for a GitHub Actions OIDC token, or a trusted project's token for VERCEL_OIDC_TOKEN. */
|
|
25
29
|
fix: z.string(),
|
|
26
30
|
};
|
|
27
31
|
/** Where a rejected credential came from, and its fix, as `credential_rejected` reports them. */
|
|
@@ -29,7 +33,9 @@ export function rejectedCredentialFacts(origin) {
|
|
|
29
33
|
return {
|
|
30
34
|
origin: origin.source === "mint"
|
|
31
35
|
? { source: "mint", ...origin.target }
|
|
32
|
-
:
|
|
36
|
+
: origin.source === "vercel-oidc"
|
|
37
|
+
? { source: "vercel-oidc" }
|
|
38
|
+
: { source: "github-actions", claims: origin.claims === undefined ? null : { ...origin.claims } },
|
|
33
39
|
fix: rejectedCredentialFix(origin),
|
|
34
40
|
};
|
|
35
41
|
}
|
|
@@ -40,22 +46,34 @@ export function rejectedCredentialFacts(origin) {
|
|
|
40
46
|
export function rejectedCredentialFix(origin) {
|
|
41
47
|
if (origin.source === "mint")
|
|
42
48
|
return "The Testserver control plane trusts development OIDC tokens only from projects in its Trusted Sources; vercel-internal mints for project vercel on team vercel. Use a trusted team and project, then retry.";
|
|
49
|
+
if (origin.source === "vercel-oidc")
|
|
50
|
+
return "The Testserver control plane trusts development OIDC tokens only from projects in its Trusted Sources. Set VERCEL_OIDC_TOKEN to a token from a trusted project, then retry.";
|
|
43
51
|
const aud = origin.claims?.aud ?? "https://github.com/<owner>";
|
|
44
52
|
const repository = origin.claims?.repository ?? "<owner>/<repo>";
|
|
45
53
|
return `The Testserver control plane trusts GitHub Actions OIDC tokens only from repositories in its Trusted Sources. Ask the \`vercel/testserver\` owners for a Trusted Source rule matching \`aud: ${aud}\` and \`repository: ${repository}\`, then rerun the job.`;
|
|
46
54
|
}
|
|
47
55
|
/** The opening of `credential_rejected`'s message: which credential the Testserver control plane rejected. */
|
|
48
56
|
export function rejectedCredentialText(origin) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
57
|
+
switch (origin.source) {
|
|
58
|
+
case "mint":
|
|
59
|
+
return `the credential minted for project ${origin.project} on team ${origin.team}`;
|
|
60
|
+
case "github-actions":
|
|
61
|
+
return "the GitHub Actions OIDC token";
|
|
62
|
+
case "vercel-oidc":
|
|
63
|
+
return "the Vercel OIDC token from VERCEL_OIDC_TOKEN";
|
|
64
|
+
}
|
|
52
65
|
}
|
|
53
66
|
/** The rows `credential_rejected` shows for where the credential came from. */
|
|
54
67
|
export function credentialOriginRows(origin) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
[
|
|
60
|
-
|
|
68
|
+
switch (origin.source) {
|
|
69
|
+
case "mint":
|
|
70
|
+
return [["Team", origin.team], ["Project", origin.project]];
|
|
71
|
+
case "github-actions":
|
|
72
|
+
return [
|
|
73
|
+
["aud", origin.claims?.aud ?? "unreadable"],
|
|
74
|
+
["repository", origin.claims?.repository ?? "unreadable"],
|
|
75
|
+
];
|
|
76
|
+
case "vercel-oidc":
|
|
77
|
+
return [["Credential", "VERCEL_OIDC_TOKEN"]];
|
|
78
|
+
}
|
|
61
79
|
}
|
|
@@ -9,7 +9,7 @@ import { testserverCanceledLines } from "./canceled.js";
|
|
|
9
9
|
import { dropLeasedEntries, releaseLeases } from "./pool/index.js";
|
|
10
10
|
import { prBuildRefusal } from "./pr-build-facts.js";
|
|
11
11
|
import { createWith, failedCreateFacts, provision, testserverCanceledFacts, unpooledFacts, } from "./provision.js";
|
|
12
|
-
import { credentialRejected, noSandboxes, noUsableSandboxes, poolUnavailable, poolUnreadable, tokenRequestFailed, } from "./refusals.js";
|
|
12
|
+
import { credentialRejected, noSandboxes, noUsableSandboxes, poolUnavailable, poolUnreadable, tokenRequestFailed, vercelOidcTokenFailed, } from "./refusals.js";
|
|
13
13
|
import { testserverPoolDropped, testserverPoolDroppedText, testserverPoolDropWarnings, testserverPoolReleased, testserverPoolReleasedText, testserverPoolReleaseWarnings, } from "./release.js";
|
|
14
14
|
import { testserverPoolResult, testserverPoolResultWarnings } from "./result.js";
|
|
15
15
|
import { STALE_TESTSERVER_VARIABLES, testserverConnectionOf } from "./run-sandbox.js";
|
|
@@ -110,6 +110,12 @@ function acquireRefusal(refusal) {
|
|
|
110
110
|
failedCreates: failedCreateFacts(refusal.failedCreates),
|
|
111
111
|
sandboxMayExist: refusal.failedCreates.some(mayLeaveSandbox),
|
|
112
112
|
});
|
|
113
|
+
case "vercel-oidc-token-failed":
|
|
114
|
+
return vercelOidcTokenFailed(refusal.failure, {
|
|
115
|
+
ttlMinutes: refusal.ttlMinutes,
|
|
116
|
+
failedCreates: failedCreateFacts(refusal.failedCreates),
|
|
117
|
+
sandboxMayExist: refusal.failedCreates.some(mayLeaveSandbox),
|
|
118
|
+
});
|
|
113
119
|
case "credential-rejected":
|
|
114
120
|
return credentialRejected(refusal.origin, {
|
|
115
121
|
status: refusal.failure.status,
|
|
@@ -5,5 +5,8 @@
|
|
|
5
5
|
*
|
|
6
6
|
* When a task rejects, no further task starts; once every started task has settled, it rejects with the first
|
|
7
7
|
* rejection. So nothing it started is still running when it returns or rejects.
|
|
8
|
+
*
|
|
9
|
+
* Its twin is `runLimited` in `src/runner/shared-snapshot-entry.ts`, with the same body: an extension folder imports
|
|
10
|
+
* storm only through the extension API, so the two have no shared home. Change both together.
|
|
8
11
|
*/
|
|
9
12
|
export declare function runLimited<T>(count: number, limit: number, proceed: () => boolean, task: (index: number) => Promise<T>): Promise<readonly (T | undefined)[]>;
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* When a task rejects, no further task starts; once every started task has settled, it rejects with the first
|
|
8
8
|
* rejection. So nothing it started is still running when it returns or rejects.
|
|
9
|
+
*
|
|
10
|
+
* Its twin is `runLimited` in `src/runner/shared-snapshot-entry.ts`, with the same body: an extension folder imports
|
|
11
|
+
* storm only through the extension API, so the two have no shared home. Change both together.
|
|
9
12
|
*/
|
|
10
13
|
export async function runLimited(count, limit, proceed, task) {
|
|
11
14
|
const results = Array.from({ length: count }, () => undefined);
|