@livedesk/hub 0.1.6 → 0.1.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livedesk/hub",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "LiveDesk local Hub API and browser frame bridge",
5
5
  "type": "module",
6
6
  "main": "src/server.js",
@@ -234,18 +234,25 @@ export function publicSettings(settings) {
234
234
 
235
235
  export function effectiveDevicePolicy(settings = DEFAULT_LIVEDESK_SETTINGS) {
236
236
  const normalized = normalizeLiveDeskSettings(settings);
237
+ // The retired ask-every-time surface has no interactive approval authority,
238
+ // so a persisted legacy value must fail closed. View-only remains able to
239
+ // receive video/audio while every mutating operation is blocked.
240
+ const accessMode = normalized.security.accessMode === 'ask-every-time'
241
+ ? 'block-remote-access'
242
+ : normalized.security.accessMode;
243
+ const allowMutation = accessMode === 'trusted-only';
237
244
  return {
238
245
  settingsSchemaVersion: normalized.settingsSchemaVersion,
239
246
  policyRevision: Number(settings?.revision || 0),
240
- accessMode: normalized.security.accessMode,
247
+ accessMode,
241
248
  allowInternetConnections: normalized.security.allowInternetConnections,
242
249
  allowLanConnections: normalized.security.allowLanConnections,
243
250
  requireEncryptedConnections: normalized.security.requireEncryptedConnections,
244
251
  allowUnencryptedLanFallback: normalized.security.allowUnencryptedLanFallback,
245
- allowControl: normalized.security.accessMode !== 'block-remote-access' && normalized.control.allowKeyboardMouse,
246
- allowClipboardText: normalized.security.accessMode !== 'block-remote-access' && normalized.control.allowClipboardText,
247
- allowFileTransfer: normalized.security.accessMode !== 'block-remote-access' && normalized.filesAudio.allowFileTransfer,
248
- allowRemoteAudio: normalized.security.accessMode !== 'block-remote-access' && normalized.filesAudio.allowRemoteAudio,
249
- allowAgent: normalized.security.accessMode !== 'block-remote-access' && normalized.agent.enabled
252
+ allowControl: allowMutation && normalized.control.allowKeyboardMouse,
253
+ allowClipboardText: allowMutation && normalized.control.allowClipboardText,
254
+ allowFileTransfer: allowMutation && normalized.filesAudio.allowFileTransfer,
255
+ allowRemoteAudio: accessMode !== 'block-remote-access' && normalized.filesAudio.allowRemoteAudio,
256
+ allowAgent: allowMutation && normalized.agent.enabled
250
257
  };
251
258
  }