awslabs / mls-rs

An implementation of Messaging Layer Security (RFC 9420)
Apache License 2.0
104 stars 19 forks source link

[1.x] `Replace Client::load_group` with `Client::resume_group` #218

Open tomleavy opened 4 days ago

tomleavy commented 4 days ago

Background

Part of #211

Before (0.x)

// Make a group state store that conforms to the GroupStateStorage trait
let group_state_store = MyGroupStateStore::new();

let client = Client::builder()
    .group_state_storage(group_state_store) // Transfer the ownership of the group state storage
    ....
    .build();

let group = client.load_group(b"foo").unwrap();

In the above, load_group first calls GroupStateStorage::state to load the group state matching group id "foo".

After (1.x)

Resume Group API

Instead of calling the storage interface internally, the resume_group function will take a pre-loaded GroupState that was previously recorded by calling Group::export_state_update as described in #212.

Calling resume_group does not load any prior epoch data. Data from prior epochs will be provided if necessary as part of processing an inbound message.