-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove test only distinction for group_context_ext_proposal #22
Changes from 3 commits
fa33f5e
c6bc4cd
8c58f21
7ed6765
7395004
eca0be9
58b8bde
88bf75c
ad48359
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
use core_group::create_commit_params::CreateCommitParams; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is really just a stylistic nitpick, but I'd suggest merging this line back into the If you need the use super::{
core_group::{self, create_commit_params::CreateCommitParams},
// ...
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks fixed here 7395004 |
||
use openmls_traits::{ | ||
key_store::OpenMlsKeyStore, signatures::Signer, types::Ciphersuite, OpenMlsProvider, | ||
}; | ||
|
||
use super::{ | ||
errors::{ProposalError, ProposeAddMemberError, ProposeRemoveMemberError}, | ||
MlsGroup, | ||
core_group, errors::{ProposalError, ProposeAddMemberError, ProposeRemoveMemberError}, CreateGroupContextExtProposalError, GroupContextExtensionProposal, GroupContextExtensionsProposalValidationError, MlsGroup, MlsGroupState, PendingCommitState, Proposal | ||
}; | ||
use crate::{ | ||
binary_tree::LeafNodeIndex, | ||
|
@@ -14,7 +14,7 @@ use crate::{ | |
framing::MlsMessageOut, | ||
group::{errors::CreateAddProposalError, GroupId, QueuedProposal}, | ||
key_packages::KeyPackage, | ||
messages::proposals::ProposalOrRefType, | ||
messages::{group_info::GroupInfo, proposals::ProposalOrRefType}, | ||
prelude::LibraryError, | ||
schedule::PreSharedKeyId, | ||
treesync::LeafNode, | ||
|
@@ -319,7 +319,6 @@ impl MlsGroup { | |
} | ||
} | ||
|
||
#[cfg(test)] | ||
pub fn propose_group_context_extensions( | ||
&mut self, | ||
provider: &impl OpenMlsProvider, | ||
|
@@ -350,4 +349,43 @@ impl MlsGroup { | |
|
||
Ok((mls_message, proposal_ref)) | ||
} | ||
|
||
pub fn update_group_context_extensions( | ||
&mut self, | ||
provider: &impl OpenMlsProvider, | ||
extensions: Extensions, | ||
signer: &impl Signer, | ||
) -> Result<(MlsMessageOut, Option<MlsMessageOut>, Option<GroupInfo>), CreateGroupContextExtProposalError> | ||
{ | ||
self.is_operational()?; | ||
|
||
// Create inline add proposals from key packages | ||
let mut inline_proposals = vec![]; | ||
inline_proposals.push(Proposal::GroupContextExtensions(GroupContextExtensionProposal { | ||
extensions, | ||
})); | ||
|
||
let params = CreateCommitParams::builder() | ||
.framing_parameters(self.framing_parameters()) | ||
.proposal_store(&self.proposal_store) | ||
.inline_proposals(inline_proposals) | ||
.build(); | ||
let create_commit_result = self.group.create_commit(params, provider, signer).unwrap(); | ||
|
||
let mls_messages = self.content_to_mls_message(create_commit_result.commit, provider)?; | ||
self.group_state = MlsGroupState::PendingCommit(Box::new(PendingCommitState::Member( | ||
create_commit_result.staged_commit, | ||
))); | ||
|
||
// Since the state of the group might be changed, arm the state flag | ||
self.flag_state_change(); | ||
|
||
Ok(( | ||
mls_messages, | ||
create_commit_result | ||
.welcome_option | ||
.map(|w| MlsMessageOut::from_welcome(w, self.group.version())), | ||
create_commit_result.group_info, | ||
)) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I need this for some work I have coming up too