@camstack/system 1.2.375 → 1.2.377
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon-runner.js +9 -4
- package/dist/addon-runner.mjs +10 -5
- package/dist/addon-utils.js +1 -1
- package/dist/addon-utils.mjs +1 -1
- package/dist/auth/external-identity-manager.d.ts +43 -0
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/autotrack/index.js +1 -1
- package/dist/builtins/autotrack/index.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
- package/dist/builtins/calendars/calendars.addon.js +1 -1
- package/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/dist/builtins/camera-grid/index.js +1 -1
- package/dist/builtins/camera-grid/index.mjs +1 -1
- package/dist/builtins/composer/composer.addon.js +2 -2
- package/dist/builtins/composer/composer.addon.mjs +2 -2
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/dist/builtins/device-manager/device-config-secrets.d.ts +21 -0
- package/dist/builtins/device-manager/device-manager.addon.d.ts +2 -0
- package/dist/builtins/device-manager/device-manager.addon.js +119 -6
- package/dist/builtins/device-manager/device-manager.addon.mjs +119 -6
- package/dist/builtins/device-manager/device-projection.d.ts +2 -1
- package/dist/builtins/device-manager/device-provider-context.d.ts +3 -0
- package/dist/builtins/device-manager/secret-config-paths.d.ts +24 -0
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/keychain/index.d.ts +1 -0
- package/dist/builtins/keychain/index.js +1416 -0
- package/dist/builtins/keychain/index.mjs +1409 -0
- package/dist/builtins/keychain/key-sources.d.ts +37 -0
- package/dist/builtins/keychain/keychain-crypto.d.ts +28 -0
- package/dist/builtins/keychain/keychain-service.d.ts +103 -0
- package/dist/builtins/keychain/keychain-store.d.ts +82 -0
- package/dist/builtins/keychain/keychain-usage.d.ts +6 -0
- package/dist/builtins/keychain/keychain.addon.d.ts +11 -0
- package/dist/builtins/keychain/platform-key-source.d.ts +24 -0
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/auth-schema.d.ts +14 -0
- package/dist/builtins/local-auth/local-auth.addon.d.ts +1 -0
- package/dist/builtins/local-auth/local-auth.addon.js +1358 -1129
- package/dist/builtins/local-auth/local-auth.addon.mjs +1358 -1129
- package/dist/builtins/local-network/local-network.addon.js +1 -1
- package/dist/builtins/local-network/local-network.addon.mjs +1 -1
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
- package/dist/builtins/storage-orchestrator/location-store.d.ts +6 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts +15 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +74 -14
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +74 -14
- package/dist/builtins/system-config/system-config.addon.js +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +1 -1
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{child-cap-dispatch-B9kziY4L.mjs → child-cap-dispatch-CgmOo0yl.mjs} +184 -29
- package/dist/{child-cap-dispatch-Bfdgkbq3.js → child-cap-dispatch-DlDSoqm1.js} +212 -27
- package/dist/{composition-sources-DYlXX2qW.js → composition-sources-BNyXPSs_.js} +1 -1
- package/dist/{composition-sources-BfZgiTYD.mjs → composition-sources-D39bl0nP.mjs} +1 -1
- package/dist/{dist-ZdSg09GJ.mjs → dist-BWNoS-1S.mjs} +2454 -108
- package/dist/{dist-CNbnikIh.js → dist-D_a9mUiM.js} +2525 -107
- package/dist/{event-loop-stall-monitor-DKcYBHdH.mjs → event-loop-stall-monitor-ClPhfx7Y.mjs} +1 -1
- package/dist/{event-loop-stall-monitor-CpEH3CoV.js → event-loop-stall-monitor-DuOn8H1n.js} +1 -1
- package/dist/{hub-cap-forward-BdT320dq.mjs → hub-cap-forward-CH6_VWVO.mjs} +13 -4
- package/dist/{hub-cap-forward-DmHNjbB0.js → hub-cap-forward-COCmYaup.js} +13 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.js +20 -6
- package/dist/index.mjs +13 -7
- package/dist/kernel/config-schema.d.ts +4 -0
- package/dist/kernel/moleculer/child-addon-call-dispatch.d.ts +6 -0
- package/dist/kernel/transport/cap-route-resolver.d.ts +19 -0
- package/dist/kernel/transport/hub-cap-forward.d.ts +22 -1
- package/dist/kernel/transport/index.d.ts +2 -2
- package/dist/kernel/transport/local-child-registry.d.ts +4 -3
- package/dist/logging/log-redactor.d.ts +9 -0
- package/dist/platform-key-source-BWlq0jjn.mjs +23 -0
- package/dist/platform-key-source-Di7HrlGR.js +40 -0
- package/dist/{retired-settings-keys-CcWvdy6u.js → retired-settings-keys-CDyOGAje.js} +1 -1
- package/dist/{retired-settings-keys-B4ZeKrbR.mjs → retired-settings-keys-iGcmzwLV.mjs} +1 -1
- package/package.json +17 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Br as scrubKnownSecrets, Gr as EventCategory$1, Sr as createEvent, en as maskUrlCredentials } from "./dist-BWNoS-1S.mjs";
|
|
2
2
|
import { a as parseProcStat, i as nodeProcReader } from "./proc-stat-CbC55Kqi.mjs";
|
|
3
|
-
import "./hub-cap-forward-
|
|
3
|
+
import "./hub-cap-forward-CH6_VWVO.mjs";
|
|
4
4
|
import * as crypto$1 from "node:crypto";
|
|
5
5
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
6
6
|
import { ensureBinary, ensureFfmpeg, ensurePython, installPythonPackages, installPythonRequirements } from "@camstack/types/node";
|
|
@@ -18,7 +18,7 @@ import * as v8 from "node:v8";
|
|
|
18
18
|
import { Session } from "node:inspector/promises";
|
|
19
19
|
import { monitorEventLoopDelay } from "node:perf_hooks";
|
|
20
20
|
import * as vm from "node:vm";
|
|
21
|
-
import { BOOT_RECOVERY_BACKOFF_MS, DATAPLANE_SECRET_HEADER, DEVICE_CHILDREN_BATCH_MAX, DeviceType, DisposerChain, EventCategory, PEER_BYTES_CHUNK_BYTES, PEER_BYTES_MAX_OUTSTANDING, PEER_BYTES_STALL_MS, PEER_BYTES_TICKET_TTL_MS, ReadinessRegistry, asJsonObject, asString, createDeviceProxy, createEventBusSliceSource, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods, readNodePin, scopeKey, sleep, withCapInputDefaults } from "@camstack/types/addon";
|
|
21
|
+
import { BOOT_RECOVERY_BACKOFF_MS, DATAPLANE_SECRET_HEADER, DEVICE_CHILDREN_BATCH_MAX, DeviceType, DisposerChain, EventCategory, PEER_BYTES_CHUNK_BYTES, PEER_BYTES_MAX_OUTSTANDING, PEER_BYTES_STALL_MS, PEER_BYTES_TICKET_TTL_MS, ReadinessRegistry, asJsonObject, asString, collectZodSecretPaths, createDeviceProxy, createEventBusSliceSource, createSecretsAccess, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods, readNodePin, scopeKey, sleep, withCapInputDefaults } from "@camstack/types/addon";
|
|
22
22
|
import { once } from "node:events";
|
|
23
23
|
import { connect, createConnection, createServer as createServer$1 } from "node:net";
|
|
24
24
|
import { TRPCClientError, createTRPCClient } from "@trpc/client";
|
|
@@ -3175,6 +3175,118 @@ function createAddonPeerBytesFacility(args) {
|
|
|
3175
3175
|
};
|
|
3176
3176
|
}
|
|
3177
3177
|
//#endregion
|
|
3178
|
+
//#region src/logging/log-redactor.ts
|
|
3179
|
+
/**
|
|
3180
|
+
* The central log redactor (D787 §8). Every line passes through it before any
|
|
3181
|
+
* destination, ring buffer or subscriber sees it — in hub-main's `LogManager`,
|
|
3182
|
+
* in a forked runner's UDS logger (which alone knows the values that runner
|
|
3183
|
+
* resolved), and on an agent before a child's line is forwarded to the hub.
|
|
3184
|
+
*
|
|
3185
|
+
* Three nets, cheapest first:
|
|
3186
|
+
* 1. KNOWN VALUES — every secret this process resolved through `ctx.secrets`
|
|
3187
|
+
* is replaced wherever it appears (`‹secret:<ref hash>›`). The only net
|
|
3188
|
+
* that catches a value inside a library's error message.
|
|
3189
|
+
* 2. URL CREDENTIALS — `user:pass@` and credential query params in any URL
|
|
3190
|
+
* inside a string (`maskUrlCredentials`), and the value after a
|
|
3191
|
+
* credential-looking CLI flag (`--token X`, `--auth-key=X`).
|
|
3192
|
+
* 3. KEY NAMES — a `meta` value under a credential-named key, at any depth.
|
|
3193
|
+
*
|
|
3194
|
+
* Key names are a LOG heuristic only: whether a field is STORED in the
|
|
3195
|
+
* keychain is decided by its schema type, never by its name.
|
|
3196
|
+
*
|
|
3197
|
+
* Hot path: a line with no meta, no `://`, no `--` and no registered values
|
|
3198
|
+
* costs a few `includes` checks.
|
|
3199
|
+
*/
|
|
3200
|
+
var REDACTED = "***";
|
|
3201
|
+
/** Credential-named keys. Substring, case-insensitive; only STRING values are replaced. */
|
|
3202
|
+
var SECRET_KEY_SUBSTRINGS = [
|
|
3203
|
+
"password",
|
|
3204
|
+
"passwd",
|
|
3205
|
+
"secret",
|
|
3206
|
+
"token",
|
|
3207
|
+
"apikey",
|
|
3208
|
+
"api_key",
|
|
3209
|
+
"authkey",
|
|
3210
|
+
"auth_key",
|
|
3211
|
+
"privatekey",
|
|
3212
|
+
"private_key",
|
|
3213
|
+
"passphrase",
|
|
3214
|
+
"credential",
|
|
3215
|
+
"cookie"
|
|
3216
|
+
];
|
|
3217
|
+
/** True when a meta key names a credential. */
|
|
3218
|
+
function isCredentialKeyName(key) {
|
|
3219
|
+
const lower = key.toLowerCase();
|
|
3220
|
+
return SECRET_KEY_SUBSTRINGS.some((needle) => lower.includes(needle));
|
|
3221
|
+
}
|
|
3222
|
+
var URL_IN_TEXT = /\b[a-z][a-z0-9+.-]*:\/\/[^\s"'<>`]+/gi;
|
|
3223
|
+
var CREDENTIAL_FLAG = /(--(?:token|auth-?key|password|passwd|pass|secret|api-?key|access-?token|refresh-?token)(?:=|\s+))(\S+)/gi;
|
|
3224
|
+
/** Redact one free-form string. */
|
|
3225
|
+
function redactLogText(text) {
|
|
3226
|
+
let out = scrubKnownSecrets(text);
|
|
3227
|
+
if (out.includes("://")) out = out.replace(URL_IN_TEXT, (url) => maskUrlCredentials(url));
|
|
3228
|
+
if (out.includes("--")) out = out.replace(CREDENTIAL_FLAG, (_m, flag, value) => value.startsWith("‹secret:") ? `${flag}${value}` : `${flag}${REDACTED}`);
|
|
3229
|
+
return out;
|
|
3230
|
+
}
|
|
3231
|
+
/** Bounds on the meta walk — a log line is not a place to traverse a graph. */
|
|
3232
|
+
var MAX_DEPTH = 8;
|
|
3233
|
+
var MAX_NODES = 2e3;
|
|
3234
|
+
/**
|
|
3235
|
+
* Redact a value, returning the SAME reference when nothing in it changed —
|
|
3236
|
+
* most lines carry clean meta, and copying every one would put an allocation
|
|
3237
|
+
* per log line on hub-main's event loop.
|
|
3238
|
+
*/
|
|
3239
|
+
function redactValue(value, depth, budget, seen) {
|
|
3240
|
+
if (budget.nodes++ > MAX_NODES) return value;
|
|
3241
|
+
if (typeof value === "string") return redactLogText(value);
|
|
3242
|
+
if (value === null || typeof value !== "object") return value;
|
|
3243
|
+
if (depth >= MAX_DEPTH || seen.has(value)) return value;
|
|
3244
|
+
if (value instanceof Error) {
|
|
3245
|
+
const message = redactLogText(value.message);
|
|
3246
|
+
return message === value.message ? value : message;
|
|
3247
|
+
}
|
|
3248
|
+
if (value instanceof Date || ArrayBuffer.isView(value) || value instanceof ArrayBuffer) return value;
|
|
3249
|
+
seen.add(value);
|
|
3250
|
+
if (Array.isArray(value)) {
|
|
3251
|
+
let copy = null;
|
|
3252
|
+
for (let i = 0; i < value.length; i++) {
|
|
3253
|
+
const item = value[i];
|
|
3254
|
+
const next = redactValue(item, depth + 1, budget, seen);
|
|
3255
|
+
if (next !== item) {
|
|
3256
|
+
copy ??= [...value];
|
|
3257
|
+
copy[i] = next;
|
|
3258
|
+
}
|
|
3259
|
+
}
|
|
3260
|
+
return copy ?? value;
|
|
3261
|
+
}
|
|
3262
|
+
let copy = null;
|
|
3263
|
+
for (const [key, child] of Object.entries(value)) {
|
|
3264
|
+
const next = typeof child === "string" && child.length > 0 && isCredentialKeyName(key) ? REDACTED : redactValue(child, depth + 1, budget, seen);
|
|
3265
|
+
if (next !== child) {
|
|
3266
|
+
copy ??= { ...value };
|
|
3267
|
+
copy[key] = next;
|
|
3268
|
+
}
|
|
3269
|
+
}
|
|
3270
|
+
return copy ?? value;
|
|
3271
|
+
}
|
|
3272
|
+
/** Redact a `meta` record; the same object back when it was already clean. */
|
|
3273
|
+
function redactLogMeta(meta) {
|
|
3274
|
+
const out = redactValue(meta, 0, { nodes: 0 }, /* @__PURE__ */ new WeakSet());
|
|
3275
|
+
if (out === meta) return meta;
|
|
3276
|
+
return out !== null && typeof out === "object" && !Array.isArray(out) ? Object.fromEntries(Object.entries(out)) : meta;
|
|
3277
|
+
}
|
|
3278
|
+
/** Redact a whole entry: message and meta. Tags are identifiers, left alone. */
|
|
3279
|
+
function redactLogEntry(entry) {
|
|
3280
|
+
const message = redactLogText(entry.message);
|
|
3281
|
+
const meta = entry.meta !== void 0 ? redactLogMeta(entry.meta) : void 0;
|
|
3282
|
+
if (message === entry.message && meta === entry.meta) return entry;
|
|
3283
|
+
return {
|
|
3284
|
+
...entry,
|
|
3285
|
+
message,
|
|
3286
|
+
...meta !== void 0 ? { meta } : {}
|
|
3287
|
+
};
|
|
3288
|
+
}
|
|
3289
|
+
//#endregion
|
|
3178
3290
|
//#region src/kernel/deps/npm-command.ts
|
|
3179
3291
|
/**
|
|
3180
3292
|
* npm invocation resolver — makes "is npm available?" a solved problem for
|
|
@@ -4709,6 +4821,16 @@ function buildDeviceOpsProvider(device) {
|
|
|
4709
4821
|
}
|
|
4710
4822
|
};
|
|
4711
4823
|
}
|
|
4824
|
+
/**
|
|
4825
|
+
* The secret paths a live device's config schema declares (D783). A device
|
|
4826
|
+
* whose `config` carries no readable schema (a test double) declares none —
|
|
4827
|
+
* the hub's keyword backstop still applies to it.
|
|
4828
|
+
*/
|
|
4829
|
+
function declaredSecretConfigPaths(device) {
|
|
4830
|
+
const schema = device.config?.schema;
|
|
4831
|
+
if (schema === void 0 || schema === null || typeof schema !== "object") return [];
|
|
4832
|
+
return [...collectZodSecretPaths(schema)];
|
|
4833
|
+
}
|
|
4712
4834
|
function callDeviceManager(api, method, input) {
|
|
4713
4835
|
const leaf = Reflect.get(Reflect.get(api, "deviceManager"), method);
|
|
4714
4836
|
return (leaf.mutate ?? leaf.query)(input);
|
|
@@ -4760,12 +4882,13 @@ function createBrokerDeviceManagerApi(opts) {
|
|
|
4760
4882
|
bindRuntimeState: (state) => {
|
|
4761
4883
|
runtimeStateRef = state;
|
|
4762
4884
|
},
|
|
4763
|
-
persistConfig: async (data) => {
|
|
4885
|
+
persistConfig: async (data, options) => {
|
|
4764
4886
|
const dataRecord = toPlainRecord(data);
|
|
4765
4887
|
if (!dataRecord) throw new Error(`worker-device-manager: persistConfig expected a plain object, got ${data === null ? "null" : typeof data}`);
|
|
4766
4888
|
await callDeviceManager(api, "persistConfig", {
|
|
4767
4889
|
deviceId: id,
|
|
4768
|
-
data: dataRecord
|
|
4890
|
+
data: dataRecord,
|
|
4891
|
+
...options?.secretConfigPaths !== void 0 ? { secretConfigPaths: [...options.secretConfigPaths] } : {}
|
|
4769
4892
|
});
|
|
4770
4893
|
},
|
|
4771
4894
|
initialRuntimeState,
|
|
@@ -5155,7 +5278,8 @@ function createBrokerDeviceManagerApi(opts) {
|
|
|
5155
5278
|
name: device.name,
|
|
5156
5279
|
parentDeviceId: device.parentDeviceId,
|
|
5157
5280
|
features: [...device.features],
|
|
5158
|
-
config: {}
|
|
5281
|
+
config: {},
|
|
5282
|
+
secretConfigPaths: declaredSecretConfigPaths(device)
|
|
5159
5283
|
});
|
|
5160
5284
|
} catch (err) {
|
|
5161
5285
|
registry.remove(device.id);
|
|
@@ -5174,7 +5298,8 @@ function createBrokerDeviceManagerApi(opts) {
|
|
|
5174
5298
|
name: device.name,
|
|
5175
5299
|
parentDeviceId: device.parentDeviceId,
|
|
5176
5300
|
features: [...device.features],
|
|
5177
|
-
config: {}
|
|
5301
|
+
config: {},
|
|
5302
|
+
secretConfigPaths: declaredSecretConfigPaths(device)
|
|
5178
5303
|
});
|
|
5179
5304
|
} catch (err) {
|
|
5180
5305
|
opts.logger.debug("post-probe features meta refresh failed (non-fatal)", {
|
|
@@ -8286,22 +8411,33 @@ function extractNodeId(args) {
|
|
|
8286
8411
|
return typeof raw === "string" && raw.length > 0 ? raw : void 0;
|
|
8287
8412
|
}
|
|
8288
8413
|
/**
|
|
8289
|
-
*
|
|
8414
|
+
* Stamp the CALLER identity into a cap call's args — the SAME "provider
|
|
8290
8415
|
* destructures what it needs and ignores the rest" convention
|
|
8291
8416
|
* {@link extractNodeId} already relies on for the inline `nodeId` pin.
|
|
8292
|
-
*
|
|
8293
|
-
*
|
|
8294
|
-
*
|
|
8295
|
-
*
|
|
8296
|
-
*
|
|
8297
|
-
|
|
8298
|
-
|
|
8299
|
-
|
|
8417
|
+
*
|
|
8418
|
+
* The stamp is the transport's, never the caller's (D787):
|
|
8419
|
+
* - a stamp (`callerAddonId` known to the transport) OVERWRITES whatever the
|
|
8420
|
+
* args carry under that key;
|
|
8421
|
+
* - NO stamp STRIPS the key: a call that crossed a wire with no identity the
|
|
8422
|
+
* transport can vouch for must not arrive carrying a claimed one. The
|
|
8423
|
+
* keychain owner-checks on this field, and until 2026-10-08 an unstamped
|
|
8424
|
+
* call let a child's own `callerAddonId` through untouched.
|
|
8425
|
+
*
|
|
8426
|
+
* A hub in-process caller never reaches this function (`localProviderLink`
|
|
8427
|
+
* calls the provider directly), which is the one place a stated identity is
|
|
8428
|
+
* trusted. A non-object `args` (or `null`/array) is returned unchanged: there
|
|
8429
|
+
* is nowhere to attach a key, and nowhere one could hide.
|
|
8430
|
+
*/
|
|
8431
|
+
function stampCallerAddonId(args, callerAddonId) {
|
|
8300
8432
|
if (args === null || typeof args !== "object" || Array.isArray(args)) return args;
|
|
8301
|
-
return {
|
|
8433
|
+
if (callerAddonId !== void 0) return {
|
|
8302
8434
|
...args,
|
|
8303
8435
|
callerAddonId
|
|
8304
8436
|
};
|
|
8437
|
+
if (!Object.prototype.hasOwnProperty.call(args, "callerAddonId")) return args;
|
|
8438
|
+
const rest = {};
|
|
8439
|
+
for (const [key, value] of Object.entries(args)) if (key !== "callerAddonId") rest[key] = value;
|
|
8440
|
+
return rest;
|
|
8305
8441
|
}
|
|
8306
8442
|
var CapRouteResolver = class {
|
|
8307
8443
|
hubNodeId;
|
|
@@ -8405,7 +8541,7 @@ var CapRouteResolver = class {
|
|
|
8405
8541
|
*/
|
|
8406
8542
|
async dispatchInner(route, method, args, addonId, callerAddonId) {
|
|
8407
8543
|
switch (route.kind) {
|
|
8408
|
-
case "hub-in-process": return route.ref.invoke(method,
|
|
8544
|
+
case "hub-in-process": return route.ref.invoke(method, stampCallerAddonId(args, callerAddonId));
|
|
8409
8545
|
case "hub-local-uds": {
|
|
8410
8546
|
const registry = this.hubLocalRegistry;
|
|
8411
8547
|
if (registry === null) throw new CapRouteError(route.capName, method, {
|
|
@@ -8965,7 +9101,8 @@ var LocalChildRegistry = class {
|
|
|
8965
9101
|
method: input.method,
|
|
8966
9102
|
args: input.args,
|
|
8967
9103
|
...input.deviceId !== void 0 ? { deviceId: input.deviceId } : {},
|
|
8968
|
-
...input.addonId !== void 0 ? { addonId: input.addonId } : {}
|
|
9104
|
+
...input.addonId !== void 0 ? { addonId: input.addonId } : {},
|
|
9105
|
+
...input.callerAddonId !== void 0 ? { callerAddonId: input.callerAddonId } : {}
|
|
8969
9106
|
};
|
|
8970
9107
|
}
|
|
8971
9108
|
listChildren() {
|
|
@@ -9239,7 +9376,8 @@ var LocalChildRegistry = class {
|
|
|
9239
9376
|
capName: out.capName,
|
|
9240
9377
|
method: out.method,
|
|
9241
9378
|
args: void 0,
|
|
9242
|
-
...out.deviceId !== void 0 ? { deviceId: out.deviceId } : {}
|
|
9379
|
+
...out.deviceId !== void 0 ? { deviceId: out.deviceId } : {},
|
|
9380
|
+
...childId !== null ? { callerAddonId: childId } : {}
|
|
9243
9381
|
};
|
|
9244
9382
|
const declared = this.capTimeoutMs?.(out.capName, out.method);
|
|
9245
9383
|
return entry.channel.request(forward, {
|
|
@@ -9464,13 +9602,14 @@ var LocalChildClient = class {
|
|
|
9464
9602
|
channel.onRequest(async (body, payload) => {
|
|
9465
9603
|
const msg = body;
|
|
9466
9604
|
if (msg.kind === "cap-call") {
|
|
9467
|
-
const args = payload !== void 0 ? unpackPayload(payload) : msg.args;
|
|
9605
|
+
const args = stampCallerAddonId(payload !== void 0 ? unpackPayload(payload) : msg.args, msg.callerAddonId);
|
|
9468
9606
|
const result = await this.options.dispatch({
|
|
9469
9607
|
capName: msg.capName,
|
|
9470
9608
|
method: msg.method,
|
|
9471
9609
|
args,
|
|
9472
9610
|
...msg.deviceId !== void 0 ? { deviceId: msg.deviceId } : {},
|
|
9473
|
-
...msg.addonId !== void 0 ? { addonId: msg.addonId } : {}
|
|
9611
|
+
...msg.addonId !== void 0 ? { addonId: msg.addonId } : {},
|
|
9612
|
+
...msg.callerAddonId !== void 0 ? { callerAddonId: msg.callerAddonId } : {}
|
|
9474
9613
|
});
|
|
9475
9614
|
if (payload !== void 0 && result !== void 0) return new PayloadReply(void 0, packPayload(result));
|
|
9476
9615
|
return result;
|
|
@@ -9653,12 +9792,12 @@ function createUdsLoggerWithState(client, addonId, nodeId, levelState, scope, ta
|
|
|
9653
9792
|
} : baseTags;
|
|
9654
9793
|
const entry = {
|
|
9655
9794
|
level,
|
|
9656
|
-
message,
|
|
9795
|
+
message: redactLogText(message),
|
|
9657
9796
|
addonId,
|
|
9658
9797
|
nodeId,
|
|
9659
9798
|
...scope !== void 0 ? { scope } : {},
|
|
9660
9799
|
tags: mergedTags,
|
|
9661
|
-
...extras?.meta !== void 0 ? { meta: extras.meta } : {}
|
|
9800
|
+
...extras?.meta !== void 0 ? { meta: redactLogMeta(extras.meta) } : {}
|
|
9662
9801
|
};
|
|
9663
9802
|
client.sendLog(entry);
|
|
9664
9803
|
}
|
|
@@ -9880,7 +10019,8 @@ function createParentUnownedCallHandler(deps) {
|
|
|
9880
10019
|
method: input.method,
|
|
9881
10020
|
args: input.args,
|
|
9882
10021
|
deviceId,
|
|
9883
|
-
native: true
|
|
10022
|
+
native: true,
|
|
10023
|
+
...input.callerAddonId !== void 0 ? { callerAddonId: input.callerAddonId } : {}
|
|
9884
10024
|
});
|
|
9885
10025
|
throw new Error(`no native provider for capability "${input.capName}" on device ${String(deviceId)}`);
|
|
9886
10026
|
}
|
|
@@ -9940,7 +10080,8 @@ function createParentUnownedCallHandler(deps) {
|
|
|
9940
10080
|
method: input.method,
|
|
9941
10081
|
args: input.args,
|
|
9942
10082
|
deviceId,
|
|
9943
|
-
nodeId: owner.nodeId
|
|
10083
|
+
nodeId: owner.nodeId,
|
|
10084
|
+
...input.callerAddonId !== void 0 ? { callerAddonId: input.callerAddonId } : {}
|
|
9944
10085
|
});
|
|
9945
10086
|
return await brokerCallForCap(deps.broker, input.capName, input.method, input.args, { nodeId: owner.nodeId });
|
|
9946
10087
|
}
|
|
@@ -9950,7 +10091,8 @@ function createParentUnownedCallHandler(deps) {
|
|
|
9950
10091
|
method: input.method,
|
|
9951
10092
|
args: input.args,
|
|
9952
10093
|
...deviceId !== void 0 ? { deviceId } : {},
|
|
9953
|
-
...nodeId !== void 0 ? { nodeId } : {}
|
|
10094
|
+
...nodeId !== void 0 ? { nodeId } : {},
|
|
10095
|
+
...input.callerAddonId !== void 0 ? { callerAddonId: input.callerAddonId } : {}
|
|
9954
10096
|
});
|
|
9955
10097
|
if (deps.isCoreServiceCap !== void 0 && !deps.isCoreServiceCap(input.capName)) {
|
|
9956
10098
|
for (let attempt = 1; attempt <= ADDON_CAP_RETRY_ATTEMPTS; attempt++) {
|
|
@@ -9961,7 +10103,7 @@ function createParentUnownedCallHandler(deps) {
|
|
|
9961
10103
|
...nodeId !== void 0 ? { nodeId } : {},
|
|
9962
10104
|
...deviceId !== void 0 ? { deviceId } : {}
|
|
9963
10105
|
});
|
|
9964
|
-
return await retryResolver.dispatch(route, input.method, input.args);
|
|
10106
|
+
return input.callerAddonId !== void 0 ? await retryResolver.dispatch(route, input.method, input.args, void 0, input.callerAddonId) : await retryResolver.dispatch(route, input.method, input.args);
|
|
9965
10107
|
} catch (err) {
|
|
9966
10108
|
if (!(err instanceof CapRouteError) || err.reason !== "no-provider") throw err;
|
|
9967
10109
|
}
|
|
@@ -11924,6 +12066,19 @@ async function buildAddonContext(runtime, declaration, dataDir, options) {
|
|
|
11924
12066
|
api,
|
|
11925
12067
|
deps: new AddonDepsManager(addonDataDir, scopedLogger),
|
|
11926
12068
|
settings: settingsView,
|
|
12069
|
+
secrets: createSecretsAccess({
|
|
12070
|
+
owner: addonId,
|
|
12071
|
+
transport: {
|
|
12072
|
+
put: (input) => api.keychain.put.mutate({
|
|
12073
|
+
ref: input.ref,
|
|
12074
|
+
value: input.value
|
|
12075
|
+
}),
|
|
12076
|
+
resolve: (input) => api.keychain.resolve.query({ refs: [...input.refs] }),
|
|
12077
|
+
delete: (input) => api.keychain.delete.mutate({ refs: [...input.refs] }),
|
|
12078
|
+
getState: () => api.keychain.getState.query({})
|
|
12079
|
+
},
|
|
12080
|
+
eventBus: scopedEventBus
|
|
12081
|
+
}),
|
|
11927
12082
|
kernel: (() => {
|
|
11928
12083
|
const streamProbe = runtime.mode === "broker" ? {
|
|
11929
12084
|
probe: (url, probeOptions) => runtime.broker.call("$stream-probe.probe", {
|
|
@@ -12750,4 +12905,4 @@ function createChildCapDispatch(deps) {
|
|
|
12750
12905
|
};
|
|
12751
12906
|
}
|
|
12752
12907
|
//#endregion
|
|
12753
|
-
export {
|
|
12908
|
+
export { stampCallerAddonId as $, sampleSocketDirection as $n, HUB_MAIN_RSS_BUDGET_MB as $t, resolveHwAccel as A, formatHeapSpaces as An, serializeTypedArrays as At, udsChildLogToWorkerEntry as B, createMeshQueueReader as Bn, isCredentialKeyName as Bt, getBrokerEventBus as C, createArrayBufferCensusGate as Cn, NATIVE_PROVIDER_SERVICE_INFIX as Ct, subscribePassthrough as D, DECISIVE_HEAP_SPACES as Dn, capServiceName as Dt, setNodeEventInterest as E, isArrayBufferCensusReport as En, capBareAction as Et, ipcParentLink as F, OUTBOUND_QUEUE_SUSTAIN_MS as Fn, installManifestNativeDeps as Ft, UDS_NO_ROUTE_PREFIX as G, createSocketPlaneMeter as Gn, hostNodeIdOf as Gt, createUdsLoggerWithControl as H, EMPTY_SOCKET_PLANE_BASELINE as Hn, redactLogMeta as Ht, localProviderLink as I, OUTBOUND_QUEUE_THRESHOLD_BYTES as In, resolveAddonClass as It, answerClaimedGetStatus as J, formatSocketPlane as Jn, HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS as Jt, afterWorkerOnlineAnnounce as K, createSocketPlaneReader as Kn, createAddonDataPlaneFacility as Kt, createParentUnownedCallHandler as L, createOutboundQueueGate as Ln, buildNpmChildEnv as Lt, brokerTransportLink as M, readHeapSpaces as Mn, CapabilityHandle as Mt, buildLinkChain as N, selectReportedSpaces as Nn, CapabilityUnavailableError as Nt, AddonDepsManager as O, HEAP_SPACE_REPORT_MIN_MB as On, parseCapAction as Ot, deviceCapResolverLink as P, OUTBOUND_QUEUE_COOLDOWN_MS as Pn, copyBundledNativeModules as Pt, CapRouteResolver as Q, recordSocketFrame as Qn, HUB_MAIN_HEAP_WATCH_LABEL as Qt, createUdsEventBridge as R, formatOutboundQueueVerdict as Rn, resolveNpmInvocation as Rt, clusterEventTopic as S, ARRAY_BUFFER_RELEASE_MIN_DROP_RATIO as Sn, validateProviderRegistrations as St, registerEventBusService as T, formatArrayBufferCensus as Tn, capActionSuffix as Tt, LocalChildClient as U, SOCKET_PLANE_TOP_N as Un, redactLogText as Ut, createUdsLogger as V, formatMeshQueue as Vn, redactLogEntry as Vt, LocalChildRegistry as W, SOCKET_QUEUE_TOP_N as Wn, createAddonPeerBytesFacility as Wt, AGENT_CAP_FWD_ACTION as X, EMPTY_SOCKET_DIRECTION as Xn, HEAP_WATCH_INTERVAL_MS as Xt, deviceOfGetStatus as Y, readSocketQueues as Yn, HEAP_RECLAIM_TRIGGER_MB as Yt, AGENT_CAP_FWD_SERVICE as Z, createSocketDirectionCounters as Zn, HEAP_WATCH_WARN_RATIO as Zt, getWorkerDeviceRegistry as _, startRunnerHeapWatch as _n, getWorkerNativeCapProvider as _t, reapProcessGroup as a, ZERO_LOOP_DELAY as an, MAX_CAP_ACTIONS_PER_PEER as ar, __resetCapUsageRegistryForTests as at, setHubConnected as b, ARRAY_BUFFER_CENSUS_SUSTAIN_MS as bn, setWorkerNativeCapsChangeListener as bt, runnerOwnsProcessGroup as c, createLoopDelayMeter as cn, diffCapActionCensus as cr, UdsLocalTransportClient as ct, summarizeMembers as d, hubMainRssBudget as dn, createEventPlaneReader as dr, PeerAnsweredError as dt, HUB_RSS_BUDGET_ENV as en, socketDirectionBytes as er, CapRouteError as et, installManifestSystemDeps as f, nextRssBudgetState as fn, diffEventPlane as fr, localEndpointPath as ft, createUdsAddonContext as g, startHeapWatch as gn, createBrokerDeviceManagerApi as gt, createAddonContext as h, shouldReclaim as hn, buildNativeCapProxy as ht, killOwnRunnerGroupAfterParentLoss as i, RUNNER_RSS_BUDGET_ENV as in, EMPTY_CAP_ACTION_READING as ir, PARENT_ROUTED_PROVIDER_ADDON_ID as it, brokerCallForCap as j, heapSpaceField as jn, DeviceRegistry as jt, createKernelHwAccel as k, emitHeapDiagnosticReport as kn, deserializeTypedArrays as kt, signalAllRunnerGroups as l, createV8Reclaimer as ln, EVENT_PLANE_TOP_N as lr, UdsLocalTransportServer as lt, adaptBrokerToCluster as m, reclaimIntervalMs as mn, encodeFrame as mt, createChildCapDispatch as n, RSS_BUDGET_RELEASE_RATIO as nn, CAP_ACTION_OVERFLOW_LABEL as nr, callWithServiceDiscovery as nt, registerRunnerGroup as o, buildHeapSample as on, capActionLabel as or, getCapUsageRegistry as ot, installManifestPythonDeps as p, parseRssBudgetMb as pn, formatEventPlane as pr, FrameDecoder as pt, GET_STATUS_METHOD as q, diffSocketPlane as qn, HEAP_RECLAIM_MIN_INTERVAL_MS as qt, defaultProcessGroupOps as r, RUNNER_HEAP_WATCH_INTERVAL_MS as rn, CAP_ACTION_UNLABELLED as rr, CapUsageRegistry as rt, releaseRunnerGroup as s, createDeferredHeapWatchSink as sn, createCapActionCensus as sr, createLocalTransport as st, CAP_METHOD_NOT_IMPLEMENTED as t, RSS_BUDGET_REANNOUNCE_MIN_MS as tn, socketDirectionMessages as tr, classifyCapRoute as tt, startRunnerParentDeathWatchdog as u, describeRss as un, createEventPlaneMeter as ur, SocketChannel as ut, getOrInitReadinessRegistry as v, strandedMb as vn, getWorkerNativeCapSnapshot as vt, getMoleculerEventStats as w, createInspectorArrayBufferCensus as wn, capActionName as wt, EVENT_TOPIC_PREFIX as x, ARRAY_BUFFER_CENSUS_THRESHOLD_MB as xn, createAddonService as xt, getOrInitReadinessRegistryForClient as y, ARRAY_BUFFER_CENSUS_COOLDOWN_MS as yn, mountNativeCapService as yt, createUdsEventBus as z, MESH_QUEUE_TOP_N as zn, runNpm as zt };
|