test-utils) only.Expand description
This crate provides a framework to set up clients and groups using the
OpenMLS mls_group API. To use the framework, start by creating a new
TestSetup with a number of clients. After that, create_clients has to be
called before the the TestSetup can be used.
Note that due to lifetime issues, no new clients can be created after initialization.
After initialization, the TestSetup enables the creation of groups using
create_group, which simply creates a one-member group, or
create_random_group, which creates a group of the given size with random
clients.
Existing groups are represented by the groups field of the TestSetup and
initial members can be instructed to either propose or commit adds, removes
or updates via the corresponding functions of TestSetup. Note, that these
functions require a &Group reference, which can be obtained via the
groups field. When using these functions, the TestSetup fills the role
of the DS and automatically distributes the required KeyPackages and
resulting mls messages to the individual clients. Alternatively, the clients
can be manipulated manually via the Client struct, which contains their
group states.
Modules§
- client
- This module provides the
Clientdatastructure, which contains the state associated with a client in the context of MLS, along with functions to have that client perform certain MLS operations. - errors
Structs§
- Group
- The
Groupstruct represents the “global” shared state of the group. Note, that this state is only consistent if operations are conducted as per spec and messages are distributed correctly to all clients via thedistribute_to_membersfunction ofTestSetup, which also updates thepublic_treefield. - MlsGroup
Test Setup MlsGroupTestSetupis the main struct of the framework. It contains the state of all clients. Thewaiting_for_welcomefield acts as a temporary store forKeyPackages that are used to add new members to groups. Note, that theMlsGroupTestSetupcan only be initialized with a fixed number of clients and thatcreate_clientshas to be called before it can be otherwise used.