-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add MLS message API stub * Migration to add conversation epoch * Load and store epoch number * Execute add proposals * Update client membership when executing a proposal When an Add proposal is executed, we check if the list of clients in the conversation consists of exactly the MLS-enabled clients of the given user, and fail the request otherwise. Galley needs to make a request to Brig to fetch an up-to-date list of MLS-enabled clients. This is not yet implemented. Also, all federation behaviour is stubbed out for now. * Stub test for adding a user to an MLS conversation * Simplify conv → group ID mapping Use SHA256, as we are already using it for 1-1 conversations, and there is no need for the length of the group ID to be random. * Pass group id to crypto-cli in base64 * fixup! Update client membership when executing a proposal * Add internal endpoint for fetching mls clients * Test adding unconnected users * Check that join events are returned * Extract client setup in test * Extract group setup in tests * Create more than one client in MLS messaging setup * Test partially adding a user to a conversation * Save MLS clients after adding members This accomplishes two things: - it makes sure that the member records exist before setting the corresponding `mls_clients` field - it prevents clients from being set for members that could not be added to a conversation (for authorisation reasons, say). Also add a test for the case where a new client of an already-present user is added to a conversation. * Clean up Swagger of MLS endpoints * WIP: check message epoch against conversation * Make it possible to setup a proteus conv in tests * Test conversation protocol check * Change endpoint name to `POST /mls/messages` * Fix internal client creation query We need the new `--group-out` option to be able to update the group state after a commit.
- Loading branch information
1 parent
e88f91f
commit 202bda0
Showing
53 changed files
with
1,154 additions
and
297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
MLS implementation progress: | ||
|
||
- commit messages containing add proposals are now processed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | ||
|
||
-- This file is part of the Wire Server implementation. | ||
-- | ||
-- Copyright (C) 2022 Wire Swiss GmbH <[email protected]> | ||
|
@@ -19,7 +21,10 @@ module Wire.API.Conversation.Protocol | |
( ProtocolTag (..), | ||
protocolTag, | ||
protocolTagSchema, | ||
Epoch (..), | ||
Protocol (..), | ||
_ProtocolMLS, | ||
_ProtocolProteus, | ||
protocolSchema, | ||
ConversationMLSData (..), | ||
) | ||
|
@@ -32,14 +37,17 @@ import Data.Schema | |
import Imports | ||
import Wire.API.Arbitrary | ||
import Wire.API.MLS.Group | ||
import Wire.API.MLS.Message | ||
|
||
data ProtocolTag = ProtocolProteusTag | ProtocolMLSTag | ||
deriving stock (Eq, Show, Enum, Bounded, Generic) | ||
deriving (Arbitrary) via GenericUniform ProtocolTag | ||
|
||
data ConversationMLSData = ConversationMLSData | ||
{ -- | The MLS group ID associated to the conversation. | ||
cnvmlsGroupId :: GroupId | ||
cnvmlsGroupId :: GroupId, | ||
-- | The current epoch number of the corresponding MLS group. | ||
cnvmlsEpoch :: Epoch | ||
} | ||
deriving stock (Eq, Show, Generic) | ||
deriving (Arbitrary) via GenericUniform ConversationMLSData | ||
|
@@ -94,3 +102,8 @@ mlsDataSchema = | |
"group_id" | ||
(description ?~ "An MLS group identifier (at most 256 bytes long)") | ||
schema | ||
<*> cnvmlsEpoch | ||
.= fieldWithDocModifier | ||
"epoch" | ||
(description ?~ "The epoch number of the corresponding MLS group") | ||
schema |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.