Skip to content

Implementation of server_remove proposal #280

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

emarteca
Copy link
Contributor

@emarteca emarteca commented May 1, 2025

Implementation of the server_remove proposal, corresponding to section 7.11.9 of the GSMA RCS spec.

This proposal represents removal prompted by the server. A group member must still both propose and commit it (since the server is not a group member), but it signals that the removal was requested by the server.

The server_remove is a proposal that has the following properties:

  • Extension Value: 0xF004
  • Extension Name: server_remove
  • External: Yes
  • Path Required: Yes

It effectively has all of the same properties and behaves identically to the existing Remove proposal, except that multiple of them can be committed externally.

@emarteca emarteca requested a review from a team as a code owner May 1, 2025 07:58
@emarteca emarteca changed the title Server remove proposal Implementation of server_remove proposal May 1, 2025
Copy link
Contributor

@mulmarta mulmarta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have two general questions:

  1. How is server remove different than normal MLS remove sent by an external sender?
  2. Is serialization the reason why the mls-rs custom proposal mechanism cannot be used for this?

Comment on lines 25 to +26
self_remove_proposal = []
server_remove_proposal = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be just a GSMA feature?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is a good idea.

Comment on lines +1084 to +1103
pub async fn propose_server_remove(
&mut self,
index: u32,
authenticated_data: Vec<u8>,
) -> Result<MlsMessage, MlsError> {
let proposal = self.server_remove_proposal(index)?;
self.proposal_message(proposal, authenticated_data).await
}

#[cfg(feature = "server_remove_proposal")]
#[cfg_attr(feature = "ffi", safer_ffi_gen::safer_ffi_gen_ignore)]
fn server_remove_proposal(&self, index: u32) -> Result<Proposal, MlsError> {
let leaf_index = LeafIndex(index);

// Verify that this leaf is actually in the tree
self.current_epoch_tree().get_leaf_node(leaf_index)?;

Ok(Proposal::ServerRemove(ServerRemoveProposal {
to_remove: leaf_index,
}))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's a server remove, why does the client code need to be able to generate it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the logic flow is a bit odd; but in this model the server is not generating the proposal. Rather, the server signals to the client that the client should remove a member, and then the client has to create the proposal. It's more of a "server said to remove" remove proposal

Comment on lines +365 to +368
fn filter_out_server_remove_if_remove_same_leaf(
strategy: FilterStrategy,
mut proposals: ProposalBundle,
) -> Result<ProposalBundle, MlsError> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That shouldn't happen, no? Server cannot have a leaf or be a committer?

@emarteca
Copy link
Contributor Author

Thanks for the comments, and (like on my other PR), so sorry for the delay in response!

To answer your questions:

  1. In this case, server remove is not actually issued by the server. Rather, the server signals to the client that it should remove a member, but flag it as having been done by the server. It's basically the same code as the Remove proposal, except that there can be more than one in an external commit.
  2. My understanding of the code is that custom proposals could not add/remove members from the tree directly, and we need this proposal to remove the member when it is processed. (basically, we need it to be the exact same as the Remove proposal except with a different ProposalType, and where more than one are allowed in an external commit). Maybe I'm missing something here though?

I'll followup with code changes soon, thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants