feat(e2ee-calls): Add a feature capability and config capability for end-to-end encrypted calls

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2025-01-13 11:44:48 +01:00 committed by Maksim Sukharev
parent f48b2f9ea6
commit 63368a13d0
21 changed files with 73 additions and 8 deletions

View file

@ -175,3 +175,5 @@
* `config => chat => has-translation-task-providers` (local) - When true, translations can be done using the [OCS TaskProcessing API](https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-taskprocessing-api.html).
* `config => conversations => list-style` (local) - Whether conversation list should appear in certain way
* `config => conversations => description-length` (local) - The maximum length for conversation descriptions, currently 2000. Before this config was added the implicit limit was 500, since the existance of the feature capability `room-description`.
* `call-end-to-end-encryption` - Signaling support of the server for the end-to-end encryption of calls
* `config => call => end-to-end-encryption` - Whether calls should be end-to-end encrypted (currently off by default, until all Talk mobile clients support it)

View file

@ -119,6 +119,7 @@ class Capabilities implements IPublicCapability {
'message-expiration',
'reactions',
'chat-summary-api',
'call-end-to-end-encryption',
];
public const LOCAL_FEATURES = [
@ -224,6 +225,7 @@ class Capabilities implements IPublicCapability {
'start-without-media' => $this->talkConfig->getCallsStartWithoutMedia($user?->getUID()),
'max-duration' => $this->appConfig->getAppValueInt('max_call_duration'),
'blur-virtual-background' => $this->talkConfig->getBlurVirtualBackground($user?->getUID()),
'end-to-end-encryption' => $this->talkConfig->isCallEndToEndEncryptionEnabled(),
],
'chat' => [
'max-length' => ChatManager::MAX_CHAT_LENGTH,
@ -337,6 +339,10 @@ class Capabilities implements IPublicCapability {
$capabilities['config']['chat']['has-translation-task-providers'] = true;
}
if ($this->talkConfig->getSignalingMode() === Config::SIGNALING_EXTERNAL) {
$capabilities['features'][] = 'call-end-to-end-encryption';
}
return [
'spreed' => $capabilities,
];

View file

@ -732,4 +732,13 @@ class Config {
public function isPasswordEnforced(): bool {
return $this->appConfig->getAppValueBool('force_passwords');
}
public function isCallEndToEndEncryptionEnabled(): bool {
if ($this->getSignalingMode() !== self::SIGNALING_EXTERNAL) {
return false;
}
// TODO Default value will be set to true, once all mobile clients support it.
return $this->appConfig->getAppValueBool('call_end_to_end_encryption');
}
}

View file

@ -347,6 +347,7 @@ namespace OCA\Talk;
* start-without-media: bool,
* max-duration: int,
* blur-virtual-background: bool,
* end-to-end-encryption: bool,
* },
* chat: array{
* max-length: int,

View file

@ -150,7 +150,8 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-virtual-background"
"blur-virtual-background",
"end-to-end-encryption"
],
"properties": {
"enabled": {
@ -199,6 +200,9 @@
},
"blur-virtual-background": {
"type": "boolean"
},
"end-to-end-encryption": {
"type": "boolean"
}
}
},

View file

@ -83,7 +83,8 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-virtual-background"
"blur-virtual-background",
"end-to-end-encryption"
],
"properties": {
"enabled": {
@ -132,6 +133,9 @@
},
"blur-virtual-background": {
"type": "boolean"
},
"end-to-end-encryption": {
"type": "boolean"
}
}
},

View file

@ -83,7 +83,8 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-virtual-background"
"blur-virtual-background",
"end-to-end-encryption"
],
"properties": {
"enabled": {
@ -132,6 +133,9 @@
},
"blur-virtual-background": {
"type": "boolean"
},
"end-to-end-encryption": {
"type": "boolean"
}
}
},

View file

@ -126,7 +126,8 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-virtual-background"
"blur-virtual-background",
"end-to-end-encryption"
],
"properties": {
"enabled": {
@ -175,6 +176,9 @@
},
"blur-virtual-background": {
"type": "boolean"
},
"end-to-end-encryption": {
"type": "boolean"
}
}
},

View file

@ -83,7 +83,8 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-virtual-background"
"blur-virtual-background",
"end-to-end-encryption"
],
"properties": {
"enabled": {
@ -132,6 +133,9 @@
},
"blur-virtual-background": {
"type": "boolean"
},
"end-to-end-encryption": {
"type": "boolean"
}
}
},

View file

@ -126,7 +126,8 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-virtual-background"
"blur-virtual-background",
"end-to-end-encryption"
],
"properties": {
"enabled": {
@ -175,6 +176,9 @@
},
"blur-virtual-background": {
"type": "boolean"
},
"end-to-end-encryption": {
"type": "boolean"
}
}
},

View file

@ -284,7 +284,8 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-virtual-background"
"blur-virtual-background",
"end-to-end-encryption"
],
"properties": {
"enabled": {
@ -333,6 +334,9 @@
},
"blur-virtual-background": {
"type": "boolean"
},
"end-to-end-encryption": {
"type": "boolean"
}
}
},

View file

@ -243,7 +243,8 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-virtual-background"
"blur-virtual-background",
"end-to-end-encryption"
],
"properties": {
"enabled": {
@ -292,6 +293,9 @@
},
"blur-virtual-background": {
"type": "boolean"
},
"end-to-end-encryption": {
"type": "boolean"
}
}
},

View file

@ -91,6 +91,11 @@ export const mockedCapabilities: Capabilities = {
'conversation-creation-password',
'call-notification-state-api',
'schedule-meeting',
// Conditional features
'message-expiration',
'reactions',
'chat-summary-api',
'call-end-to-end-encryption',
],
'features-local': [
'favorites',
@ -126,6 +131,7 @@ export const mockedCapabilities: Capabilities = {
'start-without-media': false,
'max-duration': 0,
'blur-virtual-background': false,
'end-to-end-encryption': false,
},
chat: {
'max-length': 32000,
@ -176,6 +182,7 @@ export const mockedCapabilities: Capabilities = {
conversations: [
'can-create',
'list-style',
'description-length',
],
federation: [
'enabled',

View file

@ -232,6 +232,7 @@ export type components = {
/** Format: int64 */
"max-duration": number;
"blur-virtual-background": boolean;
"end-to-end-encryption": boolean;
};
chat: {
/** Format: int64 */

View file

@ -66,6 +66,7 @@ export type components = {
/** Format: int64 */
"max-duration": number;
"blur-virtual-background": boolean;
"end-to-end-encryption": boolean;
};
chat: {
/** Format: int64 */

View file

@ -52,6 +52,7 @@ export type components = {
/** Format: int64 */
"max-duration": number;
"blur-virtual-background": boolean;
"end-to-end-encryption": boolean;
};
chat: {
/** Format: int64 */

View file

@ -147,6 +147,7 @@ export type components = {
/** Format: int64 */
"max-duration": number;
"blur-virtual-background": boolean;
"end-to-end-encryption": boolean;
};
chat: {
/** Format: int64 */

View file

@ -70,6 +70,7 @@ export type components = {
/** Format: int64 */
"max-duration": number;
"blur-virtual-background": boolean;
"end-to-end-encryption": boolean;
};
chat: {
/** Format: int64 */

View file

@ -178,6 +178,7 @@ export type components = {
/** Format: int64 */
"max-duration": number;
"blur-virtual-background": boolean;
"end-to-end-encryption": boolean;
};
chat: {
/** Format: int64 */

View file

@ -2015,6 +2015,7 @@ export type components = {
/** Format: int64 */
"max-duration": number;
"blur-virtual-background": boolean;
"end-to-end-encryption": boolean;
};
chat: {
/** Format: int64 */

View file

@ -1515,6 +1515,7 @@ export type components = {
/** Format: int64 */
"max-duration": number;
"blur-virtual-background": boolean;
"end-to-end-encryption": boolean;
};
chat: {
/** Format: int64 */