@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.
- package/dist/addon-runner.js +1 -1
- package/dist/addon-runner.mjs +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
- package/dist/builtins/device-manager/device-manager.addon.js +2 -2
- package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
- package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
- package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +1 -1
- package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
- package/dist/builtins/local-network/local-network.addon.js +1 -1
- package/dist/builtins/local-network/local-network.addon.mjs +1 -1
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
- package/dist/builtins/storage-orchestrator/location-secrets.d.ts +42 -2
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts +7 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +67 -41
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +67 -41
- package/dist/builtins/system-config/system-config.addon.js +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +1 -1
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{dist-Keu5TDO7.js → dist-B29Skpzo.js} +359 -1
- package/dist/{dist-D4xNBlJM.mjs → dist-DxFjna2a.mjs} +359 -1
- package/dist/index.js +74 -11
- package/dist/index.mjs +74 -11
- package/dist/{manifest-system-deps-CiCuev2R.mjs → manifest-system-deps-CG9ESHhv.mjs} +1 -1
- package/dist/{manifest-system-deps-DYv4ZPo2.js → manifest-system-deps-DBje540e.js} +1 -1
- package/dist/{retired-settings-keys-BBohF-eC.js → retired-settings-keys-CRL0qOnU.js} +1 -1
- package/dist/{retired-settings-keys-COQMNlOJ.mjs → retired-settings-keys-N0NZzDE3.mjs} +1 -1
- 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-
|
|
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
|
-
*
|
|
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
|
-
*
|
|
1177
|
-
*
|
|
1178
|
-
*
|
|
1179
|
-
*
|
|
1180
|
-
* `
|
|
1181
|
-
*
|
|
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
|
-
*
|
|
1188
|
-
*
|
|
1189
|
-
*
|
|
1190
|
-
*
|
|
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
|
-
|
|
1209
|
-
|
|
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
|
-
/**
|
|
2652
|
-
|
|
2653
|
-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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";
|