@cosmicdrift/kumiko-dev-server 0.414.0 → 0.416.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.
@@ -343,7 +343,7 @@ function renderMain(appName) {
343
343
  { specifier: "@cosmicdrift/kumiko-framework/engine", names: ["TenantId"], typeOnly: true },
344
344
  {
345
345
  specifier: "@cosmicdrift/kumiko-framework/crypto",
346
- names: ["requireKmsWiring", "resolveKmsWiring"],
346
+ names: ["resolveKmsWiring"],
347
347
  },
348
348
  { specifier: "../src/run-config", names: ["APP_FEATURES"] },
349
349
  { specifier: "../kumiko.config", names: [], defaultName: "appConfig" },
@@ -355,7 +355,7 @@ function renderMain(appName) {
355
355
  'displayName: "Admin",',
356
356
  ]);
357
357
  // Subject-key KMS is optional locally (plaintext + loud warning) but required
358
- // under NODE_ENV=production.
358
+ // under NODE_ENV=production, where kmsMode also resolves the *_CIPHERTEXT form via the Key Manager.
359
359
  return `// biome-ignore-all lint/style/noProcessEnv: KMS wiring and the demo admin password are read before runProdApp parses the env contract, and the scaffold has no bin/env.ts
360
360
  // Production-bootstrap. KUMIKO_DRY_RUN_ENV=boot exits after
361
361
  // composeFeatures + validateBoot + createRegistry without DB/Redis-connect
@@ -373,7 +373,7 @@ const kmsOpts = {
373
373
 
374
374
  const kmsWiring =
375
375
  process.env["NODE_ENV"] === "production"
376
- ? requireKmsWiring(process.env, kmsOpts)
376
+ ? { kmsMode: "required" as const }
377
377
  : resolveKmsWiring(process.env, kmsOpts);
378
378
 
379
379
  await runProdApp({
@@ -498,7 +498,8 @@ KUMIKO_SECRETS_MASTER_KEY_V1=
498
498
  ${adminBlock}
499
499
  # Subject-keys KMS for PII fields (user, tenant-invitation, fileRef). All-or-none.
500
500
  # Unset → local boot with plaintext PII + warning; NODE_ENV=production requires
501
- # the trio (requireKmsWiring). Generate PLATFORM_KEK / KUMIKO_BLIND_INDEX_KEY
501
+ # the trio (runProdApp kmsMode "required"); prod may supply any key as
502
+ # <NAME>_CIPHERTEXT (Key Manager). Generate PLATFORM_KEK / KUMIKO_BLIND_INDEX_KEY
502
503
  # with: openssl rand -base64 32. SUBJECT_KEYS_DATABASE_URL must be a dedicated
503
504
  # subject-keys cluster (not the app DB) — see kms-adapter.md.
504
505
  PLATFORM_KEK=
@@ -685,6 +686,7 @@ function renderBinKumiko() {
685
686
  "// ad-hoc SQL, and `events prune --aggregate-type <type> [--apply]` removes retired",
686
687
  "// aggregate types from the event log. kumiko-build bundles this file to dist-server/kumiko.js.",
687
688
  "",
689
+ 'import { kmsEnvSchema } from "@cosmicdrift/kumiko-bundled-features/crypto-shredding/env";',
688
690
  'import { runConsumerCli } from "@cosmicdrift/kumiko-framework/consumer-cli";',
689
691
  'import { kmsSlotsOf } from "@cosmicdrift/kumiko-framework/env";',
690
692
  'import { runEventsCli } from "@cosmicdrift/kumiko-framework/events-cli";',
@@ -697,7 +699,8 @@ function renderBinKumiko() {
697
699
  "const out = { log: (l: string) => console.log(l), err: (l: string) => console.error(l) };",
698
700
  "",
699
701
  'if (cmd === "schema") {',
700
- " const kmsSlots = kmsSlotsOf(envSchema.schema);",
702
+ " // bin/main.ts boots with kmsMode, which resolves the slots of kmsEnvSchema; the migrate step needs the same keys.",
703
+ " const kmsSlots = [...new Set([...kmsSlotsOf(envSchema.schema), ...kmsSlotsOf(kmsEnvSchema)])];",
701
704
  " process.exit(",
702
705
  " await runSchemaCli(rest, process.env.INIT_CWD ?? process.cwd(), out, {",
703
706
  " features: FEATURES,",
@@ -35,7 +35,7 @@ export function renderBlankMain(appName) {
35
35
  { specifier: "@cosmicdrift/kumiko-framework/engine", names: ["TenantId"], typeOnly: true },
36
36
  {
37
37
  specifier: "@cosmicdrift/kumiko-framework/crypto",
38
- names: ["requireKmsWiring", "resolveKmsWiring"],
38
+ names: ["resolveKmsWiring"],
39
39
  },
40
40
  {
41
41
  specifier: "@cosmicdrift/kumiko-bundled-features/auth-email-password",
@@ -62,7 +62,7 @@ const kmsOpts = {
62
62
 
63
63
  const kmsWiring =
64
64
  process.env["NODE_ENV"] === "production"
65
- ? requireKmsWiring(process.env, kmsOpts)
65
+ ? { kmsMode: "required" as const }
66
66
  : resolveKmsWiring(process.env, kmsOpts);
67
67
 
68
68
  // The bootstrap admin has no password; password reset is the only way it gets one. Without SMTP
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-dev-server",
3
- "version": "0.414.0",
3
+ "version": "0.416.0",
4
4
  "description": "Dev-tooling for Kumiko apps: local dev-server bootstrap (runDevApp), scaffolding. Its compose-stacks/env-schema subpaths are consumed at prod boot too — see @cosmicdrift/kumiko-server-runtime for the prod runner itself.",
5
5
  "license": "MIT",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -77,15 +77,15 @@
77
77
  "kumiko-upgrade": "./bin/kumiko-upgrade.ts"
78
78
  },
79
79
  "dependencies": {
80
- "@cosmicdrift/kumiko-bundled-features": "0.414.0",
81
- "@cosmicdrift/kumiko-feature-ast": "0.414.0",
82
- "@cosmicdrift/kumiko-framework": "0.414.0",
83
- "@cosmicdrift/kumiko-renderer": "0.414.0",
84
- "@cosmicdrift/kumiko-renderer-mail-html": "0.414.0",
85
- "@cosmicdrift/kumiko-guards": "0.414.0",
86
- "@cosmicdrift/kumiko-server-runtime": "0.414.0",
87
- "@cosmicdrift/kumiko-testing": "0.414.0",
88
- "@cosmicdrift/kumiko-types": "0.414.0",
80
+ "@cosmicdrift/kumiko-bundled-features": "0.416.0",
81
+ "@cosmicdrift/kumiko-feature-ast": "0.416.0",
82
+ "@cosmicdrift/kumiko-framework": "0.416.0",
83
+ "@cosmicdrift/kumiko-renderer": "0.416.0",
84
+ "@cosmicdrift/kumiko-renderer-mail-html": "0.416.0",
85
+ "@cosmicdrift/kumiko-guards": "0.416.0",
86
+ "@cosmicdrift/kumiko-server-runtime": "0.416.0",
87
+ "@cosmicdrift/kumiko-testing": "0.416.0",
88
+ "@cosmicdrift/kumiko-types": "0.416.0",
89
89
  "ts-morph": "^28.0.0",
90
90
  "zod": "^4.6.7"
91
91
  },
package/src/changes.json CHANGED
@@ -1,4 +1,10 @@
1
1
  [
2
+ {
3
+ "version": "0.416.0",
4
+ "type": "fix",
5
+ "title": "Scaffolded apps accept Key Manager ciphertext keys in production",
6
+ "detail": "The generated `bin/main.ts` (demo and blank starter) boots production with `kmsMode: \"required\"` instead of the sync `requireKmsWiring`, which rejected every `*_CIPHERTEXT` key; local boots keep `resolveKmsWiring`. The generated `bin/kumiko.ts` passes `schema apply` the slots of `kmsEnvSchema` in addition to the app's own, so the migrate step resolves the same keys as the server. Existing apps scaffolded before this release keep their old files; copy both changes by hand if they receive ciphertext keys."
7
+ },
2
8
  {
3
9
  "version": "0.414.0",
4
10
  "type": "fix",