@gadicc/loom 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.loom-source-manifest.json +1 -1
- package/README.md +4 -0
- package/esm/src/cli/mod.d.ts.map +1 -1
- package/esm/src/cli/mod.js +51 -1
- package/esm/src/cli/mod.js.map +1 -1
- package/package.json +2 -2
- package/skills/loom/SKILL.md +5 -0
- package/skills/loom/references/release-safety.md +10 -8
- package/skills/loom/references/release-trusted-sources.md +24 -0
- package/source/src/cli/mod.ts +66 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gadicc/loom",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "Shared helpers and verification tooling for Next.js applications.",
|
|
5
5
|
"homepage": "https://github.com/gadicc/loom#readme",
|
|
6
6
|
"repository": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "https://github.com/gadicc/loom/issues"
|
|
12
12
|
},
|
|
13
13
|
"loom": {
|
|
14
|
-
"gitCommit": "
|
|
14
|
+
"gitCommit": "10f7ecc2516ddb9dad8b39f7cde410e2fdddec6c"
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"main": "./esm/mod.js",
|
package/skills/loom/SKILL.md
CHANGED
|
@@ -136,6 +136,11 @@ and approval. Finding a skill does not authorize installing or following it.
|
|
|
136
136
|
- For a Loom DB release, read [release safety](references/release-safety.md)
|
|
137
137
|
before deployment or credential commands. Preserve the recorded release mode;
|
|
138
138
|
never print secrets or switch deployment paths after authentication failure.
|
|
139
|
+
- When `loom check` recommends OIDC for protected release HTTP checks, read
|
|
140
|
+
[Trusted Sources adoption](references/release-trusted-sources.md). Explain the
|
|
141
|
+
app-specific policy/workflow change before adoption. Checking does not change
|
|
142
|
+
provider settings or retire secrets; deployment/promotion still needs its
|
|
143
|
+
separate Vercel API credential.
|
|
139
144
|
|
|
140
145
|
## Re-establishing work context
|
|
141
146
|
|
|
@@ -109,14 +109,16 @@ required smoke check. Preserve the configured project-token or team-token mode.
|
|
|
109
109
|
cannot mint tokens, create a bounded project token in Vercel and install it
|
|
110
110
|
through GitHub's hidden environment-secret input rather than broadening its
|
|
111
111
|
scope.
|
|
112
|
-
- Smoke check the staged deployment
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
112
|
+
- Smoke check the immutable staged deployment before promotion and verify the
|
|
113
|
+
canonical alias after promotion. Prefer reviewed GitHub OIDC Trusted Sources
|
|
114
|
+
with `createGithubActionsOidcFetch` from `@gadicc/loom/release` for protected
|
|
115
|
+
HTTP checks; see [trusted-source setup](release-trusted-sources.md) for
|
|
116
|
+
`trust-plan`, `trust-apply`, `trust-check` and live acceptance. OIDC replaces
|
|
117
|
+
the HTTP protection bypass, not the deployment/promotion API credential or
|
|
118
|
+
application authentication. Existing bypass-secret workflows remain supported:
|
|
119
|
+
use normal `curl` with `x-vercel-protection-bypass` and revoke temporary secrets
|
|
120
|
+
after checks, including failure cleanup. Adoption remains app-owned and
|
|
121
|
+
deliberate. Avoid the beta `vercel curl` command in CI.
|
|
120
122
|
- Production migrations must remain backward-compatible with the currently live
|
|
121
123
|
app because old code continues serving traffic until the staged deployment is
|
|
122
124
|
promoted. Use expand/contract migrations for destructive schema changes.
|
|
@@ -5,6 +5,30 @@ through Deployment Protection. This replaces the workflow's create/check/revoke
|
|
|
5
5
|
HTTP bypass-secret sequence. The Vercel deployment API credential is separate:
|
|
6
6
|
OIDC access to a deployed app does not grant permission to deploy or promote it.
|
|
7
7
|
|
|
8
|
+
## Discover adoption opportunities
|
|
9
|
+
|
|
10
|
+
`loom check` reports optional adoption advisories for bypass-secret references
|
|
11
|
+
and app-owned OIDC HTTP acquisition in GitHub workflow steps. It also inspects
|
|
12
|
+
literal `.js`, `.mjs`, `.cjs`, `.ts`, `.mts`, `.cts` and `.sh` references under
|
|
13
|
+
`scripts/` or `.github/` in enabled `run` steps. It skips missing, unreadable,
|
|
14
|
+
oversized (over 256 KiB) and out-of-project script targets. It does not execute
|
|
15
|
+
scripts, follow imports, resolve task aliases, or prove workflow correctness;
|
|
16
|
+
dynamic commands and reusable workflows need manual inspection. Absence of an
|
|
17
|
+
advisory is not proof that a trust policy exists or that OIDC works.
|
|
18
|
+
|
|
19
|
+
These advisories stay warnings under `--production`; existing bypass workflows
|
|
20
|
+
remain supported. Neither `loom check` nor `loom check --network` applies a
|
|
21
|
+
trust policy, revokes credentials or runs live acceptance. Verify a reviewed
|
|
22
|
+
policy explicitly with `loom db release trust-check <plan>`.
|
|
23
|
+
|
|
24
|
+
Agents should read this guide when an advisory appears, explain the app-specific
|
|
25
|
+
changes and preserve its existing release mode until deliberate adoption. Keep
|
|
26
|
+
separate plans for custom beta/preview environments: the current planner targets
|
|
27
|
+
production only. Upgrade the app's published Loom dependency and managed skills
|
|
28
|
+
to receive these checks and guidance; publishing Loom alone does not update apps.
|
|
29
|
+
|
|
30
|
+
## Review and configure the policy
|
|
31
|
+
|
|
8
32
|
Use the consuming application's linked Vercel project, canonical GitHub
|
|
9
33
|
repository, configured production branch and actual workflow path. For example:
|
|
10
34
|
|
package/source/src/cli/mod.ts
CHANGED
|
@@ -10042,8 +10042,9 @@ async function checkDbProductionMigrationFlow(
|
|
|
10042
10042
|
"DB production migration flow still uses beta `vercel curl` for smoke checks: " +
|
|
10043
10043
|
[...new Set(vercelCurlWorkflowPaths)].join(", "),
|
|
10044
10044
|
);
|
|
10045
|
+
suggestions.add(GITHUB_RELEASE_OIDC_ADOPTION);
|
|
10045
10046
|
suggestions.add(
|
|
10046
|
-
"
|
|
10047
|
+
"Existing bypass-secret workflows remain supported: use normal `curl` with the `x-vercel-protection-bypass` header and revoke temporary bypass secrets after checks, including failure cleanup.",
|
|
10047
10048
|
);
|
|
10048
10049
|
}
|
|
10049
10050
|
|
|
@@ -10054,6 +10055,41 @@ async function checkDbProductionMigrationFlow(
|
|
|
10054
10055
|
};
|
|
10055
10056
|
}
|
|
10056
10057
|
|
|
10058
|
+
const GITHUB_RELEASE_OIDC_ADOPTION =
|
|
10059
|
+
"Consider reviewed GitHub OIDC Trusted Sources for protected HTTP checks: read the Loom skill's references/release-trusted-sources.md, run `loom db release trust-plan`, review and apply with `trust-apply`, verify with `trust-check`, then use `createGithubActionsOidcFetch` from `@gadicc/loom/release`. Keep VERCEL_TOKEN for deployment/promotion. Prove live allowed and denied access before removing the old bypass; `loom check` does not apply policies or revoke credentials.";
|
|
10060
|
+
|
|
10061
|
+
/**
|
|
10062
|
+
* Advisory inventory only: inspect enabled steps and their literal local script
|
|
10063
|
+
* references, never execute commands or traverse arbitrary imports/task graphs.
|
|
10064
|
+
*/
|
|
10065
|
+
async function githubReleaseHttpAuthSources(cwd: string, workflow: string) {
|
|
10066
|
+
const steps = getGithubWorkflowStepBlocks(
|
|
10067
|
+
stripWorkflowComments(workflow),
|
|
10068
|
+
).filter((block) => !workflowStepIsDisabled(block));
|
|
10069
|
+
const sources = new Map([["workflow", steps.join("\n")]]);
|
|
10070
|
+
const root = await realpath(cwd);
|
|
10071
|
+
const scriptPattern =
|
|
10072
|
+
/(?:^|[\s"'`])((?:\.\/)?(?:scripts|\.github)\/[A-Za-z0-9_./-]+\.(?:[cm]?[jt]s|sh))(?=$|[\s"'`])/gm;
|
|
10073
|
+
for (const step of steps) {
|
|
10074
|
+
if (!/^\s*(?:-\s*)?run:\s*/m.test(step)) continue;
|
|
10075
|
+
for (const match of step.matchAll(scriptPattern)) {
|
|
10076
|
+
const path = match[1].replace(/^\.\//, "");
|
|
10077
|
+
if (path.split("/").includes("..") || sources.has(path)) continue;
|
|
10078
|
+
try {
|
|
10079
|
+
const target = await realpath(join(root, path));
|
|
10080
|
+
if (!target.startsWith(root + sep)) continue;
|
|
10081
|
+
const info = await stat(target);
|
|
10082
|
+
if (!info.isFile() || info.size > 256 * 1024) continue;
|
|
10083
|
+
sources.set(path, await readFile(target, "utf8"));
|
|
10084
|
+
} catch {
|
|
10085
|
+
// Missing/unreadable scripts provide no adoption evidence. This is not
|
|
10086
|
+
// a workflow validator, and diagnostics must never echo script content.
|
|
10087
|
+
}
|
|
10088
|
+
}
|
|
10089
|
+
}
|
|
10090
|
+
return sources;
|
|
10091
|
+
}
|
|
10092
|
+
|
|
10057
10093
|
async function checkGithubActionsWorkflows(cwd: string) {
|
|
10058
10094
|
const warnings: string[] = [];
|
|
10059
10095
|
const suggestions = new Set<string>();
|
|
@@ -10065,6 +10101,35 @@ async function checkGithubActionsWorkflows(cwd: string) {
|
|
|
10065
10101
|
}
|
|
10066
10102
|
|
|
10067
10103
|
const normalized = normalizeText(workflowText);
|
|
10104
|
+
const httpAuthSources = await githubReleaseHttpAuthSources(cwd, normalized);
|
|
10105
|
+
for (const [sourcePath, text] of httpAuthSources) {
|
|
10106
|
+
const source =
|
|
10107
|
+
sourcePath === "workflow"
|
|
10108
|
+
? relativePath
|
|
10109
|
+
: `${relativePath} -> ${sourcePath}`;
|
|
10110
|
+
if (
|
|
10111
|
+
/\bx-vercel-protection-bypass\b|\bVERCEL_(?:AUTOMATION_BYPASS_SECRET|PROTECTION_BYPASS)\b/i.test(
|
|
10112
|
+
text,
|
|
10113
|
+
)
|
|
10114
|
+
) {
|
|
10115
|
+
warnings.push(
|
|
10116
|
+
`GitHub Actions protected HTTP checks retain bypass-secret references (OIDC adoption is optional): ${source}`,
|
|
10117
|
+
);
|
|
10118
|
+
suggestions.add(GITHUB_RELEASE_OIDC_ADOPTION);
|
|
10119
|
+
}
|
|
10120
|
+
if (
|
|
10121
|
+
/\bx-vercel-trusted-oidc-idp-token\b/i.test(text) &&
|
|
10122
|
+
/\bACTIONS_ID_TOKEN_REQUEST_URL\b|\bgetIDToken\s*\(/.test(text)
|
|
10123
|
+
) {
|
|
10124
|
+
warnings.push(
|
|
10125
|
+
`GitHub Actions protected HTTP checks implement OIDC token acquisition locally: ${source}`,
|
|
10126
|
+
);
|
|
10127
|
+
suggestions.add(
|
|
10128
|
+
"Consider Loom's `createGithubActionsOidcFetch` from `@gadicc/loom/release` for shared masking, token refresh and origin/redirect restrictions. Preserve the app's readiness/auth assertions and reviewed trust policy; see the Loom skill's references/release-trusted-sources.md.",
|
|
10129
|
+
);
|
|
10130
|
+
}
|
|
10131
|
+
}
|
|
10132
|
+
|
|
10068
10133
|
const stepBlocks = getGithubWorkflowStepBlocks(normalized);
|
|
10069
10134
|
if (!workflowInstallsNodeDependencies(stepBlocks)) {
|
|
10070
10135
|
continue;
|