@camstack/server 1.2.478 → 1.2.480

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.
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.enrichInputWithUserAgent = enrichInputWithUserAgent;
4
4
  exports.enrichInputWithRelayClass = enrichInputWithRelayClass;
5
+ exports.stripTalkbackFromRequest = stripTalkbackFromRequest;
5
6
  exports.enrichHintsWithClientClass = enrichHintsWithClientClass;
6
7
  exports.wrapWebrtcSessionProviderWithRelay = wrapWebrtcSessionProviderWithRelay;
7
8
  exports.buildAppRouter = buildAppRouter;
@@ -95,6 +96,25 @@ function enrichInputWithRelayClass(input, clientClass) {
95
96
  const relayOnly = FORCE_RELAY_REMOTE ? (0, client_ip_js_1.deriveRelayOnly)(clientClass) : false;
96
97
  return { ...input, relayOnly };
97
98
  }
99
+ /**
100
+ * Strip `talkback` from a REQUEST-bound `handleOffer` (D771).
101
+ *
102
+ * Talk-back sends the peer's microphone to the camera's speaker. Only a
103
+ * trusted, mesh-originated caller may ask for it — today the Alexa export,
104
+ * which has already checked the linked user may control the camera. A
105
+ * browser's talk permission lives on the intercom cap's own surface (share
106
+ * tokens gate it there); letting a request-bound `handleOffer` set this flag
107
+ * would be a second door to the speaker. Same rule as `relayOnly`: a
108
+ * mesh-originated call (`clientClass === null`) passes through unchanged.
109
+ *
110
+ * Immutable — builds a NEW input object, never mutates the caller's.
111
+ */
112
+ function stripTalkbackFromRequest(input, clientClass) {
113
+ if (clientClass === null || input.talkback === undefined)
114
+ return input;
115
+ const { talkback: _dropped, ...rest } = input;
116
+ return rest;
117
+ }
98
118
  /**
99
119
  * Bias used to live here (`prefersTier: 'low'` for `remote`). That pinned
100
120
  * every phone-sized session — including LAN IPv6 GUA misclassified as remote
@@ -145,7 +165,7 @@ function wrapWebrtcSessionProviderWithRelay(provider, ctx) {
145
165
  return {
146
166
  ...provider,
147
167
  createSession: (input) => provider.createSession(enrichHintsWithClientClass(enrichInputWithRelayClass(enrichInputWithUserAgent(input, userAgent), clientClass), clientClass)),
148
- handleOffer: (input) => provider.handleOffer(enrichHintsWithClientClass(enrichInputWithRelayClass(enrichInputWithUserAgent(input, userAgent), clientClass), clientClass)),
168
+ handleOffer: (input) => provider.handleOffer(enrichHintsWithClientClass(enrichInputWithRelayClass(enrichInputWithUserAgent(stripTalkbackFromRequest(input, clientClass), userAgent), clientClass), clientClass)),
149
169
  };
150
170
  }
151
171
  /**
@@ -48,16 +48,17 @@ const types_1 = require("@camstack/types");
48
48
  const client_1 = require("@trpc/client");
49
49
  const addon_call_gateway_js_1 = require("./addon-call-gateway.js");
50
50
  const addon_row_manifest_1 = require("./addon-row-manifest");
51
- const settings_door_wiring_js_1 = require("./settings-door-wiring.js");
52
51
  const addon_settings_provider_js_1 = require("./addon-settings-provider.js");
53
52
  const device_meta_mirror_js_1 = require("./device-meta-mirror.js");
53
+ const forked_custom_actions_js_1 = require("./forked-custom-actions.js");
54
54
  const integration_visibility_js_1 = require("./integration-visibility.js");
55
+ const materialize_route_path_js_1 = require("./materialize-route-path.js");
55
56
  const package_dir_utils_1 = require("./package-dir-utils");
56
- const forked_custom_actions_js_1 = require("./forked-custom-actions.js");
57
57
  const prune_misplaced_addons_js_1 = require("./prune-misplaced-addons.js");
58
58
  const runner_convergence_1 = require("./runner-convergence");
59
59
  const runner_serialization_1 = require("./runner-serialization");
60
60
  const runner_spawn_fanout_js_1 = require("./runner-spawn-fanout.js");
61
+ const settings_door_wiring_js_1 = require("./settings-door-wiring.js");
61
62
  /**
62
63
  * Decide whether an in-memory addon entry should be evicted because it is no
63
64
  * longer on disk (the uninstall path in `loadNewAddons`).
@@ -2672,7 +2673,9 @@ class AddonRegistryService {
2672
2673
  handler: async (req, reply) => {
2673
2674
  const envelope = await invoker.invoke({
2674
2675
  method: route.method,
2675
- path: route.path,
2676
+ // The CONCRETE path, not the pattern: the child re-matches it and
2677
+ // would otherwise bind every param to its own `:placeholder`.
2678
+ path: (0, materialize_route_path_js_1.materializeRoutePath)(route.path, req.params),
2676
2679
  params: req.params,
2677
2680
  query: req.query,
2678
2681
  body: req.body,
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.materializeRoutePath = materializeRoutePath;
4
+ /**
5
+ * Rebuild the concrete request path from a route pattern and the params the
6
+ * hub already matched (`/:providerId/start` + `{providerId:'authentik'}` →
7
+ * `/authentik/start`).
8
+ *
9
+ * The forked-addon bridge forwards a request to the child's
10
+ * `buildAddonRouteProvider().invoke`, which matches the path again to pick the
11
+ * route and extract params. Sending it the PATTERN made that second match bind
12
+ * every param to its own placeholder (`providerId = ':providerId'`), which
13
+ * overwrote the real value — every parameterized route of a forked addon saw
14
+ * literal `:name` params.
15
+ */
16
+ function materializeRoutePath(pattern, params) {
17
+ return pattern
18
+ .split('/')
19
+ .map((part) => {
20
+ if (!part.startsWith(':'))
21
+ return part;
22
+ const value = params[part.slice(1)];
23
+ return value === undefined ? part : encodeURIComponent(value);
24
+ })
25
+ .join('/');
26
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/server",
3
- "version": "1.2.478",
3
+ "version": "1.2.480",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "files": [
@@ -37,17 +37,17 @@
37
37
  ]
38
38
  },
39
39
  "dependencies": {
40
- "@camstack/addon-admin-ui": "1.2.351",
40
+ "@camstack/addon-admin-ui": "1.2.353",
41
41
  "@camstack/addon-agent-ui": "1.2.190",
42
42
  "@camstack/addon-auth": "1.2.130",
43
43
  "@camstack/addon-decoder-nodeav": "1.2.121",
44
44
  "@camstack/addon-notifiers": "1.2.128",
45
- "@camstack/addon-pipeline": "1.2.344",
45
+ "@camstack/addon-pipeline": "1.2.345",
46
46
  "@camstack/addon-pipeline-orchestrator": "1.2.297",
47
47
  "@camstack/addon-post-analysis": "1.2.342",
48
48
  "@camstack/sdk": "1.2.126",
49
- "@camstack/system": "1.2.373",
50
- "@camstack/types": "1.2.324",
49
+ "@camstack/system": "1.2.375",
50
+ "@camstack/types": "1.2.326",
51
51
  "@camstack/ui-library": "1.2.248",
52
52
  "@fastify/compress": "^9.0.0",
53
53
  "@fastify/cookie": "^11.0.2",