@camstack/system 1.2.380 → 1.2.382
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 +4 -2
- package/dist/addon-runner.mjs +4 -2
- package/dist/addon-utils.js +1 -1
- package/dist/addon-utils.mjs +1 -1
- package/dist/auth/admin-token-manager.d.ts +75 -0
- package/dist/auth/api-key-manager.d.ts +1 -14
- package/dist/auth/auth-audit-log.d.ts +59 -0
- package/dist/auth/auth-manager.d.ts +28 -16
- package/dist/auth/cidr.d.ts +22 -0
- package/dist/auth/login-session-manager.d.ts +158 -0
- package/dist/auth/user-management-internal.d.ts +69 -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.d.ts +14 -0
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +291 -3631
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +284 -3617
- package/dist/builtins/backup-orchestrator/encryption-key-store.d.ts +36 -0
- package/dist/builtins/backup-orchestrator/manifest-store.d.ts +19 -1
- package/dist/builtins/backup-orchestrator/restore-archive.d.ts +24 -0
- 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-aggregation.d.ts +12 -0
- package/dist/builtins/device-manager/device-form-secrets.d.ts +25 -0
- package/dist/builtins/device-manager/device-manager.addon.d.ts +2 -0
- package/dist/builtins/device-manager/device-manager.addon.js +165 -26
- package/dist/builtins/device-manager/device-manager.addon.mjs +165 -26
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/keychain/index.js +1108 -733
- package/dist/builtins/keychain/index.mjs +1108 -733
- package/dist/builtins/keychain/keychain-reset-trigger.d.ts +25 -0
- package/dist/builtins/keychain/keychain-service.d.ts +36 -3
- package/dist/builtins/keychain/keychain-store.d.ts +24 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.d.ts +16 -0
- package/dist/builtins/local-auth/local-auth.addon.js +1021 -118
- package/dist/builtins/local-auth/local-auth.addon.mjs +1034 -141
- package/dist/builtins/local-network/local-network.addon.js +3 -3
- package/dist/builtins/local-network/local-network.addon.mjs +3 -3
- package/dist/builtins/loki-logging/index.js +97 -29
- package/dist/builtins/loki-logging/index.mjs +97 -29
- package/dist/builtins/loki-logging/loki-logging.addon.d.ts +7 -23
- package/dist/builtins/loki-logging/retire-enabled-flag.d.ts +23 -0
- 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 +2 -2
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +2 -2
- package/dist/builtins/system-backup/backup-encryption.d.ts +57 -0
- package/dist/builtins/system-backup/system-backup.service.d.ts +16 -1
- package/dist/builtins/system-config/cluster-secret-keeper.d.ts +7 -0
- package/dist/builtins/system-config/system-config.addon.d.ts +13 -3
- package/dist/builtins/system-config/system-config.addon.js +324 -38
- package/dist/builtins/system-config/system-config.addon.mjs +312 -39
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{child-cap-dispatch-CZeRUgYF.js → child-cap-dispatch-BrMdKHfp.js} +6 -3
- package/dist/{child-cap-dispatch-CpjohToR.mjs → child-cap-dispatch-WsYPNvnK.mjs} +10 -7
- package/dist/{cluster-secret-Dg0OOOSr.js → cluster-secret-BEPLh3LL.js} +1 -1
- package/dist/{cluster-secret-BDue-uJj.mjs → cluster-secret-DhPdZ0VA.mjs} +1 -1
- package/dist/{composition-sources-CHvLMrFI.js → composition-sources-C6ZynCZ2.js} +1 -1
- package/dist/{composition-sources-DT_uJwI3.mjs → composition-sources-XqRX51db.mjs} +1 -1
- package/dist/{dist-B9oFw2jh.mjs → dist-CP5TTjwd.mjs} +1713 -157
- package/dist/{dist-Cc6KOdY-.js → dist-tnAO12ak.js} +1754 -156
- package/dist/{event-loop-stall-monitor-mk6WGxir.js → event-loop-stall-monitor-9kR0sAPS.js} +15 -15
- package/dist/{event-loop-stall-monitor-anUH2IE1.mjs → event-loop-stall-monitor-WkssIXjq.mjs} +15 -15
- package/dist/{hub-cap-forward-CH6_VWVO.mjs → hub-cap-forward-CDiN1p98.mjs} +18 -2
- package/dist/{hub-cap-forward-COCmYaup.js → hub-cap-forward-W8oEm4ME.js} +23 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.js +3341 -79
- package/dist/index.mjs +3567 -354
- package/dist/{jwt-signing-key-Qhde8r82.mjs → jwt-signing-key-CAbozwvF.mjs} +1 -1
- package/dist/{jwt-signing-key-C2rE3wH6.js → jwt-signing-key-Dgf8sIXY.js} +1 -1
- package/dist/kernel/index.d.ts +12 -0
- package/dist/kernel/moleculer/broker-factory.d.ts +8 -1
- package/dist/kernel/moleculer/child-addon-call-dispatch.d.ts +1 -0
- package/dist/kernel/moleculer/hub-service.d.ts +9 -0
- package/dist/kernel/moleculer/mesh-access-middleware.d.ts +28 -0
- package/dist/kernel/moleculer/mesh-auth-mode.d.ts +64 -0
- package/dist/kernel/moleculer/mesh-authenticator.d.ts +71 -0
- package/dist/kernel/moleculer/mesh-auto-enforce.d.ts +26 -0
- package/dist/kernel/moleculer/mesh-join-client.d.ts +51 -0
- package/dist/kernel/moleculer/mesh-join-proof.d.ts +39 -0
- package/dist/kernel/system-settings-policy.d.ts +4 -3
- package/dist/kernel/transport/hub-cap-forward.d.ts +14 -3
- package/dist/kernel/transport/index.d.ts +1 -1
- package/dist/restore-archive-BV39nY46.mjs +4045 -0
- package/dist/restore-archive-CbvrfPuB.js +4139 -0
- package/dist/{retired-settings-keys-YOOKLA3v.js → retired-settings-keys-4bHpL-0m.js} +1 -1
- package/dist/{retired-settings-keys-DlZ3VV6x.mjs → retired-settings-keys-CzpIkwS-.mjs} +1 -1
- package/dist/{tls-CJHogwTl.mjs → tls-4cRH24Id.mjs} +3 -3
- package/package.json +1 -1
- package/dist/{tls-CCMX7MjX.js → tls-CljF057D.js} +1 -1
package/dist/addon-runner.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
2
|
-
const require_child_cap_dispatch = require("./child-cap-dispatch-
|
|
2
|
+
const require_child_cap_dispatch = require("./child-cap-dispatch-BrMdKHfp.js");
|
|
3
3
|
const require_custom_action_registry = require("./custom-action-registry-acBY3mHA.js");
|
|
4
4
|
let node_path = require("node:path");
|
|
5
5
|
node_path = require_chunk.__toESM(node_path);
|
|
@@ -25,11 +25,13 @@ function toSerializableRoute(route) {
|
|
|
25
25
|
if (typeof method !== "string" || typeof path !== "string") throw new Error("child-addon-call: route descriptor missing method/path");
|
|
26
26
|
const access = route["access"];
|
|
27
27
|
const description = route["description"];
|
|
28
|
+
const rateLimit = route["rateLimit"];
|
|
28
29
|
return {
|
|
29
30
|
method,
|
|
30
31
|
path,
|
|
31
32
|
...typeof access === "string" ? { access } : {},
|
|
32
|
-
...typeof description === "string" ? { description } : {}
|
|
33
|
+
...typeof description === "string" ? { description } : {},
|
|
34
|
+
...typeof rateLimit === "string" ? { rateLimit } : {}
|
|
33
35
|
};
|
|
34
36
|
}
|
|
35
37
|
/**
|
package/dist/addon-runner.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ft as installManifestNativeDeps, H as createUdsLoggerWithControl, It as resolveAddonClass, St as validateProviderRegistrations, U as LocalChildClient, _n as startRunnerHeapWatch, _t as getWorkerNativeCapProvider, bt as setWorkerNativeCapsChangeListener, f as installManifestSystemDeps, g as createUdsAddonContext, i as killOwnRunnerGroupAfterParentLoss, in as RUNNER_RSS_BUDGET_ENV, kn as emitHeapDiagnosticReport, n as createChildCapDispatch, p as installManifestPythonDeps, u as startRunnerParentDeathWatchdog, vt as getWorkerNativeCapSnapshot } from "./child-cap-dispatch-
|
|
1
|
+
import { Ft as installManifestNativeDeps, H as createUdsLoggerWithControl, It as resolveAddonClass, St as validateProviderRegistrations, U as LocalChildClient, _n as startRunnerHeapWatch, _t as getWorkerNativeCapProvider, bt as setWorkerNativeCapsChangeListener, f as installManifestSystemDeps, g as createUdsAddonContext, i as killOwnRunnerGroupAfterParentLoss, in as RUNNER_RSS_BUDGET_ENV, kn as emitHeapDiagnosticReport, n as createChildCapDispatch, p as installManifestPythonDeps, u as startRunnerParentDeathWatchdog, vt as getWorkerNativeCapSnapshot } from "./child-cap-dispatch-WsYPNvnK.mjs";
|
|
2
2
|
import { t as CustomActionRegistry } from "./custom-action-registry-B4Cf4O_X.mjs";
|
|
3
3
|
import { register } from "node:module";
|
|
4
4
|
import * as path$1 from "node:path";
|
|
@@ -22,11 +22,13 @@ function toSerializableRoute(route) {
|
|
|
22
22
|
if (typeof method !== "string" || typeof path !== "string") throw new Error("child-addon-call: route descriptor missing method/path");
|
|
23
23
|
const access = route["access"];
|
|
24
24
|
const description = route["description"];
|
|
25
|
+
const rateLimit = route["rateLimit"];
|
|
25
26
|
return {
|
|
26
27
|
method,
|
|
27
28
|
path,
|
|
28
29
|
...typeof access === "string" ? { access } : {},
|
|
29
|
-
...typeof description === "string" ? { description } : {}
|
|
30
|
+
...typeof description === "string" ? { description } : {},
|
|
31
|
+
...typeof rateLimit === "string" ? { rateLimit } : {}
|
|
30
32
|
};
|
|
31
33
|
}
|
|
32
34
|
/**
|
package/dist/addon-utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("./chunk-Cek0wNdY.js");
|
|
3
|
-
const require_event_loop_stall_monitor = require("./event-loop-stall-monitor-
|
|
3
|
+
const require_event_loop_stall_monitor = require("./event-loop-stall-monitor-9kR0sAPS.js");
|
|
4
4
|
const require_custom_action_registry = require("./custom-action-registry-acBY3mHA.js");
|
|
5
5
|
const require_snapshot_courtesy = require("./snapshot-courtesy-D_C5-nC0.js");
|
|
6
6
|
exports.COURTESY_DEFAULT_WIDTH = require_snapshot_courtesy.COURTESY_DEFAULT_WIDTH;
|
package/dist/addon-utils.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as resolveFormatRevision, S as isModelDownloaded, a as createFileDataPlaneHandler, b as getModelFilePath, c as parseRangeHeader, d as ModelDownloadService, f as ModelDownloadHttpError, g as downloadFile, h as deleteModelFromDisk, i as startEventLoopStallMonitor, m as collectModelFiles, n as STALL_TICK_MS, o as contentTypeFor, p as adoptModelRevisions, r as attributeStall, t as STALL_REPORT_MS, v as ensureModel, x as isModelDownloadHttpError } from "./event-loop-stall-monitor-
|
|
1
|
+
import { C as resolveFormatRevision, S as isModelDownloaded, a as createFileDataPlaneHandler, b as getModelFilePath, c as parseRangeHeader, d as ModelDownloadService, f as ModelDownloadHttpError, g as downloadFile, h as deleteModelFromDisk, i as startEventLoopStallMonitor, m as collectModelFiles, n as STALL_TICK_MS, o as contentTypeFor, p as adoptModelRevisions, r as attributeStall, t as STALL_REPORT_MS, v as ensureModel, x as isModelDownloadHttpError } from "./event-loop-stall-monitor-WkssIXjq.mjs";
|
|
2
2
|
import { t as CustomActionRegistry } from "./custom-action-registry-B4Cf4O_X.mjs";
|
|
3
3
|
import { i as renderCourtesyOverlayJpeg, n as courtesyCacheKey, r as renderCourtesyJpeg, t as COURTESY_DEFAULT_WIDTH } from "./snapshot-courtesy-CyFs1M3I.mjs";
|
|
4
4
|
export { COURTESY_DEFAULT_WIDTH, CustomActionRegistry, ModelDownloadHttpError, ModelDownloadService, STALL_REPORT_MS, STALL_TICK_MS, adoptModelRevisions, attributeStall, collectModelFiles, contentTypeFor, courtesyCacheKey, createFileDataPlaneHandler, deleteModelFromDisk, downloadFile, ensureModel, getModelFilePath, isModelDownloadHttpError, isModelDownloaded, parseRangeHeader, renderCourtesyJpeg, renderCourtesyOverlayJpeg, resolveFormatRevision, startEventLoopStallMonitor };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { SettingsStoreClient } from '@camstack/types';
|
|
2
|
+
/**
|
|
3
|
+
* @durable class=config owner=local-auth
|
|
4
|
+
* write="an admin creates a token (after re-authentication); `lastUsedAt` is
|
|
5
|
+
* rewritten at most once a minute while it is used; `revoke` stamps revokedAt"
|
|
6
|
+
* retention="the daily reap deletes rows expired or revoked more than 30 days ago"
|
|
7
|
+
*/
|
|
8
|
+
export declare const ADMIN_TOKENS_COLLECTION = "admin_tokens";
|
|
9
|
+
export declare const ADMIN_TOKENS_COLUMNS: ({
|
|
10
|
+
name: string;
|
|
11
|
+
type: "TEXT";
|
|
12
|
+
primaryKey: boolean;
|
|
13
|
+
notNull: boolean;
|
|
14
|
+
unique?: undefined;
|
|
15
|
+
} | {
|
|
16
|
+
name: string;
|
|
17
|
+
type: "TEXT";
|
|
18
|
+
notNull: boolean;
|
|
19
|
+
primaryKey?: undefined;
|
|
20
|
+
unique?: undefined;
|
|
21
|
+
} | {
|
|
22
|
+
name: string;
|
|
23
|
+
type: "TEXT";
|
|
24
|
+
notNull: boolean;
|
|
25
|
+
unique: boolean;
|
|
26
|
+
primaryKey?: undefined;
|
|
27
|
+
} | {
|
|
28
|
+
name: string;
|
|
29
|
+
type: "INTEGER";
|
|
30
|
+
notNull: boolean;
|
|
31
|
+
primaryKey?: undefined;
|
|
32
|
+
unique?: undefined;
|
|
33
|
+
} | {
|
|
34
|
+
name: string;
|
|
35
|
+
type: "INTEGER";
|
|
36
|
+
primaryKey?: undefined;
|
|
37
|
+
notNull?: undefined;
|
|
38
|
+
unique?: undefined;
|
|
39
|
+
})[];
|
|
40
|
+
export declare const ADMIN_TOKEN_PREFIX = "csa_";
|
|
41
|
+
export declare const ADMIN_TOKEN_MAX_LIFETIME_MS: number;
|
|
42
|
+
export interface AdminTokenRecord {
|
|
43
|
+
readonly id: string;
|
|
44
|
+
readonly createdBy: string;
|
|
45
|
+
readonly name: string;
|
|
46
|
+
readonly tokenPrefix: string;
|
|
47
|
+
readonly createdAt: number;
|
|
48
|
+
readonly expiresAt: number;
|
|
49
|
+
readonly lastUsedAt: number | null;
|
|
50
|
+
readonly revokedAt: number | null;
|
|
51
|
+
}
|
|
52
|
+
export declare class AdminTokenManager {
|
|
53
|
+
private readonly store;
|
|
54
|
+
private readonly now;
|
|
55
|
+
constructor(store: SettingsStoreClient, now?: () => number);
|
|
56
|
+
/** Mint a token for `createdBy`. Refuses an expiry in the past or past 90 days. */
|
|
57
|
+
create(input: {
|
|
58
|
+
readonly createdBy: string;
|
|
59
|
+
readonly name: string;
|
|
60
|
+
readonly expiresAt: number;
|
|
61
|
+
}): Promise<{
|
|
62
|
+
readonly token: string;
|
|
63
|
+
readonly record: AdminTokenRecord;
|
|
64
|
+
}>;
|
|
65
|
+
/** The live record behind `token`, or `null` (unknown, revoked, expired, not a `csa_`). */
|
|
66
|
+
validate(token: string): Promise<AdminTokenRecord | null>;
|
|
67
|
+
/** Every token not yet reaped, newest first (no hashes). */
|
|
68
|
+
list(): Promise<readonly AdminTokenRecord[]>;
|
|
69
|
+
/** Revoke one token. `false` when unknown or already revoked. */
|
|
70
|
+
revoke(id: string): Promise<boolean>;
|
|
71
|
+
/** Revoke every live token `userId` created (the user was deleted). */
|
|
72
|
+
revokeAllCreatedBy(userId: string): Promise<number>;
|
|
73
|
+
/** Delete rows expired or revoked more than 30 days ago. */
|
|
74
|
+
reap(): Promise<number>;
|
|
75
|
+
}
|
|
@@ -1,25 +1,12 @@
|
|
|
1
|
-
import { AuthManager } from './auth-manager.js';
|
|
2
1
|
import { ApiKeyRecord, SettingsStoreClient } from '@camstack/types';
|
|
3
2
|
export type { ApiKeyRecord };
|
|
4
|
-
interface CreateApiKeyInput {
|
|
5
|
-
label: string;
|
|
6
|
-
isAdmin?: boolean;
|
|
7
|
-
allowedProviders?: string[] | '*';
|
|
8
|
-
allowedDevices?: Record<string, string[] | '*'>;
|
|
9
|
-
}
|
|
10
3
|
export interface ApiKeyStorageAccess {
|
|
11
4
|
getStore(): SettingsStoreClient;
|
|
12
5
|
}
|
|
13
6
|
export declare class ApiKeyManager {
|
|
14
7
|
private readonly storageAccess;
|
|
15
|
-
|
|
16
|
-
constructor(storageAccess: ApiKeyStorageAccess, auth: AuthManager);
|
|
8
|
+
constructor(storageAccess: ApiKeyStorageAccess);
|
|
17
9
|
private get store();
|
|
18
|
-
create(input: CreateApiKeyInput): Promise<{
|
|
19
|
-
record: ApiKeyRecord;
|
|
20
|
-
token: string;
|
|
21
|
-
}>;
|
|
22
|
-
validateToken(token: string): Promise<ApiKeyRecord | null>;
|
|
23
10
|
listAll(): Promise<Omit<ApiKeyRecord, 'tokenHash'>[]>;
|
|
24
11
|
revoke(id: string): Promise<void>;
|
|
25
12
|
findById(id: string): Promise<ApiKeyRecord | null>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { IScopedLogger, SettingsStoreClient } from '@camstack/types';
|
|
2
|
+
/**
|
|
3
|
+
* @durable class=ledger owner=local-auth
|
|
4
|
+
* write="one row per audited auth event: a second factor skipped from a trusted
|
|
5
|
+
* network, an admin token created / used / revoked"
|
|
6
|
+
* retention="the daily reap deletes rows older than 90 days"
|
|
7
|
+
*/
|
|
8
|
+
export declare const AUTH_AUDIT_COLLECTION = "auth_audit";
|
|
9
|
+
export declare const AUTH_AUDIT_COLUMNS: ({
|
|
10
|
+
name: string;
|
|
11
|
+
type: "TEXT";
|
|
12
|
+
primaryKey: boolean;
|
|
13
|
+
notNull: boolean;
|
|
14
|
+
} | {
|
|
15
|
+
name: string;
|
|
16
|
+
type: "INTEGER";
|
|
17
|
+
notNull: boolean;
|
|
18
|
+
primaryKey?: undefined;
|
|
19
|
+
} | {
|
|
20
|
+
name: string;
|
|
21
|
+
type: "TEXT";
|
|
22
|
+
notNull: boolean;
|
|
23
|
+
primaryKey?: undefined;
|
|
24
|
+
} | {
|
|
25
|
+
name: string;
|
|
26
|
+
type: "TEXT";
|
|
27
|
+
primaryKey?: undefined;
|
|
28
|
+
notNull?: undefined;
|
|
29
|
+
})[];
|
|
30
|
+
export declare const AUTH_AUDIT_ACTIONS: readonly ["second-factor-skipped", "admin-token-created", "admin-token-used", "admin-token-revoked"];
|
|
31
|
+
export type AuthAuditAction = (typeof AUTH_AUDIT_ACTIONS)[number];
|
|
32
|
+
export interface AuthAuditEvent {
|
|
33
|
+
readonly action: AuthAuditAction;
|
|
34
|
+
/** The user the event is about (the one signing in; the token's owner). */
|
|
35
|
+
readonly userId?: string;
|
|
36
|
+
/** The real client address, when there was a request. */
|
|
37
|
+
readonly ip?: string;
|
|
38
|
+
/** Short, non-secret context: the method, the token's name and prefix, the path. */
|
|
39
|
+
readonly detail?: Readonly<Record<string, string | number | boolean>>;
|
|
40
|
+
}
|
|
41
|
+
export interface AuthAuditRecord extends AuthAuditEvent {
|
|
42
|
+
readonly id: string;
|
|
43
|
+
readonly at: number;
|
|
44
|
+
}
|
|
45
|
+
export declare class AuthAuditLog {
|
|
46
|
+
private readonly store;
|
|
47
|
+
private readonly logger;
|
|
48
|
+
private readonly now;
|
|
49
|
+
constructor(store: SettingsStoreClient, logger?: IScopedLogger | null, now?: () => number);
|
|
50
|
+
/** Record `event`. Never throws. */
|
|
51
|
+
record(event: AuthAuditEvent): Promise<void>;
|
|
52
|
+
/** Newest first, at most `limit` (≤ 500), optionally one user's. */
|
|
53
|
+
list(input?: {
|
|
54
|
+
readonly limit?: number;
|
|
55
|
+
readonly userId?: string;
|
|
56
|
+
}): Promise<readonly AuthAuditRecord[]>;
|
|
57
|
+
/** Delete rows older than 90 days. Returns how many. */
|
|
58
|
+
reap(): Promise<number>;
|
|
59
|
+
}
|
|
@@ -34,7 +34,13 @@ export declare class AuthManager {
|
|
|
34
34
|
constructor(config: AuthConfigReader, logger?: IScopedLogger, signingKey?: JwtSigningKeySource);
|
|
35
35
|
/** The current signing key; throws `JwtSigningKeyUnavailableError` while there is none. */
|
|
36
36
|
private get jwtSecret();
|
|
37
|
-
|
|
37
|
+
/**
|
|
38
|
+
* @param options.expiresInSec an explicit lifetime (a session's access
|
|
39
|
+
* token): wins over `auth.tokenExpiry`, bounded to at least one minute.
|
|
40
|
+
*/
|
|
41
|
+
signToken(payload: Omit<TokenPayload, 'iat' | 'exp'>, options?: {
|
|
42
|
+
readonly expiresInSec?: number;
|
|
43
|
+
}): string;
|
|
38
44
|
/**
|
|
39
45
|
* The operator's `auth.tokenExpiry`, or `undefined` → DEFAULT_TOKEN_EXPIRY.
|
|
40
46
|
*
|
|
@@ -49,23 +55,9 @@ export declare class AuthManager {
|
|
|
49
55
|
verifyToken(token: string): TokenPayload;
|
|
50
56
|
hashPassword(password: string): Promise<string>;
|
|
51
57
|
comparePassword(password: string, hash: string): Promise<boolean>;
|
|
52
|
-
generateApiKey(): {
|
|
53
|
-
token: string;
|
|
54
|
-
hash: string;
|
|
55
|
-
prefix: string;
|
|
56
|
-
};
|
|
57
|
-
validateApiKey(token: string, storedHash: string): boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Create a service token for agent/worker authentication.
|
|
60
|
-
* Used when forking workers or when agents register.
|
|
61
|
-
*/
|
|
62
|
-
createServiceToken(opts: {
|
|
63
|
-
readonly agentId: string;
|
|
64
|
-
readonly expiresIn?: string;
|
|
65
|
-
}): string;
|
|
66
58
|
/**
|
|
67
59
|
* Mint a short-lived HMAC-signed bridge token used by SSO-style auth
|
|
68
|
-
* providers (OIDC, SAML,
|
|
60
|
+
* providers (OIDC, SAML, …) to hand the post-callback
|
|
69
61
|
* claims to `/api/auth/sso/finish` without trusting unsigned query
|
|
70
62
|
* parameters. The endpoint verifies the token signature with the same
|
|
71
63
|
* `jwtSecret` and only then mints the user session JWT. This closes
|
|
@@ -102,6 +94,15 @@ export declare class AuthManager {
|
|
|
102
94
|
* short enough that an abandoned login can't be picked up later.
|
|
103
95
|
*/
|
|
104
96
|
signTotpChallengeToken(payload: TotpChallengeClaims, ttlSec?: number): string;
|
|
97
|
+
/**
|
|
98
|
+
* A short-lived proof that the signed-in user just re-entered their password
|
|
99
|
+
* or used a passkey. Sensitive self-service actions (linking a sign-in
|
|
100
|
+
* account, disabling 2FA, removing a passkey, minting an admin token)
|
|
101
|
+
* require one. `kind: 'reauth'` keeps it from ever being a bearer.
|
|
102
|
+
*/
|
|
103
|
+
signReauthToken(claims: ReauthClaims, ttlSec?: number): string;
|
|
104
|
+
/** Decode a re-authentication proof, or `null` (forged, expired, another kind). */
|
|
105
|
+
verifyReauthToken(token: string): ReauthClaims | null;
|
|
105
106
|
/**
|
|
106
107
|
* Verify + decode a TOTP challenge token. Returns `null` for any
|
|
107
108
|
* failure (invalid signature, expired, wrong `kind`, missing
|
|
@@ -111,6 +112,15 @@ export declare class AuthManager {
|
|
|
111
112
|
*/
|
|
112
113
|
verifyTotpChallengeToken(token: string): TotpChallengeClaims | null;
|
|
113
114
|
}
|
|
115
|
+
/** Seconds a re-authentication proof lasts (`signReauthToken`). */
|
|
116
|
+
export declare const REAUTH_TTL_SEC = 300;
|
|
117
|
+
/** What a re-authentication proof says: who proved it, from which session, how. */
|
|
118
|
+
export interface ReauthClaims {
|
|
119
|
+
readonly userId: string;
|
|
120
|
+
/** The login session it was proved in — a proof is spent only there. */
|
|
121
|
+
readonly sessionId?: string;
|
|
122
|
+
readonly method: 'password' | 'passkey';
|
|
123
|
+
}
|
|
114
124
|
/**
|
|
115
125
|
* Derived from the cap schema rather than restated.
|
|
116
126
|
*
|
|
@@ -125,4 +135,6 @@ export interface TotpChallengeClaims {
|
|
|
125
135
|
readonly userId: string;
|
|
126
136
|
readonly username: string;
|
|
127
137
|
readonly isAdmin: boolean;
|
|
138
|
+
/** The primary factor the user already proved — recorded on the session it leads to. */
|
|
139
|
+
readonly method?: 'password' | 'passkey' | 'sso';
|
|
128
140
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Strip an IPv4-mapped IPv6 prefix and a zone id, so ranges see a clean address. */
|
|
2
|
+
export declare function normalizeIp(ip: string): string;
|
|
3
|
+
export interface ParsedCidr {
|
|
4
|
+
readonly network: string;
|
|
5
|
+
readonly prefix: number;
|
|
6
|
+
readonly family: 'ipv4' | 'ipv6';
|
|
7
|
+
}
|
|
8
|
+
export interface ParsedCidrList {
|
|
9
|
+
readonly valid: readonly ParsedCidr[];
|
|
10
|
+
readonly invalid: readonly string[];
|
|
11
|
+
}
|
|
12
|
+
/** Parse a list of CIDR strings; blanks are skipped, unparseable entries returned. */
|
|
13
|
+
export declare function parseCidrList(entries: readonly string[]): ParsedCidrList;
|
|
14
|
+
/** A stored setting as a string list — accepts a list, or one comma/space separated string. */
|
|
15
|
+
export declare function readCidrSetting(value: unknown): readonly string[];
|
|
16
|
+
export interface CidrMatcher {
|
|
17
|
+
contains(ip: string): boolean;
|
|
18
|
+
/** How many valid ranges the matcher holds (0 = matches nothing). */
|
|
19
|
+
readonly size: number;
|
|
20
|
+
}
|
|
21
|
+
/** A matcher over the VALID entries of `entries`; invalid ones match nothing. */
|
|
22
|
+
export declare function createCidrMatcher(entries: readonly string[]): CidrMatcher;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { IScopedLogger, SettingsStoreClient } from '@camstack/types';
|
|
2
|
+
/**
|
|
3
|
+
* @durable class=ledger owner=local-auth
|
|
4
|
+
* write="one row per login (password, passkey, SSO, handoff, session exchange);
|
|
5
|
+
* rewritten on every refresh / renewal (expiry slides, refresh hash rotates)
|
|
6
|
+
* and on revocation"
|
|
7
|
+
* retention="the daily reap deletes rows expired more than 7 days ago and rows
|
|
8
|
+
* revoked more than 30 days ago. A session the user keeps refreshing lives as
|
|
9
|
+
* long as it is used."
|
|
10
|
+
*/
|
|
11
|
+
export declare const LOGIN_SESSIONS_COLLECTION = "login_sessions";
|
|
12
|
+
/**
|
|
13
|
+
* @durable class=config owner=local-auth
|
|
14
|
+
* write="revoking all of a user's sessions (logout everywhere, password change or
|
|
15
|
+
* reset, user deletion) sets that user's cutoff to now"
|
|
16
|
+
* retention="none — one row per user who ever had all sessions revoked; it only
|
|
17
|
+
* ever matters for tokens minted before sessions existed, and is harmless after."
|
|
18
|
+
*/
|
|
19
|
+
export declare const LOGIN_SESSION_CUTOFFS_COLLECTION = "login_session_cutoffs";
|
|
20
|
+
export declare const LOGIN_SESSIONS_COLUMNS: ({
|
|
21
|
+
name: string;
|
|
22
|
+
type: "TEXT";
|
|
23
|
+
primaryKey: boolean;
|
|
24
|
+
notNull: boolean;
|
|
25
|
+
} | {
|
|
26
|
+
name: string;
|
|
27
|
+
type: "TEXT";
|
|
28
|
+
notNull: boolean;
|
|
29
|
+
primaryKey?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
name: string;
|
|
32
|
+
type: "BOOLEAN";
|
|
33
|
+
notNull: boolean;
|
|
34
|
+
primaryKey?: undefined;
|
|
35
|
+
} | {
|
|
36
|
+
name: string;
|
|
37
|
+
type: "INTEGER";
|
|
38
|
+
notNull: boolean;
|
|
39
|
+
primaryKey?: undefined;
|
|
40
|
+
} | {
|
|
41
|
+
name: string;
|
|
42
|
+
type: "INTEGER";
|
|
43
|
+
primaryKey?: undefined;
|
|
44
|
+
notNull?: undefined;
|
|
45
|
+
} | {
|
|
46
|
+
name: string;
|
|
47
|
+
type: "TEXT";
|
|
48
|
+
primaryKey?: undefined;
|
|
49
|
+
notNull?: undefined;
|
|
50
|
+
})[];
|
|
51
|
+
export declare const LOGIN_SESSION_CUTOFFS_COLUMNS: ({
|
|
52
|
+
name: string;
|
|
53
|
+
type: "TEXT";
|
|
54
|
+
primaryKey: boolean;
|
|
55
|
+
notNull: boolean;
|
|
56
|
+
} | {
|
|
57
|
+
name: string;
|
|
58
|
+
type: "INTEGER";
|
|
59
|
+
notNull: boolean;
|
|
60
|
+
primaryKey?: undefined;
|
|
61
|
+
})[];
|
|
62
|
+
/** How a session began — shown on the sessions list. */
|
|
63
|
+
export type LoginSessionMethod = 'password' | 'passkey' | 'sso' | 'handoff' | 'exchange';
|
|
64
|
+
/** Why a session ended. */
|
|
65
|
+
export type LoginSessionRevocation = 'logout' | 'logout-everywhere' | 'password-changed' | 'password-reset' | 'user-deleted' | 'refresh-reuse' | 'revoked-by-user' | 'revoked-by-admin';
|
|
66
|
+
export interface LoginSessionRecord {
|
|
67
|
+
readonly id: string;
|
|
68
|
+
readonly userId: string;
|
|
69
|
+
readonly method: LoginSessionMethod;
|
|
70
|
+
readonly refreshable: boolean;
|
|
71
|
+
readonly createdAt: number;
|
|
72
|
+
readonly lastUsedAt: number;
|
|
73
|
+
readonly expiresAt: number;
|
|
74
|
+
readonly revokedAt: number | null;
|
|
75
|
+
readonly revokedReason: string | null;
|
|
76
|
+
readonly refreshHash: string | null;
|
|
77
|
+
readonly previousRefreshHash: string | null;
|
|
78
|
+
readonly rotatedAt: number | null;
|
|
79
|
+
readonly client: string | null;
|
|
80
|
+
readonly ip: string | null;
|
|
81
|
+
}
|
|
82
|
+
/** A session as the UI sees it — no refresh hashes. */
|
|
83
|
+
export type LoginSessionSummary = Omit<LoginSessionRecord, 'refreshHash' | 'previousRefreshHash' | 'rotatedAt'>;
|
|
84
|
+
export interface CreateLoginSessionInput {
|
|
85
|
+
readonly userId: string;
|
|
86
|
+
readonly lifetimeMs: number;
|
|
87
|
+
readonly refreshable: boolean;
|
|
88
|
+
readonly method: LoginSessionMethod;
|
|
89
|
+
readonly client?: string;
|
|
90
|
+
readonly ip?: string;
|
|
91
|
+
}
|
|
92
|
+
export type LoginSessionCheck = {
|
|
93
|
+
readonly state: 'active';
|
|
94
|
+
readonly session: LoginSessionRecord;
|
|
95
|
+
} | {
|
|
96
|
+
readonly state: 'unknown' | 'revoked' | 'expired';
|
|
97
|
+
};
|
|
98
|
+
export type LoginSessionRefresh = {
|
|
99
|
+
readonly ok: true;
|
|
100
|
+
readonly session: LoginSessionRecord;
|
|
101
|
+
readonly refreshToken: string;
|
|
102
|
+
} | {
|
|
103
|
+
readonly ok: false;
|
|
104
|
+
readonly reason: 'unknown' | 'expired' | 'revoked' | 'reused';
|
|
105
|
+
};
|
|
106
|
+
export declare const REFRESH_TOKEN_PREFIX = "csr_";
|
|
107
|
+
export declare function toLoginSessionSummary(record: LoginSessionRecord): LoginSessionSummary;
|
|
108
|
+
export interface LoginSessionManagerOptions {
|
|
109
|
+
readonly now?: () => number;
|
|
110
|
+
readonly logger?: IScopedLogger;
|
|
111
|
+
}
|
|
112
|
+
export declare class LoginSessionManager {
|
|
113
|
+
private readonly store;
|
|
114
|
+
private readonly sessions;
|
|
115
|
+
/** refresh hash (current or previous) → session id */
|
|
116
|
+
private readonly byRefreshHash;
|
|
117
|
+
private readonly cutoffs;
|
|
118
|
+
private readonly now;
|
|
119
|
+
private readonly logger;
|
|
120
|
+
constructor(store: SettingsStoreClient, options?: LoginSessionManagerOptions);
|
|
121
|
+
/** Load every row into the mirror. Call once at init, before serving. */
|
|
122
|
+
load(): Promise<void>;
|
|
123
|
+
create(input: CreateLoginSessionInput): Promise<{
|
|
124
|
+
readonly session: LoginSessionRecord;
|
|
125
|
+
readonly refreshToken: string | null;
|
|
126
|
+
}>;
|
|
127
|
+
/** Is `sessionId` a live session right now? Synchronous: the hub asks on every request. */
|
|
128
|
+
check(sessionId: string): LoginSessionCheck;
|
|
129
|
+
/** Epoch ms before which a pre-session (no `sid`) token of `userId` is refused; 0 = none. */
|
|
130
|
+
legacyCutoff(userId: string): number;
|
|
131
|
+
/** Swap a refresh token for a rotated one, sliding the session's expiry to now + `lifetimeMs`. */
|
|
132
|
+
refresh(refreshToken: string, lifetimeMs: number): Promise<LoginSessionRefresh>;
|
|
133
|
+
/** Renew an active session (legacy client): slide its expiry. `null` when it is not active. */
|
|
134
|
+
extend(sessionId: string, lifetimeMs: number): Promise<LoginSessionRecord | null>;
|
|
135
|
+
/** End one session. `false` when it was unknown or already ended. */
|
|
136
|
+
revoke(sessionId: string, reason: LoginSessionRevocation): Promise<boolean>;
|
|
137
|
+
/**
|
|
138
|
+
* End every live session of `userId` except `exceptSessionId`, and move the
|
|
139
|
+
* user's legacy cutoff to now (pre-session tokens die too). Returns how many
|
|
140
|
+
* sessions ended.
|
|
141
|
+
*/
|
|
142
|
+
revokeAllForUser(userId: string, options: {
|
|
143
|
+
readonly exceptSessionId?: string;
|
|
144
|
+
readonly reason: LoginSessionRevocation;
|
|
145
|
+
}): Promise<number>;
|
|
146
|
+
/** `userId`'s live sessions, newest first. */
|
|
147
|
+
listForUser(userId: string): readonly LoginSessionSummary[];
|
|
148
|
+
/** Every live session, newest first. */
|
|
149
|
+
listActive(): readonly LoginSessionSummary[];
|
|
150
|
+
/** Delete rows expired more than 7 days ago or revoked more than 30. Returns how many. */
|
|
151
|
+
reap(): Promise<number>;
|
|
152
|
+
private newRefreshToken;
|
|
153
|
+
private remember;
|
|
154
|
+
private forget;
|
|
155
|
+
private replace;
|
|
156
|
+
private persist;
|
|
157
|
+
private persistCutoff;
|
|
158
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { AdminTokenRecord } from './admin-token-manager.js';
|
|
2
|
+
import { AuthAuditEvent, AuthAuditRecord } from './auth-audit-log.js';
|
|
3
|
+
import { LoginSessionManager } from './login-session-manager.js';
|
|
4
|
+
/** Process-global, so every bundled copy of this module agrees on the key. */
|
|
5
|
+
export declare const USER_MANAGEMENT_INTERNAL: unique symbol;
|
|
6
|
+
export interface LinkExternalIdentityInput {
|
|
7
|
+
readonly userId: string;
|
|
8
|
+
readonly provider: string;
|
|
9
|
+
readonly subject: string;
|
|
10
|
+
readonly issuer: string;
|
|
11
|
+
readonly label?: string;
|
|
12
|
+
}
|
|
13
|
+
/** The login-session table, as the hub uses it (`login-session-manager.ts`). */
|
|
14
|
+
export type LoginSessionsInternal = Pick<LoginSessionManager, 'create' | 'refresh' | 'extend' | 'check' | 'legacyCutoff' | 'revoke' | 'revokeAllForUser' | 'listForUser' | 'listActive'>;
|
|
15
|
+
export interface SetPasswordInput {
|
|
16
|
+
readonly userId: string;
|
|
17
|
+
readonly newPassword: string;
|
|
18
|
+
/**
|
|
19
|
+
* The session the change was made from: it stays signed in, every other
|
|
20
|
+
* session of the user ends. Absent — every session ends.
|
|
21
|
+
*/
|
|
22
|
+
readonly keepSessionId?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface UserManagementInternal {
|
|
25
|
+
/**
|
|
26
|
+
* Link `(provider, subject)` to `userId`. Idempotent for the same user;
|
|
27
|
+
* throws for an identity linked to another user and for a user that does
|
|
28
|
+
* not exist.
|
|
29
|
+
*/
|
|
30
|
+
linkExternalIdentity(input: LinkExternalIdentityInput): Promise<{
|
|
31
|
+
readonly success: true;
|
|
32
|
+
}>;
|
|
33
|
+
/** Server-side login sessions: create, refresh, check, revoke, list. */
|
|
34
|
+
readonly sessions: LoginSessionsInternal;
|
|
35
|
+
/** Change a password and end the user's other sessions (and pre-session tokens). */
|
|
36
|
+
setPassword(input: SetPasswordInput): Promise<void>;
|
|
37
|
+
/** Admin tokens (`csa_`) — the hub router gates creation (admin + re-auth). */
|
|
38
|
+
readonly adminTokens: AdminTokensInternal;
|
|
39
|
+
/** The authentication audit trail. */
|
|
40
|
+
readonly audit: AuthAuditInternal;
|
|
41
|
+
}
|
|
42
|
+
export interface AdminTokensInternal {
|
|
43
|
+
create(input: {
|
|
44
|
+
readonly createdBy: string;
|
|
45
|
+
readonly name: string;
|
|
46
|
+
readonly expiresAt: number;
|
|
47
|
+
}): Promise<{
|
|
48
|
+
readonly token: string;
|
|
49
|
+
readonly record: AdminTokenRecord;
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* The live token behind `token` — `null` when unknown, revoked, expired, or
|
|
53
|
+
* when its creator no longer exists or is no longer an admin.
|
|
54
|
+
*/
|
|
55
|
+
validate(token: string): Promise<AdminTokenRecord | null>;
|
|
56
|
+
list(): Promise<readonly AdminTokenRecord[]>;
|
|
57
|
+
revoke(id: string): Promise<boolean>;
|
|
58
|
+
}
|
|
59
|
+
export interface AuthAuditInternal {
|
|
60
|
+
record(event: AuthAuditEvent): Promise<void>;
|
|
61
|
+
list(input?: {
|
|
62
|
+
readonly limit?: number;
|
|
63
|
+
readonly userId?: string;
|
|
64
|
+
}): Promise<readonly AuthAuditRecord[]>;
|
|
65
|
+
}
|
|
66
|
+
/** Attach `internal` to `provider` (returns the same object, now carrying it). */
|
|
67
|
+
export declare function attachUserManagementInternal<T extends object>(provider: T, internal: UserManagementInternal): T;
|
|
68
|
+
/** The hub-internal surface of a `user-management` provider, or `null` when it carries none. */
|
|
69
|
+
export declare function getUserManagementInternal(provider: unknown): UserManagementInternal | null;
|
|
@@ -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-tnAO12ak.js");
|
|
7
7
|
const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
|
|
8
8
|
let node_crypto = require("node:crypto");
|
|
9
9
|
let node_path = require("node:path");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { G as addonPagesCapability, ei as EventCategory, lr as errMsg, ur as BaseAddon } from "../../dist-CP5TTjwd.mjs";
|
|
2
2
|
import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
import * as path$1 from "node:path";
|
|
@@ -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-tnAO12ak.js");
|
|
7
7
|
const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
|
|
8
8
|
let node_crypto = require("node:crypto");
|
|
9
9
|
let node_path = require("node:path");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ei as EventCategory, lr as errMsg, q as addonWidgetsCapability, ur as BaseAddon } from "../../dist-CP5TTjwd.mjs";
|
|
2
2
|
import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
import * as path$1 from "node:path";
|
|
@@ -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-tnAO12ak.js");
|
|
7
7
|
//#region src/builtins/alerts/device-label.ts
|
|
8
8
|
/**
|
|
9
9
|
* Operator-facing device label for alert messages.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { J as alertsCapability, Tr as createEvent, ei as EventCategory, lr as errMsg, n as AlertSchema, ur as BaseAddon } from "../../dist-CP5TTjwd.mjs";
|
|
2
2
|
//#region src/builtins/alerts/device-label.ts
|
|
3
3
|
/**
|
|
4
4
|
* Operator-facing device label for alert messages.
|
|
@@ -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-tnAO12ak.js");
|
|
7
7
|
//#region src/builtins/autotrack/autotrack-config.ts
|
|
8
8
|
var DEFAULT_AUTOTRACK_LOOP_CONFIG = {
|
|
9
9
|
deadZoneFraction: .5,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mr as isEvent, S as FIRST_LEVEL_MACRO_CLASSES, Z as bareAddonId, _n as ptzAutotrackCapability, ei as EventCategory, lr as errMsg, ur as BaseAddon } from "../../dist-CP5TTjwd.mjs";
|
|
2
2
|
//#region src/builtins/autotrack/autotrack-config.ts
|
|
3
3
|
var DEFAULT_AUTOTRACK_LOOP_CONFIG = {
|
|
4
4
|
deadZoneFraction: .5,
|
|
@@ -3,6 +3,9 @@ export declare class BackupOrchestratorAddon extends BaseAddon<Record<string, ne
|
|
|
3
3
|
private systemBackup;
|
|
4
4
|
private policies;
|
|
5
5
|
private schedules;
|
|
6
|
+
/** Backup encryption keys — PUBLIC keys only (see encryption-key-store.ts). */
|
|
7
|
+
private encryptionKeys;
|
|
8
|
+
private warnedNoEncryptionStore;
|
|
6
9
|
private dataDir;
|
|
7
10
|
/**
|
|
8
11
|
* Transient build buffer for archive fan-out. The tar is built here
|
|
@@ -194,6 +197,17 @@ export declare class BackupOrchestratorAddon extends BaseAddon<Record<string, ne
|
|
|
194
197
|
* whitelist — only those top-level locations get extracted.
|
|
195
198
|
*/
|
|
196
199
|
private scheduleRestore;
|
|
200
|
+
private requireEncryptionKeys;
|
|
201
|
+
/**
|
|
202
|
+
* The key a run encrypts to; `null` = encryption off. THROWS when the
|
|
203
|
+
* setting cannot be read — a run must fail rather than ship a plain archive
|
|
204
|
+
* an operator asked to be encrypted.
|
|
205
|
+
*/
|
|
206
|
+
private activeEncryptionKey;
|
|
207
|
+
private getEncryption;
|
|
208
|
+
private setupEncryption;
|
|
209
|
+
private disableEncryption;
|
|
210
|
+
private checkBackupKey;
|
|
197
211
|
/**
|
|
198
212
|
* Resolve a target destination set — see {@link selectBackupTargets} for the
|
|
199
213
|
* rule. Caller-provided list wins over the per-destination policy flag;
|