@camstack/system 1.2.375 → 1.2.377
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 +9 -4
- package/dist/addon-runner.mjs +10 -5
- package/dist/addon-utils.js +1 -1
- package/dist/addon-utils.mjs +1 -1
- package/dist/auth/external-identity-manager.d.ts +43 -0
- 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/autotrack/index.js +1 -1
- package/dist/builtins/autotrack/index.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/calendars/calendars.addon.js +1 -1
- package/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/dist/builtins/camera-grid/index.js +1 -1
- package/dist/builtins/camera-grid/index.mjs +1 -1
- package/dist/builtins/composer/composer.addon.js +2 -2
- package/dist/builtins/composer/composer.addon.mjs +2 -2
- 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 +2 -2
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/dist/builtins/device-manager/device-config-secrets.d.ts +21 -0
- package/dist/builtins/device-manager/device-manager.addon.d.ts +2 -0
- package/dist/builtins/device-manager/device-manager.addon.js +119 -6
- package/dist/builtins/device-manager/device-manager.addon.mjs +119 -6
- package/dist/builtins/device-manager/device-projection.d.ts +2 -1
- package/dist/builtins/device-manager/device-provider-context.d.ts +3 -0
- package/dist/builtins/device-manager/secret-config-paths.d.ts +24 -0
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/keychain/index.d.ts +1 -0
- package/dist/builtins/keychain/index.js +1416 -0
- package/dist/builtins/keychain/index.mjs +1409 -0
- package/dist/builtins/keychain/key-sources.d.ts +37 -0
- package/dist/builtins/keychain/keychain-crypto.d.ts +28 -0
- package/dist/builtins/keychain/keychain-service.d.ts +103 -0
- package/dist/builtins/keychain/keychain-store.d.ts +82 -0
- package/dist/builtins/keychain/keychain-usage.d.ts +6 -0
- package/dist/builtins/keychain/keychain.addon.d.ts +11 -0
- package/dist/builtins/keychain/platform-key-source.d.ts +24 -0
- 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/auth-schema.d.ts +14 -0
- package/dist/builtins/local-auth/local-auth.addon.d.ts +1 -0
- package/dist/builtins/local-auth/local-auth.addon.js +1358 -1129
- package/dist/builtins/local-auth/local-auth.addon.mjs +1358 -1129
- 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-store.d.ts +6 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts +15 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +74 -14
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +74 -14
- 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/{child-cap-dispatch-B9kziY4L.mjs → child-cap-dispatch-CgmOo0yl.mjs} +184 -29
- package/dist/{child-cap-dispatch-Bfdgkbq3.js → child-cap-dispatch-DlDSoqm1.js} +212 -27
- package/dist/{composition-sources-DYlXX2qW.js → composition-sources-BNyXPSs_.js} +1 -1
- package/dist/{composition-sources-BfZgiTYD.mjs → composition-sources-D39bl0nP.mjs} +1 -1
- package/dist/{dist-ZdSg09GJ.mjs → dist-BWNoS-1S.mjs} +2454 -108
- package/dist/{dist-CNbnikIh.js → dist-D_a9mUiM.js} +2525 -107
- package/dist/{event-loop-stall-monitor-DKcYBHdH.mjs → event-loop-stall-monitor-ClPhfx7Y.mjs} +1 -1
- package/dist/{event-loop-stall-monitor-CpEH3CoV.js → event-loop-stall-monitor-DuOn8H1n.js} +1 -1
- package/dist/{hub-cap-forward-BdT320dq.mjs → hub-cap-forward-CH6_VWVO.mjs} +13 -4
- package/dist/{hub-cap-forward-DmHNjbB0.js → hub-cap-forward-COCmYaup.js} +13 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.js +20 -6
- package/dist/index.mjs +13 -7
- package/dist/kernel/config-schema.d.ts +4 -0
- package/dist/kernel/moleculer/child-addon-call-dispatch.d.ts +6 -0
- package/dist/kernel/transport/cap-route-resolver.d.ts +19 -0
- package/dist/kernel/transport/hub-cap-forward.d.ts +22 -1
- package/dist/kernel/transport/index.d.ts +2 -2
- package/dist/kernel/transport/local-child-registry.d.ts +4 -3
- package/dist/logging/log-redactor.d.ts +9 -0
- package/dist/platform-key-source-BWlq0jjn.mjs +23 -0
- package/dist/platform-key-source-Di7HrlGR.js +40 -0
- package/dist/{retired-settings-keys-CcWvdy6u.js → retired-settings-keys-CDyOGAje.js} +1 -1
- package/dist/{retired-settings-keys-B4ZeKrbR.mjs → retired-settings-keys-iGcmzwLV.mjs} +1 -1
- package/package.json +17 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
3
|
-
const require_dist = require("../../dist-
|
|
3
|
+
const require_dist = require("../../dist-D_a9mUiM.js");
|
|
4
4
|
const require_tls = require("../../tls-CCMX7MjX.js");
|
|
5
5
|
let zod = require("zod");
|
|
6
6
|
let node_os = require("node:os");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Cn as resolveHubAddressRoles, En as resolveNotificationTapAddress, Gr as EventCategory, Hn as validateCustomAddress, It as isAppLinkBase, Yt as localNetworkCapability, fn as pickAppLinkHub, lr as BaseAddon, nt as checkRoleAddress, s as CAMSTACK_APP_LINK_ORIGIN, yn as resolveAppConnections, zt as isDefaultAppConnectionEndpoint } from "../../dist-BWNoS-1S.mjs";
|
|
2
2
|
import { P as readLanHttpState, _ as writeExtraSans, h as readTlsMode, i as storeUploadedCertificate, j as applyLanHttp, k as DEFAULT_LAN_HTTP_PORT, m as readTlsAccessStatus, n as regenerateCertificate, p as readExtraSans, r as revertToGeneratedCertificate, t as applyCertificateToListener, u as servedHttpsLeafFingerprint, y as ensureTlsCert } from "../../tls-CJHogwTl.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import * as os from "node:os";
|
|
@@ -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-D_a9mUiM.js");
|
|
7
7
|
//#region src/builtins/loki-logging/loki-payload.ts
|
|
8
8
|
/**
|
|
9
9
|
* Loki rejects a label name that is not a valid Prometheus label
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Zt as logDestinationCapability,
|
|
1
|
+
import { Zt as logDestinationCapability, lr as BaseAddon } from "../../dist-BWNoS-1S.mjs";
|
|
2
2
|
//#region src/builtins/loki-logging/loki-payload.ts
|
|
3
3
|
/**
|
|
4
4
|
* Loki rejects a label name that is not a valid Prometheus label
|
|
@@ -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-D_a9mUiM.js");
|
|
7
7
|
const require_proc_stat = require("../../proc-stat-DL-WUOhl.js");
|
|
8
8
|
let node_fs_promises = require("node:fs/promises");
|
|
9
9
|
let node_os = require("node:os");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Gr as EventCategory, Mt as foldSnapshotByFunction, Sr as createEvent, _n as reducePoints, bn as resolveBucketMs, cr as errMsg, in as metricsProviderCapability, lr as BaseAddon } from "../../dist-BWNoS-1S.mjs";
|
|
2
2
|
import { a as parseProcStat, i as nodeProcReader, n as elapsedSecSince, o as parseProcStatusRss, r as lifetimeCpuPercent, t as commandFromCmdline } from "../../proc-stat-CbC55Kqi.mjs";
|
|
3
3
|
import { access, readFile, readdir } from "node:fs/promises";
|
|
4
4
|
import * as os from "node:os";
|
|
@@ -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-D_a9mUiM.js");
|
|
7
7
|
let node_os = require("node:os");
|
|
8
8
|
node_os = require_chunk.__toESM(node_os);
|
|
9
9
|
let node_fs = require("node:fs");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as __toESM } from "../../chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { An as scoreRuntimes, Ct as enumerateInferenceDevices, Gr as EventCategory, cr as errMsg, lr as BaseAddon, mn as platformProbeCapability, wr as emitReadiness } from "../../dist-BWNoS-1S.mjs";
|
|
3
3
|
import * as os from "node:os";
|
|
4
4
|
import * as fs from "node:fs";
|
|
5
5
|
import { execFile } from "node:child_process";
|
|
@@ -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-D_a9mUiM.js");
|
|
7
7
|
//#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
|
|
8
8
|
/**
|
|
9
9
|
* Reconcile the durable `enabledProviders` set against authoritative
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Gr as EventCategory, lr as BaseAddon } from "../../dist-BWNoS-1S.mjs";
|
|
2
2
|
//#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
|
|
3
3
|
/**
|
|
4
4
|
* Reconcile the durable `enabledProviders` set against authoritative
|
|
@@ -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-D_a9mUiM.js");
|
|
7
7
|
const require_snapshot_courtesy = require("../../snapshot-courtesy-D_C5-nC0.js");
|
|
8
8
|
let zod = require("zod");
|
|
9
9
|
let node_crypto = require("node:crypto");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Gr as EventCategory, Nn as snapshotCapability, X as bareAddonId, Z as batteryCapability, _t as deriveBatteryPresence, a as BatteryStatusSchema, ar as DeviceFeature, cr as errMsg, jr as nodePin, lr as BaseAddon, rn as memoizePinnedFfmpeg, sr as DeviceType, zn as streamQualityLabel } from "../../dist-BWNoS-1S.mjs";
|
|
2
2
|
import { i as renderCourtesyOverlayJpeg, n as courtesyCacheKey, r as renderCourtesyJpeg } from "../../snapshot-courtesy-CyFs1M3I.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
@@ -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-D_a9mUiM.js");
|
|
7
7
|
let node_crypto = require("node:crypto");
|
|
8
8
|
let node_fs_promises = require("node:fs/promises");
|
|
9
9
|
let node_path = require("node:path");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ln as storageProviderCapability, jt as filesystemBrowseCapability, lr as BaseAddon } from "../../dist-BWNoS-1S.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import { mkdir, readdir, realpath, statfs } from "node:fs/promises";
|
|
4
4
|
import * as path$1 from "node:path";
|
|
Binary file
|
|
Binary file
|
|
@@ -22,6 +22,12 @@ export interface ILocationStore {
|
|
|
22
22
|
/** Remove a location by id. */
|
|
23
23
|
delete(id: string): Promise<void>;
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* @durable class=config owner=storage-orchestrator
|
|
27
|
+
* write="an operator creates or edits a location (basePath, minFreePercent, enabled, node pin); plus the boot reconcile — declared defaults seeded on a fresh install, and in-memory-only locations backfilled when the store is late-wired"
|
|
28
|
+
* retention="none — a row goes only when the operator deletes the location, or when the declaration pass prunes one whose declaring addon is gone. Bounded by the storage targets a human configures."
|
|
29
|
+
*/
|
|
30
|
+
export declare const STORAGE_LOCATIONS = "storage_locations";
|
|
25
31
|
/**
|
|
26
32
|
* `ILocationStore` on the `settings-store` collection surface — the same door
|
|
27
33
|
* every other consumer uses. It holds the `data-store-provider` engine object
|
|
@@ -167,6 +167,21 @@ export declare class StorageOrchestratorAddon extends BaseAddon<StorageOrchestra
|
|
|
167
167
|
*/
|
|
168
168
|
private announceLocationsChanged;
|
|
169
169
|
/** A location with its provider's declared secrets replaced by the sentinel. */
|
|
170
|
+
/**
|
|
171
|
+
* The location as a PROVIDER must see it: every keychain marker in its
|
|
172
|
+
* config resolved (D787). The same object when it holds none — a filesystem
|
|
173
|
+
* location costs nothing. An unresolvable secret is left out and logged by
|
|
174
|
+
* ref; the provider then fails its own connection, by name.
|
|
175
|
+
*/
|
|
176
|
+
private withResolvedSecrets;
|
|
177
|
+
/**
|
|
178
|
+
* Strip the provider's DECLARED secrets (its form schema, by type) out of a
|
|
179
|
+
* location config into the keychain, under `row/storage_locations/<id>`.
|
|
180
|
+
* A provider that has not registered declares nothing: only keys that
|
|
181
|
+
* already hold a marker are handled then — a new plaintext is never guessed
|
|
182
|
+
* at, it stays as sent until the provider is back and the location is saved.
|
|
183
|
+
*/
|
|
184
|
+
private keepSecretsInKeychain;
|
|
170
185
|
private redacted;
|
|
171
186
|
/**
|
|
172
187
|
* Is this location backed by a provider that serves a genuine local
|
|
@@ -3,8 +3,8 @@ 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-
|
|
7
|
-
const require_hub_cap_forward = require("../../hub-cap-forward-
|
|
6
|
+
const require_dist = require("../../dist-D_a9mUiM.js");
|
|
7
|
+
const require_hub_cap_forward = require("../../hub-cap-forward-COCmYaup.js");
|
|
8
8
|
let zod = require("zod");
|
|
9
9
|
let node_crypto = require("node:crypto");
|
|
10
10
|
let _camstack_types_node = require("@camstack/types/node");
|
|
@@ -3474,9 +3474,10 @@ var StorageOrchestratorAddon = class extends require_dist.BaseAddon {
|
|
|
3474
3474
|
upsertLocation: async (input) => {
|
|
3475
3475
|
const stored = service.getLocationById(input.id);
|
|
3476
3476
|
const config = restoreRedactedSecrets(input.config, stored?.config, this.secretKeysFor(input.providerId, stored?.config ?? {}));
|
|
3477
|
-
const
|
|
3477
|
+
const keychained = await this.keepSecretsInKeychain(input.id, input.providerId, config, stored?.config ?? {});
|
|
3478
|
+
const next = keychained === input.config ? input : {
|
|
3478
3479
|
...input,
|
|
3479
|
-
config
|
|
3480
|
+
config: keychained
|
|
3480
3481
|
};
|
|
3481
3482
|
await this.carryDataOnRepoint(stored, next);
|
|
3482
3483
|
const saved = service.upsertLocation(next);
|
|
@@ -3495,7 +3496,9 @@ var StorageOrchestratorAddon = class extends require_dist.BaseAddon {
|
|
|
3495
3496
|
error: `Location "${id}" not found`
|
|
3496
3497
|
};
|
|
3497
3498
|
try {
|
|
3498
|
-
|
|
3499
|
+
const p = await service.getProviderFor(loc);
|
|
3500
|
+
const live = await this.withResolvedSecrets(loc);
|
|
3501
|
+
return p.testLocation({ config: live.config });
|
|
3499
3502
|
} catch (err) {
|
|
3500
3503
|
return {
|
|
3501
3504
|
ok: false,
|
|
@@ -3531,7 +3534,7 @@ var StorageOrchestratorAddon = class extends require_dist.BaseAddon {
|
|
|
3531
3534
|
};
|
|
3532
3535
|
},
|
|
3533
3536
|
resolve: async ({ location, relativePath }) => {
|
|
3534
|
-
const loc = service.resolveRef(location);
|
|
3537
|
+
const loc = await this.withResolvedSecrets(service.resolveRef(location));
|
|
3535
3538
|
this.refuseRemoteResolve(loc);
|
|
3536
3539
|
return (await service.getProviderFor(loc)).resolve({
|
|
3537
3540
|
location: loc,
|
|
@@ -3539,7 +3542,7 @@ var StorageOrchestratorAddon = class extends require_dist.BaseAddon {
|
|
|
3539
3542
|
});
|
|
3540
3543
|
},
|
|
3541
3544
|
write: async ({ location, relativePath, data }) => {
|
|
3542
|
-
const loc = service.resolveRef(location);
|
|
3545
|
+
const loc = await this.withResolvedSecrets(service.resolveRef(location));
|
|
3543
3546
|
return (await service.getProviderFor(loc)).write({
|
|
3544
3547
|
location: loc,
|
|
3545
3548
|
relativePath,
|
|
@@ -3547,21 +3550,21 @@ var StorageOrchestratorAddon = class extends require_dist.BaseAddon {
|
|
|
3547
3550
|
});
|
|
3548
3551
|
},
|
|
3549
3552
|
read: async ({ location, relativePath }) => {
|
|
3550
|
-
const loc = service.resolveRef(location);
|
|
3553
|
+
const loc = await this.withResolvedSecrets(service.resolveRef(location));
|
|
3551
3554
|
return (await service.getProviderFor(loc)).read({
|
|
3552
3555
|
location: loc,
|
|
3553
3556
|
relativePath
|
|
3554
3557
|
});
|
|
3555
3558
|
},
|
|
3556
3559
|
exists: async ({ location, relativePath }) => {
|
|
3557
|
-
const loc = service.resolveRef(location);
|
|
3560
|
+
const loc = await this.withResolvedSecrets(service.resolveRef(location));
|
|
3558
3561
|
return (await service.getProviderFor(loc)).exists({
|
|
3559
3562
|
location: loc,
|
|
3560
3563
|
relativePath
|
|
3561
3564
|
});
|
|
3562
3565
|
},
|
|
3563
3566
|
list: async ({ location, prefix }) => {
|
|
3564
|
-
const loc = service.resolveRef(location);
|
|
3567
|
+
const loc = await this.withResolvedSecrets(service.resolveRef(location));
|
|
3565
3568
|
const p = await service.getProviderFor(loc);
|
|
3566
3569
|
return prefix !== void 0 ? p.list({
|
|
3567
3570
|
location: loc,
|
|
@@ -3569,18 +3572,18 @@ var StorageOrchestratorAddon = class extends require_dist.BaseAddon {
|
|
|
3569
3572
|
}) : p.list({ location: loc });
|
|
3570
3573
|
},
|
|
3571
3574
|
delete: async ({ location, relativePath }) => {
|
|
3572
|
-
const loc = service.resolveRef(location);
|
|
3575
|
+
const loc = await this.withResolvedSecrets(service.resolveRef(location));
|
|
3573
3576
|
return (await service.getProviderFor(loc)).delete({
|
|
3574
3577
|
location: loc,
|
|
3575
3578
|
relativePath
|
|
3576
3579
|
});
|
|
3577
3580
|
},
|
|
3578
3581
|
getAvailableSpace: async ({ location }) => {
|
|
3579
|
-
const loc = service.resolveRef(location);
|
|
3582
|
+
const loc = await this.withResolvedSecrets(service.resolveRef(location));
|
|
3580
3583
|
return (await service.getProviderFor(loc)).getAvailableSpace({ location: loc });
|
|
3581
3584
|
},
|
|
3582
3585
|
beginUpload: async ({ location, relativePath, sizeBytes }) => {
|
|
3583
|
-
const loc = service.resolveRef(location);
|
|
3586
|
+
const loc = await this.withResolvedSecrets(service.resolveRef(location));
|
|
3584
3587
|
const p = await service.getProviderFor(loc);
|
|
3585
3588
|
const result = sizeBytes !== void 0 ? await p.beginUpload({
|
|
3586
3589
|
location: loc,
|
|
@@ -3613,7 +3616,7 @@ var StorageOrchestratorAddon = class extends require_dist.BaseAddon {
|
|
|
3613
3616
|
}
|
|
3614
3617
|
},
|
|
3615
3618
|
beginDownload: async ({ location, relativePath }) => {
|
|
3616
|
-
const loc = service.resolveRef(location);
|
|
3619
|
+
const loc = await this.withResolvedSecrets(service.resolveRef(location));
|
|
3617
3620
|
const result = await (await service.getProviderFor(loc)).beginDownload({
|
|
3618
3621
|
location: loc,
|
|
3619
3622
|
relativePath
|
|
@@ -4075,6 +4078,63 @@ var StorageOrchestratorAddon = class extends require_dist.BaseAddon {
|
|
|
4075
4078
|
}
|
|
4076
4079
|
}
|
|
4077
4080
|
/** A location with its provider's declared secrets replaced by the sentinel. */
|
|
4081
|
+
/**
|
|
4082
|
+
* The location as a PROVIDER must see it: every keychain marker in its
|
|
4083
|
+
* config resolved (D787). The same object when it holds none — a filesystem
|
|
4084
|
+
* location costs nothing. An unresolvable secret is left out and logged by
|
|
4085
|
+
* ref; the provider then fails its own connection, by name.
|
|
4086
|
+
*/
|
|
4087
|
+
async withResolvedSecrets(location) {
|
|
4088
|
+
const secrets = this.ctx.secrets;
|
|
4089
|
+
if (secrets === void 0) return location;
|
|
4090
|
+
const { value, unresolved } = await require_dist.resolveSecretMarkers(location.config, secrets);
|
|
4091
|
+
if (unresolved.length > 0) this.ctx.logger.error("storage location secret unavailable", { meta: {
|
|
4092
|
+
locationId: location.id,
|
|
4093
|
+
secrets: unresolved.map((u) => ({
|
|
4094
|
+
ref: u.ref,
|
|
4095
|
+
reason: u.reason
|
|
4096
|
+
}))
|
|
4097
|
+
} });
|
|
4098
|
+
return value === location.config ? location : {
|
|
4099
|
+
...location,
|
|
4100
|
+
config: value
|
|
4101
|
+
};
|
|
4102
|
+
}
|
|
4103
|
+
/**
|
|
4104
|
+
* Strip the provider's DECLARED secrets (its form schema, by type) out of a
|
|
4105
|
+
* location config into the keychain, under `row/storage_locations/<id>`.
|
|
4106
|
+
* A provider that has not registered declares nothing: only keys that
|
|
4107
|
+
* already hold a marker are handled then — a new plaintext is never guessed
|
|
4108
|
+
* at, it stays as sent until the provider is back and the location is saved.
|
|
4109
|
+
*/
|
|
4110
|
+
async keepSecretsInKeychain(locationId, providerId, config, stored) {
|
|
4111
|
+
const secrets = this.ctx.secrets;
|
|
4112
|
+
if (secrets === void 0) return config;
|
|
4113
|
+
const declared = this.declaredSecretKeys(providerId) ?? /* @__PURE__ */ new Set();
|
|
4114
|
+
const markerKeys = Object.entries(stored).filter(([, v]) => require_dist.isSecretMarker(v)).map(([k]) => k);
|
|
4115
|
+
const tree = require_dist.secretTreeFromPaths([...new Set([...declared, ...markerKeys])]);
|
|
4116
|
+
if (tree.size === 0) return config;
|
|
4117
|
+
const result = await require_dist.transformSecretWrite({
|
|
4118
|
+
tree,
|
|
4119
|
+
secrets,
|
|
4120
|
+
patch: { ...config },
|
|
4121
|
+
stored: { ...stored },
|
|
4122
|
+
scope: {
|
|
4123
|
+
kind: "row",
|
|
4124
|
+
collection: STORAGE_LOCATIONS,
|
|
4125
|
+
rowId: locationId
|
|
4126
|
+
}
|
|
4127
|
+
});
|
|
4128
|
+
const merged = { ...result.patch };
|
|
4129
|
+
for (const key of tree.keys()) if (!(key in merged) && key in stored) merged[key] = stored[key];
|
|
4130
|
+
result.afterWrite().then(({ orphaned }) => {
|
|
4131
|
+
if (orphaned.length > 0) this.ctx.logger.warn("storage location: dropped keychain refs could not be deleted", { meta: {
|
|
4132
|
+
locationId,
|
|
4133
|
+
refs: [...orphaned]
|
|
4134
|
+
} });
|
|
4135
|
+
});
|
|
4136
|
+
return merged;
|
|
4137
|
+
}
|
|
4078
4138
|
redacted(location) {
|
|
4079
4139
|
return redactLocation(location, this.secretKeysFor(location.providerId, location.config));
|
|
4080
4140
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as HUB_CAP_FWD_ACTION } from "../../hub-cap-forward-
|
|
1
|
+
import { Ar as isSecretMarker, B as StorageLocationModeSchema, Bt as isLocationEnabled, D as LegacyStorageLocationDefaultSchema, Dt as evictionPolicyOfLocation, Fn as storageMigrationCapability, Gr as EventCategory, H as StorageMigrationJobSchema, Kn as withLocationMode, Nr as parseJsonObject, Pn as storageCapability, Pt as gbToBytes, Rr as resolveSecretMarkers, V as StorageLocationTypeSchema, Vr as secretTreeFromPaths, Wr as transformSecretWrite, an as modeMayWrite, br as collectSecretConfigKeys, jn as settingsStoreCapability, lr as BaseAddon, nn as mayWriteToLocation, pr as REDACTED_SECRET, qt as legacyModeOf, tn as mayReadLocation, wn as resolveLocationMode, z as StorageCleanupJobSchema } from "../../dist-BWNoS-1S.mjs";
|
|
2
|
+
import { t as HUB_CAP_FWD_ACTION } from "../../hub-cap-forward-CH6_VWVO.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import { containsOrEquals, physicalRootOf } from "@camstack/types/node";
|
|
@@ -3469,9 +3469,10 @@ var StorageOrchestratorAddon = class extends BaseAddon {
|
|
|
3469
3469
|
upsertLocation: async (input) => {
|
|
3470
3470
|
const stored = service.getLocationById(input.id);
|
|
3471
3471
|
const config = restoreRedactedSecrets(input.config, stored?.config, this.secretKeysFor(input.providerId, stored?.config ?? {}));
|
|
3472
|
-
const
|
|
3472
|
+
const keychained = await this.keepSecretsInKeychain(input.id, input.providerId, config, stored?.config ?? {});
|
|
3473
|
+
const next = keychained === input.config ? input : {
|
|
3473
3474
|
...input,
|
|
3474
|
-
config
|
|
3475
|
+
config: keychained
|
|
3475
3476
|
};
|
|
3476
3477
|
await this.carryDataOnRepoint(stored, next);
|
|
3477
3478
|
const saved = service.upsertLocation(next);
|
|
@@ -3490,7 +3491,9 @@ var StorageOrchestratorAddon = class extends BaseAddon {
|
|
|
3490
3491
|
error: `Location "${id}" not found`
|
|
3491
3492
|
};
|
|
3492
3493
|
try {
|
|
3493
|
-
|
|
3494
|
+
const p = await service.getProviderFor(loc);
|
|
3495
|
+
const live = await this.withResolvedSecrets(loc);
|
|
3496
|
+
return p.testLocation({ config: live.config });
|
|
3494
3497
|
} catch (err) {
|
|
3495
3498
|
return {
|
|
3496
3499
|
ok: false,
|
|
@@ -3526,7 +3529,7 @@ var StorageOrchestratorAddon = class extends BaseAddon {
|
|
|
3526
3529
|
};
|
|
3527
3530
|
},
|
|
3528
3531
|
resolve: async ({ location, relativePath }) => {
|
|
3529
|
-
const loc = service.resolveRef(location);
|
|
3532
|
+
const loc = await this.withResolvedSecrets(service.resolveRef(location));
|
|
3530
3533
|
this.refuseRemoteResolve(loc);
|
|
3531
3534
|
return (await service.getProviderFor(loc)).resolve({
|
|
3532
3535
|
location: loc,
|
|
@@ -3534,7 +3537,7 @@ var StorageOrchestratorAddon = class extends BaseAddon {
|
|
|
3534
3537
|
});
|
|
3535
3538
|
},
|
|
3536
3539
|
write: async ({ location, relativePath, data }) => {
|
|
3537
|
-
const loc = service.resolveRef(location);
|
|
3540
|
+
const loc = await this.withResolvedSecrets(service.resolveRef(location));
|
|
3538
3541
|
return (await service.getProviderFor(loc)).write({
|
|
3539
3542
|
location: loc,
|
|
3540
3543
|
relativePath,
|
|
@@ -3542,21 +3545,21 @@ var StorageOrchestratorAddon = class extends BaseAddon {
|
|
|
3542
3545
|
});
|
|
3543
3546
|
},
|
|
3544
3547
|
read: async ({ location, relativePath }) => {
|
|
3545
|
-
const loc = service.resolveRef(location);
|
|
3548
|
+
const loc = await this.withResolvedSecrets(service.resolveRef(location));
|
|
3546
3549
|
return (await service.getProviderFor(loc)).read({
|
|
3547
3550
|
location: loc,
|
|
3548
3551
|
relativePath
|
|
3549
3552
|
});
|
|
3550
3553
|
},
|
|
3551
3554
|
exists: async ({ location, relativePath }) => {
|
|
3552
|
-
const loc = service.resolveRef(location);
|
|
3555
|
+
const loc = await this.withResolvedSecrets(service.resolveRef(location));
|
|
3553
3556
|
return (await service.getProviderFor(loc)).exists({
|
|
3554
3557
|
location: loc,
|
|
3555
3558
|
relativePath
|
|
3556
3559
|
});
|
|
3557
3560
|
},
|
|
3558
3561
|
list: async ({ location, prefix }) => {
|
|
3559
|
-
const loc = service.resolveRef(location);
|
|
3562
|
+
const loc = await this.withResolvedSecrets(service.resolveRef(location));
|
|
3560
3563
|
const p = await service.getProviderFor(loc);
|
|
3561
3564
|
return prefix !== void 0 ? p.list({
|
|
3562
3565
|
location: loc,
|
|
@@ -3564,18 +3567,18 @@ var StorageOrchestratorAddon = class extends BaseAddon {
|
|
|
3564
3567
|
}) : p.list({ location: loc });
|
|
3565
3568
|
},
|
|
3566
3569
|
delete: async ({ location, relativePath }) => {
|
|
3567
|
-
const loc = service.resolveRef(location);
|
|
3570
|
+
const loc = await this.withResolvedSecrets(service.resolveRef(location));
|
|
3568
3571
|
return (await service.getProviderFor(loc)).delete({
|
|
3569
3572
|
location: loc,
|
|
3570
3573
|
relativePath
|
|
3571
3574
|
});
|
|
3572
3575
|
},
|
|
3573
3576
|
getAvailableSpace: async ({ location }) => {
|
|
3574
|
-
const loc = service.resolveRef(location);
|
|
3577
|
+
const loc = await this.withResolvedSecrets(service.resolveRef(location));
|
|
3575
3578
|
return (await service.getProviderFor(loc)).getAvailableSpace({ location: loc });
|
|
3576
3579
|
},
|
|
3577
3580
|
beginUpload: async ({ location, relativePath, sizeBytes }) => {
|
|
3578
|
-
const loc = service.resolveRef(location);
|
|
3581
|
+
const loc = await this.withResolvedSecrets(service.resolveRef(location));
|
|
3579
3582
|
const p = await service.getProviderFor(loc);
|
|
3580
3583
|
const result = sizeBytes !== void 0 ? await p.beginUpload({
|
|
3581
3584
|
location: loc,
|
|
@@ -3608,7 +3611,7 @@ var StorageOrchestratorAddon = class extends BaseAddon {
|
|
|
3608
3611
|
}
|
|
3609
3612
|
},
|
|
3610
3613
|
beginDownload: async ({ location, relativePath }) => {
|
|
3611
|
-
const loc = service.resolveRef(location);
|
|
3614
|
+
const loc = await this.withResolvedSecrets(service.resolveRef(location));
|
|
3612
3615
|
const result = await (await service.getProviderFor(loc)).beginDownload({
|
|
3613
3616
|
location: loc,
|
|
3614
3617
|
relativePath
|
|
@@ -4070,6 +4073,63 @@ var StorageOrchestratorAddon = class extends BaseAddon {
|
|
|
4070
4073
|
}
|
|
4071
4074
|
}
|
|
4072
4075
|
/** A location with its provider's declared secrets replaced by the sentinel. */
|
|
4076
|
+
/**
|
|
4077
|
+
* The location as a PROVIDER must see it: every keychain marker in its
|
|
4078
|
+
* config resolved (D787). The same object when it holds none — a filesystem
|
|
4079
|
+
* location costs nothing. An unresolvable secret is left out and logged by
|
|
4080
|
+
* ref; the provider then fails its own connection, by name.
|
|
4081
|
+
*/
|
|
4082
|
+
async withResolvedSecrets(location) {
|
|
4083
|
+
const secrets = this.ctx.secrets;
|
|
4084
|
+
if (secrets === void 0) return location;
|
|
4085
|
+
const { value, unresolved } = await resolveSecretMarkers(location.config, secrets);
|
|
4086
|
+
if (unresolved.length > 0) this.ctx.logger.error("storage location secret unavailable", { meta: {
|
|
4087
|
+
locationId: location.id,
|
|
4088
|
+
secrets: unresolved.map((u) => ({
|
|
4089
|
+
ref: u.ref,
|
|
4090
|
+
reason: u.reason
|
|
4091
|
+
}))
|
|
4092
|
+
} });
|
|
4093
|
+
return value === location.config ? location : {
|
|
4094
|
+
...location,
|
|
4095
|
+
config: value
|
|
4096
|
+
};
|
|
4097
|
+
}
|
|
4098
|
+
/**
|
|
4099
|
+
* Strip the provider's DECLARED secrets (its form schema, by type) out of a
|
|
4100
|
+
* location config into the keychain, under `row/storage_locations/<id>`.
|
|
4101
|
+
* A provider that has not registered declares nothing: only keys that
|
|
4102
|
+
* already hold a marker are handled then — a new plaintext is never guessed
|
|
4103
|
+
* at, it stays as sent until the provider is back and the location is saved.
|
|
4104
|
+
*/
|
|
4105
|
+
async keepSecretsInKeychain(locationId, providerId, config, stored) {
|
|
4106
|
+
const secrets = this.ctx.secrets;
|
|
4107
|
+
if (secrets === void 0) return config;
|
|
4108
|
+
const declared = this.declaredSecretKeys(providerId) ?? /* @__PURE__ */ new Set();
|
|
4109
|
+
const markerKeys = Object.entries(stored).filter(([, v]) => isSecretMarker(v)).map(([k]) => k);
|
|
4110
|
+
const tree = secretTreeFromPaths([...new Set([...declared, ...markerKeys])]);
|
|
4111
|
+
if (tree.size === 0) return config;
|
|
4112
|
+
const result = await transformSecretWrite({
|
|
4113
|
+
tree,
|
|
4114
|
+
secrets,
|
|
4115
|
+
patch: { ...config },
|
|
4116
|
+
stored: { ...stored },
|
|
4117
|
+
scope: {
|
|
4118
|
+
kind: "row",
|
|
4119
|
+
collection: STORAGE_LOCATIONS,
|
|
4120
|
+
rowId: locationId
|
|
4121
|
+
}
|
|
4122
|
+
});
|
|
4123
|
+
const merged = { ...result.patch };
|
|
4124
|
+
for (const key of tree.keys()) if (!(key in merged) && key in stored) merged[key] = stored[key];
|
|
4125
|
+
result.afterWrite().then(({ orphaned }) => {
|
|
4126
|
+
if (orphaned.length > 0) this.ctx.logger.warn("storage location: dropped keychain refs could not be deleted", { meta: {
|
|
4127
|
+
locationId,
|
|
4128
|
+
refs: [...orphaned]
|
|
4129
|
+
} });
|
|
4130
|
+
});
|
|
4131
|
+
return merged;
|
|
4132
|
+
}
|
|
4073
4133
|
redacted(location) {
|
|
4074
4134
|
return redactLocation(location, this.secretKeysFor(location.providerId, location.config));
|
|
4075
4135
|
}
|
|
@@ -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-D_a9mUiM.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 {
|
|
1
|
+
import { Dr as hydrateSchema, cr as errMsg, lr as BaseAddon } from "../../dist-BWNoS-1S.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-D_a9mUiM.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 { Zt as logDestinationCapability,
|
|
1
|
+
import { Zt as logDestinationCapability, lr as BaseAddon } from "../../dist-BWNoS-1S.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";
|