ffp-sql-sandbox 0.1.0 → 0.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/INTEGRATION.md +13 -13
- package/README.md +148 -76
- package/dist/docker-executor.js +1 -1
- package/dist/docker-executor.js.map +1 -1
- package/dist/image.d.ts +5 -10
- package/dist/image.d.ts.map +1 -1
- package/dist/image.js +5 -10
- package/dist/image.js.map +1 -1
- package/package.json +10 -8
package/INTEGRATION.md
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
# Integrating ffp-sql-sandbox
|
|
1
|
+
# Integrating ffp-sql-sandbox
|
|
2
2
|
|
|
3
|
-
This repository does
|
|
3
|
+
This repository ships **library primitives only**. It does not embed a product UI, Nest module, or connection catalog. Wire `validateSql` / `executeSql` in the host application after this package is a real dependency, tests are green, and there are no P0s.
|
|
4
4
|
|
|
5
5
|
## Adapter shape
|
|
6
6
|
|
|
7
|
-
Keep
|
|
7
|
+
Keep framework DI, secret decryption, and ORM / data-source types in the host app. Do not leak those types into this library.
|
|
8
8
|
|
|
9
|
-
Suggested adapter
|
|
9
|
+
Suggested host adapter:
|
|
10
10
|
|
|
11
|
-
1. Decrypt
|
|
11
|
+
1. Decrypt the database password with the host app’s secret store.
|
|
12
12
|
2. Call `validateSql` / `executeSql` from `ffp-sql-sandbox`.
|
|
13
|
-
3. Map `{ ok: true, data }` → the
|
|
13
|
+
3. Map `{ ok: true, data }` → the host app’s query-result shape (`success` / `columns`+`rows`).
|
|
14
14
|
4. Map `{ ok: false, code, error }` → `{ success: false, error }`.
|
|
15
15
|
|
|
16
|
-
## Host rewrite stays in
|
|
16
|
+
## Host rewrite stays in the caller
|
|
17
17
|
|
|
18
18
|
`resolveSandboxDbHost` is **not** a public export of this package (on purpose).
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
The host app may keep a private loopback → `host.docker.internal` helper for its own tests and Docker-on-Linux setups. If the adapter rewrites the host *before* calling `executeSql`, put the rewritten name on `hostAllowlist` as well.
|
|
21
21
|
|
|
22
22
|
Alternatively, pass the original host (`localhost`, `db.internal`, …) in `connection.host`, allowlist **that** name, and let this library apply a private rewrite after the allowlist check. Either way, user-controlled hosts must not bypass `hostAllowlist`.
|
|
23
23
|
|
|
24
|
-
## What not to copy from
|
|
24
|
+
## What not to copy from a naive Docker sandbox
|
|
25
25
|
|
|
26
|
-
|
|
|
26
|
+
| Naive sandbox | v1 library |
|
|
27
27
|
| --- | --- |
|
|
28
|
-
|
|
|
28
|
+
| Password in container `Env` (`DB_PASS`, `PGPASSWORD`, …) | Forbidden. Password goes to tmpfs `/run/secrets/db_password`. |
|
|
29
29
|
| `Cmd: [sql]` | SQL on stdin JSON. |
|
|
30
|
-
| Floating
|
|
30
|
+
| Floating image tag (`:latest`) | Default image digest-pinned; custom `image` is untrusted. |
|
|
31
31
|
| Configurable validator prefixes/patterns | Not exposed. `validateSql(sql)` only. |
|
|
32
32
|
| Wait for container + `logs()` then parse/truncate | Streaming attach; `maxRows` / `maxBytes` applied as data arrives. |
|
|
33
33
|
| Regex as the security proof | Documented as fail-fast only. Proof is RO role + limits + allowlist. |
|
|
34
34
|
|
|
35
35
|
## Image
|
|
36
36
|
|
|
37
|
-
Build `sandbox/Dockerfile` from this repo (or pull the published digest) and configure
|
|
37
|
+
Build `sandbox/Dockerfile` from this repo (or pull the published digest) and configure the host app to use `DEFAULT_SANDBOX_IMAGE` or an explicit digest-pinned ref. Do not default to `:latest`.
|
package/README.md
CHANGED
|
@@ -1,24 +1,48 @@
|
|
|
1
1
|
# ffp-sql-sandbox
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**From First Principle** — when an LLM (or any untrusted caller) wants to run SQL, don’t trust a clever prompt. Trust a small set of checks you can name, test, and refuse to weaken.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Install
|
|
5
|
+
`ffp-sql-sandbox` is a Node.js library for **read-only SQL execution with hard limits**: a fail-fast `validateSql`, plus a one-shot Docker `executeSql` that enforces resource caps, dual timeouts, streaming row/byte ceilings, and a required host allowlist.
|
|
8
6
|
|
|
9
7
|
```bash
|
|
10
8
|
pnpm add ffp-sql-sandbox
|
|
11
9
|
```
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
Package: [npmjs.com/package/ffp-sql-sandbox](https://www.npmjs.com/package/ffp-sql-sandbox) · Org: [FFP Tech Lab](https://github.com/FFP-Tech-Lab)
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
---
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
## Why this exists
|
|
16
|
+
|
|
17
|
+
Most “AI → SQL” stacks fail the same way: the model produces a string, something runs it, and safety is a pile of regexes plus hope. That feels productive until the first write, SSRF, or unbounded result set.
|
|
18
|
+
|
|
19
|
+
We built this library around a different bet:
|
|
20
|
+
|
|
21
|
+
1. **Name the proof.** If you can’t point at *what* stops a mutation or an unbounded read, you don’t have a sandbox — you have vibes.
|
|
22
|
+
2. **Keep the surface small.** Two calls. No query wizard, no schema sync, no NL layer. Host apps own product UX.
|
|
23
|
+
3. **Refuse soft knobs that erase the threat model.** No “just allow this DML prefix.” No password in container env. No floating `:latest` as the default trust root.
|
|
24
|
+
|
|
25
|
+
FFP Tech Lab ships primitives you can reason about. This is one of them.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Design principles
|
|
30
|
+
|
|
31
|
+
| Principle | What it means here |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| Proof over ceremony | Safety claims map to concrete mechanisms (read-only DB role, container limits, streaming caps, host allowlist) — not to `validateSql` returning `{ ok: true }`. |
|
|
34
|
+
| Fail closed | Empty allowlist denies all. Missing Docker fails loudly. Soft “fall back to in-process SQL” is not an option. |
|
|
35
|
+
| Streaming limits, not post-hoc truncate | `maxRows` / `maxBytes` apply as rows arrive. Buffering the full result and then slicing is not the limits implementation. |
|
|
36
|
+
| Secrets stay out of `Env` | The password goes to tmpfs (`/run/secrets/db_password`). SQL rides stdin JSON. `docker inspect` should not print credentials. |
|
|
37
|
+
| Honest non-goals | We do not claim absolute network isolation, a full SQL AST, or that regex is authorization. |
|
|
20
38
|
|
|
21
|
-
|
|
39
|
+
`validateSql` is a **cheap fail-fast** for obvious writes and multi-statement junk — not the proof. Treat `{ ok: true }` as “not obviously broken,” never as “safe to run outside this sandbox.”
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Quick start
|
|
44
|
+
|
|
45
|
+
Docker is a **hard dependency** of `executeSql`.
|
|
22
46
|
|
|
23
47
|
```ts
|
|
24
48
|
import {
|
|
@@ -28,92 +52,105 @@ import {
|
|
|
28
52
|
DEFAULT_SANDBOX_IMAGE,
|
|
29
53
|
} from 'ffp-sql-sandbox'
|
|
30
54
|
|
|
31
|
-
validateSql(
|
|
55
|
+
const check = validateSql('SELECT 1')
|
|
56
|
+
if (!check.ok) throw new Error(check.reason)
|
|
32
57
|
|
|
33
|
-
executeSql(
|
|
34
|
-
sql:
|
|
58
|
+
const result = await executeSql({
|
|
59
|
+
sql: 'SELECT 1 AS n',
|
|
35
60
|
connection: {
|
|
36
|
-
type: 'postgres'
|
|
37
|
-
host:
|
|
38
|
-
port:
|
|
39
|
-
user:
|
|
40
|
-
password:
|
|
41
|
-
database:
|
|
42
|
-
}
|
|
43
|
-
hostAllowlist:
|
|
44
|
-
limits?: Partial<
|
|
45
|
-
image?: string // untrusted override;
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
61
|
+
type: 'postgres', // or 'mysql'
|
|
62
|
+
host: 'db.internal',
|
|
63
|
+
port: 5432,
|
|
64
|
+
user: 'readonly_user',
|
|
65
|
+
password: process.env.DB_PASSWORD!,
|
|
66
|
+
database: 'app',
|
|
67
|
+
},
|
|
68
|
+
hostAllowlist: ['db.internal'],
|
|
69
|
+
// limits?: Partial<typeof DEFAULT_SANDBOX_LIMITS>
|
|
70
|
+
// image?: string // untrusted override; prefer DEFAULT_SANDBOX_IMAGE
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
if (!result.ok) {
|
|
74
|
+
console.error(result.code, result.error)
|
|
75
|
+
} else {
|
|
76
|
+
console.log(result.data.columns, result.data.rows)
|
|
77
|
+
}
|
|
50
78
|
```
|
|
51
79
|
|
|
52
|
-
|
|
80
|
+
Wire framework DI, secret decryption, and result mapping in the host — see [INTEGRATION.md](./INTEGRATION.md).
|
|
53
81
|
|
|
54
|
-
|
|
82
|
+
### Runner image
|
|
55
83
|
|
|
56
|
-
|
|
84
|
+
Default runner is on GHCR, digest-pinned as `DEFAULT_SANDBOX_IMAGE`:
|
|
57
85
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
86
|
+
```bash
|
|
87
|
+
docker pull ghcr.io/ffp-tech-lab/ffp-sql-sandbox-runner@sha256:13cc50f33c2d00a9ae464f3742c49a18a6b2750fdc39c23d68022476c79171a9
|
|
88
|
+
# convenience tags (same image): :v1 and :0.1.0 — image tags, not the npm package version
|
|
89
|
+
docker pull ghcr.io/ffp-tech-lab/ffp-sql-sandbox-runner:v1
|
|
90
|
+
```
|
|
63
91
|
|
|
64
|
-
|
|
92
|
+
Local build is an **untrusted** override (`image` option) — pin and review if you use it:
|
|
65
93
|
|
|
66
|
-
|
|
94
|
+
```bash
|
|
95
|
+
docker build -t ghcr.io/ffp-tech-lab/ffp-sql-sandbox-runner:v1 ./sandbox
|
|
96
|
+
```
|
|
67
97
|
|
|
68
|
-
|
|
69
|
-
| --- | --- |
|
|
70
|
-
| 1. Read-only DB role | **Caller must connect as a read-only role** (and/or a `READ ONLY` transaction). The library also sets `statement_timeout` and *prefers* a read-only session (`SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY` on Postgres, `SET SESSION TRANSACTION READ ONLY` on MySQL) when the dialect allows it. If that `SET` is ignored or the role can override it, the database role is still the real write barrier. |
|
|
71
|
-
| 2. Container limits + dual timeout | Memory, nano-CPUs, PID cap, dropped capabilities. **Dual timeout**: the runner sets DB `statement_timeout` / `MAX_EXECUTION_TIME` to `timeoutMs`, and the host kills the container after `timeoutMs + 2000ms` if it is still running. |
|
|
72
|
-
| 3. Streaming `maxRows` / `maxBytes` | The runner applies limits **as rows arrive** and stops/cancels instead of buffering the full result. The host consumer is a backstop on the live Docker attach stream. **Demux-then-truncate of a completed log buffer is not the limits implementation.** |
|
|
73
|
-
| 4. `connection.host` allowlist | SSRF defense. `hostAllowlist` is required. Hosts not on the list are rejected **before** any container is created. No arbitrary hosts, no glob, no CIDR in v1 — exact match after trim + case-insensitive compare. |
|
|
98
|
+
---
|
|
74
99
|
|
|
75
|
-
|
|
100
|
+
## What actually provides the proof
|
|
76
101
|
|
|
77
|
-
|
|
102
|
+
| Guard | Role |
|
|
103
|
+
| --- | --- |
|
|
104
|
+
| 1. Read-only DB role | **You** connect as a read-only role (and/or `READ ONLY` transaction). The runner also prefers a read-only session and sets `statement_timeout` / `MAX_EXECUTION_TIME`. The role is still the real write barrier. |
|
|
105
|
+
| 2. Container limits + dual timeout | Memory, CPU, PID caps. DB timeout **and** host kill at `timeoutMs + 2000ms`. |
|
|
106
|
+
| 3. Streaming `maxRows` / `maxBytes` | Stop as data arrives; result may set `truncated: true`. |
|
|
107
|
+
| 4. `hostAllowlist` | Required. Exact match (trim, case-insensitive). Empty list → deny all. Checked **before** any container is created (SSRF). |
|
|
78
108
|
|
|
79
|
-
|
|
109
|
+
### Default limits
|
|
110
|
+
|
|
111
|
+
| Limit | Default |
|
|
80
112
|
| --- | --- |
|
|
81
|
-
| `
|
|
82
|
-
| `
|
|
113
|
+
| `timeoutMs` | `10000` |
|
|
114
|
+
| `memoryMb` | `128` |
|
|
115
|
+
| `nanoCpus` | `500000000` (0.5 CPU) |
|
|
116
|
+
| `maxRows` | `1000` |
|
|
117
|
+
| `maxBytes` | `1000000` |
|
|
83
118
|
|
|
84
|
-
|
|
119
|
+
### `hostAllowlist`
|
|
85
120
|
|
|
86
|
-
|
|
121
|
+
- Required on every `executeSql` call.
|
|
122
|
+
- Allowlist the host string you pass in `connection.host`.
|
|
123
|
+
- The library may privately rewrite loopback (`localhost`, `127.0.0.1`, …) to `host.docker.internal` *after* the allowlist check. That helper is **not** a public export.
|
|
87
124
|
|
|
88
|
-
|
|
125
|
+
### Default image vs custom `image`
|
|
89
126
|
|
|
90
|
-
|
|
|
91
|
-
| --- | --- |
|
|
92
|
-
| `
|
|
93
|
-
| `
|
|
94
|
-
| `nanoCpus` | `500000000` (0.5 CPU) | Container CFS quota |
|
|
95
|
-
| `maxRows` | `1000` | Streaming row cap; result may set `truncated: true` |
|
|
96
|
-
| `maxBytes` | `1000000` | Streaming serialized-row / stdout byte cap; result may set `truncated: true` |
|
|
127
|
+
| Image | Trust |
|
|
128
|
+
| --- | --- |
|
|
129
|
+
| `DEFAULT_SANDBOX_IMAGE` (`…@sha256:…`) | Supported, digest-pinned runner. |
|
|
130
|
+
| `image` override | **Untrusted.** A custom image can ignore caps or leak secrets. |
|
|
97
131
|
|
|
98
|
-
|
|
132
|
+
---
|
|
99
133
|
|
|
100
|
-
-
|
|
101
|
-
- Empty list → `HOST_NOT_ALLOWED` (deny all).
|
|
102
|
-
- Compared against the **caller-supplied** `connection.host` (trimmed, case-insensitive). The library may rewrite loopback (`localhost`, `127.0.0.1`, `::1`, `0.0.0.0`) to `host.docker.internal` *after* the allowlist check so the container can reach a DB on the Docker host. That rewrite is private and not a public API.
|
|
103
|
-
- Put the host you actually pass in on the list (e.g. `db.internal` or `localhost`). Do not accept user-controlled hosts without your own allowlist.
|
|
134
|
+
## Non-goals
|
|
104
135
|
|
|
105
|
-
|
|
136
|
+
- Natural language → SQL, guidance UIs, or schema sync
|
|
137
|
+
- A full SQL AST as a v1 requirement
|
|
138
|
+
- Multi-tenant auth / connection-pool product
|
|
139
|
+
- Claiming absolute network isolation (bridge networking reaches the allowlisted DB by design)
|
|
140
|
+
- Exporting host-rewrite helpers as public API
|
|
141
|
+
- Treating `validateSql` as authorization
|
|
106
142
|
|
|
107
|
-
`validateSql`
|
|
143
|
+
### Known `validateSql` bypass classes (fail-fast only)
|
|
108
144
|
|
|
109
|
-
| Class | Example |
|
|
145
|
+
| Class | Example | Real guard |
|
|
110
146
|
| --- | --- | --- |
|
|
111
|
-
| Writes that
|
|
112
|
-
|
|
|
113
|
-
| Comment / encoding tricks | Leading
|
|
114
|
-
| Expensive reads | `SELECT * FROM huge_table` |
|
|
115
|
-
|
|
|
116
|
-
|
|
147
|
+
| Writes that look like `SELECT` | `SELECT … INTO …`, side-effect functions | Read-only role |
|
|
148
|
+
| Keyword false positives | `… WHERE action = 'UPDATE'` | Not an AST |
|
|
149
|
+
| Comment / encoding tricks | Leading `--`, homoglyphs | Not a parser |
|
|
150
|
+
| Expensive reads | `SELECT * FROM huge_table` | Timeout + streaming caps + role |
|
|
151
|
+
| SQL-level network | `dblink`, FDW, `LOAD_FILE` | Locked-down role (allowlist is on `connection.host`) |
|
|
152
|
+
|
|
153
|
+
---
|
|
117
154
|
|
|
118
155
|
## Error codes
|
|
119
156
|
|
|
@@ -126,19 +163,54 @@ Until GHCR publish, `DEFAULT_SANDBOX_IMAGE` is a **content digest** of the v1 ru
|
|
|
126
163
|
| `DOCKER_UNAVAILABLE` | `executeSql` |
|
|
127
164
|
| `TIMEOUT` | `executeSql` |
|
|
128
165
|
| `INVALID_LIMITS` | `executeSql` |
|
|
129
|
-
| `IMAGE_UNPINNED` | `executeSql`
|
|
130
|
-
| `IMAGE_UNAVAILABLE` | `executeSql`
|
|
166
|
+
| `IMAGE_UNPINNED` | `executeSql` |
|
|
167
|
+
| `IMAGE_UNAVAILABLE` | `executeSql` |
|
|
131
168
|
| `UNSUPPORTED_DIALECT` | `executeSql` |
|
|
132
169
|
| `EXECUTION_FAILED` | `executeSql` |
|
|
133
170
|
|
|
171
|
+
---
|
|
172
|
+
|
|
134
173
|
## Scripts
|
|
135
174
|
|
|
136
175
|
```bash
|
|
137
|
-
pnpm test
|
|
176
|
+
pnpm test
|
|
138
177
|
pnpm typecheck
|
|
139
178
|
pnpm build
|
|
140
179
|
```
|
|
141
180
|
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Release
|
|
184
|
+
|
|
185
|
+
Library (npm) and runner image (GHCR) use **separate** workflows.
|
|
186
|
+
|
|
187
|
+
### npm
|
|
188
|
+
|
|
189
|
+
Workflow: [`.github/workflows/publish-npm.yml`](./.github/workflows/publish-npm.yml).
|
|
190
|
+
|
|
191
|
+
1. Bump `version` in `package.json` (keep in sync with the git tag).
|
|
192
|
+
2. Repo secret **`NPM_TOKEN`**: npm granular token with publish + bypass 2FA.
|
|
193
|
+
3. Merge to `main`, then `git tag vX.Y.Z && git push origin vX.Y.Z` (or `workflow_dispatch` / GitHub Release).
|
|
194
|
+
4. Already-published versions are skipped (no force republish).
|
|
195
|
+
|
|
196
|
+
Published versions: [npm](https://www.npmjs.com/package/ffp-sql-sandbox).
|
|
197
|
+
|
|
198
|
+
### GHCR runner
|
|
199
|
+
|
|
200
|
+
Workflow: [`.github/workflows/publish-runner.yml`](./.github/workflows/publish-runner.yml).
|
|
201
|
+
|
|
202
|
+
- Triggers on `sandbox/**` changes to `main` or `workflow_dispatch`.
|
|
203
|
+
- Pushes `ghcr.io/ffp-tech-lab/ffp-sql-sandbox-runner:v1` (and a convenience tag such as `:0.1.0` for the image line — **not** the npm semver).
|
|
204
|
+
- After a runner change, update `DEFAULT_SANDBOX_IMAGE` to the new digest from the job summary.
|
|
205
|
+
|
|
206
|
+
Org package visibility must allow public packages for anonymous `docker pull`. If pull returns unauthorized, check [org Packages settings](https://github.com/orgs/FFP-Tech-Lab/packages) and the package’s visibility.
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
142
210
|
## License
|
|
143
211
|
|
|
144
|
-
MIT.
|
|
212
|
+
MIT.
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
*Built at [FFP Tech Lab](https://github.com/FFP-Tech-Lab) — From First Principle: build from fundamentals, ship with clarity.*
|
package/dist/docker-executor.js
CHANGED
|
@@ -185,7 +185,7 @@ function isImageUnavailableError(err) {
|
|
|
185
185
|
}
|
|
186
186
|
function imageUnavailableMessage(request) {
|
|
187
187
|
if (request.usingDefaultImage) {
|
|
188
|
-
return `Default sandbox image is not pullable (${request.image}).
|
|
188
|
+
return `Default sandbox image is not pullable (${request.image}). Pull ghcr.io/ffp-tech-lab/ffp-sql-sandbox-runner@sha256:<digest> (or :v1), or build sandbox/Dockerfile locally and pass image: '<tag-or-id>' (untrusted override). If docker pull is unauthorized, the GHCR package may still be private.`;
|
|
189
189
|
}
|
|
190
190
|
return `Sandbox image not found: ${request.image}. Build or pull it before calling executeSql.`;
|
|
191
191
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docker-executor.js","sourceRoot":"","sources":["../src/docker-executor.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EACL,WAAW,GAGZ,MAAM,mBAAmB,CAAC;AAK3B,MAAM,uBAAuB,GAAG,KAAK,CAAC;AACtC,MAAM,YAAY,GAAG,cAAc,CAAC;AAEpC,MAAM,UAAU,mBAAmB;IACjC,OAAO,IAAI,MAAM,EAA2B,CAAC;AAC/C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,MAAkB,EAClB,OAAyB;IAEzB,IAAI,SAAS,GACX,IAAI,CAAC;IACP,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,IAAI,cAAc,GAAG,KAAK,CAAC;IAC3B,IAAI,YAAY,GACd,IAAI,CAAC;IAEP,MAAM,kBAAkB,GAAG,OAAO,CAAC,SAAS,GAAG,uBAAuB,CAAC;IACvE,IAAI,SAAoD,CAAC;IAEzD,IAAI,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
1
1
|
/**
|
|
2
2
|
* Default runner image. Digest-pinned in code; do not use a floating tag.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* `
|
|
7
|
-
*
|
|
8
|
-
* Custom `image` overrides are untrusted.
|
|
9
|
-
*
|
|
10
|
-
* Content identity (sha256 of the runner files at this freeze):
|
|
11
|
-
* sandbox/Dockerfile + execute.js + stream-limit.js + session-setup.js +
|
|
12
|
-
* secrets.js + events.js + package.json.
|
|
4
|
+
* Published to GHCR as `ghcr.io/ffp-tech-lab/ffp-sql-sandbox-runner`
|
|
5
|
+
* (`:v1`, `:0.1.0`, and this digest). `executeSql` without `image` returns
|
|
6
|
+
* `IMAGE_UNAVAILABLE` if Docker cannot pull or find it. Custom `image`
|
|
7
|
+
* overrides are untrusted.
|
|
13
8
|
*/
|
|
14
|
-
export declare const DEFAULT_SANDBOX_IMAGE = "ghcr.io/ffp-tech-lab/ffp-sql-sandbox-runner@sha256:
|
|
9
|
+
export declare const DEFAULT_SANDBOX_IMAGE = "ghcr.io/ffp-tech-lab/ffp-sql-sandbox-runner@sha256:13cc50f33c2d00a9ae464f3742c49a18a6b2750fdc39c23d68022476c79171a9";
|
|
15
10
|
export declare function isDigestPinnedImage(image: string): boolean;
|
|
16
11
|
//# sourceMappingURL=image.d.ts.map
|
package/dist/image.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,wHACqF,CAAC;AAExH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE1D"}
|
package/dist/image.js
CHANGED
|
@@ -2,17 +2,12 @@ const DIGEST_PINNED = /^.+@sha256:[a-f0-9]{64}$/i;
|
|
|
2
2
|
/**
|
|
3
3
|
* Default runner image. Digest-pinned in code; do not use a floating tag.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `
|
|
8
|
-
*
|
|
9
|
-
* Custom `image` overrides are untrusted.
|
|
10
|
-
*
|
|
11
|
-
* Content identity (sha256 of the runner files at this freeze):
|
|
12
|
-
* sandbox/Dockerfile + execute.js + stream-limit.js + session-setup.js +
|
|
13
|
-
* secrets.js + events.js + package.json.
|
|
5
|
+
* Published to GHCR as `ghcr.io/ffp-tech-lab/ffp-sql-sandbox-runner`
|
|
6
|
+
* (`:v1`, `:0.1.0`, and this digest). `executeSql` without `image` returns
|
|
7
|
+
* `IMAGE_UNAVAILABLE` if Docker cannot pull or find it. Custom `image`
|
|
8
|
+
* overrides are untrusted.
|
|
14
9
|
*/
|
|
15
|
-
export const DEFAULT_SANDBOX_IMAGE = 'ghcr.io/ffp-tech-lab/ffp-sql-sandbox-runner@sha256:
|
|
10
|
+
export const DEFAULT_SANDBOX_IMAGE = 'ghcr.io/ffp-tech-lab/ffp-sql-sandbox-runner@sha256:13cc50f33c2d00a9ae464f3742c49a18a6b2750fdc39c23d68022476c79171a9';
|
|
16
11
|
export function isDigestPinnedImage(image) {
|
|
17
12
|
return DIGEST_PINNED.test(image.trim());
|
|
18
13
|
}
|
package/dist/image.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.js","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":"AAAA,MAAM,aAAa,GAAG,2BAA2B,CAAC;AAElD
|
|
1
|
+
{"version":3,"file":"image.js","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":"AAAA,MAAM,aAAa,GAAG,2BAA2B,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAChC,qHAAqH,CAAC;AAExH,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC/C,OAAO,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;AAC1C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ffp-sql-sandbox",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Read-only SQL sandbox primitives: fail-fast validateSql + Docker executeSql with hard limits",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -22,16 +22,13 @@
|
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=20"
|
|
24
24
|
},
|
|
25
|
-
"packageManager": "pnpm@10.33.3",
|
|
26
25
|
"repository": {
|
|
27
26
|
"type": "git",
|
|
28
27
|
"url": "git+https://github.com/FFP-Tech-Lab/ffp-sql-sandbox.git"
|
|
29
28
|
},
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"test": "tsx --test test/**/*.test.ts",
|
|
34
|
-
"prepack": "pnpm build"
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public",
|
|
31
|
+
"registry": "https://registry.npmjs.org/"
|
|
35
32
|
},
|
|
36
33
|
"dependencies": {
|
|
37
34
|
"dockerode": "^4.0.7"
|
|
@@ -41,5 +38,10 @@
|
|
|
41
38
|
"@types/node": "^22.18.0",
|
|
42
39
|
"tsx": "^4.20.5",
|
|
43
40
|
"typescript": "^5.9.2"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsc -p tsconfig.build.json",
|
|
44
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
45
|
+
"test": "tsx --test test/**/*.test.ts"
|
|
44
46
|
}
|
|
45
|
-
}
|
|
47
|
+
}
|