You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 14bce5e
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: packages/drivers/driver-turso/src/spec/turso.zod.ts
+34-61Lines changed: 34 additions & 61 deletions
Original file line number
Diff line number
Diff line change
@@ -81,6 +81,24 @@ const WASM_RETIRED =
81
81
+'the remote arm (`libsql://` / `https://`), which needs none. '
82
82
+'Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand.';
83
83
84
+
/**
85
+
* The prescription the REMOVED `encryptionKey` raises (#25050, ADR-0049
86
+
* enforce-or-remove). Unlike the three above, it is not this package's own
87
+
* wording: it is `@objectstack/spec`'s `TursoConfigSchema` tombstone text, byte
88
+
* for byte, and the constructor in `../turso-driver.ts` refuses the key in it
89
+
* too, because the one key is judged at three places and an author must meet
90
+
* one prescription at all of them. `turso-config-constructor-parity.test.ts`
91
+
* holds the three copies equal.
92
+
*/
93
+
constENCRYPTION_KEY_RETIRED=
94
+
'`turso config.encryptionKey` was removed in @objectstack/spec 18 and @objectstack/driver-turso 18 '
95
+
+'(ADR-0049) — it never encrypted anything, in any mode: a local or embedded-replica file is read and '
96
+
+'written through a SQLite engine that has no encryption codec, and the driver never handed the key to '
97
+
+'a remote database, whose storage encryption the server configures. Delete the key. A local file that '
98
+
+'must be encrypted at rest belongs on an encrypted disk or volume. '
99
+
+'Run `os migrate meta --from 17` to list the mechanical edits for the unset and remote-url cases; '
100
+
+'`--write` applies the ones it can prove, and you delete the key from a local or replica datasource by hand.';
authToken: z.string().optional().describe('Authentication token for remote database'),
373
344
374
345
/**
375
-
* Encryption Key — encrypts nothing, in any mode, and is REFUSED for a local
376
-
* or embedded-replica database, and beside a `file:` url or `:memory:` under
377
-
* a forced `mode: 'remote'` (#25020; the refusals are the
378
-
* `tursoTransportIssues` arms above, in the spec contract's words — this
379
-
* mirror declares no `mode`, so it judges such a config as the local
380
-
* database its url selects, and refuses it with that arm's text).
346
+
* Tombstone for the REMOVED `encryptionKey` (#25050, ADR-0049
347
+
* enforce-or-remove).
348
+
*
349
+
* It promised to encrypt the local database file at rest with AES-256 and
350
+
* was honoured in no mode: the driver reads and writes that file through
351
+
* better-sqlite3, which has no encryption codec (so #25020 refused it
352
+
* there), and it never handed the key to the libSQL client it builds for a
353
+
* remote url, where the key was parsed and dropped. `z.never()` rather than
354
+
* a bare deletion for the reason `timeout` below spells out: this shape is a
355
+
* plain `z.object`, and a deletion would strip the key in silence.
381
356
*
382
-
* It used to promise to encrypt the local database file at rest with
383
-
* AES-256. The driver reads and writes that file through better-sqlite3,
384
-
* which has no encryption codec, so the file was written in plaintext that
385
-
* any SQLite reader opened without the key; an embedded replica handed it to
386
-
* its sync client only. The driver does not forward it to a remote database
387
-
* either, whose storage encryption is the server's.
357
+
* The text is `@objectstack/spec`'s `TursoConfigSchema` tombstone on the
358
+
* same key, byte for byte, and the constructor's refusal in
359
+
* `../turso-driver.ts`; `turso-config-constructor-parity.test.ts` holds the
360
+
* three equal.
388
361
*/
389
-
encryptionKey: z.string().optional().describe("Not honoured in any mode: refused for a local or replica datasource, whose SQLite engine cannot encrypt the file, and for a file: url or :memory: under a forced remote mode, whose libSQL client is handed no key; a remote database's storage encryption is the server's, not set by this key"),
0 commit comments