Commit Graph

2112 Commits

Author SHA1 Message Date
Denis Kasak
fdbed7fbf8 docs(crypto): Add room key sharing decision tree to the docs. 2021-10-04 14:48:12 +02:00
Denis Kasak
f2c0abeb58 Add decision tree rendering of the algorithm. 2021-10-04 12:51:16 +02:00
Denis Kasak
671efb2313 Await result. 2021-10-04 11:13:02 +02:00
Denis Kasak
da052ed9aa clippy fix 2021-10-04 11:12:46 +02:00
Denis Kasak
49e722ffbf cargo fmt 2021-10-04 10:57:11 +02:00
Denis Kasak
de2e2539b7 Write a test.
Signed-off-by: Denis Kasak <dkasak@termina.org.uk>
2021-10-04 10:51:31 +02:00
Denis Kasak
5f87ccdcd9 Explain return value in the docstring.
Signed-off-by: Denis Kasak <dkasak@termina.org.uk>
2021-10-04 10:51:31 +02:00
Denis Kasak
bf2195b999 crypto: Share all indices with own trusted devices.
This fixes an edge case in the key sharing decision algorithm in which
your own trusted devices could be getting a limited session upon a
reshare. It also simplifies the algorithm a bit by bringing the check
for an own and trusted device to the start.

If the requesting device is a trusted/verified device of our own, we
share the session in full, regardless of whether we've previously shared
with that device and at which index. Otherwise, we do the "have we
shared previously" check via the outbound session and only share from
the index it was originally shared at, as before.

Signed-off-by: Denis Kasak <dkasak@termina.org.uk>
2021-10-04 10:45:25 +02:00
Damir Jelić
3042209cf6 crypto: Check that the event was encrypted for the right room 2021-09-21 17:27:31 +02:00
Damir Jelić
87728268e2 crypto: Don't borrow the plaintext to later clone it 2021-09-21 16:48:42 +02:00
Jonas Platte
bbbd5648e0 Fix comment typos 2021-09-21 15:36:04 +02:00
Jonas Platte
b813735dd2 Remove unused dev-dependency 2021-09-21 15:24:55 +02:00
Jonas Platte
871a245702 crypto: Avoid unnecessary event serialization 2021-09-21 15:20:02 +02:00
Jonas Platte
f783fb9830 Fix typo: Missmatched => Mismatched 2021-09-21 15:19:21 +02:00
Damir Jelić
fa5aea2ca1 Merge branch 'fix-anyhow-feature' 2021-09-21 14:54:40 +02:00
Jonas Platte
2128d0bfcc CI: Use Nightly Clippy 2021-09-21 13:12:46 +02:00
Jonas Platte
42061c9bf5 CI: Run clippy on more (Cargo) targets 2021-09-21 13:12:34 +02:00
Jonas Platte
d0851c8a9e Fix new (Nightly) Clippy warnings 2021-09-21 13:11:53 +02:00
Jonas Platte
0817bc490e Add missing required-features for examples 2021-09-21 13:11:31 +02:00
Jonas Platte
3621b62418 Fix Client::register future not being Send under warp feature
Caused by https://github.com/tokio-rs/tracing/issues/1487.
2021-09-21 13:07:40 +02:00
Jonas Platte
cbc0739041 Re-export anyhow and eyre features from matrix-sdk-appservice 2021-09-21 11:59:47 +02:00
Jonas Platte
f752bded4b Add eyre feature to matrix-sdk 2021-09-21 11:59:47 +02:00
Jonas Platte
6cbb07bc2d Fix broken anyhow feature 2021-09-21 11:59:15 +02:00
Damir Jelić
4d048934e6 Merge branch 'master-rename' 2021-09-20 11:18:17 +02:00
Damir Jelić
544a66fa34 chore: Rename the master branch 2021-09-20 10:09:40 +02:00
Jonas Platte
533c86d285 Run event / notification handler callbacks in order 2021-09-17 20:46:32 +02:00
Damir Jelić
15e9d03c2c fix(sdk): Don't retry requests in the tests
Since now sync_once() sends out E2EE requests after the sync and our
tests only set up the `/sync` endpoint using mockito we're going to be
stuck in a retry loop trying to send out the mentioned requests.

It's fine to disable request retrying and let those requests fail.
2021-09-17 20:19:13 +02:00
Damir Jelić
ef3f827769 docs(sdk): Fix a typo 2021-09-17 20:18:42 +02:00
Damir Jelić
d34b83851f feat(sdk): Add a getter for the Session 2021-09-17 20:18:17 +02:00
Damir Jelić
61eefbbadd docs(sdk): Fix some doc links. 2021-09-17 11:10:18 +02:00
Damir Jelić
544d15c574 docs(sdk): Improve a bunch of Client docs 2021-09-17 11:10:18 +02:00
Damir Jelić
8ed06883f6 fix(sdk): Don't take ownership of the user id when logging in using SSO 2021-09-17 11:10:18 +02:00
Damir Jelić
39edd32072 feat(sdk): Add a method to sync as an async stream 2021-09-17 10:54:20 +02:00
Damir Jelić
051d935b28 docs(sdk): Add better docs and examples to the sync methods 2021-09-17 10:54:20 +02:00
Damir Jelić
37904007bb feat(sdk): Send the outgoing E2EE requests out concurrently 2021-09-16 15:43:50 +02:00
Damir Jelić
3dc9f78051 fix(sdk): Move the crypto plumbing in the sync to the sync_once method
This would allow people to avoid the `sync()` method and let them drive
their own syncs.

Until now using `sync()` only would mean that the crypto requests would
never have been sent out.
2021-09-16 14:36:16 +02:00
Damir Jelić
729a29352b chore(sdk): Move the crypto plumbing of the sync into a separate method 2021-09-16 14:14:37 +02:00
Damir Jelić
626f4b92b5 chore(sdk): Remove some unwraps 2021-09-16 14:06:44 +02:00
Damir Jelić
fa6230a08a fix(sdk): Use a better variable name for the file when uploading 2021-09-15 22:08:45 +02:00
Damir Jelić
866ab33c45 chore: Remove some unneeded clippy silences 2021-09-15 20:48:15 +02:00
Damir Jelić
7764f01b59 fix(crypto): Only send cancellations if there were multiple request recipients 2021-09-15 20:28:16 +02:00
Damir Jelić
ff9bb94ab4 docs(sdk): Simplify the event sending examples 2021-09-15 20:27:36 +02:00
Damir Jelić
28412344d5 docs(sdk): Fix the link to the examples dir 2021-09-15 14:20:14 +02:00
Damir Jelić
bae6b33497 feat(sdk): Add the ability to send out custom message events 2021-09-15 14:20:14 +02:00
Damir Jelić
7a21bdd573 docs(sdk): Fix a small typo 2021-09-15 10:36:58 +02:00
Damir Jelić
43011261a8 fix(sdk): Remove the room_send method from the Client
This method is a bit dangerous if the room is encrypted, e.g. people can
send events before the room state has been fetched and thus accidentally
send out unencrypted events in an encrypted room.
2021-09-15 10:36:58 +02:00
Damir Jelić
d8b60dfe55 feat(sdk): Add support to send out custom state events 2021-09-14 23:36:09 +02:00
Damir Jelić
70ab0f446d chore: Sort the deps in our Cargo.toml files 2021-09-14 16:38:33 +02:00
Damir Jelić
af74988a83 chore: Rename the crate folders to use dashes instead of underscores 2021-09-14 16:38:33 +02:00
Damir Jelić
31b7063e68 docs(sdk): Remove unwraps from the joined room doc examples 2021-09-14 16:38:33 +02:00