You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Make a key package store that conforms to the KeyPackageStorage traitlet psk_store = MyPskStore::new();let client = Client::builder().pre_shared_key_storage(psk_store)// Transfer the ownership of the PSK repo to a client via the ClientBuilder
.....build();// Load group from storage, transfer ownership of the PSK repo from client to group.let group = client.load_group(group_id).unwrap();// Process commit. Internally retrieves PSKs from the PSK repo
client.process_message(commit).unwrap();
After (1.x)
Process Commit API
let psk_store = MyPskStore::new();let message_description = commit.description();letMlsMessageDescription::ProtocolMessage{
group_id,
epoch_id,
content_type,} = message_description
else {// Handle the case where this is not a protocol message};if content_type != ContentType::Commit{// Handle the case where this is not a Commit message}// Load group from storage. No PSK storage specific configuration.let group_store = MyGroupStore::new();let group_state = group_store.get(group_id, epoch_id).unwrap();letmut group = Client::resume_group(group_state).unwrap();// Process commit. If commit is encrypted, this function decrypts it. This allows to access encrypted PSK IDslet processor = group.commit_processor(commit).unwrap();// Independently retrieve PSKslet psks = psk_store.get(processor.psk_ids()).unwrap();// Filter proposals// Note to myself : processor should have validated that custom proposal types are supportedlet filtered_proposals = my_proposal_filter(processor.proposals()).unwrap();// Process the commit and transition group to new epoch.
processor
.with_psks(psks).with_proposals_override(filtered_proposals).process().unwrap();
Background:
Part of #211
Before (0.x)
Process Commit API
After (1.x)
Process Commit API
The text was updated successfully, but these errors were encountered: