@camstack/system 1.2.161 → 1.2.163

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.
Files changed (57) hide show
  1. package/dist/addon-runner.js +1 -1
  2. package/dist/addon-runner.mjs +1 -1
  3. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/alerts/alerts.addon.js +1 -1
  8. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  9. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  10. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  11. package/dist/builtins/console-logging/index.js +1 -1
  12. package/dist/builtins/console-logging/index.mjs +1 -1
  13. package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
  14. package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
  15. package/dist/builtins/device-manager/device-manager.addon.js +2 -2
  16. package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
  17. package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
  18. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
  19. package/dist/builtins/hub-forwarder/index.js +1 -1
  20. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  21. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  22. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  23. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  24. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  25. package/dist/builtins/local-network/local-network.addon.js +1 -1
  26. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  27. package/dist/builtins/loki-logging/index.js +1 -1
  28. package/dist/builtins/loki-logging/index.mjs +1 -1
  29. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  30. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  31. package/dist/builtins/platform-probe/index.js +1 -1
  32. package/dist/builtins/platform-probe/index.mjs +1 -1
  33. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  34. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  35. package/dist/builtins/snapshot/index.js +1 -1
  36. package/dist/builtins/snapshot/index.mjs +1 -1
  37. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  38. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  39. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  40. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  41. package/dist/builtins/storage-orchestrator/location-secrets.d.ts +42 -2
  42. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts +7 -1
  43. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +67 -41
  44. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +67 -41
  45. package/dist/builtins/system-config/system-config.addon.js +1 -1
  46. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  47. package/dist/builtins/winston-logging/index.js +1 -1
  48. package/dist/builtins/winston-logging/index.mjs +1 -1
  49. package/dist/{dist-Keu5TDO7.js → dist-B29Skpzo.js} +359 -1
  50. package/dist/{dist-D4xNBlJM.mjs → dist-DxFjna2a.mjs} +359 -1
  51. package/dist/index.js +74 -11
  52. package/dist/index.mjs +74 -11
  53. package/dist/{manifest-system-deps-CiCuev2R.mjs → manifest-system-deps-CG9ESHhv.mjs} +1 -1
  54. package/dist/{manifest-system-deps-DYv4ZPo2.js → manifest-system-deps-DBje540e.js} +1 -1
  55. package/dist/{retired-settings-keys-BBohF-eC.js → retired-settings-keys-CRL0qOnU.js} +1 -1
  56. package/dist/{retired-settings-keys-COQMNlOJ.mjs → retired-settings-keys-N0NZzDE3.mjs} +1 -1
  57. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { Mt as BaseAddon, N as collectSecretConfigKeys, Qt as parseJsonObject, S as StorageMigrationJobSchema, St as settingsStoreCapability, Tt as storageMigrationCapability, m as REDACTED_SECRET, wt as storageCapability, x as StorageLocationTypeSchema } from "../../dist-D4xNBlJM.mjs";
1
+ import { Mt as BaseAddon, N as collectSecretConfigKeys, Qt as parseJsonObject, S as StorageMigrationJobSchema, St as settingsStoreCapability, Tt as storageMigrationCapability, m as REDACTED_SECRET, wt as storageCapability, x as StorageLocationTypeSchema } from "../../dist-DxFjna2a.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import * as fs from "node:fs/promises";
4
4
  import * as path$1 from "node:path";
@@ -1171,47 +1171,62 @@ function createDataStoreDispatch(getEngines) {
1171
1171
  //#endregion
1172
1172
  //#region src/builtins/storage-orchestrator/location-secrets.ts
1173
1173
  /**
1174
- * Credential redaction for `StorageLocation.config`.
1174
+ * The config keys the ORCHESTRATOR itself owns, as opposed to the ones a
1175
+ * provider owns. Every one of them is read by framework code that has no idea
1176
+ * which provider is behind the row:
1175
1177
  *
1176
- * ── What was wrong ─────────────────────────────────────────────────────────
1177
- * `storage.listLocations` carries no `auth` override, so it is `protected` —
1178
- * every authenticated session reaches it, admin or not. The orchestrator
1179
- * spread each stored row verbatim. `StorageLocation.config` is
1180
- * `z.record(z.string(), z.unknown())`, and the SFTP / S3 / WebDAV providers
1181
- * already declare `password`, `privateKey`, `privateKeyPassphrase`,
1182
- * `secretAccessKey` and `token` inside it. Nothing was exposed only because
1183
- * every location on the live hub is `filesystem-storage`, whose config is
1184
- * `basePath` + `maxUsedGb`. The exposure arrives with the first remote
1185
- * location, and three providers that collect one already ship.
1178
+ * - `basePath` — `localCapacityOf`, `locationOccupancy`, the seed pass,
1179
+ * `LocationCard`'s summary, `StorageSection`;
1180
+ * - `readOnly` — drain mode; the recorder and post-analysis both filter on
1181
+ * it off a `listLocations` row;
1182
+ * - `maxUsedGb` — `resolveLocationMaxUsedBytes`;
1183
+ * - `minFreePercent` `resolveLocationThresholds`.
1186
1184
  *
1187
- * ── The mechanism ──────────────────────────────────────────────────────────
1188
- * Schema-driven, never a hardcoded key list: each provider's
1189
- * `getProviderInfo().configSchema` already says which of its fields hold a
1190
- * credential, so it is the one thing that cannot drift from the provider.
1191
- *
1192
- * Two directions, and both are needed:
1193
- * - **out** — {@link redactLocationConfig} replaces every secret value with
1194
- * `REDACTED_SECRET` on the way to a caller.
1195
- * - **in** — {@link restoreRedactedSecrets} treats that same sentinel, sent
1196
- * back on an upsert, as "keep what is stored". Without it the wizard's
1197
- * edit-and-save round trip would write the sentinel into the config and
1198
- * lock the operator out of their own share on the first rename.
1199
- *
1200
- * ── The trap this deliberately avoids ──────────────────────────────────────
1201
- * Keying redaction off `type: 'password'` alone MISSES a secret parked in a
1202
- * `textarea`, and the SFTP provider parks an entire PEM private key there.
1203
- * Discovery goes through `collectSecretConfigKeys`, whose discriminator is
1204
- * `type === 'password' || secret === true`. A redaction that quietly misses a
1205
- * credential is worse than none: it is a leak plus an assurance there is not
1206
- * one.
1185
+ * None can be a credential, because the framework interprets all four itself.
1186
+ * That is what makes the list safe to hardcode — it is NOT a list of "keys we
1187
+ * believe are not secret", which is the rotting kind. It is the closed set of
1188
+ * keys this module, not a provider, defines the meaning of.
1207
1189
  */
1208
- /** Shared empty set for providers that declare no secrets (or are unknown). */
1209
- var EMPTY_SECRET_KEYS = /* @__PURE__ */ new Set();
1190
+ var FRAMEWORK_CONFIG_KEYS = new Set([
1191
+ "basePath",
1192
+ "readOnly",
1193
+ "maxUsedGb",
1194
+ "minFreePercent"
1195
+ ]);
1210
1196
  /** Secret config keys a provider declares, derived from its own form schema. */
1211
1197
  function secretKeysOfProviderInfo(info) {
1212
1198
  return collectSecretConfigKeys(info.configSchema);
1213
1199
  }
1214
1200
  /**
1201
+ * Which keys of THIS config must be treated as secret.
1202
+ *
1203
+ * `declared` is what the provider's own schema said, or `undefined` when the
1204
+ * provider has not registered on this node and so has said nothing.
1205
+ *
1206
+ * The `undefined` branch is the one that matters. Redaction is schema-driven
1207
+ * and the schema arrives with the provider, so "no provider" used to mean "no
1208
+ * secret keys" — which redacted nothing while `listLocations` happily served
1209
+ * the row, because that method reads the store and never needs a provider.
1210
+ * That is a real window on every hub restart (the `remote-storage` group is a
1211
+ * separate runner that registers after the orchestrator boots) and it is
1212
+ * PERMANENT for a runner the CrashSupervisor marked terminally failed.
1213
+ *
1214
+ * So an unknown provider fails CLOSED: every key the framework does not itself
1215
+ * define is withheld. It over-redacts — a host name is hidden alongside the
1216
+ * password — and that is the correct direction, because the admin UI cannot
1217
+ * render a provider's form without that same provider's `configSchema` either,
1218
+ * so nothing that was working stops working.
1219
+ *
1220
+ * Withholding is done with the sentinel, never by dropping the key, so a save
1221
+ * performed in this degraded state still round-trips every value back intact.
1222
+ */
1223
+ function secretKeysForConfig(config, declared) {
1224
+ if (declared !== void 0) return declared;
1225
+ const out = /* @__PURE__ */ new Set();
1226
+ for (const key of Object.keys(config)) if (!FRAMEWORK_CONFIG_KEYS.has(key)) out.add(key);
1227
+ return out;
1228
+ }
1229
+ /**
1215
1230
  * A copy of `config` with every declared secret replaced by the sentinel.
1216
1231
  * Returns the SAME object when there is nothing to redact, so the common case
1217
1232
  * (a filesystem location) allocates nothing.
@@ -2293,7 +2308,7 @@ var StorageOrchestratorAddon = class extends BaseAddon {
2293
2308
  listLocationDeclarations: async () => service.listDeclarations(),
2294
2309
  upsertLocation: async (input) => {
2295
2310
  const stored = service.getLocationById(input.id);
2296
- const config = restoreRedactedSecrets(input.config, stored?.config, this.secretKeysFor(input.providerId));
2311
+ const config = restoreRedactedSecrets(input.config, stored?.config, this.secretKeysFor(input.providerId, stored?.config ?? {}));
2297
2312
  const saved = service.upsertLocation(config === input.config ? input : {
2298
2313
  ...input,
2299
2314
  config
@@ -2326,11 +2341,14 @@ var StorageOrchestratorAddon = class extends BaseAddon {
2326
2341
  } });
2327
2342
  });
2328
2343
  },
2329
- testConfig: async ({ providerId, config }) => {
2344
+ testConfig: async ({ providerId, locationId, config }) => {
2345
+ const stored = locationId === void 0 ? void 0 : service.getLocationById(locationId);
2346
+ const base = stored?.providerId === providerId ? stored.config : void 0;
2347
+ const resolved = restoreRedactedSecrets(config, base, this.secretKeysFor(providerId, base ?? {}));
2330
2348
  const providers = getProviders();
2331
2349
  for (const p of providers) try {
2332
2350
  if ((await p.getProviderInfo()).providerId !== providerId) continue;
2333
- return p.testLocation({ config });
2351
+ return p.testLocation({ config: resolved });
2334
2352
  } catch (err) {
2335
2353
  return {
2336
2354
  ok: false,
@@ -2648,13 +2666,21 @@ var StorageOrchestratorAddon = class extends BaseAddon {
2648
2666
  }
2649
2667
  return out;
2650
2668
  }
2651
- /** Declared secret config keys for a provider; empty when unknown. */
2652
- secretKeysFor(providerId) {
2653
- return this.secretKeysByProvider.get(providerId) ?? EMPTY_SECRET_KEYS;
2669
+ /**
2670
+ * What the provider's own schema declared secret, or `undefined` when this
2671
+ * node has never heard from that provider. The distinction is the whole
2672
+ * point — see `secretKeysForConfig`, which fails CLOSED on `undefined`.
2673
+ */
2674
+ declaredSecretKeys(providerId) {
2675
+ return this.secretKeysByProvider.get(providerId);
2676
+ }
2677
+ /** Which keys of a given stored config must never leave this process. */
2678
+ secretKeysFor(providerId, config) {
2679
+ return secretKeysForConfig(config, this.declaredSecretKeys(providerId));
2654
2680
  }
2655
2681
  /** A location with its provider's declared secrets replaced by the sentinel. */
2656
2682
  redacted(location) {
2657
- return redactLocation(location, this.secretKeysFor(location.providerId));
2683
+ return redactLocation(location, this.secretKeysFor(location.providerId, location.config));
2658
2684
  }
2659
2685
  /**
2660
2686
  * Is this location backed by a provider that serves a genuine local
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-Keu5TDO7.js");
6
+ const require_dist = require("../../dist-B29Skpzo.js");
7
7
  //#region src/builtins/system-config/system-config.addon.ts
8
8
  /**
9
9
  * Built-in `system-config` addon — Phase 4 of the settings redesign.
@@ -1,4 +1,4 @@
1
- import { Mt as BaseAddon, Yt as hydrateSchema, jt as errMsg } from "../../dist-D4xNBlJM.mjs";
1
+ import { Mt as BaseAddon, Yt as hydrateSchema, jt as errMsg } from "../../dist-DxFjna2a.mjs";
2
2
  //#region src/builtins/system-config/system-config.addon.ts
3
3
  /**
4
4
  * Built-in `system-config` addon — Phase 4 of the settings redesign.
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-Keu5TDO7.js");
6
+ const require_dist = require("../../dist-B29Skpzo.js");
7
7
  const require_formatter = require("../../formatter-DqAKDlvN.js");
8
8
  let node_path = require("node:path");
9
9
  node_path = require_chunk.__toESM(node_path);
@@ -1,4 +1,4 @@
1
- import { Mt as BaseAddon, ot as logDestinationCapability } from "../../dist-D4xNBlJM.mjs";
1
+ import { Mt as BaseAddon, ot as logDestinationCapability } from "../../dist-DxFjna2a.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
3
3
  import * as path$1 from "node:path";
4
4
  import path from "node:path";