-
Notifications
You must be signed in to change notification settings - Fork 240
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
feat(crypto): Customized event types #767
Conversation
Codecov Report
@@ Coverage Diff @@
## main #767 +/- ##
==========================================
+ Coverage 77.92% 77.95% +0.02%
==========================================
Files 92 96 +4
Lines 13930 14088 +158
==========================================
+ Hits 10855 10982 +127
- Misses 3075 3106 +31
Continue to review full report at Codecov.
|
@@ -763,7 +761,7 @@ impl GossipMachine { | |||
&self, | |||
sender_key: &str, | |||
event: &mut SecretSendEvent, |
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.
Why is this code working with mutable events in the first place? That strikes me as a little odd.
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.
This is explained here:
https://github.com/matrix-org/matrix-rust-sdk/pull/767/files#diff-723b3a87aa508f41a037f9c4222c6c2e125abca051e3d60c43cb99e275ebcfe7R783=
// Set the secret name so other consumers of the event know
// what this event is about.
That event type doesn't really carry enough information to let users know what the secret is about. You only get to know this via previous state, from the time you made the request.
For convenience we set the secret name.
|
||
/// An enum over the various to-device events we support. | ||
#[derive(Debug)] | ||
pub enum ToDeviceEvents { |
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.
Since this is not a collection type (i.e. an instance only contains one event), its name should be singular, right? We could use the same naming as Ruma (AnyToDeviceEvent
).
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.
I agree, but having two AnyToDeviceEvent
types in the crate would confuse me to no end. Eventually we'll use only our customized one in the matrix-sdk-crypto
crate and we'll rename it then.
So bear with me until we get to that point.
3e98583
to
f8ab926
Compare
Rebased onto main to get CI going. |
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.
Looks good to me, thanks for having taking time to do it.
This patch adds customized event types, currently only for the m.room_key and m.secret.send to-device events. This allows us to: a) Deserialize the session_key field into a vodozemac type b) Control when we zeroize secrets better
4a198d1
to
e6bde16
Compare
This patch adds customized event types, currently only for the m.room_key and m.secret.send to-device events.
This allows us to:
a) Deserialize the session_key field into a vodozemac type
b) Control when we zeroize secrets better