@camstack/server 1.2.927 → 1.2.929
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/CHANGELOG.md +12 -0
- package/package.json +11 -14
- package/system/dist/addon-id-CVg1_r5E.mjs +39 -0
- package/system/dist/addon-id-Di0lNJ89.js +50 -0
- package/system/dist/addon-pages.cap-Df9FQwN1.js +49 -0
- package/system/dist/addon-pages.cap-DksUlE8j.mjs +44 -0
- package/system/dist/addon-settings.cap-3-TIIMq_.mjs +592 -0
- package/system/dist/addon-settings.cap-DAiE0Nb0.js +651 -0
- package/system/dist/addon-widgets.cap-C4jxflbF.js +200 -0
- package/system/dist/addon-widgets.cap-D9m48X78.mjs +183 -0
- package/system/dist/base-addon-DD5dIfcZ.js +4624 -0
- package/system/dist/base-addon-Md14i7pe.mjs +4505 -0
- package/system/dist/base-device-2sL1DMm1.js +1103 -0
- package/system/dist/base-device-IuM1AwXZ.mjs +1098 -0
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +8 -6
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +3 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +8 -6
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +3 -1
- package/system/dist/builtins/alerts/alerts.addon.js +113 -56
- package/system/dist/builtins/alerts/alerts.addon.mjs +58 -1
- package/system/dist/builtins/autotrack/index.js +21 -17
- package/system/dist/builtins/autotrack/index.mjs +5 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +14 -11
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +5 -2
- package/system/dist/builtins/calendars/calendars.addon.js +8 -6
- package/system/dist/builtins/calendars/calendars.addon.mjs +3 -1
- package/system/dist/builtins/camera-grid/index.js +615 -58
- package/system/dist/builtins/camera-grid/index.mjs +558 -1
- package/system/dist/builtins/composer/composer.addon.js +788 -209
- package/system/dist/builtins/composer/composer.addon.mjs +583 -4
- package/system/dist/builtins/console-logging/index.js +4 -3
- package/system/dist/builtins/console-logging/index.mjs +2 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +7887 -381
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +7511 -5
- package/system/dist/builtins/core-notifier/core-notifier.addon.js +731 -21
- package/system/dist/builtins/core-notifier/core-notifier.addon.mjs +711 -1
- package/system/dist/builtins/device-history/device-history.addon.js +110 -31
- package/system/dist/builtins/device-history/device-history.addon.mjs +81 -2
- package/system/dist/builtins/device-manager/device-manager.addon.js +12806 -227
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +12583 -5
- package/system/dist/builtins/hub-forwarder/index.js +4 -3
- package/system/dist/builtins/hub-forwarder/index.mjs +2 -1
- package/system/dist/builtins/keychain/index.js +31 -28
- package/system/dist/builtins/keychain/index.mjs +7 -4
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +15 -12
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +4 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +140 -39
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +103 -3
- package/system/dist/builtins/local-network/local-network.addon.js +43 -39
- package/system/dist/builtins/local-network/local-network.addon.mjs +7 -3
- package/system/dist/builtins/loki-logging/index.js +23 -17
- package/system/dist/builtins/loki-logging/index.mjs +7 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +156 -15
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +142 -1
- package/system/dist/builtins/platform-probe/index.js +25 -23
- package/system/dist/builtins/platform-probe/index.mjs +4 -2
- package/system/dist/builtins/record-entries/index.js +9 -7
- package/system/dist/builtins/record-entries/index.mjs +3 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +4 -4
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +97 -44
- package/system/dist/builtins/snapshot/index.mjs +54 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +5 -4
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +2 -1
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +87 -61
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +29 -3
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +81 -72
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +10 -1
- package/system/dist/builtins/system-config/system-config.addon.js +17 -14
- package/system/dist/builtins/system-config/system-config.addon.mjs +6 -3
- package/system/dist/builtins/winston-logging/index.js +7 -5
- package/system/dist/builtins/winston-logging/index.mjs +3 -1
- package/system/dist/calendars.cap-CaFlShS9.js +155 -0
- package/system/dist/calendars.cap-_C4eD4fi.mjs +138 -0
- package/system/dist/camstack-error-DJ-TUAi1.js +23 -0
- package/system/dist/camstack-error-viZYfcj9.mjs +18 -0
- package/system/dist/cap-call-context-Bd76CbOW.js +95 -0
- package/system/dist/cap-call-context-DNwdgGSQ.mjs +78 -0
- package/system/dist/capability-definition-C2rJdVeX.mjs +177 -0
- package/system/dist/capability-definition-HCmTem8c.js +242 -0
- package/system/dist/{capture-engine-BcuwOSXv.js → capture-engine-DZ0LIUqA.js} +5 -4
- package/system/dist/{capture-engine-Bz7eXFjT.mjs → capture-engine-DiwbjoWp.mjs} +2 -1
- package/system/dist/command-origin-claim-Cief660O.js +35 -0
- package/system/dist/command-origin-claim-D1Wy7Qld.mjs +24 -0
- package/system/dist/composition-sources-Caqv7O7z.mjs +391 -0
- package/system/dist/composition-sources-CgnHjm8Q.js +408 -0
- package/system/dist/{constants-D2etJ02O.js → constants-Ba3FTIHl.js} +1 -1
- package/system/dist/constants-C860Y6U4.js +26 -0
- package/system/dist/{constants-BcUTQd1M.mjs → constants-DB4piTD5.mjs} +1 -1
- package/system/dist/constants-DCLpoF4L.mjs +21 -0
- package/system/dist/coral-accelerators-7o8hqvcN.js +564 -0
- package/system/dist/coral-accelerators-BKcXP59c.mjs +521 -0
- package/system/dist/core-blocks.cap-C6iKAZ-x.mjs +17986 -0
- package/system/dist/core-blocks.cap-LEMqVwxO.js +18705 -0
- package/system/dist/custom-actions-BFUSalC9.mjs +25 -0
- package/system/dist/custom-actions-D92NRi2c.js +36 -0
- package/system/dist/database-snapshot.cap-DF38e-0P.js +162 -0
- package/system/dist/database-snapshot.cap-dhrc9xnY.mjs +133 -0
- package/system/dist/declared-device-BWphj9WE.js +303 -0
- package/system/dist/declared-device-CKERA1Hi.mjs +286 -0
- package/system/dist/{device-ca-ExMN3xW3.mjs → device-ca-BLM6fccc.mjs} +2 -1
- package/system/dist/{device-ca-CU8zh9Pi.js → device-ca-C5kJE6mL.js} +7 -6
- package/system/dist/device-certificate-Cddm4Idn.mjs +91 -0
- package/system/dist/device-certificate-CguVACQO.js +162 -0
- package/system/dist/device-identifiers-BQg9EQi1.js +600 -0
- package/system/dist/device-identifiers-iSuQCKmK.mjs +529 -0
- package/system/dist/device-kind-BJ2pfsjw.mjs +78 -0
- package/system/dist/device-kind-CsSiv_YF.js +101 -0
- package/system/dist/device-manager.cap-2abwVLCM.js +2874 -0
- package/system/dist/device-manager.cap-CFZSPfUh.mjs +2749 -0
- package/system/dist/device-provider.cap-3Uvk6f5-.mjs +331 -0
- package/system/dist/device-provider.cap-D7TV2kVH.js +366 -0
- package/system/dist/{device-row-store-CeW_GWh9.mjs → device-row-store-YF3jtmkk.mjs} +4 -1
- package/system/dist/{device-row-store-BMIR-n3m.js → device-row-store-doTfMOqn.js} +12 -9
- package/system/dist/device-transitions.cap-B5w5PYU_.js +860 -0
- package/system/dist/device-transitions.cap-DojcwEuX.mjs +819 -0
- package/system/dist/device-type-CbQsnFdC.js +477 -0
- package/system/dist/device-type-DgEvK3ch.mjs +454 -0
- package/system/dist/entry-kind-D9MuVJCK.mjs +44 -0
- package/system/dist/entry-kind-cq90c--V.js +55 -0
- package/system/dist/error.cap-CSM_SRfR.mjs +3423 -0
- package/system/dist/error.cap-DBhgPeWK.js +3848 -0
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/history-catalog-BKRarIL_.js +831 -0
- package/system/dist/history-catalog-BwTeQ4Mr.mjs +802 -0
- package/system/dist/{hub-identity-Csxx2Q8k.js → hub-identity-BMdR3Mw9.js} +2 -2
- package/system/dist/{hub-identity-BBXzP6Ve.mjs → hub-identity-DjMN9Ac2.mjs} +1 -1
- package/system/dist/{hub-mdns-ciao-By5577HM.js → hub-mdns-ciao--0v1TKME.js} +5 -5
- package/system/dist/{hub-mdns-ciao-DG17NbGU.mjs → hub-mdns-ciao-DBrtHOcc.mjs} +2 -2
- package/system/dist/index.js +763 -151
- package/system/dist/index.mjs +624 -12
- package/system/dist/integration-instances.cap-Cl9O-k4h.mjs +538 -0
- package/system/dist/integration-instances.cap-dJIxg2_s.js +549 -0
- package/system/dist/keychain-admin.cap-Db_oFX4H.js +425 -0
- package/system/dist/keychain-admin.cap-GtM7gVGG.mjs +396 -0
- package/system/dist/l10n-Bu6aUvSY.mjs +10 -0
- package/system/dist/l10n-CGMvp7NF.js +15 -0
- package/system/dist/labels-DX5S8deC.js +81 -0
- package/system/dist/labels-DsBcU7md.mjs +64 -0
- package/system/dist/{legacy-integration-rows-door-CVwOo5aq.js → legacy-integration-rows-door-B1nzxxr5.js} +2 -2
- package/system/dist/{legacy-integration-rows-door-D9tQOUzh.mjs → legacy-integration-rows-door-nTvo_6jQ.mjs} +1 -1
- package/system/dist/log-destination.cap-CxZzAVaR.mjs +143 -0
- package/system/dist/log-destination.cap-DELPJkZ0.js +148 -0
- package/system/dist/low-power-sleep.cap-7lfVU41N.js +103 -0
- package/system/dist/low-power-sleep.cap-tGPmaZ_V.mjs +92 -0
- package/system/dist/mask-shape-Ci8Co9w0.mjs +57 -0
- package/system/dist/mask-shape-CmPA2fst.js +92 -0
- package/system/dist/metrics-provider.cap-BNmcHDkQ.mjs +405 -0
- package/system/dist/metrics-provider.cap-BcmQUt6l.js +410 -0
- package/system/dist/migration-BMjgkyG2.js +380 -0
- package/system/dist/migration-DRJAtdy7.mjs +321 -0
- package/system/dist/network-access.cap-B5TWLDCC.js +1099 -0
- package/system/dist/network-access.cap-BJnGbE6n.mjs +1004 -0
- package/system/dist/notification-rules.cap-B__YBgnG.js +3422 -0
- package/system/dist/notification-rules.cap-D9ArZlwx.mjs +3357 -0
- package/system/dist/ops-log-CB4pIdqi.mjs +64 -0
- package/system/dist/ops-log-pxt9176Z.js +81 -0
- package/system/dist/pinned-binary-BOhOSNff.js +28 -0
- package/system/dist/pinned-binary-CrIRAi4G.mjs +23 -0
- package/system/dist/platform-probe.cap-1WrMhWHx.js +250 -0
- package/system/dist/platform-probe.cap-BFeqFLtQ.mjs +233 -0
- package/system/dist/prefix-walk-B4b2-9aK.mjs +790 -0
- package/system/dist/prefix-walk-DC0ljmbB.js +843 -0
- package/system/dist/ptz-autotrack.cap-BW7w0zHD.js +229 -0
- package/system/dist/ptz-autotrack.cap-DT2GypXw.mjs +224 -0
- package/system/dist/quantity-D3g5SxsZ.mjs +114 -0
- package/system/dist/quantity-lY1KiTSZ.js +143 -0
- package/system/dist/raw-secret-migration-DxuBFtvi.js +50 -0
- package/system/dist/raw-secret-migration-iv88mLoc.mjs +39 -0
- package/system/dist/record-entries.cap-sMUhTvTU.mjs +75 -0
- package/system/dist/record-entries.cap-ti1C046R.js +80 -0
- package/system/dist/record-kind-DoBfYHCs.js +203 -0
- package/system/dist/record-kind-ub6NXqfh.mjs +162 -0
- package/system/dist/recording-archive.cap-7OrIn9e5.mjs +1299 -0
- package/system/dist/recording-archive.cap-D7bo-QSM.js +1328 -0
- package/system/dist/records.cap-ClcWV64i.js +329 -0
- package/system/dist/records.cap-CwLT2ByG.mjs +294 -0
- package/system/dist/relocate-CdVQAk-w.js +804 -0
- package/system/dist/relocate-CoZZTui1.mjs +661 -0
- package/system/dist/rename-composition-block-7WIICIDq.mjs +33525 -0
- package/system/dist/rename-composition-block-CcWLwVhG.js +34692 -0
- package/system/dist/{restore-archive-kwtBd00M.mjs → restore-archive-CjAyKpgX.mjs} +3 -1
- package/system/dist/{restore-archive-CIFvqOze.js → restore-archive-CkTkv3Ss.js} +6 -4
- package/system/dist/scoped-settings-CylSSq_8.js +955 -0
- package/system/dist/scoped-settings-DVWUIP7Z.mjs +650 -0
- package/system/dist/server-name-BIhLuHvX.mjs +35 -0
- package/system/dist/server-name-OALNvpqC.js +52 -0
- package/system/dist/settings-store.cap-Ci4F2zul.mjs +569 -0
- package/system/dist/settings-store.cap-wlJhCspr.js +640 -0
- package/system/dist/snapshot.cap-3suPdBHV.js +250 -0
- package/system/dist/snapshot.cap-Bs8Oyaqh.mjs +245 -0
- package/system/dist/source-info-DGB7SdB_.mjs +190 -0
- package/system/dist/source-info-DtWf4k2j.js +225 -0
- package/system/dist/storage-admin.cap-BSv1NjKJ.mjs +883 -0
- package/system/dist/storage-admin.cap-he0OqvVM.js +906 -0
- package/system/dist/storage-location-CBT8GCD6.mjs +163 -0
- package/system/dist/storage-location-CTweDMZf.js +198 -0
- package/system/dist/storage-location-mode-B21UVRRX.mjs +167 -0
- package/system/dist/storage-location-mode-CS4sMzo-.js +232 -0
- package/system/dist/storage-migration.cap-CyyATY_p.js +330 -0
- package/system/dist/storage-migration.cap-D7QqGobp.mjs +313 -0
- package/system/dist/storage-occupancy.cap-2rmnS58Z.js +622 -0
- package/system/dist/storage-occupancy.cap-CqBztTl9.mjs +611 -0
- package/system/dist/storage-provider.cap-Bw0CfxVc.js +213 -0
- package/system/dist/storage-provider.cap-CMeck2w4.mjs +202 -0
- package/system/dist/stream-catalog.cap-Bp7SkgIf.mjs +6560 -0
- package/system/dist/stream-catalog.cap-D3uwePiA.js +6763 -0
- package/system/dist/streaming-shared-B8cXatuU.mjs +431 -0
- package/system/dist/streaming-shared-DQwFZOSi.js +526 -0
- package/system/dist/system-reasons-Be_k1W8g.js +25 -0
- package/system/dist/system-reasons-CYj4qwyS.mjs +20 -0
- package/system/dist/tag-BxLazvVb.js +2138 -0
- package/system/dist/tag-uZBAq6ox.mjs +2073 -0
- package/system/dist/user-management.cap-B9QDu8NE.js +825 -0
- package/system/dist/user-management.cap-DBIi77sB.mjs +766 -0
- package/system/dist/vector-store.cap-DnyfrYDn.js +330 -0
- package/system/dist/vector-store.cap-h2GHWQ1t.mjs +319 -0
- package/system/dist/{wal-maintenance-CTrCPzds.mjs → wal-maintenance-BG01rOn9.mjs} +0 -0
- package/system/dist/{wal-maintenance-dq7T3quB.js → wal-maintenance-DyrebYKF.js} +0 -0
- package/system/dist/zod-secret-DS7mj1bk.js +78 -0
- package/system/dist/zod-secret-zY4nM61M.mjs +73 -0
- package/system/package.json +1 -1
- package/system/dist/composition-sources-BI614LJx.mjs +0 -141
- package/system/dist/composition-sources-v_kkb8A9.js +0 -152
- package/system/dist/coral-accelerators-BSVsBVzt.js +0 -250
- package/system/dist/coral-accelerators-DBlgWB8k.mjs +0 -231
- package/system/dist/dist-BCHMSqzc.mjs +0 -143467
- package/system/dist/dist-BZfvhfS1.js +0 -146970
- package/system/dist/prefix-walk-DAOBSyH1.mjs +0 -88
- package/system/dist/prefix-walk-Dv6MLZlM.js +0 -99
- package/system/dist/rename-composition-block-C9HuBrKS.js +0 -112
- package/system/dist/rename-composition-block-DtaYmYAR.mjs +0 -101
|
@@ -3,7 +3,8 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const
|
|
6
|
+
const require_base_addon = require("../../base-addon-DD5dIfcZ.js");
|
|
7
|
+
const require_log_destination_cap = require("../../log-destination.cap-DELPJkZ0.js");
|
|
7
8
|
const require_formatter = require("../../formatter-xbxeV4GD.js");
|
|
8
9
|
//#region src/builtins/hub-forwarder/hub-forwarder-destination.ts
|
|
9
10
|
var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
|
|
@@ -117,7 +118,7 @@ var HubForwarderDestination = class {
|
|
|
117
118
|
* reachable. The broker is read from `ctx.kernel.cluster?.broker`; outbound
|
|
118
119
|
* log replay on hub-connect is handled internally by the destination.
|
|
119
120
|
*/
|
|
120
|
-
var HubForwarderAddon = class extends
|
|
121
|
+
var HubForwarderAddon = class extends require_base_addon.BaseAddon {
|
|
121
122
|
destination = null;
|
|
122
123
|
constructor() {
|
|
123
124
|
super({});
|
|
@@ -131,7 +132,7 @@ var HubForwarderAddon = class extends require_dist.BaseAddon {
|
|
|
131
132
|
else this.ctx.logger.warn("cluster.broker not available — hub forwarding disabled, console only");
|
|
132
133
|
this.ctx.logger.info("Hub forwarder log destination registered");
|
|
133
134
|
return [{
|
|
134
|
-
capability:
|
|
135
|
+
capability: require_log_destination_cap.logDestinationCapability,
|
|
135
136
|
provider: this.destination
|
|
136
137
|
}];
|
|
137
138
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as BaseAddon } from "../../base-addon-Md14i7pe.mjs";
|
|
2
|
+
import { t as logDestinationCapability } from "../../log-destination.cap-CxZzAVaR.mjs";
|
|
2
3
|
import { t as formatLogLine } from "../../formatter-DkYZ4LXp.mjs";
|
|
3
4
|
//#region src/builtins/hub-forwarder/hub-forwarder-destination.ts
|
|
4
5
|
var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
|
|
@@ -3,11 +3,14 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const require_base_addon = require("../../base-addon-DD5dIfcZ.js");
|
|
7
|
+
const require_scoped_settings = require("../../scoped-settings-CylSSq_8.js");
|
|
8
|
+
const require_record_kind = require("../../record-kind-DoBfYHCs.js");
|
|
9
|
+
const require_keychain_admin_cap = require("../../keychain-admin.cap-Db_oFX4H.js");
|
|
10
|
+
const require_device_ca = require("../../device-ca-C5kJE6mL.js");
|
|
8
11
|
const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
|
|
9
|
-
const require_legacy_integration_rows_door = require("../../legacy-integration-rows-door-
|
|
10
|
-
const require_constants = require("../../constants-
|
|
12
|
+
const require_legacy_integration_rows_door = require("../../legacy-integration-rows-door-B1nzxxr5.js");
|
|
13
|
+
const require_constants = require("../../constants-Ba3FTIHl.js");
|
|
11
14
|
const require_platform_key_source = require("../../platform-key-source-Di7HrlGR.js");
|
|
12
15
|
let node_crypto = require("node:crypto");
|
|
13
16
|
let _camstack_types_node = require("@camstack/types/node");
|
|
@@ -345,7 +348,7 @@ async function applyKeychainResetTrigger(input) {
|
|
|
345
348
|
}
|
|
346
349
|
let record;
|
|
347
350
|
try {
|
|
348
|
-
record = await service.resetAs(
|
|
351
|
+
record = await service.resetAs(require_keychain_admin_cap.KEYCHAIN_RESET_TRIGGER_ACTOR);
|
|
349
352
|
} catch (err) {
|
|
350
353
|
const error = err instanceof Error ? err.message : String(err);
|
|
351
354
|
logger.error(`RESET_KEYCHAIN refused — nothing was archived, the keychain is still locked: ${error}. The trigger file was deleted; fix the key source and create it again.`, {
|
|
@@ -601,10 +604,10 @@ var KeychainService = class {
|
|
|
601
604
|
* @returns how many values were removed.
|
|
602
605
|
*/
|
|
603
606
|
async releaseRecordRefs(caller, refs, onBehalfOf) {
|
|
604
|
-
if (caller === null ||
|
|
607
|
+
if (caller === null || require_scoped_settings.normalizeSecretOwner(caller) !== "sqlite-settings") throw new KeychainForbiddenError("records", caller);
|
|
605
608
|
const accepted = [];
|
|
606
609
|
for (const ref of new Set(refs)) {
|
|
607
|
-
const parts =
|
|
610
|
+
const parts = require_scoped_settings.parseSecretRef(ref);
|
|
608
611
|
if (parts === null || parts.scope.kind !== "row" || !parts.scope.collection.startsWith("records:")) throw new KeychainForbiddenError(ref, caller);
|
|
609
612
|
accepted.push(ref);
|
|
610
613
|
}
|
|
@@ -617,7 +620,7 @@ var KeychainService = class {
|
|
|
617
620
|
await this.audit("delete", `user:${onBehalfOf}`, ref, "record-kind-dropped");
|
|
618
621
|
this.deps.events.emit({
|
|
619
622
|
ref,
|
|
620
|
-
owner:
|
|
623
|
+
owner: require_scoped_settings.parseSecretRef(ref)?.owner ?? "",
|
|
621
624
|
version: null,
|
|
622
625
|
change: "delete"
|
|
623
626
|
});
|
|
@@ -627,14 +630,14 @@ var KeychainService = class {
|
|
|
627
630
|
/** May `caller` touch values owned by `owner`? */
|
|
628
631
|
owns(caller, owner) {
|
|
629
632
|
if (caller === null) return false;
|
|
630
|
-
const c =
|
|
631
|
-
const o =
|
|
633
|
+
const c = require_scoped_settings.normalizeSecretOwner(caller);
|
|
634
|
+
const o = require_scoped_settings.normalizeSecretOwner(owner);
|
|
632
635
|
if (c.length === 0) return false;
|
|
633
636
|
if (c === o) return true;
|
|
634
637
|
return this.deps.runnerIdOf(o) === c;
|
|
635
638
|
}
|
|
636
639
|
ownerOf(ref, caller) {
|
|
637
|
-
const parts =
|
|
640
|
+
const parts = require_scoped_settings.parseSecretRef(ref);
|
|
638
641
|
if (parts === null || !this.owns(caller, parts.owner)) throw new KeychainForbiddenError(ref, caller);
|
|
639
642
|
return parts.owner;
|
|
640
643
|
}
|
|
@@ -646,7 +649,7 @@ var KeychainService = class {
|
|
|
646
649
|
const owner = this.ownerOf(ref, caller);
|
|
647
650
|
const unlocked = this.requireReady();
|
|
648
651
|
if (value.length === 0) throw new Error("keychain.put: an empty value is not stored — delete the ref");
|
|
649
|
-
const parts =
|
|
652
|
+
const parts = require_scoped_settings.parseSecretRef(ref);
|
|
650
653
|
if (parts === null) throw new KeychainForbiddenError(ref, caller);
|
|
651
654
|
const existing = (await this.deps.repo.getSecrets([ref])).get(ref);
|
|
652
655
|
if (existing !== void 0) {
|
|
@@ -661,7 +664,7 @@ var KeychainService = class {
|
|
|
661
664
|
await this.deps.repo.putSecret({
|
|
662
665
|
ref,
|
|
663
666
|
owner,
|
|
664
|
-
scope:
|
|
667
|
+
scope: require_scoped_settings.formatSecretScope(parts.scope),
|
|
665
668
|
fieldPath: parts.fieldPath,
|
|
666
669
|
ciphertext: encryptValue(unlocked.dek, unlocked.keyId, ref, value),
|
|
667
670
|
keyId: unlocked.keyId,
|
|
@@ -687,7 +690,7 @@ var KeychainService = class {
|
|
|
687
690
|
const out = {};
|
|
688
691
|
const owned = [];
|
|
689
692
|
for (const ref of new Set(refs)) {
|
|
690
|
-
const parts =
|
|
693
|
+
const parts = require_scoped_settings.parseSecretRef(ref);
|
|
691
694
|
if (parts === null || !this.owns(caller, parts.owner)) {
|
|
692
695
|
out[ref] = { kind: "forbidden" };
|
|
693
696
|
continue;
|
|
@@ -781,8 +784,8 @@ var KeychainService = class {
|
|
|
781
784
|
* @returns the refs removed (never values), for the caller's one log line.
|
|
782
785
|
*/
|
|
783
786
|
async deleteDeviceScope(caller, deviceId) {
|
|
784
|
-
if (caller === null ||
|
|
785
|
-
const scope =
|
|
787
|
+
if (caller === null || require_scoped_settings.normalizeSecretOwner(caller) !== "device-manager") throw new KeychainForbiddenError(`device/${deviceId}`, caller);
|
|
788
|
+
const scope = require_scoped_settings.formatSecretScope({
|
|
786
789
|
kind: "device",
|
|
787
790
|
deviceId
|
|
788
791
|
});
|
|
@@ -850,7 +853,7 @@ var KeychainService = class {
|
|
|
850
853
|
async importSecret(userId, ref, value) {
|
|
851
854
|
if (!IMPORTABLE_REF.test(ref)) throw new Error(`keychain: "${ref}" is not an importable ref (restream tokens or record row secrets)`);
|
|
852
855
|
if ((await this.deps.repo.getSecrets([ref])).has(ref)) throw new Error(`keychain: a value is already stored at ${ref} - import refuses to overwrite`);
|
|
853
|
-
const parts =
|
|
856
|
+
const parts = require_scoped_settings.parseSecretRef(ref);
|
|
854
857
|
if (parts === null) throw new Error(`keychain: "${ref}" is not a secret ref`);
|
|
855
858
|
return this.put(parts.owner, ref, value, `user:${userId}`);
|
|
856
859
|
}
|
|
@@ -885,7 +888,7 @@ var KeychainService = class {
|
|
|
885
888
|
if (deleted.length > 0) {
|
|
886
889
|
await this.deps.repo.deleteSecrets(deleted);
|
|
887
890
|
for (const ref of deleted) {
|
|
888
|
-
const owner =
|
|
891
|
+
const owner = require_scoped_settings.parseSecretRef(ref)?.owner ?? "";
|
|
889
892
|
this.deps.events.emit({
|
|
890
893
|
ref,
|
|
891
894
|
owner,
|
|
@@ -1119,21 +1122,21 @@ function toMeta(row) {
|
|
|
1119
1122
|
};
|
|
1120
1123
|
}
|
|
1121
1124
|
function actorOfAddon(caller) {
|
|
1122
|
-
return caller === null ? "system" : `addon:${
|
|
1125
|
+
return caller === null ? "system" : `addon:${require_scoped_settings.normalizeSecretOwner(caller)}`;
|
|
1123
1126
|
}
|
|
1124
1127
|
function errMsg(err) {
|
|
1125
1128
|
return err instanceof Error ? err.message : String(err);
|
|
1126
1129
|
}
|
|
1127
|
-
|
|
1128
|
-
var KeychainAuditBodySchema =
|
|
1130
|
+
require_base_addon.EventCategory.KeychainChanged;
|
|
1131
|
+
var KeychainAuditBodySchema = require_keychain_admin_cap.KeychainAuditEntrySchema.omit({
|
|
1129
1132
|
id: true,
|
|
1130
1133
|
at: true
|
|
1131
1134
|
});
|
|
1132
|
-
var KeychainResetBodySchema =
|
|
1135
|
+
var KeychainResetBodySchema = require_keychain_admin_cap.KeychainResetRecordSchema.omit({
|
|
1133
1136
|
id: true,
|
|
1134
1137
|
at: true
|
|
1135
1138
|
});
|
|
1136
|
-
var _keychainRecordKinds =
|
|
1139
|
+
var _keychainRecordKinds = require_record_kind.defineRecordKinds({
|
|
1137
1140
|
audit: {
|
|
1138
1141
|
schema: KeychainAuditBodySchema,
|
|
1139
1142
|
class: "audit",
|
|
@@ -1911,7 +1914,7 @@ function createKeychainUsageCheck(door) {
|
|
|
1911
1914
|
const out = /* @__PURE__ */ new Map();
|
|
1912
1915
|
const groups = /* @__PURE__ */ new Map();
|
|
1913
1916
|
for (const row of rows) {
|
|
1914
|
-
const parts =
|
|
1917
|
+
const parts = require_scoped_settings.parseSecretRef(row.ref);
|
|
1915
1918
|
if (parts === null) {
|
|
1916
1919
|
out.set(row.ref, "unknown");
|
|
1917
1920
|
continue;
|
|
@@ -1977,7 +1980,7 @@ function callerOf(input) {
|
|
|
1977
1980
|
const raw = Reflect.get(input, "callerAddonId");
|
|
1978
1981
|
return typeof raw === "string" && raw.length > 0 ? raw : null;
|
|
1979
1982
|
}
|
|
1980
|
-
var KeychainAddon = class extends
|
|
1983
|
+
var KeychainAddon = class extends require_base_addon.BaseAddon {
|
|
1981
1984
|
id = "keychain";
|
|
1982
1985
|
pruneTimer = null;
|
|
1983
1986
|
constructor() {
|
|
@@ -2015,7 +2018,7 @@ var KeychainAddon = class extends require_dist.BaseAddon {
|
|
|
2015
2018
|
type: "addon",
|
|
2016
2019
|
id: "keychain"
|
|
2017
2020
|
},
|
|
2018
|
-
category:
|
|
2021
|
+
category: require_base_addon.EventCategory.KeychainChanged,
|
|
2019
2022
|
data: payload
|
|
2020
2023
|
});
|
|
2021
2024
|
} },
|
|
@@ -2036,7 +2039,7 @@ var KeychainAddon = class extends require_dist.BaseAddon {
|
|
|
2036
2039
|
}, DAY_MS);
|
|
2037
2040
|
this.pruneTimer.unref?.();
|
|
2038
2041
|
return [{
|
|
2039
|
-
capability:
|
|
2042
|
+
capability: require_keychain_admin_cap.keychainCapability,
|
|
2040
2043
|
provider: {
|
|
2041
2044
|
put: (input) => service.put(callerOf(input), input.ref, input.value),
|
|
2042
2045
|
resolve: (input) => service.resolve(callerOf(input), input.refs),
|
|
@@ -2047,7 +2050,7 @@ var KeychainAddon = class extends require_dist.BaseAddon {
|
|
|
2047
2050
|
getState: async () => service.getState()
|
|
2048
2051
|
}
|
|
2049
2052
|
}, {
|
|
2050
|
-
capability:
|
|
2053
|
+
capability: require_keychain_admin_cap.keychainAdminCapability,
|
|
2051
2054
|
provider: {
|
|
2052
2055
|
status: () => service.status(),
|
|
2053
2056
|
listSecrets: () => service.listSecrets(),
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { b as EventCategory, t as BaseAddon } from "../../base-addon-Md14i7pe.mjs";
|
|
2
|
+
import { C as normalizeSecretOwner, w as parseSecretRef, x as formatSecretScope } from "../../scoped-settings-DVWUIP7Z.mjs";
|
|
3
|
+
import { s as defineRecordKinds } from "../../record-kind-ub6NXqfh.mjs";
|
|
4
|
+
import { a as keychainCapability, i as keychainAdminCapability, n as KeychainAuditEntrySchema, r as KeychainResetRecordSchema, t as KEYCHAIN_RESET_TRIGGER_ACTOR } from "../../keychain-admin.cap-GtM7gVGG.mjs";
|
|
5
|
+
import { d as JWT_SIGNING_KEY_REF, n as DEVICE_CA_KEY_REF, p as SYSTEM_SECRET_OWNER } from "../../device-ca-BLM6fccc.mjs";
|
|
3
6
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
4
|
-
import { t as LEGACY_INTEGRATION_ROWS_TABLE } from "../../legacy-integration-rows-door-
|
|
5
|
-
import { a as MESH_CA_KEY_REF } from "../../constants-
|
|
7
|
+
import { t as LEGACY_INTEGRATION_ROWS_TABLE } from "../../legacy-integration-rows-door-nTvo_6jQ.mjs";
|
|
8
|
+
import { a as MESH_CA_KEY_REF } from "../../constants-DB4piTD5.mjs";
|
|
6
9
|
import { n as getPlatformKeychainKey } from "../../platform-key-source-BWlq0jjn.mjs";
|
|
7
10
|
import { createCipheriv, createDecipheriv, createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
|
8
11
|
import { restrictDirToOwnerSync, restrictFileToOwnerSync, writeOwnerOnlyFileSync } from "@camstack/types/node";
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
3
|
-
const
|
|
3
|
+
const require_base_addon = require("../../base-addon-DD5dIfcZ.js");
|
|
4
|
+
const require_scoped_settings = require("../../scoped-settings-CylSSq_8.js");
|
|
5
|
+
const require_recording_archive_cap = require("../../recording-archive.cap-D7bo-QSM.js");
|
|
6
|
+
const require_storage_location_mode = require("../../storage-location-mode-CS4sMzo-.js");
|
|
4
7
|
let node_fs = require("node:fs");
|
|
5
8
|
let node_path = require("node:path");
|
|
6
9
|
node_path = require_chunk.__toESM(node_path);
|
|
@@ -97,7 +100,7 @@ var LivenessReporter = class {
|
|
|
97
100
|
severity: finding.severity
|
|
98
101
|
}
|
|
99
102
|
});
|
|
100
|
-
this.deps.emit(
|
|
103
|
+
this.deps.emit(require_base_addon.createEvent(require_base_addon.EventCategory.SystemLivenessFailed, LIVENESS_SOURCE, {
|
|
101
104
|
findingId: finding.id,
|
|
102
105
|
severity: finding.severity,
|
|
103
106
|
title: finding.title,
|
|
@@ -110,7 +113,7 @@ var LivenessReporter = class {
|
|
|
110
113
|
if (current.has(id) || !inFamily(id)) continue;
|
|
111
114
|
this.active.delete(id);
|
|
112
115
|
this.deps.logger.info(`liveness: recovered — ${id}`, { meta: { findingId: id } });
|
|
113
|
-
this.deps.emit(
|
|
116
|
+
this.deps.emit(require_base_addon.createEvent(require_base_addon.EventCategory.SystemLivenessRecovered, LIVENESS_SOURCE, { findingId: id }));
|
|
114
117
|
}
|
|
115
118
|
}
|
|
116
119
|
};
|
|
@@ -145,7 +148,7 @@ function storageRootTargets(locations, localNodeId) {
|
|
|
145
148
|
for (const location of locations) {
|
|
146
149
|
if (location.providerId !== FILESYSTEM_PROVIDER_ID) continue;
|
|
147
150
|
if (location.nodeId !== void 0 && location.nodeId !== localNodeId) continue;
|
|
148
|
-
if (!
|
|
151
|
+
if (!require_storage_location_mode.mayWriteToLocation(location)) continue;
|
|
149
152
|
const basePath = location.config["basePath"];
|
|
150
153
|
if (typeof basePath !== "string" || !node_path.default.isAbsolute(basePath)) continue;
|
|
151
154
|
const root = node_path.default.resolve(basePath);
|
|
@@ -171,7 +174,7 @@ async function probeStorageRoot(target, probe) {
|
|
|
171
174
|
if (!isMissing(err) || parent === dir) return {
|
|
172
175
|
kind: "unknown",
|
|
173
176
|
target,
|
|
174
|
-
reason: `stat ${dir} failed: ${
|
|
177
|
+
reason: `stat ${dir} failed: ${require_scoped_settings.errMsg(err)}`
|
|
175
178
|
};
|
|
176
179
|
dir = parent;
|
|
177
180
|
}
|
|
@@ -187,7 +190,7 @@ async function probeStorageRoot(target, probe) {
|
|
|
187
190
|
target,
|
|
188
191
|
blockedAt: dir,
|
|
189
192
|
stat,
|
|
190
|
-
reason:
|
|
193
|
+
reason: require_scoped_settings.errMsg(err)
|
|
191
194
|
};
|
|
192
195
|
}
|
|
193
196
|
}
|
|
@@ -292,7 +295,7 @@ var DEFAULT_STALE_AFTER_MS = 15 * 6e4;
|
|
|
292
295
|
* reported — which is what keeps the check free of any configuration coupling.
|
|
293
296
|
*/
|
|
294
297
|
var RECORDING_LOOKBACK_MS = 1440 * 6e4;
|
|
295
|
-
var LivenessMonitorAddon = class extends
|
|
298
|
+
var LivenessMonitorAddon = class extends require_base_addon.BaseAddon {
|
|
296
299
|
tickTimer = null;
|
|
297
300
|
startedAtMs = 0;
|
|
298
301
|
reporter = null;
|
|
@@ -334,7 +337,7 @@ var LivenessMonitorAddon = class extends require_dist.BaseAddon {
|
|
|
334
337
|
this.reporter?.report(findings, isLivenessFindingId);
|
|
335
338
|
return [...storage, ...findings];
|
|
336
339
|
} catch (err) {
|
|
337
|
-
this.ctx.logger.error("liveness-monitor: check failed — node health is UNKNOWN this tick", { meta: { error:
|
|
340
|
+
this.ctx.logger.error("liveness-monitor: check failed — node health is UNKNOWN this tick", { meta: { error: require_scoped_settings.errMsg(err) } });
|
|
338
341
|
return [];
|
|
339
342
|
}
|
|
340
343
|
}
|
|
@@ -353,7 +356,7 @@ var LivenessMonitorAddon = class extends require_dist.BaseAddon {
|
|
|
353
356
|
const cameras = [];
|
|
354
357
|
for (const device of cameraDevices) {
|
|
355
358
|
const lastSegmentMs = await this.lastSegmentMs(device.id, nowMs, staleAfterMs);
|
|
356
|
-
const activeMode = lastSegmentMs !== null && nowMs - lastSegmentMs > staleAfterMs ?
|
|
359
|
+
const activeMode = lastSegmentMs !== null && nowMs - lastSegmentMs > staleAfterMs ? require_recording_archive_cap.RecordingStatusSchema.parse(await this.ctx.api.recordingArchive.getStatus.query({ deviceId: device.id })).activeMode : null;
|
|
357
360
|
cameras.push({
|
|
358
361
|
deviceId: device.id,
|
|
359
362
|
name: device.name,
|
|
@@ -379,7 +382,7 @@ var LivenessMonitorAddon = class extends require_dist.BaseAddon {
|
|
|
379
382
|
async lastSegmentMs(deviceId, nowMs, staleAfterMs) {
|
|
380
383
|
const recent = await this.ctx.api.recording.getAvailability.query({
|
|
381
384
|
deviceId,
|
|
382
|
-
provider:
|
|
385
|
+
provider: require_recording_archive_cap.RECORDING_SOURCE_CAMSTACK_ADDON,
|
|
383
386
|
fromMs: nowMs - staleAfterMs,
|
|
384
387
|
toMs: nowMs
|
|
385
388
|
});
|
|
@@ -387,7 +390,7 @@ var LivenessMonitorAddon = class extends require_dist.BaseAddon {
|
|
|
387
390
|
if (recent.ranges.length > 0) return Math.max(...recent.ranges.map((r) => r.endMs));
|
|
388
391
|
const day = await this.ctx.api.recording.getAvailability.query({
|
|
389
392
|
deviceId,
|
|
390
|
-
provider:
|
|
393
|
+
provider: require_recording_archive_cap.RECORDING_SOURCE_CAMSTACK_ADDON,
|
|
391
394
|
fromMs: nowMs - RECORDING_LOOKBACK_MS,
|
|
392
395
|
toMs: nowMs
|
|
393
396
|
});
|
|
@@ -432,7 +435,7 @@ var LivenessMonitorAddon = class extends require_dist.BaseAddon {
|
|
|
432
435
|
reporter.report(findings, isStorageRootFindingId);
|
|
433
436
|
return findings;
|
|
434
437
|
} catch (err) {
|
|
435
|
-
this.ctx.logger.warn("liveness: storage locations unreadable — storage roots not checked", { meta: { error:
|
|
438
|
+
this.ctx.logger.warn("liveness: storage locations unreadable — storage roots not checked", { meta: { error: require_scoped_settings.errMsg(err) } });
|
|
436
439
|
return [];
|
|
437
440
|
}
|
|
438
441
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as EventCategory, p as createEvent, t as BaseAddon } from "../../base-addon-Md14i7pe.mjs";
|
|
2
|
+
import { Z as errMsg } from "../../scoped-settings-DVWUIP7Z.mjs";
|
|
3
|
+
import { r as RECORDING_SOURCE_CAMSTACK_ADDON, t as RecordingStatusSchema } from "../../recording-archive.cap-7OrIn9e5.mjs";
|
|
4
|
+
import { o as mayWriteToLocation } from "../../storage-location-mode-B21UVRRX.mjs";
|
|
2
5
|
import { constants } from "node:fs";
|
|
3
6
|
import path from "node:path";
|
|
4
7
|
import * as fsp from "node:fs/promises";
|