integration-0.1.0
Safe HaskellSafe-Inferred
LanguageGHC2021

MLS.Util

Synopsis

Documentation

data InitMLSClient Source #

Constructors

InitMLSClient 

Instances

Instances details
Default InitMLSClient Source # 
Instance details

Defined in MLS.Util

createMLSClient :: (MakesValue u, HasCallStack) => InitMLSClient -> u -> App ClientIdentity Source #

Create new mls client and register with backend.

uploadNewKeyPackage :: HasCallStack => ClientIdentity -> App String Source #

create and upload to backend

createNewGroup :: HasCallStack => ClientIdentity -> App (String, Value) Source #

Create conversation and corresponding group.

createSelfGroup :: HasCallStack => ClientIdentity -> App (String, Value) Source #

Retrieve self conversation and create the corresponding group.

createGroup :: MakesValue conv => ClientIdentity -> conv -> App () Source #

resetOne2OneGroup :: (HasCallStack, MakesValue one2OneConv) => ClientIdentity -> one2OneConv -> App () Source #

resetOne2OneGroupGeneric :: (HasCallStack, MakesValue conv, MakesValue keys) => ClientIdentity -> conv -> keys -> App () Source #

Useful when keys are to be taken from main conv and the conv here is the subconv

createAddCommit :: HasCallStack => ClientIdentity -> [Value] -> App MessagePackage Source #

Claim keypackages and create a commit/welcome pair on a given client. Note that this alters the state of the group immediately. If we want to test a scenario where the commit is rejected by the backend, we can restore the group to the previous state by using an older version of the group file.

eventSubConv :: HasCallStack => MakesValue event => event -> App Value Source #

Extract a conversation ID (including an optional subconversation) from an event object.

consumeMessage :: HasCallStack => ClientIdentity -> Maybe MessagePackage -> WebSocket -> App Value Source #

Get a single MLS message from a websocket and consume it. Return a JSON representation of the message.

consumeMessageNoExternal :: HasCallStack => ClientIdentity -> Maybe MessagePackage -> WebSocket -> App Value Source #

like consumeMessage but will not consume a message where the sender is the backend

sendAndConsumeMessage :: HasCallStack => MessagePackage -> App Value Source #

Send an MLS message, wait for clients to receive it, then consume it on the client side. If the message is a commit, the sendAndConsumeCommitBundle function should be used instead.

sendAndConsumeCommitBundle :: HasCallStack => MessagePackage -> App Value Source #

Send an MLS commit bundle, wait for clients to receive it, consume it, and update the test state accordingly.