Skip to content

Commit

Permalink
feat(e2ee-calls): Add a feature capability and config capability for …
Browse files Browse the repository at this point in the history
…end-to-end encrypted calls

Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Jan 13, 2025
1 parent a810f93 commit 164e795
Show file tree
Hide file tree
Showing 20 changed files with 66 additions and 8 deletions.
2 changes: 2 additions & 0 deletions docs/capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,5 @@
* `call-notification-state-api` (local) - Whether the endpoints exists for checking if a call notification should be dismissed
* `schedule-meeting` (local) - Whether logged-in participants can schedule meetings
* `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).
* `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)
6 changes: 6 additions & 0 deletions lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class Capabilities implements IPublicCapability {
'message-expiration',
'reactions',
'chat-summary-api',
'call-end-to-end-encryption',
];

public const LOCAL_FEATURES = [
Expand Down Expand Up @@ -222,6 +223,7 @@ public function getCapabilities(): array {
'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,
Expand Down Expand Up @@ -333,6 +335,10 @@ public function getCapabilities(): array {
$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,
];
Expand Down
9 changes: 9 additions & 0 deletions lib/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -710,4 +710,13 @@ public function enableLobbyOnLockedRooms(): bool {
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');
}
}
1 change: 1 addition & 0 deletions lib/ResponseDefinitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@
* start-without-media: bool,
* max-duration: int,
* blur-virtual-background: bool,
* end-to-end-encryption: bool,
* },
* chat: array{
* max-length: int,
Expand Down
6 changes: 5 additions & 1 deletion openapi-administration.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-virtual-background"
"blur-virtual-background",
"end-to-end-encryption"
],
"properties": {
"enabled": {
Expand Down Expand Up @@ -199,6 +200,9 @@
},
"blur-virtual-background": {
"type": "boolean"
},
"end-to-end-encryption": {
"type": "boolean"
}
}
},
Expand Down
6 changes: 5 additions & 1 deletion openapi-backend-recording.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-virtual-background"
"blur-virtual-background",
"end-to-end-encryption"
],
"properties": {
"enabled": {
Expand Down Expand Up @@ -132,6 +133,9 @@
},
"blur-virtual-background": {
"type": "boolean"
},
"end-to-end-encryption": {
"type": "boolean"
}
}
},
Expand Down
6 changes: 5 additions & 1 deletion openapi-backend-signaling.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-virtual-background"
"blur-virtual-background",
"end-to-end-encryption"
],
"properties": {
"enabled": {
Expand Down Expand Up @@ -132,6 +133,9 @@
},
"blur-virtual-background": {
"type": "boolean"
},
"end-to-end-encryption": {
"type": "boolean"
}
}
},
Expand Down
6 changes: 5 additions & 1 deletion openapi-backend-sipbridge.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-virtual-background"
"blur-virtual-background",
"end-to-end-encryption"
],
"properties": {
"enabled": {
Expand Down Expand Up @@ -175,6 +176,9 @@
},
"blur-virtual-background": {
"type": "boolean"
},
"end-to-end-encryption": {
"type": "boolean"
}
}
},
Expand Down
6 changes: 5 additions & 1 deletion openapi-bots.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-virtual-background"
"blur-virtual-background",
"end-to-end-encryption"
],
"properties": {
"enabled": {
Expand Down Expand Up @@ -132,6 +133,9 @@
},
"blur-virtual-background": {
"type": "boolean"
},
"end-to-end-encryption": {
"type": "boolean"
}
}
},
Expand Down
6 changes: 5 additions & 1 deletion openapi-federation.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-virtual-background"
"blur-virtual-background",
"end-to-end-encryption"
],
"properties": {
"enabled": {
Expand Down Expand Up @@ -175,6 +176,9 @@
},
"blur-virtual-background": {
"type": "boolean"
},
"end-to-end-encryption": {
"type": "boolean"
}
}
},
Expand Down
6 changes: 5 additions & 1 deletion openapi-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-virtual-background"
"blur-virtual-background",
"end-to-end-encryption"
],
"properties": {
"enabled": {
Expand Down Expand Up @@ -333,6 +334,9 @@
},
"blur-virtual-background": {
"type": "boolean"
},
"end-to-end-encryption": {
"type": "boolean"
}
}
},
Expand Down
6 changes: 5 additions & 1 deletion openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-virtual-background"
"blur-virtual-background",
"end-to-end-encryption"
],
"properties": {
"enabled": {
Expand Down Expand Up @@ -292,6 +293,9 @@
},
"blur-virtual-background": {
"type": "boolean"
},
"end-to-end-encryption": {
"type": "boolean"
}
}
},
Expand Down
1 change: 1 addition & 0 deletions src/types/openapi/openapi-administration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ export type components = {
/** Format: int64 */
"max-duration": number;
"blur-virtual-background": boolean;
"end-to-end-encryption": boolean;
};
chat: {
/** Format: int64 */
Expand Down
1 change: 1 addition & 0 deletions src/types/openapi/openapi-backend-recording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export type components = {
/** Format: int64 */
"max-duration": number;
"blur-virtual-background": boolean;
"end-to-end-encryption": boolean;
};
chat: {
/** Format: int64 */
Expand Down
1 change: 1 addition & 0 deletions src/types/openapi/openapi-backend-signaling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export type components = {
/** Format: int64 */
"max-duration": number;
"blur-virtual-background": boolean;
"end-to-end-encryption": boolean;
};
chat: {
/** Format: int64 */
Expand Down
1 change: 1 addition & 0 deletions src/types/openapi/openapi-backend-sipbridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export type components = {
/** Format: int64 */
"max-duration": number;
"blur-virtual-background": boolean;
"end-to-end-encryption": boolean;
};
chat: {
/** Format: int64 */
Expand Down
1 change: 1 addition & 0 deletions src/types/openapi/openapi-bots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export type components = {
/** Format: int64 */
"max-duration": number;
"blur-virtual-background": boolean;
"end-to-end-encryption": boolean;
};
chat: {
/** Format: int64 */
Expand Down
1 change: 1 addition & 0 deletions src/types/openapi/openapi-federation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ export type components = {
/** Format: int64 */
"max-duration": number;
"blur-virtual-background": boolean;
"end-to-end-encryption": boolean;
};
chat: {
/** Format: int64 */
Expand Down
1 change: 1 addition & 0 deletions src/types/openapi/openapi-full.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2015,6 +2015,7 @@ export type components = {
/** Format: int64 */
"max-duration": number;
"blur-virtual-background": boolean;
"end-to-end-encryption": boolean;
};
chat: {
/** Format: int64 */
Expand Down
1 change: 1 addition & 0 deletions src/types/openapi/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,7 @@ export type components = {
/** Format: int64 */
"max-duration": number;
"blur-virtual-background": boolean;
"end-to-end-encryption": boolean;
};
chat: {
/** Format: int64 */
Expand Down

0 comments on commit 164e795

Please sign in to comment.