* Remove serde(skip_serializing_if = ...) attribute from chunk response field
* Make the start response field required by changing its type from
Option<String> to String
When a `UserId` was created via `parse_with_server_name` (and its
variants), the localpart was not validated. This lead to invalid user
ids being constructed and lead to a crash when `is_historical` was
called.
This changes will prevent that this invalid user is can be constructed.
This implements support for MSC2732[1], fallback keys. Only support to
upload and get notifications about fallback keys via `/sync` is
implemented.
[1]: https://github.com/matrix-org/matrix-doc/pull/2732
Similarly to the way structs holding public keys require signature
verification, the BackupAlgorithm struct may require verification as
well.
This lets users know if a certain device trusts the BackupAlgorithm and
if it should be used to upload room keys to the backup.
Uploaded objects holding public keys tend to have the object signed by
the very same key that is part of the object. Users that download such
public keys are expected to verify the signature to confirm that the
public key and its surrounding fields in the object have not been
manipulated with.
The SignedKey, DeviceKeys, and CrossSigningKey structs
perform a lossy variant of deserialization, which removes the ability to
verify signatures of the aforementioned objects.
This patch changes the response types to a Raw variant, which let's the
user decide how to deserialize.
Gets rid of unnecessary copying and makes things more explicit by using
a struct with named fields instead of a tuple for tie breaking.
Co-authored-by: Jonathan de Jong <jonathan@automatia.nl>
It is easy to turn it into an owned value through `.to_owned()`.
The reverse was not possible without tying the reference to the lifetime
of a temporary variable.