@gadicc/loom 1.23.0 → 1.25.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/README.md +19 -2
- package/db/databaseTls.js +42 -0
- package/db/databaseTls.test.ts +171 -0
- package/db/neonFull.js +2 -4
- package/esm/_dnt.polyfills.d.ts +11 -0
- package/esm/_dnt.polyfills.d.ts.map +1 -1
- package/esm/_dnt.polyfills.js +14 -0
- package/esm/src/cli/filesR2Policy.d.ts +33 -0
- package/esm/src/cli/filesR2Policy.d.ts.map +1 -0
- package/esm/src/cli/filesR2Policy.js +130 -0
- package/esm/src/cli/mod.d.ts.map +1 -1
- package/esm/src/cli/mod.js +163 -60
- package/esm/src/cli/releaseConfig.d.ts +10 -0
- package/esm/src/cli/releaseConfig.d.ts.map +1 -0
- package/esm/src/cli/releaseConfig.js +22 -0
- package/esm/src/next/pwa/mod.d.ts +10 -2
- package/esm/src/next/pwa/mod.d.ts.map +1 -1
- package/esm/src/next/pwa/mod.js +142 -31
- package/package.json +2 -2
- package/script/_dnt.polyfills.d.ts +11 -0
- package/script/_dnt.polyfills.d.ts.map +1 -1
- package/script/_dnt.polyfills.js +14 -0
- package/script/src/cli/filesR2Policy.d.ts +33 -0
- package/script/src/cli/filesR2Policy.d.ts.map +1 -0
- package/script/src/cli/filesR2Policy.js +135 -0
- package/script/src/cli/mod.d.ts.map +1 -1
- package/script/src/cli/mod.js +163 -60
- package/script/src/cli/releaseConfig.d.ts +10 -0
- package/script/src/cli/releaseConfig.d.ts.map +1 -0
- package/script/src/cli/releaseConfig.js +26 -0
- package/script/src/next/pwa/mod.d.ts +10 -2
- package/script/src/next/pwa/mod.d.ts.map +1 -1
- package/script/src/next/pwa/mod.js +142 -31
- package/skills/loom-db/SKILL.md +5 -1
- package/skills/loom-files/SKILL.md +12 -1
package/README.md
CHANGED
|
@@ -88,7 +88,20 @@ documented in [`docs/project-tooling.md`](docs/project-tooling.md).
|
|
|
88
88
|
DB dependencies and tasks to their recorded configs, rewrites the standard
|
|
89
89
|
`neon.ts` / `neonFull.ts` / `drizzle.config.ts` / PGlite test harness files
|
|
90
90
|
into Loom-managed thin wrappers, scaffolds the app-local fixture script
|
|
91
|
-
entrypoint, and enables the `loom-db` skill link.
|
|
91
|
+
entrypoint, and enables the `loom-db` skill link. `neonFull` verifies remote
|
|
92
|
+
TLS certificates and hostnames even when the selected URL contains
|
|
93
|
+
`sslmode=require`. Private remote CAs must be trusted explicitly, for example
|
|
94
|
+
with process-start `NODE_EXTRA_CA_CERTS`; invalid certificates fail instead of
|
|
95
|
+
falling back. The existing plaintext exceptions for `db.localtest.me`,
|
|
96
|
+
`localhost` and `127.0.0.1` remain, including their existing override of URL
|
|
97
|
+
TLS settings. Database URL precedence is unchanged. TLS verification does not
|
|
98
|
+
add SCRAM channel-binding support to the underlying driver. Remote IPv4
|
|
99
|
+
certificates must contain a matching IP subject alternative name. DNS-only
|
|
100
|
+
multi-host URLs retain the driver's per-host verification. Empty or escaped
|
|
101
|
+
hosts, extra unescaped `@` signs or fragments in the authority, IP-containing
|
|
102
|
+
multi-host URLs and bracketed IPv6 hosts are rejected because the runtime
|
|
103
|
+
cannot reliably bind their current driver routing to certificate identity; use
|
|
104
|
+
an explicit DNS host or single IPv4 address.
|
|
92
105
|
- `loom add files` activates the shared files schema contract after the DB
|
|
93
106
|
feature is active. It materializes the Loom-managed Drizzle schema blueprint
|
|
94
107
|
into an app-local committed schema file, records the blueprint version and
|
|
@@ -197,7 +210,11 @@ documented in [`docs/project-tooling.md`](docs/project-tooling.md).
|
|
|
197
210
|
- `loom db release setup-github` creates/updates the GitHub `production`
|
|
198
211
|
environment for staged Vercel releases: it stores `VERCEL_ORG_ID` and
|
|
199
212
|
`VERCEL_PROJECT_ID`, creates a Vercel token scoped to the linked Vercel team,
|
|
200
|
-
and saves that token as the GitHub `VERCEL_TOKEN` environment secret.
|
|
213
|
+
and saves that token as the GitHub `VERCEL_TOKEN` environment secret. Its
|
|
214
|
+
branch policy and the release checks use
|
|
215
|
+
`features.db.config.release.productionBranch` from `loom.json`, defaulting to
|
|
216
|
+
`main`. See [release configuration](docs/network-checks.md) for other
|
|
217
|
+
production branches and matching app-owned workflow/Vercel settings.
|
|
201
218
|
- `loom dev local /path/to/loom` enables local unpublished Loom development. It
|
|
202
219
|
adds a managed `file:` override in `pnpm-workspace.yaml` for pnpm projects or
|
|
203
220
|
a Deno `links` entry in `deno.json(c)`, then runs the local-dev sync flow when
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { isIP } from "node:net";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Preserve the existing plaintext local development endpoints; require native
|
|
5
|
+
* certificate and hostname verification for every other runtime database.
|
|
6
|
+
* postgres.js's "require" mode encrypts but disables certificate verification.
|
|
7
|
+
* @param {string} databaseUrl Selected runtime database URL.
|
|
8
|
+
* @returns {false | { rejectUnauthorized: true, host?: string }} Explicit TLS option.
|
|
9
|
+
*/
|
|
10
|
+
export function resolveRuntimeDatabaseTls(databaseUrl) {
|
|
11
|
+
const hostname = new URL(databaseUrl).hostname;
|
|
12
|
+
// The driver starts userinfo at the first raw @ and does not stop authority
|
|
13
|
+
// parsing at #. WHATWG uses the last @ and recognizes fragments instead.
|
|
14
|
+
const authority = databaseUrl.slice(databaseUrl.indexOf("://") + 3)
|
|
15
|
+
.split(/[?/]/)[0];
|
|
16
|
+
if (
|
|
17
|
+
authority.indexOf("@") !== authority.lastIndexOf("@") ||
|
|
18
|
+
authority.includes("#")
|
|
19
|
+
) {
|
|
20
|
+
throw new Error("Unsupported runtime database host configuration");
|
|
21
|
+
}
|
|
22
|
+
// postgres.js decodes multi-host authorities differently from WHATWG URL, and
|
|
23
|
+
// an empty authority inherits PGHOST. Do not guess the effective destination.
|
|
24
|
+
if (!hostname || /[%\[\]]/.test(hostname)) {
|
|
25
|
+
throw new Error("Unsupported runtime database host configuration");
|
|
26
|
+
}
|
|
27
|
+
const hosts = hostname.split(",");
|
|
28
|
+
if (
|
|
29
|
+
hosts.some((host) => !host) ||
|
|
30
|
+
(hosts.length > 1 && hosts.some((host) => isIP(host)))
|
|
31
|
+
) {
|
|
32
|
+
throw new Error("Unsupported runtime database host configuration");
|
|
33
|
+
}
|
|
34
|
+
const isLocal = hostname === "db.localtest.me" || hostname === "localhost" ||
|
|
35
|
+
hostname === "127.0.0.1";
|
|
36
|
+
if (isLocal) return false;
|
|
37
|
+
// The driver omits SNI for IPs. Supplying TLS's public host option prevents
|
|
38
|
+
// native certificate verification from falling back to "localhost".
|
|
39
|
+
return isIP(hostname)
|
|
40
|
+
? { rejectUnauthorized: true, host: hostname }
|
|
41
|
+
: { rejectUnauthorized: true };
|
|
42
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { expect } from "@std/expect";
|
|
2
|
+
import { describe, it } from "@std/testing/bdd";
|
|
3
|
+
import postgres from "postgres";
|
|
4
|
+
import { resolveRuntimeDatabaseTls } from "./databaseTls.js";
|
|
5
|
+
import { resolveRuntimeDatabaseUrl } from "./databaseUrl.js";
|
|
6
|
+
|
|
7
|
+
/** The real driver parses options without connecting; tests have no net grant. */
|
|
8
|
+
async function effectiveTls(databaseUrl: string) {
|
|
9
|
+
const sql = postgres(databaseUrl, {
|
|
10
|
+
ssl: resolveRuntimeDatabaseTls(databaseUrl),
|
|
11
|
+
});
|
|
12
|
+
try {
|
|
13
|
+
return sql.options.ssl;
|
|
14
|
+
} finally {
|
|
15
|
+
await sql.end();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
describe("runtime database TLS", () => {
|
|
20
|
+
for (
|
|
21
|
+
const hostname of [
|
|
22
|
+
"ep-runtime.example.test",
|
|
23
|
+
"ep-runtime-pooler.example.test",
|
|
24
|
+
"db.localtest.me.example.test",
|
|
25
|
+
"localhost.example.test",
|
|
26
|
+
"first.example,second.example",
|
|
27
|
+
]
|
|
28
|
+
) {
|
|
29
|
+
it(`verifies nonlocal ${hostname}`, async () => {
|
|
30
|
+
expect(await effectiveTls(`postgresql://test:test@${hostname}/test`))
|
|
31
|
+
.toEqual({ rejectUnauthorized: true });
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
it("binds native verification to the explicit remote IPv4 address", async () => {
|
|
36
|
+
expect(await effectiveTls("postgresql://test:test@192.0.2.1/test"))
|
|
37
|
+
.toEqual({ rejectUnauthorized: true, host: "192.0.2.1" });
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it("preserves escaped credentials while validating only host routing", async () => {
|
|
41
|
+
const url =
|
|
42
|
+
"postgresql://test%40user:synthetic%3Apass%40word@remote.example/test";
|
|
43
|
+
const sql = postgres(url, { ssl: resolveRuntimeDatabaseTls(url) });
|
|
44
|
+
try {
|
|
45
|
+
expect(sql.options.user).toBe("test@user");
|
|
46
|
+
expect(sql.options.pass).toBe("synthetic:pass@word");
|
|
47
|
+
expect(sql.options.host).toEqual(["remote.example"]);
|
|
48
|
+
expect(sql.options.ssl).toEqual({ rejectUnauthorized: true });
|
|
49
|
+
} finally {
|
|
50
|
+
await sql.end();
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
for (
|
|
55
|
+
const authority of [
|
|
56
|
+
"",
|
|
57
|
+
"%31%39%32.0.2.1",
|
|
58
|
+
"remote.example,%31%39%32.0.2.1",
|
|
59
|
+
"remote.example%2C192.0.2.1",
|
|
60
|
+
"remote.example,192.0.2.1",
|
|
61
|
+
"192.0.2.1,remote.example",
|
|
62
|
+
"192.0.2.1,192.0.2.2",
|
|
63
|
+
"remote.example,",
|
|
64
|
+
"[::1]",
|
|
65
|
+
"[2001:db8::1]",
|
|
66
|
+
]
|
|
67
|
+
) {
|
|
68
|
+
it(`refuses unverifiable host routing ${authority || "(empty)"}`, () => {
|
|
69
|
+
expect(() => resolveRuntimeDatabaseTls(`postgresql://${authority}/test`))
|
|
70
|
+
.toThrow("Unsupported runtime database host configuration");
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
it("refuses an empty authority instead of inheriting PGHOST", () => {
|
|
75
|
+
const previous = Deno.env.get("PGHOST");
|
|
76
|
+
Deno.env.set("PGHOST", "192.0.2.1");
|
|
77
|
+
try {
|
|
78
|
+
expect(() => resolveRuntimeDatabaseTls("postgresql:///test"))
|
|
79
|
+
.toThrow("Unsupported runtime database host configuration");
|
|
80
|
+
} finally {
|
|
81
|
+
if (previous === undefined) Deno.env.delete("PGHOST");
|
|
82
|
+
else Deno.env.set("PGHOST", previous);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
for (
|
|
87
|
+
const url of [
|
|
88
|
+
"postgres://user:pw@192.0.2.1,remote.example@safe.example/db",
|
|
89
|
+
"postgres://user:pw@192.0.2.1%2Cremote.example@safe.example/db",
|
|
90
|
+
"postgres://safe.example#ignored,192.0.2.1/db",
|
|
91
|
+
"postgres://safe.example#ignored%2C192.0.2.1",
|
|
92
|
+
"postgres://localhost#ignored,192.0.2.1",
|
|
93
|
+
"postgres://remote.example#@192.0.2.1,other.example",
|
|
94
|
+
]
|
|
95
|
+
) {
|
|
96
|
+
it("rejects authority syntax with different driver routing", () => {
|
|
97
|
+
expect(() => resolveRuntimeDatabaseTls(url))
|
|
98
|
+
.toThrow("Unsupported runtime database host configuration");
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
for (
|
|
103
|
+
const query of [
|
|
104
|
+
"sslmode=require",
|
|
105
|
+
"sslmode=verify-full",
|
|
106
|
+
"sslmode=disable",
|
|
107
|
+
"sslmode=prefer",
|
|
108
|
+
"ssl=false",
|
|
109
|
+
"sslrootcert=system",
|
|
110
|
+
]
|
|
111
|
+
) {
|
|
112
|
+
it(`keeps explicit remote verification with ${query}`, async () => {
|
|
113
|
+
expect(
|
|
114
|
+
await effectiveTls(
|
|
115
|
+
`postgresql://test:test@remote.example/test?${query}`,
|
|
116
|
+
),
|
|
117
|
+
).toEqual({ rejectUnauthorized: true });
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
for (const hostname of ["db.localtest.me", "localhost", "127.0.0.1"]) {
|
|
122
|
+
for (const query of ["", "?sslmode=verify-full"]) {
|
|
123
|
+
it(`preserves local plaintext for ${hostname}${query}`, async () => {
|
|
124
|
+
expect(
|
|
125
|
+
await effectiveTls(`postgresql://test:test@${hostname}/test${query}`),
|
|
126
|
+
).toBe(false);
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
for (const ambient of ["disable", "prefer", "require", "false"]) {
|
|
132
|
+
it(`does not inherit PGSSL=${ambient}`, async () => {
|
|
133
|
+
const previous = Deno.env.get("PGSSL");
|
|
134
|
+
Deno.env.set("PGSSL", ambient);
|
|
135
|
+
try {
|
|
136
|
+
expect(await effectiveTls("postgresql://test:test@remote.example/test"))
|
|
137
|
+
.toEqual({ rejectUnauthorized: true });
|
|
138
|
+
expect(await effectiveTls("postgresql://test:test@localhost/test"))
|
|
139
|
+
.toBe(false);
|
|
140
|
+
} finally {
|
|
141
|
+
if (previous === undefined) Deno.env.delete("PGSSL");
|
|
142
|
+
else Deno.env.set("PGSSL", previous);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
it("uses the selected runtime URL without changing precedence", async () => {
|
|
148
|
+
const env = {
|
|
149
|
+
DATABASE_URL_DIRECT: "postgresql://test:test@localhost/direct",
|
|
150
|
+
DATABASE_URL_UNPOOLED: "postgresql://test:test@unpooled.example/primary",
|
|
151
|
+
DATABASE_URL: "postgresql://test:test@pooler.example/fallback",
|
|
152
|
+
};
|
|
153
|
+
const local = resolveRuntimeDatabaseUrl(env);
|
|
154
|
+
expect(local.envName).toBe("DATABASE_URL_DIRECT");
|
|
155
|
+
expect(await effectiveTls(local.url)).toBe(false);
|
|
156
|
+
const remote = resolveRuntimeDatabaseUrl({
|
|
157
|
+
...env,
|
|
158
|
+
DATABASE_URL_DIRECT: "",
|
|
159
|
+
});
|
|
160
|
+
expect(remote.envName).toBe("DATABASE_URL_UNPOOLED");
|
|
161
|
+
expect(await effectiveTls(remote.url)).toEqual({
|
|
162
|
+
rejectUnauthorized: true,
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
it("does not share mutable TLS options across clients", () => {
|
|
167
|
+
const first = resolveRuntimeDatabaseTls("postgresql://remote.example/db");
|
|
168
|
+
const second = resolveRuntimeDatabaseTls("postgresql://remote.example/db");
|
|
169
|
+
expect(first).not.toBe(second);
|
|
170
|
+
});
|
|
171
|
+
});
|
package/db/neonFull.js
CHANGED
|
@@ -3,15 +3,13 @@ import { drizzle } from "drizzle-orm/postgres-js";
|
|
|
3
3
|
import postgres from "postgres";
|
|
4
4
|
import process from "node:process";
|
|
5
5
|
import { resolveRuntimeDatabaseUrl } from "./databaseUrl.js";
|
|
6
|
+
import { resolveRuntimeDatabaseTls } from "./databaseTls.js";
|
|
6
7
|
|
|
7
8
|
const { direct, url: databaseUrl } = resolveRuntimeDatabaseUrl(process.env);
|
|
8
9
|
|
|
9
10
|
const parsedUrl = new URL(databaseUrl);
|
|
10
|
-
const isLocal = parsedUrl.hostname === "db.localtest.me" ||
|
|
11
|
-
parsedUrl.hostname === "localhost" ||
|
|
12
|
-
parsedUrl.hostname === "127.0.0.1";
|
|
13
11
|
const isPooler = parsedUrl.hostname.includes("pooler");
|
|
14
|
-
const ssl =
|
|
12
|
+
const ssl = resolveRuntimeDatabaseTls(databaseUrl);
|
|
15
13
|
|
|
16
14
|
if (isPooler && !direct) {
|
|
17
15
|
console.warn(
|
package/esm/_dnt.polyfills.d.ts
CHANGED
|
@@ -152,4 +152,15 @@ declare global {
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
export {};
|
|
155
|
+
declare global {
|
|
156
|
+
interface Object {
|
|
157
|
+
/**
|
|
158
|
+
* Determines whether an object has a property with the specified name.
|
|
159
|
+
* @param o An object.
|
|
160
|
+
* @param v A property name.
|
|
161
|
+
*/
|
|
162
|
+
hasOwn(o: object, v: PropertyKey): boolean;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
export {};
|
|
155
166
|
//# sourceMappingURL=_dnt.polyfills.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_dnt.polyfills.d.ts","sourceRoot":"","sources":["../src/_dnt.polyfills.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK;QACb,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB;CACF;AAED,OAAO,EAAE,CAAC;AACV;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAgC,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAGlE,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,UAAU;QAClB;;;;;;;;;;;;;;WAcG;QACH,GAAG,EAAE,MAAM,CAAC;QACZ;;;;;;;;;;;;WAYG;QACH,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,GAAG,MAAM,CAAC;QACtE;;;;;;;;WAQG;QACH,IAAI,EAAE,OAAO,CAAC;QAEd;;;;;;;;;;;;WAYG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;;;;;;;;;;;WAYG;QACH,OAAO,EAAE,MAAM,CAAC;KACjB;CACF;AAED,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,KAAK,UAAU,GAAG,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;AACnD,UAAU,0BAA0B;IAClC,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC;CACxD;AACD,UAAU,0BAA0B;IAClC,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,C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AG,GACZ,CAAC,GAAG,SAAS,CAAC;QACjB,QAAQ,CACJ,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,KAAK,OAAO,EACvE,OAAO,CAAC,EAAE,GAAG,GACd,MAAM,GAAG,SAAS,CAAC;QAEtB;;;;;;;;WAQG;QACH,aAAa,CACT,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,KAAK,OAAO,EACvE,OAAO,CAAC,EAAE,GAAG,GACd,MAAM,CAAC;KACX;CACF;AA4CD,OAAO,EAAE,CAAC;AAgBV,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd;;;;WAIG;QACH,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;KAC5C;CACF;AAED,OAAO,EAAE,CAAC"}
|
package/esm/_dnt.polyfills.js
CHANGED
|
@@ -161,3 +161,17 @@ if (!Uint8Array.prototype.findLast) {
|
|
|
161
161
|
return findLast(this, callbackfn, that);
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
|
+
// https://github.com/tc39/proposal-accessible-object-hasownproperty/blob/main/polyfill.js
|
|
165
|
+
if (!Object.hasOwn) {
|
|
166
|
+
Object.defineProperty(Object, "hasOwn", {
|
|
167
|
+
value: function (object, property) {
|
|
168
|
+
if (object == null) {
|
|
169
|
+
throw new TypeError("Cannot convert undefined or null to object");
|
|
170
|
+
}
|
|
171
|
+
return Object.prototype.hasOwnProperty.call(Object(object), property);
|
|
172
|
+
},
|
|
173
|
+
configurable: true,
|
|
174
|
+
enumerable: false,
|
|
175
|
+
writable: true,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** Explicit browser transport permission; it never grants public object access. */
|
|
2
|
+
export type FilesR2DirectUploadPolicy = {
|
|
3
|
+
kind: "presigned-put";
|
|
4
|
+
origins: Record<"production" | "preview", string[]>;
|
|
5
|
+
allowedHeaders: string[];
|
|
6
|
+
maxAgeSeconds: number;
|
|
7
|
+
};
|
|
8
|
+
type PolicyInput = {
|
|
9
|
+
accessMode?: unknown;
|
|
10
|
+
directBrowserAccess?: unknown;
|
|
11
|
+
directUpload?: unknown;
|
|
12
|
+
forcePathStyle?: unknown;
|
|
13
|
+
publicUrl?: unknown;
|
|
14
|
+
};
|
|
15
|
+
/** Validates untrusted manifest policy before setup or network side effects. */
|
|
16
|
+
export declare function filesR2PolicyIssues(provider: PolicyInput): string[];
|
|
17
|
+
type CorsRule = {
|
|
18
|
+
origins: string[];
|
|
19
|
+
methods: string[];
|
|
20
|
+
headers: string[];
|
|
21
|
+
exposeHeaders: string[];
|
|
22
|
+
maxAgeSeconds: number;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Wrangler 4.112 has no CORS JSON flag. Parse its complete labelled permission
|
|
26
|
+
* projection, rejecting unknown formats instead of treating a successful CLI
|
|
27
|
+
* exit as proof. Rule IDs are not rendered and have no permission semantics.
|
|
28
|
+
*/
|
|
29
|
+
export declare function parseWranglerR2Cors(text: string, bucket: string): CorsRule[] | null;
|
|
30
|
+
/** Compares one minimal PUT rule, combining declared origins for a shared bucket. */
|
|
31
|
+
export declare function r2CorsMatchesPolicy(rules: CorsRule[], policy: FilesR2DirectUploadPolicy, environments: Array<"production" | "preview">): boolean;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=filesR2Policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filesR2Policy.d.ts","sourceRoot":"","sources":["../../../src/src/cli/filesR2Policy.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC,YAAY,GAAG,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;IACpD,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AA2BF,gFAAgF;AAChF,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,WAAW,GAAG,MAAM,EAAE,CAuEnE;AAED,KAAK,QAAQ,GAAG;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACb,QAAQ,EAAE,GAAG,IAAI,CA6CnB;AAED,qFAAqF;AACrF,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,QAAQ,EAAE,EACjB,MAAM,EAAE,yBAAyB,EACjC,YAAY,EAAE,KAAK,CAAC,YAAY,GAAG,SAAS,CAAC,GAC5C,OAAO,CAcT"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
function record(value) {
|
|
2
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3
|
+
}
|
|
4
|
+
function exactKeys(value, keys) {
|
|
5
|
+
return Object.keys(value).length === keys.length &&
|
|
6
|
+
keys.every((key) => Object.hasOwn(value, key));
|
|
7
|
+
}
|
|
8
|
+
function uniqueStrings(value) {
|
|
9
|
+
return Array.isArray(value) && value.length > 0 &&
|
|
10
|
+
value.every((entry) => typeof entry === "string") &&
|
|
11
|
+
new Set(value).size === value.length;
|
|
12
|
+
}
|
|
13
|
+
function exactHttpsOrigin(value) {
|
|
14
|
+
try {
|
|
15
|
+
const url = new URL(value);
|
|
16
|
+
return url.protocol === "https:" && url.origin === value &&
|
|
17
|
+
!value.includes("*");
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/** Validates untrusted manifest policy before setup or network side effects. */
|
|
24
|
+
export function filesR2PolicyIssues(provider) {
|
|
25
|
+
const issues = [];
|
|
26
|
+
if (provider.accessMode !== "private" || provider.publicUrl !== null) {
|
|
27
|
+
issues.push("Files R2 provider policy must remain private with publicUrl null.");
|
|
28
|
+
}
|
|
29
|
+
if (provider.forcePathStyle !== undefined &&
|
|
30
|
+
typeof provider.forcePathStyle !== "boolean") {
|
|
31
|
+
issues.push("Files R2 forcePathStyle must be an explicit boolean when present.");
|
|
32
|
+
}
|
|
33
|
+
if (provider.directBrowserAccess === false &&
|
|
34
|
+
provider.directUpload === undefined)
|
|
35
|
+
return issues;
|
|
36
|
+
if (provider.directBrowserAccess !== true) {
|
|
37
|
+
issues.push("Files R2 directBrowserAccess must be false, or true with an explicit presigned-put policy.");
|
|
38
|
+
return issues;
|
|
39
|
+
}
|
|
40
|
+
const policy = provider.directUpload;
|
|
41
|
+
if (!record(policy) ||
|
|
42
|
+
!exactKeys(policy, [
|
|
43
|
+
"kind",
|
|
44
|
+
"origins",
|
|
45
|
+
"allowedHeaders",
|
|
46
|
+
"maxAgeSeconds",
|
|
47
|
+
]) || policy.kind !== "presigned-put") {
|
|
48
|
+
issues.push("Files R2 directUpload must be an explicit presigned-put policy with only the documented fields.");
|
|
49
|
+
return issues;
|
|
50
|
+
}
|
|
51
|
+
if (!record(policy.origins) ||
|
|
52
|
+
!exactKeys(policy.origins, ["production", "preview"]) ||
|
|
53
|
+
![policy.origins.production, policy.origins.preview].every((origins) => uniqueStrings(origins) && origins.every(exactHttpsOrigin))) {
|
|
54
|
+
issues.push("Files R2 directUpload origins must be nonempty unique exact HTTPS origins for Production and Preview, without paths or wildcards.");
|
|
55
|
+
}
|
|
56
|
+
if (!uniqueStrings(policy.allowedHeaders) ||
|
|
57
|
+
!policy.allowedHeaders.every((header) => /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(header))) {
|
|
58
|
+
issues.push("Files R2 directUpload allowedHeaders must be unique explicit lowercase header names without wildcards.");
|
|
59
|
+
}
|
|
60
|
+
if (typeof policy.maxAgeSeconds !== "number" ||
|
|
61
|
+
!Number.isSafeInteger(policy.maxAgeSeconds) || policy.maxAgeSeconds < 0 ||
|
|
62
|
+
policy.maxAgeSeconds > 86400) {
|
|
63
|
+
issues.push("Files R2 directUpload maxAgeSeconds must be an integer from 0 to 86400.");
|
|
64
|
+
}
|
|
65
|
+
return issues;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Wrangler 4.112 has no CORS JSON flag. Parse its complete labelled permission
|
|
69
|
+
* projection, rejecting unknown formats instead of treating a successful CLI
|
|
70
|
+
* exit as proof. Rule IDs are not rendered and have no permission semantics.
|
|
71
|
+
*/
|
|
72
|
+
export function parseWranglerR2Cors(text, bucket) {
|
|
73
|
+
const lines = text.trim().split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
|
|
74
|
+
if (lines.shift() !== `Listing CORS rules for bucket '${bucket}'...`) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
if (lines.length === 1 &&
|
|
78
|
+
lines[0] ===
|
|
79
|
+
`There is no CORS configuration defined for bucket '${bucket}'.`)
|
|
80
|
+
return [];
|
|
81
|
+
if (!lines.length || lines.length % 5)
|
|
82
|
+
return null;
|
|
83
|
+
const labels = [
|
|
84
|
+
"allowed_origins",
|
|
85
|
+
"allowed_methods",
|
|
86
|
+
"allowed_headers",
|
|
87
|
+
"exposed_headers",
|
|
88
|
+
"max_age_seconds",
|
|
89
|
+
];
|
|
90
|
+
const rules = [];
|
|
91
|
+
for (let i = 0; i < lines.length; i += 5) {
|
|
92
|
+
const values = labels.map((label, offset) => {
|
|
93
|
+
const line = lines[i + offset];
|
|
94
|
+
return line.startsWith(`${label}:`)
|
|
95
|
+
? line.slice(label.length + 1).trim()
|
|
96
|
+
: null;
|
|
97
|
+
});
|
|
98
|
+
if (values.some((value) => value === null || value === ""))
|
|
99
|
+
return null;
|
|
100
|
+
const [origins, methods, headers, exposeHeaders, maxAge] = values;
|
|
101
|
+
if (!/^(?:0|[1-9]\d*|\(0 seconds\))$/.test(maxAge))
|
|
102
|
+
return null;
|
|
103
|
+
const maxAgeSeconds = maxAge === "(0 seconds)" ? 0 : Number(maxAge);
|
|
104
|
+
if (!Number.isSafeInteger(maxAgeSeconds))
|
|
105
|
+
return null;
|
|
106
|
+
const list = (value, empty) => value === empty ? [] : value.split(", ");
|
|
107
|
+
rules.push({
|
|
108
|
+
origins: list(origins, "(no origins)"),
|
|
109
|
+
methods: list(methods, "(no methods)"),
|
|
110
|
+
headers: list(headers, "(no headers)"),
|
|
111
|
+
exposeHeaders: list(exposeHeaders, "(no exposed headers)"),
|
|
112
|
+
maxAgeSeconds,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
return rules;
|
|
116
|
+
}
|
|
117
|
+
/** Compares one minimal PUT rule, combining declared origins for a shared bucket. */
|
|
118
|
+
export function r2CorsMatchesPolicy(rules, policy, environments) {
|
|
119
|
+
if (rules.length !== 1)
|
|
120
|
+
return false;
|
|
121
|
+
const rule = rules[0];
|
|
122
|
+
const equal = (a, b) => JSON.stringify([...a].sort()) === JSON.stringify([...b].sort());
|
|
123
|
+
return equal(rule.origins, [
|
|
124
|
+
...new Set(environments.flatMap((environment) => policy.origins[environment])),
|
|
125
|
+
]) &&
|
|
126
|
+
equal(rule.methods, ["PUT"]) &&
|
|
127
|
+
equal(rule.headers, policy.allowedHeaders) &&
|
|
128
|
+
rule.exposeHeaders.length === 0 &&
|
|
129
|
+
rule.maxAgeSeconds === policy.maxAgeSeconds;
|
|
130
|
+
}
|
package/esm/src/cli/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/src/cli/mod.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/src/cli/mod.ts"],"names":[],"mappings":"AAqDA,OAAO,EAUL,KAAK,cAAc,EAMpB,MAAM,qBAAqB,CAAC;AAE7B,eAAO,MAAM,kBAAkB,WAAW,CAAC;AAC3C,eAAO,MAAM,eAAe,iBAAiB,CAAC;AAC9C,eAAO,MAAM,oBAAoB,2DACyB,CAAC;AAC3D,eAAO,MAAM,yBAAyB,uCAAuC,CAAC;AAC9E,eAAO,MAAM,uBAAuB,qCAAqC,CAAC;AAC1E,eAAO,MAAM,8BAA8B,8CACE,CAAC;AAC9C,eAAO,MAAM,4BAA4B,4CACE,CAAC;AAC5C,eAAO,MAAM,+BAA+B,6BAA6B,CAAC;AAC1E,eAAO,MAAM,6BAA6B,2BAA2B,CAAC;AACtE,eAAO,MAAM,kCAAkC,yBAAyB,CAAC;AACzE,eAAO,MAAM,mCAAmC,yBAAyB,CAAC;AAI1E,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAAO,CAAC;AAwCtD,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,cAAc,CAAC,EAAE,MAAM,CAAC;IAC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