@@ -1050,6 +1050,64 @@ testExternalCommitNewClient = do
1050
1050
1051
1051
-- the list of members should be [alice1, bob1]
1052
1052
1053
+ testExternalCommitNotMember :: TestM ()
1054
+ testExternalCommitNotMember = do
1055
+ [alice, bob] <- createAndConnectUsers (replicate 2 Nothing )
1056
+
1057
+ runMLSTest $ do
1058
+ [alice1, alice2, bob1] <- traverse createMLSClient [alice, alice, bob]
1059
+ traverse_ uploadNewKeyPackage [bob1, alice2]
1060
+ (_, qcnv) <- setupMLSGroup alice1
1061
+
1062
+ -- so that we have the public group state
1063
+ void $ createAddCommit alice1 [alice] >>= sendAndConsumeCommitBundle
1064
+
1065
+ pgs <-
1066
+ LBS. toStrict . fromJust . responseBody
1067
+ <$> getGroupInfo (ciUser alice1) qcnv
1068
+ mp <- createExternalCommit bob1 (Just pgs) qcnv
1069
+ bundle <- createBundle mp
1070
+ postCommitBundle (ciUser (mpSender mp)) bundle
1071
+ !!! const 404 === statusCode
1072
+
1073
+ testExternalCommitSameClient :: TestM ()
1074
+ testExternalCommitSameClient = do
1075
+ [alice, bob] <- createAndConnectUsers (replicate 2 Nothing )
1076
+
1077
+ runMLSTest $ do
1078
+ [alice1, bob1] <- traverse createMLSClient [alice, bob]
1079
+ void $ uploadNewKeyPackage bob1
1080
+ (_, qcnv) <- setupMLSGroup alice1
1081
+ void $ createAddCommit alice1 [bob] >>= sendAndConsumeCommitBundle
1082
+
1083
+ let rejoiner = alice1
1084
+ ecEvents <- createExternalCommit rejoiner Nothing qcnv >>= sendAndConsumeCommitBundle
1085
+ liftIO $
1086
+ assertBool " No events after external commit expected" (null ecEvents)
1087
+
1088
+ message <- createApplicationMessage bob1 " hello"
1089
+ void $ sendAndConsumeMessage message
1090
+
1091
+ testExternalCommitNewClient :: TestM ()
1092
+ testExternalCommitNewClient = do
1093
+ [alice, bob] <- createAndConnectUsers (replicate 2 Nothing )
1094
+
1095
+ runMLSTest $ do
1096
+ [alice1, bob1] <- traverse createMLSClient [alice, bob]
1097
+ void $ uploadNewKeyPackage bob1
1098
+ (_, qcnv) <- setupMLSGroup alice1
1099
+ void $ createAddCommit alice1 [bob] >>= sendAndConsumeCommitBundle
1100
+
1101
+ nc <- createMLSClient bob
1102
+ ecEvents <- createExternalCommit nc Nothing qcnv >>= sendAndConsumeCommitBundle
1103
+ liftIO $
1104
+ assertBool " No events after external commit expected" (null ecEvents)
1105
+
1106
+ message <- createApplicationMessage nc " hello"
1107
+ void $ sendAndConsumeMessage message
1108
+
1109
+ -- the list of members should be [alice1, bob1]
1110
+
1053
1111
testAppMessage :: TestM ()
1054
1112
testAppMessage = do
1055
1113
users@ (alice : _) <- createAndConnectUsers (replicate 4 Nothing )
0 commit comments