@camstack/system 1.2.378 → 1.2.380
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/assets/addon-pages-aggregator/icon.svg +5 -0
- package/assets/addon-widgets-aggregator/icon.svg +6 -0
- package/assets/alert-center/icon.svg +5 -0
- package/assets/autotrack/icon.svg +5 -0
- package/assets/backup-orchestrator/icon.svg +5 -0
- package/assets/calendars/icon.svg +5 -0
- package/assets/camera-grid/icon.svg +10 -0
- package/assets/composer/icon.svg +7 -0
- package/assets/console-logging/icon.svg +4 -0
- package/assets/core-blocks/icon.svg +6 -0
- package/assets/device-manager/icon.svg +6 -0
- package/assets/filesystem-storage/icon.svg +6 -0
- package/assets/hub-forwarder/icon.svg +7 -0
- package/assets/keychain/icon.svg +6 -0
- package/assets/liveness-monitor/icon.svg +4 -0
- package/assets/local-auth/icon.svg +5 -0
- package/assets/local-network/icon.svg +7 -0
- package/assets/loki-logging/icon.svg +7 -0
- package/assets/metrics-native/icon.svg +3 -0
- package/assets/platform-probe/icon.svg +5 -0
- package/assets/remote-access-orchestrator/icon.svg +5 -0
- package/assets/snapshot/icon.svg +4 -0
- package/assets/sqlite-settings/icon.svg +5 -0
- package/assets/storage-orchestrator/icon.svg +8 -0
- package/assets/system-config/icon.svg +4 -0
- package/assets/winston-logging/icon.svg +6 -0
- package/dist/addon-runner.js +1 -1
- package/dist/addon-runner.mjs +1 -1
- package/dist/addon-utils.js +1 -1
- package/dist/addon-utils.mjs +1 -1
- package/dist/auth/auth-manager.d.ts +10 -2
- package/dist/auth/jwt-signing-key.d.ts +42 -0
- package/dist/auth/user-manager.d.ts +19 -19
- 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-manager.addon.js +2 -2
- package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/keychain/index.js +34 -4
- package/dist/builtins/keychain/index.mjs +34 -4
- package/dist/builtins/keychain/keychain-service.d.ts +14 -2
- package/dist/builtins/keychain/system-held-secrets.d.ts +11 -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/admin-account-boot.d.ts +1 -1
- package/dist/builtins/local-auth/auth-config-reader.d.ts +9 -7
- package/dist/builtins/local-auth/jwt-signing-key-keeper.d.ts +30 -0
- package/dist/builtins/local-auth/local-auth.addon.d.ts +2 -6
- package/dist/builtins/local-auth/local-auth.addon.js +127 -221
- package/dist/builtins/local-auth/local-auth.addon.mjs +126 -220
- 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/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/cluster-secret-keeper.d.ts +36 -0
- package/dist/builtins/system-config/system-config.addon.d.ts +13 -0
- package/dist/builtins/system-config/system-config.addon.js +244 -53
- package/dist/builtins/system-config/system-config.addon.mjs +244 -54
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{child-cap-dispatch-C9lmrWFT.js → child-cap-dispatch-CZeRUgYF.js} +1 -1
- package/dist/{child-cap-dispatch-DpHovtQd.mjs → child-cap-dispatch-CpjohToR.mjs} +1 -1
- package/dist/cluster-secret-BDue-uJj.mjs +83 -0
- package/dist/cluster-secret-Dg0OOOSr.js +148 -0
- package/dist/{composition-sources-CxhGdtdh.js → composition-sources-CHvLMrFI.js} +1 -1
- package/dist/{composition-sources-BLBd338N.mjs → composition-sources-DT_uJwI3.mjs} +1 -1
- package/dist/{dist-Bvl5JgNt.mjs → dist-B9oFw2jh.mjs} +58 -2
- package/dist/{dist-KxsOMQik.js → dist-Cc6KOdY-.js} +69 -1
- package/dist/{event-loop-stall-monitor-D8rqSWfW.mjs → event-loop-stall-monitor-anUH2IE1.mjs} +14 -14
- package/dist/{event-loop-stall-monitor-CbSmCWkp.js → event-loop-stall-monitor-mk6WGxir.js} +14 -14
- package/dist/index.d.ts +4 -2
- package/dist/index.js +192 -62
- package/dist/index.mjs +171 -55
- package/dist/jwt-signing-key-C2rE3wH6.js +174 -0
- package/dist/jwt-signing-key-Qhde8r82.mjs +127 -0
- package/dist/kernel/config-manager.d.ts +1 -1
- package/dist/kernel/config-schema.d.ts +4 -11
- package/dist/kernel/index.d.ts +2 -1
- package/dist/kernel/moleculer/broker-factory.d.ts +0 -2
- package/dist/kernel/moleculer/cluster-secret.d.ts +31 -0
- package/dist/kernel/moleculer/hub-service.d.ts +7 -4
- package/dist/kernel/moleculer/node-registry.d.ts +1 -1
- package/dist/kernel/system-settings-policy.d.ts +7 -9
- package/dist/{retired-settings-keys-BAcfvFtm.mjs → retired-settings-keys-DlZ3VV6x.mjs} +1 -1
- package/dist/{retired-settings-keys-gTsZfpmP.js → retired-settings-keys-YOOKLA3v.js} +1 -1
- package/package.json +55 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as buildStreamParamsConfigSchema, A as MINUTES_PER_DAY, C as FieldClaimModeSchema, Dn as runtimeStatePolicyFor,
|
|
2
|
-
import { n as purgeRetiredSettingsRows } from "../../retired-settings-keys-
|
|
1
|
+
import { $ as buildStreamParamsConfigSchema, A as MINUTES_PER_DAY, C as FieldClaimModeSchema, Dn as runtimeStatePolicyFor, Hr as secretTreeFromPaths, Kr as transformSecretWrite, Kt as legacyAutoLinkIds, L as STREAM_PROFILE_META, Mn as siteZoneKey, Nt as formatMinutes, O as LocationIconIdSchema, Ot as expandContainer, Sr as collectZodSecretPaths, St as deviceStatusCapability, Tt as enumerateSchemaFields, Wr as sleep$1, Xt as locationIconKey, ar as DeviceFeature, bt as deviceManagerCapability, c as CAP_NAMES_WITH_STATUS, cn as normalizeUnit, cr as errMsg, dn as parseStreamParamsFormPatch, dt as createDeviceExtensionProvider, gr as WELL_KNOWN_TAB_MAP, gt as defineExtensionSlotProvider, kr as isDeviceConfigCap, lr as BaseAddon, o as CAMERA_SWITCH_ORDER, or as DeviceRole, qr as EventCategory, sr as DeviceType, t as ALL_CAPABILITY_DEFINITIONS, v as DAY_NAMES, w as FieldClaimSchema, wt as enumerateItemArrayFields, x as DeviceStatusSchema, xt as deviceStateCapability, yt as deviceExtensionCapability, zr as resolveSecretMarkers } from "../../dist-B9oFw2jh.mjs";
|
|
2
|
+
import { n as purgeRetiredSettingsRows } from "../../retired-settings-keys-DlZ3VV6x.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import { canonicalDeviceFingerprint } from "@camstack/types/node";
|
|
@@ -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-Cc6KOdY-.js");
|
|
7
7
|
const require_formatter = require("../../formatter-DqAKDlvN.js");
|
|
8
8
|
//#region src/builtins/hub-forwarder/hub-forwarder-destination.ts
|
|
9
9
|
var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Zt as logDestinationCapability, lr as BaseAddon } from "../../dist-
|
|
1
|
+
import { Zt as logDestinationCapability, lr as BaseAddon } from "../../dist-B9oFw2jh.mjs";
|
|
2
2
|
import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
|
|
3
3
|
//#region src/builtins/hub-forwarder/hub-forwarder-destination.ts
|
|
4
4
|
var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
|
|
@@ -3,7 +3,9 @@ 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-Cc6KOdY-.js");
|
|
7
|
+
const require_jwt_signing_key = require("../../jwt-signing-key-C2rE3wH6.js");
|
|
8
|
+
const require_cluster_secret = require("../../cluster-secret-Dg0OOOSr.js");
|
|
7
9
|
const require_platform_key_source = require("../../platform-key-source-Di7HrlGR.js");
|
|
8
10
|
let node_crypto = require("node:crypto");
|
|
9
11
|
let node_path = require("node:path");
|
|
@@ -635,6 +637,14 @@ var KeychainRepository = class {
|
|
|
635
637
|
return rows.length;
|
|
636
638
|
}
|
|
637
639
|
};
|
|
640
|
+
//#endregion
|
|
641
|
+
//#region src/builtins/keychain/system-held-secrets.ts
|
|
642
|
+
/** The refs `keychain-admin.setSystemSecret` may write, by name. */
|
|
643
|
+
var SYSTEM_HELD_SECRET_REFS = { "jwt-signing-key": require_jwt_signing_key.JWT_SIGNING_KEY_REF };
|
|
644
|
+
/** System refs no blob points at — in use for as long as they exist. */
|
|
645
|
+
var PROCESS_HELD_SECRET_REFS = new Set([require_jwt_signing_key.JWT_SIGNING_KEY_REF]);
|
|
646
|
+
/** `system-settings` keys that may hold a system-owned secret's marker. */
|
|
647
|
+
var SYSTEM_SECRET_SETTINGS_KEYS = [require_cluster_secret.CLUSTER_SECRET_SETTINGS_KEY];
|
|
638
648
|
var KeychainLockedError = class extends Error {
|
|
639
649
|
reason;
|
|
640
650
|
constructor(reason) {
|
|
@@ -845,7 +855,11 @@ var KeychainService = class {
|
|
|
845
855
|
if (parts === null || !this.owns(caller, parts.owner)) throw new KeychainForbiddenError(ref, caller);
|
|
846
856
|
return parts.owner;
|
|
847
857
|
}
|
|
848
|
-
|
|
858
|
+
/**
|
|
859
|
+
* @param actor who the audit names — the owner addon by default; the
|
|
860
|
+
* operator (`user:<id>`) for {@link setSystemSecret}.
|
|
861
|
+
*/
|
|
862
|
+
async put(caller, ref, value, actor = actorOfAddon(caller)) {
|
|
849
863
|
const owner = this.ownerOf(ref, caller);
|
|
850
864
|
const unlocked = this.requireReady();
|
|
851
865
|
if (value.length === 0) throw new Error("keychain.put: an empty value is not stored — delete the ref");
|
|
@@ -871,10 +885,10 @@ var KeychainService = class {
|
|
|
871
885
|
version,
|
|
872
886
|
createdAt: existing?.createdAt ?? t,
|
|
873
887
|
updatedAt: t,
|
|
874
|
-
updatedBy:
|
|
888
|
+
updatedBy: actor,
|
|
875
889
|
lastReadAt: existing?.lastReadAt ?? null
|
|
876
890
|
});
|
|
877
|
-
await this.audit("put",
|
|
891
|
+
await this.audit("put", actor, ref, `version=${version}`);
|
|
878
892
|
this.deps.events.emit({
|
|
879
893
|
ref,
|
|
880
894
|
owner,
|
|
@@ -1004,6 +1018,14 @@ var KeychainService = class {
|
|
|
1004
1018
|
usage: usage.get(row.ref) ?? "unknown"
|
|
1005
1019
|
}));
|
|
1006
1020
|
}
|
|
1021
|
+
/**
|
|
1022
|
+
* The operator replaces a system-held secret no form edits (D797) — the
|
|
1023
|
+
* session signing key. Stored under owner `system`, audited as the user.
|
|
1024
|
+
*/
|
|
1025
|
+
async setSystemSecret(userId, name, value) {
|
|
1026
|
+
const ref = SYSTEM_HELD_SECRET_REFS[name];
|
|
1027
|
+
return this.put(require_jwt_signing_key.SYSTEM_SECRET_OWNER, ref, value, `user:${userId}`);
|
|
1028
|
+
}
|
|
1007
1029
|
async listAudit(limit) {
|
|
1008
1030
|
return this.deps.repo.listAudit(limit);
|
|
1009
1031
|
}
|
|
@@ -1243,6 +1265,13 @@ async function prefixRows(door, collection, prefix) {
|
|
|
1243
1265
|
}
|
|
1244
1266
|
/** The blobs that may hold the marker of a ref in `scope`; `null` = cannot tell. */
|
|
1245
1267
|
async function blobsFor(door, owner, scope) {
|
|
1268
|
+
if (owner === "system" && scope.kind === "global") return [[...PROCESS_HELD_SECRET_REFS].map((ref) => ({
|
|
1269
|
+
$secret: ref,
|
|
1270
|
+
v: 1
|
|
1271
|
+
})), ...await Promise.all(SYSTEM_SECRET_SETTINGS_KEYS.map((key) => door.get({
|
|
1272
|
+
collection: "system-settings",
|
|
1273
|
+
key
|
|
1274
|
+
})))];
|
|
1246
1275
|
switch (scope.kind) {
|
|
1247
1276
|
case "global":
|
|
1248
1277
|
case "node": {
|
|
@@ -1424,6 +1453,7 @@ var KeychainAddon = class extends require_dist.BaseAddon {
|
|
|
1424
1453
|
listSecrets: () => service.listSecrets(),
|
|
1425
1454
|
listAudit: (input) => service.listAudit(input.limit ?? 100),
|
|
1426
1455
|
reveal: (input) => service.reveal(input.caller.userId, input.ref),
|
|
1456
|
+
setSystemSecret: (input) => service.setSystemSecret(input.caller.userId, input.name, input.value),
|
|
1427
1457
|
deleteOrphans: (input) => service.deleteOrphans(input.caller.userId, input.refs),
|
|
1428
1458
|
rotateMasterKey: (input) => service.rotateMasterKey(input.caller.userId),
|
|
1429
1459
|
purgeRetiredKeys: async (input) => ({ purged: await service.purgeRetiredKeys(input.caller.userId) }),
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dr as formatSecretScope, Gt as keychainCapability, Ir as parseSecretRef, Nr as normalizeSecretOwner, Wt as keychainAdminCapability, lr as BaseAddon, qr as EventCategory } from "../../dist-B9oFw2jh.mjs";
|
|
2
|
+
import { r as SYSTEM_SECRET_OWNER, t as JWT_SIGNING_KEY_REF } from "../../jwt-signing-key-Qhde8r82.mjs";
|
|
3
|
+
import { i as CLUSTER_SECRET_SETTINGS_KEY } from "../../cluster-secret-BDue-uJj.mjs";
|
|
2
4
|
import { n as getPlatformKeychainKey } from "../../platform-key-source-BWlq0jjn.mjs";
|
|
3
5
|
import { createCipheriv, createDecipheriv, createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
|
4
6
|
import * as path$1 from "node:path";
|
|
@@ -629,6 +631,14 @@ var KeychainRepository = class {
|
|
|
629
631
|
return rows.length;
|
|
630
632
|
}
|
|
631
633
|
};
|
|
634
|
+
//#endregion
|
|
635
|
+
//#region src/builtins/keychain/system-held-secrets.ts
|
|
636
|
+
/** The refs `keychain-admin.setSystemSecret` may write, by name. */
|
|
637
|
+
var SYSTEM_HELD_SECRET_REFS = { "jwt-signing-key": JWT_SIGNING_KEY_REF };
|
|
638
|
+
/** System refs no blob points at — in use for as long as they exist. */
|
|
639
|
+
var PROCESS_HELD_SECRET_REFS = new Set([JWT_SIGNING_KEY_REF]);
|
|
640
|
+
/** `system-settings` keys that may hold a system-owned secret's marker. */
|
|
641
|
+
var SYSTEM_SECRET_SETTINGS_KEYS = [CLUSTER_SECRET_SETTINGS_KEY];
|
|
632
642
|
var KeychainLockedError = class extends Error {
|
|
633
643
|
reason;
|
|
634
644
|
constructor(reason) {
|
|
@@ -839,7 +849,11 @@ var KeychainService = class {
|
|
|
839
849
|
if (parts === null || !this.owns(caller, parts.owner)) throw new KeychainForbiddenError(ref, caller);
|
|
840
850
|
return parts.owner;
|
|
841
851
|
}
|
|
842
|
-
|
|
852
|
+
/**
|
|
853
|
+
* @param actor who the audit names — the owner addon by default; the
|
|
854
|
+
* operator (`user:<id>`) for {@link setSystemSecret}.
|
|
855
|
+
*/
|
|
856
|
+
async put(caller, ref, value, actor = actorOfAddon(caller)) {
|
|
843
857
|
const owner = this.ownerOf(ref, caller);
|
|
844
858
|
const unlocked = this.requireReady();
|
|
845
859
|
if (value.length === 0) throw new Error("keychain.put: an empty value is not stored — delete the ref");
|
|
@@ -865,10 +879,10 @@ var KeychainService = class {
|
|
|
865
879
|
version,
|
|
866
880
|
createdAt: existing?.createdAt ?? t,
|
|
867
881
|
updatedAt: t,
|
|
868
|
-
updatedBy:
|
|
882
|
+
updatedBy: actor,
|
|
869
883
|
lastReadAt: existing?.lastReadAt ?? null
|
|
870
884
|
});
|
|
871
|
-
await this.audit("put",
|
|
885
|
+
await this.audit("put", actor, ref, `version=${version}`);
|
|
872
886
|
this.deps.events.emit({
|
|
873
887
|
ref,
|
|
874
888
|
owner,
|
|
@@ -998,6 +1012,14 @@ var KeychainService = class {
|
|
|
998
1012
|
usage: usage.get(row.ref) ?? "unknown"
|
|
999
1013
|
}));
|
|
1000
1014
|
}
|
|
1015
|
+
/**
|
|
1016
|
+
* The operator replaces a system-held secret no form edits (D797) — the
|
|
1017
|
+
* session signing key. Stored under owner `system`, audited as the user.
|
|
1018
|
+
*/
|
|
1019
|
+
async setSystemSecret(userId, name, value) {
|
|
1020
|
+
const ref = SYSTEM_HELD_SECRET_REFS[name];
|
|
1021
|
+
return this.put(SYSTEM_SECRET_OWNER, ref, value, `user:${userId}`);
|
|
1022
|
+
}
|
|
1001
1023
|
async listAudit(limit) {
|
|
1002
1024
|
return this.deps.repo.listAudit(limit);
|
|
1003
1025
|
}
|
|
@@ -1237,6 +1259,13 @@ async function prefixRows(door, collection, prefix) {
|
|
|
1237
1259
|
}
|
|
1238
1260
|
/** The blobs that may hold the marker of a ref in `scope`; `null` = cannot tell. */
|
|
1239
1261
|
async function blobsFor(door, owner, scope) {
|
|
1262
|
+
if (owner === "system" && scope.kind === "global") return [[...PROCESS_HELD_SECRET_REFS].map((ref) => ({
|
|
1263
|
+
$secret: ref,
|
|
1264
|
+
v: 1
|
|
1265
|
+
})), ...await Promise.all(SYSTEM_SECRET_SETTINGS_KEYS.map((key) => door.get({
|
|
1266
|
+
collection: "system-settings",
|
|
1267
|
+
key
|
|
1268
|
+
})))];
|
|
1240
1269
|
switch (scope.kind) {
|
|
1241
1270
|
case "global":
|
|
1242
1271
|
case "node": {
|
|
@@ -1418,6 +1447,7 @@ var KeychainAddon = class extends BaseAddon {
|
|
|
1418
1447
|
listSecrets: () => service.listSecrets(),
|
|
1419
1448
|
listAudit: (input) => service.listAudit(input.limit ?? 100),
|
|
1420
1449
|
reveal: (input) => service.reveal(input.caller.userId, input.ref),
|
|
1450
|
+
setSystemSecret: (input) => service.setSystemSecret(input.caller.userId, input.name, input.value),
|
|
1421
1451
|
deleteOrphans: (input) => service.deleteOrphans(input.caller.userId, input.refs),
|
|
1422
1452
|
rotateMasterKey: (input) => service.rotateMasterKey(input.caller.userId),
|
|
1423
1453
|
purgeRetiredKeys: async (input) => ({ purged: await service.purgeRetiredKeys(input.caller.userId) }),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventCategory, KeychainAuditEntry, KeychainKeySource, KeychainResolveResult, KeychainSecretMeta, KeychainSecretUsage, KeychainState, KeychainStatus, KeychainUnavailableReason } from '@camstack/types';
|
|
1
|
+
import { EventCategory, KeychainAuditEntry, KeychainKeySource, KeychainResolveResult, KeychainSecretMeta, KeychainSecretUsage, KeychainState, KeychainStatus, KeychainUnavailableReason, SystemHeldSecretName } from '@camstack/types';
|
|
2
2
|
import { KeychainRepository, KeychainSecretRow } from './keychain-store.js';
|
|
3
3
|
import { KeySourceCandidate } from './key-sources.js';
|
|
4
4
|
/** `lastReadAt` is written at most this often per ref (hub I/O is the bottleneck). */
|
|
@@ -54,7 +54,11 @@ export declare class KeychainService {
|
|
|
54
54
|
/** May `caller` touch values owned by `owner`? */
|
|
55
55
|
owns(caller: string | null, owner: string): boolean;
|
|
56
56
|
private ownerOf;
|
|
57
|
-
|
|
57
|
+
/**
|
|
58
|
+
* @param actor who the audit names — the owner addon by default; the
|
|
59
|
+
* operator (`user:<id>`) for {@link setSystemSecret}.
|
|
60
|
+
*/
|
|
61
|
+
put(caller: string | null, ref: string, value: string, actor?: string): Promise<{
|
|
58
62
|
ref: string;
|
|
59
63
|
version: number;
|
|
60
64
|
}>;
|
|
@@ -66,6 +70,14 @@ export declare class KeychainService {
|
|
|
66
70
|
listSecrets(): Promise<readonly (KeychainSecretMeta & {
|
|
67
71
|
usage: KeychainSecretUsage;
|
|
68
72
|
})[]>;
|
|
73
|
+
/**
|
|
74
|
+
* The operator replaces a system-held secret no form edits (D797) — the
|
|
75
|
+
* session signing key. Stored under owner `system`, audited as the user.
|
|
76
|
+
*/
|
|
77
|
+
setSystemSecret(userId: string, name: SystemHeldSecretName, value: string): Promise<{
|
|
78
|
+
ref: string;
|
|
79
|
+
version: number;
|
|
80
|
+
}>;
|
|
69
81
|
listAudit(limit: number): Promise<readonly KeychainAuditEntry[]>;
|
|
70
82
|
reveal(userId: string, ref: string): Promise<{
|
|
71
83
|
value: string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SystemHeldSecretName } from '@camstack/types';
|
|
2
|
+
import { SYSTEM_SECRET_OWNER } from '../../auth/jwt-signing-key.js';
|
|
3
|
+
import { CLUSTER_SECRET_REF } from '../../kernel/moleculer/cluster-secret.js';
|
|
4
|
+
export { SYSTEM_SECRET_OWNER };
|
|
5
|
+
/** The refs `keychain-admin.setSystemSecret` may write, by name. */
|
|
6
|
+
export declare const SYSTEM_HELD_SECRET_REFS: Readonly<Record<SystemHeldSecretName, string>>;
|
|
7
|
+
/** System refs no blob points at — in use for as long as they exist. */
|
|
8
|
+
export declare const PROCESS_HELD_SECRET_REFS: ReadonlySet<string>;
|
|
9
|
+
/** `system-settings` keys that may hold a system-owned secret's marker. */
|
|
10
|
+
export declare const SYSTEM_SECRET_SETTINGS_KEYS: readonly string[];
|
|
11
|
+
export { CLUSTER_SECRET_REF };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../chunk-Cek0wNdY.js");
|
|
3
|
-
const require_dist = require("../../dist-
|
|
3
|
+
const require_dist = require("../../dist-Cc6KOdY-.js");
|
|
4
4
|
//#region src/builtins/liveness-monitor/liveness-checks.ts
|
|
5
5
|
var NO_DEVICES = "liveness:no-devices";
|
|
6
6
|
var ALL_OFFLINE = "liveness:all-devices-offline";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Cr as createEvent, F as RecordingStatusSchema, N as RECORDING_SOURCE_CAMSTACK_ADDON, cr as errMsg, lr as BaseAddon, qr as EventCategory } from "../../dist-B9oFw2jh.mjs";
|
|
2
2
|
//#region src/builtins/liveness-monitor/liveness-checks.ts
|
|
3
3
|
var NO_DEVICES = "liveness:no-devices";
|
|
4
4
|
var ALL_OFFLINE = "liveness:all-devices-offline";
|
|
@@ -21,7 +21,7 @@ export interface AdminAccountBootInput {
|
|
|
21
21
|
}
|
|
22
22
|
export interface AdminAccountBootResult {
|
|
23
23
|
readonly outcome: AdminSeedOutcome;
|
|
24
|
-
/** The admin still signs in with {@link
|
|
24
|
+
/** The admin still signs in with {@link FIRST_BOOT_ADMIN_PASSWORD}. */
|
|
25
25
|
readonly usesDefaultPassword: boolean;
|
|
26
26
|
}
|
|
27
27
|
export declare function reconcileAdminAccountAtBoot(input: AdminAccountBootInput): Promise<AdminAccountBootResult>;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { AuthConfigReader } from '../../auth/auth-manager.js';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* The values `local-auth` pre-resolves before constructing its AuthManager.
|
|
4
|
+
*
|
|
5
|
+
* No credential is among them (D797): the session signing key lives in the
|
|
6
|
+
* keychain (`jwt-signing-key.ts`) and the first-boot admin is fixed
|
|
7
|
+
* (`admin` / `changeme`), so `auth.jwtSecret`, `auth.adminUsername` and
|
|
8
|
+
* `auth.adminPassword` are answered by nothing.
|
|
9
|
+
*/
|
|
3
10
|
export interface ResolvedAuthConfig {
|
|
4
|
-
readonly jwtSecret: string;
|
|
5
|
-
readonly adminUsername: string;
|
|
6
|
-
readonly adminPassword: string;
|
|
7
11
|
/**
|
|
8
12
|
* Operator-configured session lifetime. `undefined` when the `auth` section
|
|
9
13
|
* carries no value — the signer then applies `DEFAULT_TOKEN_EXPIRY`, which
|
|
@@ -11,10 +15,8 @@ export interface ResolvedAuthConfig {
|
|
|
11
15
|
*/
|
|
12
16
|
readonly tokenExpiry: string | undefined;
|
|
13
17
|
}
|
|
14
|
-
/** Persist the generated JWT secret. Called by AuthManager on first boot. */
|
|
15
|
-
export type AuthSectionWriter = (patch: Record<string, unknown>) => void;
|
|
16
18
|
/**
|
|
17
19
|
* Every config path this reader can answer. Anything else resolves to
|
|
18
20
|
* `undefined` by construction — see the module docblock.
|
|
19
21
|
*/
|
|
20
|
-
export declare function createAuthConfigReader(resolved: ResolvedAuthConfig
|
|
22
|
+
export declare function createAuthConfigReader(resolved: ResolvedAuthConfig): AuthConfigReader;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SecretsAccess } from '@camstack/types';
|
|
2
|
+
/** How often a locked keychain is asked again. */
|
|
3
|
+
export declare const SIGNING_KEY_RETRY_MS = 30000;
|
|
4
|
+
interface KeeperLogger {
|
|
5
|
+
info(message: string, meta?: {
|
|
6
|
+
meta?: Record<string, unknown>;
|
|
7
|
+
}): void;
|
|
8
|
+
error(message: string, meta?: {
|
|
9
|
+
meta?: Record<string, unknown>;
|
|
10
|
+
}): void;
|
|
11
|
+
}
|
|
12
|
+
export interface JwtSigningKeyKeeperDeps {
|
|
13
|
+
/** A keychain handle for owner `system`; `null` when this process has no keychain door. */
|
|
14
|
+
readonly secrets: SecretsAccess | null;
|
|
15
|
+
readonly logger: KeeperLogger;
|
|
16
|
+
readonly retryMs?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare class JwtSigningKeyKeeper {
|
|
19
|
+
private readonly deps;
|
|
20
|
+
private retryTimer;
|
|
21
|
+
private unsubscribe;
|
|
22
|
+
private stopped;
|
|
23
|
+
constructor(deps: JwtSigningKeyKeeperDeps);
|
|
24
|
+
start(): Promise<void>;
|
|
25
|
+
stop(): void;
|
|
26
|
+
private load;
|
|
27
|
+
private apply;
|
|
28
|
+
private scheduleRetry;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { ProviderRegistration, BaseAddon } from '@camstack/types';
|
|
2
|
-
|
|
3
|
-
jwtSecret?: string;
|
|
4
|
-
adminUsername?: string;
|
|
5
|
-
adminPassword?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare class LocalAuthAddon extends BaseAddon<LocalAuthConfig> {
|
|
2
|
+
export declare class LocalAuthAddon extends BaseAddon {
|
|
8
3
|
private authManager;
|
|
9
4
|
private userManager;
|
|
10
5
|
private apiKeyManager;
|
|
@@ -13,6 +8,7 @@ export declare class LocalAuthAddon extends BaseAddon<LocalAuthConfig> {
|
|
|
13
8
|
private reapTimer;
|
|
14
9
|
private totpManager;
|
|
15
10
|
private externalIdentities;
|
|
11
|
+
private signingKeyKeeper;
|
|
16
12
|
constructor();
|
|
17
13
|
protected onInitialize(): Promise<ProviderRegistration[]>;
|
|
18
14
|
/**
|