Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
ee0d9c6
Apply SQL attribute permissions to every column reference
kriszyp Oct 30, 2026
6127088
Check read permission on the columns an SQL UPDATE or DELETE reads
kriszyp Oct 30, 2026
1a69ae4
Close the remaining SQL column-attribution gaps the review found
kriszyp Oct 30, 2026
e0d0bb9
Test that a JSON literal in an UPDATE SET adds no read requirement
kriszyp Oct 30, 2026
1387b72
Bring the SQL attribution design note up to date
kriszyp Oct 30, 2026
3ccb9fc
Let SQL DELETE filter on a read-denied primary key, as UPDATE can
kriszyp Oct 31, 2026
cd7c7f2
Refuse SQL row accessors after wildcard expansion
kriszyp Oct 31, 2026
0273b4e
Skip SQL AST walk setup for an absent clause
kriszyp Oct 31, 2026
02dfd68
Keep SQL literals and names intact when legacy SQL re-runs a statement
kriszyp Nov 1, 2026
87c2912
Refuse legacy SQL names that its text cannot hold, aliases included
kriszyp Nov 2, 2026
ebf4229
Check that legacy SQL's statement text reads nothing new, and keep nu…
kriszyp Nov 2, 2026
230286b
Compare legacy SQL's re-parsed text by table-qualified column and count
kriszyp Nov 2, 2026
f9b3d8d
Fit the SQL design notes under the root index ceiling
kriszyp Nov 2, 2026
f223898
Check legacy SQL text without copying it, and only the text legacy wr…
kriszyp Nov 2, 2026
26e9ae0
Restore exactly the keys the legacy text check backticks
kriszyp Nov 2, 2026
bbe6649
Name legacy join primary-key results as bracketed aliases
kriszyp Nov 2, 2026
1483e5a
Keep a join's primary-key result name valid when the key holds a bracket
kriszyp Nov 2, 2026
9842f1f
Refuse SQL parameters as whole-row accessors for non-super users
kriszyp Nov 2, 2026
bab75e3
Shorten three root index descriptions so DESIGN.md meets its byte cei…
kriszyp Nov 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A note lives in the `DESIGN.md` of the directory that owns the code it describes

## sqlTranslator/ — legacy SQL integration

- [CommonJS date functions](sqlTranslator/DESIGN.md#commonjs-date-functions) — Both runtimes use the same CommonJS helper object, enforced by `alasqlFunctionImporter.test.js`.
- [CommonJS date functions](sqlTranslator/DESIGN.md#commonjs-date-functions) — Both runtimes use the same CommonJS helper object, enforced by `alasqlFunctionImporter.test.js`. · [SQL column attribution](sqlTranslator/DESIGN.md#sql-column-attribution) — Shared column resolver. · [Legacy SQL text round trip](sqlTranslator/DESIGN.md#legacy-sql-text-round-trip) — Re-parsed text reads nothing new.

## .github/ — CI workflows

Expand Down Expand Up @@ -158,7 +158,7 @@ A note lives in the `DESIGN.md` of the directory that owns the code it describes
- [A restart covers exactly the workers that loaded a component or will load it](components/DESIGN.md#a-restart-covers-exactly-the-workers-that-loaded-a-component-or-will-load-it) — A new or still-isolated application restarts only its dedicated worker; main adds the pool when a pool worker reported loading it, and a named restart reconciles only that application · [`drop_component`: main owns the whole-component drop](components/DESIGN.md#drop_component-main-owns-the-whole-component-drop) — Main drops under the lock (workers hand over and wait); an absent component is a no-op; an isolated worker stops without `restart`; branches go last unless `keepBranches`; each node reports its own outcome.
- [Component preparation is serialized across worker threads](components/DESIGN.md#component-preparation-is-serialized-across-worker-threads) — One component transaction at a time across workers; the lifecycle broadcast sits outside the lock; the load lock is keyed by application and plugin.
- [Peer-side deploy_component payload read: retryable blob stalls and `Readable.from()` cancellation](components/DESIGN.md#peer-side-deploy_component-payload-read-retryable-blob-stalls-and-readablefrom-cancellation) — Retry a `BLOB_UNAVAILABLE` read only before any byte reached the consumer; use `Readable.from()` for cancellation, not a hand-rolled `ReadableStream`. · [An origin waits for a peer's deploy answer only as long as the peer may take](components/DESIGN.md#an-origin-waits-for-a-peers-deploy-answer-only-as-long-as-the-peer-may-take) — The replicated deploy's per-peer deadline sums the peer's own allowances, so it never undercuts a healthy peer; a missed deadline is a failure with an unknown outcome, not cancellation.
- [A replicated deploy reports each node's install fingerprint, and never acts on it](components/DESIGN.md#a-replicated-deploy-reports-each-nodes-install-fingerprint-and-never-acts-on-it) — Each node records the source identity its resolver already produced and the sha256 of its root lockfiles; the origin compares peers once on the aggregate and reports differences in a warning, the message and `peer_results`, without ever failing the deploy. · [The deployment record (`system.hdb_deployment`)](components/DESIGN.md#the-deployment-record-systemhdb_deployment) — One row per deploy on the receiving node; a live tail ends on a promise settled after the terminal write; a rolling deploy stays `rolling_out` until its activation job records every peer's outcome; the source is OIDC-attested or client-declared; failed deploys' payloads expire by count and age. · [A rolling restart job completes only if every peer restarted (`bin/restart.ts` `restartEachPeer`)](components/DESIGN.md#a-rolling-restart-job-completes-only-if-every-peer-restarted-binrestartts-restarteachpeer) — `ERROR` names each peer that failed or was skipped, with every peer's outcome in `result.replicated`; a failed or possibly-running peer restart halts the roll; only write back-pressure is retried.
- [A replicated deploy reports each node's install fingerprint, and never acts on it](components/DESIGN.md#a-replicated-deploy-reports-each-nodes-install-fingerprint-and-never-acts-on-it) — Peers' install fingerprints are compared once and reported, never acted on. · [The deployment record (`system.hdb_deployment`)](components/DESIGN.md#the-deployment-record-systemhdb_deployment) — One row per deploy on the receiving node; a rolling deploy stays `rolling_out` until every peer's outcome is recorded. · [A rolling restart job completes only if every peer restarted (`bin/restart.ts` `restartEachPeer`)](components/DESIGN.md#a-rolling-restart-job-completes-only-if-every-peer-restarted-binrestartts-restarteachpeer) — `ERROR` names each peer that failed or was skipped, with every outcome in `result.replicated`; a failed peer halts the roll.
- [A dangling symlink silently truncates the deploy tarball (`components/packageComponent.ts`)](components/DESIGN.md#a-dangling-symlink-silently-truncates-the-deploy-tarball-componentspackagecomponentts) — tar-fs treats a dangling symlink's ENOENT as end-of-stream, so `scanPackageDirectory()` pre-walks the tree; a deploy also warns when a declared `jsResource`/`graphqlSchema` entry point matched nothing · [The packer never ships the loader's links to the install (`components/packageComponent.ts`)](components/DESIGN.md#the-packer-never-ships-the-loaders-links-to-the-install-componentspackagecomponentts) — The application's `node_modules/harper` is skipped by name; a nested one, or a `harperdb` link, only when it resolves to the running install, and `harperdb` ships as an empty directory the loader relinks.
- [Deploy watcher generations preserve logical entry events](components/DESIGN.md#deploy-watcher-generations-preserve-logical-entry-events) — `EntryHandler` snapshots matching paths across a deploy so consumers see logical change and delete events, not raw rescan adds. · [Restart-free deploys require proof of runtime equivalence](components/DESIGN.md#restart-free-deploys-require-proof-of-runtime-equivalence) — A deploy stays restart-free only when declared files, the imported runtime and installed dependencies are all proven equivalent.
- [Secret custody starts before boot-time installs](components/DESIGN.md#secret-custody-starts-before-boot-time-installs) — `startSecretCustodyOnMainThread()` runs the custody built-in ahead of `installApplications()`; the root load reuses it.
Expand Down
3 changes: 2 additions & 1 deletion dataLayer/SQLSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import uniqBy from 'lodash/uniqBy.js';
import alasql from 'alasql';
alasql.options.cache = false;
import alasqlFunctionImporter from '../sqlTranslator/alasqlFunctionImporter.ts';
import { generatedName } from '../sqlTranslator/legacySqlText.ts';
import clone from 'clone';
import RecursiveIterator from 'recursive-iterator';
import log from '../utility/logging/harper_logger.ts';
Expand Down Expand Up @@ -992,7 +993,7 @@ class SQLSearch {
table: table.as ? table.as_orig : table.tableid_orig,
keys: new Set(),
});
select.push(`${table.as ? table.as : table.tableid}.\`${hash}\` AS "${tableKey}.${hash}"`);
select.push(`${table.as ? table.as : table.tableid}.\`${hash}\` AS ${generatedName(`${tableKey}.${hash}`)}`);

existingAttributes[table.as ? table.as_orig : table.tableid_orig] =
this.data[`${table.databaseid_orig}_${table.as ? table.as_orig : table.tableid_orig}`].__mergedAttributes;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
graphqlSchema:
files: '*.graphql'
rest: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# The test role reads both tables but is denied `ssn` on ColPermLeft and the primary key and
# `code` on ColPermRight.
type ColPermLeft @table @export {
id: ID @primaryKey
label: String @indexed
ssn: String @indexed
}

type ColPermRight @table @export {
id: ID @primaryKey
label: String @indexed
ssn: String @indexed
code: String @indexed
}
Loading
Loading