pub enum ProcessedMessageContent {
ApplicationMessage(ApplicationMessage),
ProposalMessage(Box<QueuedProposal>),
ExternalJoinProposalMessage(Box<QueuedProposal>),
StagedCommitMessage(Box<StagedCommit>),
OwnPendingCommit,
OwnPrivateMessage,
UnresolvedAppDataCommit(Box<UnresolvedAppDataCommit>),
}Expand description
Content of a processed message.
See the content variants’ documentation for more information.
StagedCommit and QueuedProposal can be inspected for authorization purposes.
Variants§
ApplicationMessage(ApplicationMessage)
An application message.
The ApplicationMessage contains a vector of bytes that can be used right-away.
ProposalMessage(Box<QueuedProposal>)
A standalone proposal.
The QueuedProposal can be inspected for authorization purposes by the application.
If the proposal is deemed to be allowed, it should be added to the group’s proposal
queue using MlsGroup::store_pending_proposal().
ExternalJoinProposalMessage(Box<QueuedProposal>)
An external join proposal sent by a NewMemberProposal sender which is outside the group.
Since this originates from a party outside the group, the QueuedProposal SHOULD be
inspected for authorization purposes by the application. If the proposal is deemed to be
allowed, it should be added to the group’s proposal queue using
MlsGroup::store_pending_proposal().
StagedCommitMessage(Box<StagedCommit>)
A Commit message.
The StagedCommit can be inspected for authorization purposes by the application.
If the type of the commit and the proposals it covers are deemed to be allowed,
the commit should be merged into the group’s state using
MlsGroup::merge_staged_commit().
OwnPendingCommit
A Commit authored by this client that it got fanned out by the delivery service, matching the group’s pending commit.
This is returned instead of
StagedCommitMessage when the processed
Commit was created by this client and matches the group’s pending commit.
Since this client already holds the corresponding pending commit, the
incoming Commit is not staged. To apply it, merge the pending commit
using
MlsGroup::merge_pending_commit().
An own Commit that does not match the pending commit is instead returned
as a StagedCommitMessage (if it has no
UpdatePath) or rejected (if it has an UpdatePath we cannot decrypt).
The match against the pending commit is established by comparing the confirmation tag of the incoming Commit against the one stored with the pending commit. The message signature has already been verified, which authenticates the Commit as ours, and a matching confirmation tag binds the confirmed transcript hash of the new epoch. We do not otherwise compare the contents of the incoming Commit against the pending commit, and the incoming Commit’s state is never adopted.
This is only produced for Commits framed as
PublicMessage. A
Commit framed as a
PrivateMessage
cannot be decrypted by its own author and instead surfaces as
OwnPrivateMessage. The exception is the
virtual-clients-draft feature, where an own private Commit whose
encryption secret is still retained (not yet confirmed) decrypts and
can produce this variant as well. Under that feature the pending-commit
match is checked before any sibling-commit (virtual clients) material is
loaded, so an own Commit fanned back by the delivery service surfaces as
OwnPendingCommit without consuming an operation-secret generation from
the emulation epoch’s operation secret tree.
OwnPrivateMessage
A PrivateMessage whose sender data claims this client’s own leaf index, i.e. a message this client authored that the delivery service fanned back.
The content cannot be decrypted (the own sender ratchet is encryption-only) and the signature cannot be verified.
Applications should treat this variant as a hint to skip the message.
The content type of the incoming message (application/proposal/commit)
is available via ProtocolMessage::content_type() before processing,
and is unauthenticated plaintext in the PrivateMessage framing.
With the virtual-clients-draft feature, own-leaf messages are
decryptable while their secrets are retained: unconfirmed own sends
and messages from sibling emulator clients decrypt and process
normally. This variant is then only returned in groups that do not
use virtual clients (no emulation state registered for the message’s
epoch), when decryption of an own message fails, e.g. because the
send was already confirmed via
MlsGroup::confirm_application_message().
UnresolvedAppDataCommit(Box<UnresolvedAppDataCommit>)
extensions-draft only.A Commit message covering AppDataUpdate proposals.
The proposals carry diffs in an application-defined format, so the
commit cannot be staged before the application has interpreted them and
computed the resulting dictionary entries. Inspect the proposals via
UnresolvedAppDataCommit::app_data_update_proposals(), compute the
updates with the help of
MlsGroup::app_data_dictionary_updater()
and resume staging via
MlsGroup::stage_app_data_commit().
This variant is likewise returned by
PublicGroup::process_message(),
where the updates are computed with
PublicGroup::app_data_dictionary_updater()
and staging resumes via
PublicGroup::stage_app_data_commit().
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProcessedMessageContent
impl RefUnwindSafe for ProcessedMessageContent
impl Send for ProcessedMessageContent
impl Sync for ProcessedMessageContent
impl Unpin for ProcessedMessageContent
impl UnsafeUnpin for ProcessedMessageContent
impl UnwindSafe for ProcessedMessageContent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more