@camstack/server 1.2.301 → 1.2.302
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.
|
@@ -17,6 +17,16 @@ const GRID_VIEW_OPEN_METHODS = new Set([
|
|
|
17
17
|
'turnProvider.getTurnServers',
|
|
18
18
|
'live.onEvent',
|
|
19
19
|
]);
|
|
20
|
+
/**
|
|
21
|
+
* Talk-back, callable only on a token minted with `scope.talk` AND only for an
|
|
22
|
+
* in-scope deviceId. Enumerated, never `intercom.*`: a namespace grant here
|
|
23
|
+
* would pick up whatever the cap grows next.
|
|
24
|
+
*/
|
|
25
|
+
const GRID_VIEW_TALK_METHODS = new Set([
|
|
26
|
+
'intercom.startSession',
|
|
27
|
+
'intercom.handleAnswer',
|
|
28
|
+
'intercom.stopSession',
|
|
29
|
+
]);
|
|
20
30
|
/**
|
|
21
31
|
* Methods callable ONLY with an in-scope `input.deviceId`. A missing or
|
|
22
32
|
* non-numeric deviceId is denied (fail closed).
|
|
@@ -135,7 +145,15 @@ function checkShareViewAccess(scope, path, input) {
|
|
|
135
145
|
if (GRID_VIEW_OPEN_METHODS.has(path)) {
|
|
136
146
|
return { ok: true };
|
|
137
147
|
}
|
|
138
|
-
|
|
148
|
+
// Talk-back BEFORE the device enumeration, because it is the one gate that
|
|
149
|
+
// can refuse for a reason other than the device: a token that never asked
|
|
150
|
+
// for it must be told that, not told its camera is out of scope.
|
|
151
|
+
if (GRID_VIEW_TALK_METHODS.has(path)) {
|
|
152
|
+
if (scope.talk !== true) {
|
|
153
|
+
return { ok: false, reason: `'${path}' needs a share link minted with talk-back` };
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (GRID_VIEW_TALK_METHODS.has(path) || GRID_VIEW_DEVICE_METHODS.has(path)) {
|
|
139
157
|
const deviceId = extractDeviceId(input);
|
|
140
158
|
if (deviceId === null) {
|
|
141
159
|
return { ok: false, reason: `'${path}' requires a numeric deviceId for share-view access` };
|
|
@@ -118,6 +118,22 @@ exports.SHARE_TOKEN_MAX_DEVICES = 64;
|
|
|
118
118
|
exports.ShareTokenScopeSchema = zod_1.z.object({
|
|
119
119
|
kind: zod_1.z.enum(types_1.SHARE_VIEW_KINDS),
|
|
120
120
|
deviceIds: zod_1.z.array(zod_1.z.number().int().nonnegative()).min(1).max(exports.SHARE_TOKEN_MAX_DEVICES),
|
|
121
|
+
/**
|
|
122
|
+
* TALK-BACK, opt-in at mint time. Absent means OFF, and that is the whole
|
|
123
|
+
* point: a share link is handed to third parties, so the difference between
|
|
124
|
+
* "can watch the kitchen" and "can speak into the kitchen" must be a choice
|
|
125
|
+
* somebody made for THAT link, on the day they made it.
|
|
126
|
+
*
|
|
127
|
+
* It rides on the scope rather than widening the grid enumeration because
|
|
128
|
+
* the enumeration is retroactive: a method added there is granted to every
|
|
129
|
+
* token ever minted, including the one handed to a neighbour last week.
|
|
130
|
+
* `share-view-access.ts` says so about event history; the same rule with
|
|
131
|
+
* actuation into the home on the other end of it is not a smaller matter.
|
|
132
|
+
*
|
|
133
|
+
* It widens WHAT may be called, never WHICH cameras — `deviceIds` still
|
|
134
|
+
* gates every talk call.
|
|
135
|
+
*/
|
|
136
|
+
talk: zod_1.z.boolean().optional(),
|
|
121
137
|
});
|
|
122
138
|
/** Persisted record — never leaves the server with `tokenHash` attached. */
|
|
123
139
|
exports.ShareTokenRecordSchema = zod_1.z.object({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/server",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.302",
|
|
4
4
|
"private": false,
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"@camstack/addon-decoder-nodeav": "1.2.107",
|
|
42
42
|
"@camstack/addon-notifiers": "1.2.111",
|
|
43
43
|
"@camstack/addon-pipeline": "1.2.250",
|
|
44
|
-
"@camstack/addon-pipeline-orchestrator": "1.2.
|
|
45
|
-
"@camstack/addon-post-analysis": "1.2.
|
|
44
|
+
"@camstack/addon-pipeline-orchestrator": "1.2.213",
|
|
45
|
+
"@camstack/addon-post-analysis": "1.2.254",
|
|
46
46
|
"@camstack/sdk": "1.2.110",
|
|
47
47
|
"@camstack/system": "1.2.245",
|
|
48
48
|
"@camstack/types": "1.2.204",
|