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
Add support for authenticated backups (MSC4048) #1677
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
ruma 0.9.2 Upgrade `ruma-events` and re-export its new `unstable-msc3401` feature.
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.
Alright, left a couple of nits. You'll have to add a feature flag for this field, you can take a look at this PR on how to do that: #1605.
crates/ruma-client-api/src/backup.rs
Outdated
@@ -135,11 +139,14 @@ pub struct EncryptedSessionDataInit { | |||
|
|||
/// First 8 bytes of MAC key, encoded in base64. | |||
pub mac: Base64, | |||
|
|||
/// MAC of the key, encoded in base64 |
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 type should not be changed, the point of this type is to have a stable interface and constructor if new fields to the non-init type are added, the docs on the type tell you this as well:
/// This struct will not be updated even if additional fields are added to [
EncryptedSessionData
]
/// in a new (non-breaking) release of the Matrix specification.
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.
Ah, I missed the comment. So, do I create a new ...Init
struct for creating v2 data?
crates/ruma-client-api/src/backup.rs
Outdated
@@ -118,6 +118,10 @@ pub struct EncryptedSessionData { | |||
|
|||
/// First 8 bytes of MAC key, encoded in base64. | |||
pub mac: Base64, | |||
|
|||
/// MAC of the key, encoded in base64 | |||
#[serde(rename = "org.matrix.msc4048.mac2")] |
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 field needs to be feature flagged behind a feature called unstable-msc4048
.
If you need help with this, let me know. Otherwise I'll assume priorities have shifted and will let it sit. |
That isn't the case anymore, |
TODO:
mac
ormac2
is set