Commit Graph

272 Commits (cf9ecbd0e85e03bbb020582e314d9122d7478df1)

Author SHA1 Message Date
Damir Jelić 01664bc613 async_client: Allow the content and event type to be overridden when sending messages. 2020-04-09 16:26:00 +02:00
Damir Jelić dc2983d9a2 crypto: Add initial support to encrypt messages. 2020-04-09 16:24:40 +02:00
Damir Jelić a5f43db859 crypto: Add some more methods to the group session wrapper. 2020-04-09 16:23:24 +02:00
Damir Jelić b4de95185d device: Change to the higher level ruma types for device ids. 2020-04-09 16:22:25 +02:00
Damir Jelić 2c7115da84 async_client: Use a UUID for the transaction id. 2020-04-09 16:19:32 +02:00
Damir Jelić f19e251de1 crypto: Add some initial code for megolm session sharing. 2020-04-08 15:06:57 +02:00
Damir Jelić 816295cd48 crytpo: Add a wrapper for outbound megolm sessions. 2020-04-08 15:05:57 +02:00
Devin R 2137d198fc remove internal assertions in favor of returning clients and rooms 2020-04-07 16:11:35 -04:00
Devin R 4dbc0aaad6 clean up, cargo fmt/clippy, add example/TestRunner tests 2020-04-07 08:55:42 -04:00
Devin R f635fbe0cf note about async client test runner 2020-04-06 21:01:48 -04:00
Devin R 9ffe7cca10 more work needed for AsyncClient test runner 2020-04-06 20:59:44 -04:00
Devin R 78f92130fa add individual events for tests, working TestRunner 2020-04-06 15:29:38 -04:00
Devin R 854948fc6d generic add event 2020-04-06 09:11:38 -04:00
Devin R 00ac6d08f9 bring over test builder 2020-04-06 07:13:45 -04:00
Devin R c2b3210cc9 cargo fmt/clippy, move power levels into Room 2020-04-05 12:41:00 -04:00
Devin R e987a9006b remove User and merge fields into RoomMember 2020-04-05 08:34:02 -04:00
Devin R 25a3533792 don't unwrap UserId from state key 2020-04-05 08:23:59 -04:00
Devin R eff322c0c5 crypto compiles, tests pass 2020-04-03 11:00:37 -04:00
Devin R db62c1fa25 cargo fmt/clippy no more warnings 2020-04-03 09:14:46 -04:00
Devin R 4ac9153be1 use RoomId and UserId over string, use setter method names in Room 2020-04-03 09:07:40 -04:00
Damir Jelić 74f1a21e42 rust-sdk: Updates for the new ruma crate versions. 2020-04-03 14:09:56 +02:00
Damir Jelić 12dc5212e3 rust-sdk: Remove a bunch of unused imports and unused variables. 2020-04-03 12:34:05 +02:00
Damir Jelić 294ca108bb rust-sdk: Move some encryption specific imports under a cfg. 2020-04-03 10:42:03 +02:00
Damir Jelić 7c6d0d14dd crypto: Fix the sqlite tests. 2020-04-03 10:39:07 +02:00
Damir Jelić 670761376d async_client: Claim keys for missing sessions if we try to send in an encrypted room. 2020-04-03 10:30:32 +02:00
Damir Jelić 2dd84517b9 crypto: Expose the key-claiming methods in the clients. 2020-04-03 10:27:30 +02:00
Damir Jelić 3d0829b2a0 crypto: Add the new devices to the store. 2020-04-03 10:21:14 +02:00
Damir Jelić 6fce9b335a crypto: Add a method to check for missing Olm sessions for users. 2020-04-03 10:20:03 +02:00
Damir Jelić ff9bcdddb9 crypto: Use a SignedKey type when creating outbound Olm sessions. 2020-04-03 10:16:20 +02:00
Damir Jelić aa7bedbefd Merge branch 'ev-emitter' 2020-04-03 10:14:40 +02:00
Devin R a96286a5ff remove calculate in docs, fix unused imports 2020-04-02 18:22:52 -04:00
Devin R 187734f449 add test and docs for EventEmitter, fix review issues 2020-04-02 15:59:13 -04:00
Damir Jelić 8d487ac097 crypto: Allow the device store to be cloned. 2020-04-02 17:27:39 +02:00
Damir Jelić 785db205c3 crypto: Add initial key claiming handling. 2020-04-02 16:07:21 +02:00
Damir Jelić 913cc374d0 crypto: Calculate the deleted devices in a key query. 2020-04-02 14:52:15 +02:00
Devin R 55c25ce6ba fix encryption feature Mutex::lock instead of RwLock::read 2020-04-02 07:21:24 -04:00
Devin R c172507b5f cargo fmt/clippy 2020-04-02 07:06:21 -04:00
Damir Jelić 56084a7809 crypto: Initial support for device tracking. 2020-04-02 11:14:23 +02:00
Devin R 2ed152708c use inner event type for EventEmitter methods 2020-04-01 16:36:20 -04:00
Devin R 83bf8bc67c oops replace tracing::debug for crypto features 2020-04-01 16:36:20 -04:00
Devin R 5c418f3420 cargo fmt/clippy 2020-04-01 16:36:20 -04:00
Devin R f2b50677b9 fix example, use tokio::Mutex for all types that could be passed
in async thread spawn envs
2020-04-01 16:36:17 -04:00
Devin R 5612825762 add EventEmitter trait, clean up imports so new warnings are easier to see 2020-04-01 16:35:50 -04:00
Damir Jelić 5e22eb9faf room: Handle encryption events. 2020-04-01 16:06:28 +02:00
Damir Jelić 2020700673 crypto: Prepare the scaffolding for key queries and user tracking. 2020-04-01 15:37:00 +02:00
Damir Jelić fdb2028dfc Merge branch 'room-calculate-name' 2020-04-01 09:39:25 +02:00
Denis Kasak a298b7f9fd
Add Room::calculate_name convenience method.
Signed-off-by: Denis Kasak <dkasak@termina.org.uk>
2020-03-31 23:19:50 +02:00
Damir Jelić 453c9f3be5 Merge branch 'room-name' 2020-03-31 22:07:30 +02:00
Devin R c3f4a946cb remove split on UserId, update tests to correct domain 2020-03-31 15:18:27 -04:00
Damir Jelić 559a5847bb crypto: Implement group session loading for the sqlite store. 2020-03-31 16:22:45 +02:00
Devin R df58c60d2e add tests in models files, run coverage 2020-03-31 09:01:48 -04:00
Damir Jelić 0d183daa3d crypto: Replace the decrypted to-device events in the sync response. 2020-03-31 13:38:44 +02:00
Devin R 0d79c3574e remove base_client method 2020-03-31 07:07:14 -04:00
Devin R 62159cc6dc fix review issues 2020-03-31 06:57:29 -04:00
Devin R 4391fb695e looked over for review 2020-03-30 14:18:08 -04:00
Damir Jelić ceeb685e1a crypto: Add the MemoryStore back. 2020-03-30 17:07:36 +02:00
Devin R 705464fb51 added a few todos, cargo fmt/clippy 2020-03-30 07:14:33 -04:00
Devin R 14a8d04a03 account data loop 2020-03-29 16:24:31 -04:00
Devin R c89ae2537e add account data, current room_id calc, unread, push ruleset, ignored users 2020-03-29 15:54:26 -04:00
Devin R 05b6f4679a cargo fmt/clippy 2020-03-29 08:07:25 -04:00
Devin R 4c7acd4b18 clean up presence updating and member state, add_presence_callback method for AsyncClient 2020-03-29 08:05:40 -04:00
Devin R 0147e8c0ac update_member, update_power methods for room_member 2020-03-28 15:05:37 -04:00
Devin R d4c9bb3cec cargo fmt 2020-03-28 09:08:34 -04:00
Devin R 9ee8a2d011 merged add-events, fix a few type changes and merge fails 2020-03-28 08:58:02 -04:00
Devin R b1027796c8 Merge branch 'add-events' into room-name 2020-03-28 08:36:30 -04:00
Devin R bd50e615a7 use tokio::test, cargo fmt/clippy 2020-03-28 08:27:16 -04:00
Devin R b760b32bae fix rebase swap 2020-03-28 08:12:52 -04:00
Devin R bb89db30cb remove unused import 2020-03-28 07:52:25 -04:00
Devin R 7062bdb484 fix slice match room_aliases 2020-03-28 07:47:50 -04:00
Devin R 063d86af71 cargo fmt/clippy 2020-03-28 07:47:50 -04:00
Devin R bcdd81dc8c add test, AsyncClient room name methods 2020-03-28 07:47:50 -04:00
Devin R 011e77cf4b calculate room name internal `Room` method 2020-03-28 07:47:50 -04:00
Devin R e8b5534a71 start handle_power_levels 2020-03-28 07:07:50 -04:00
Devin R 090600e6aa restructure folders, add User, fill out RoomMember, handle prescence. 2020-03-28 06:58:30 -04:00
Devin R c2022180ad fix slice match room_aliases 2020-03-27 20:17:06 -04:00
Devin R 82f8af4c08 cargo fmt/clippy 2020-03-27 17:23:49 -04:00
Devin R a29ae2a62e add test, AsyncClient room name methods 2020-03-27 17:22:11 -04:00
Devin R 20618e7a20 calculate room name internal `Room` method 2020-03-27 16:14:16 -04:00
Damir Jelić 85f344c32e crypto: Add the ability to store group sessions to the sqlite store. 2020-03-27 17:01:21 +01:00
Damir Jelić 23065a5aa3 crypto: Use an upsert for the account saving. 2020-03-27 16:01:00 +01:00
Damir Jelić c3654bd03f crypto: More cleanup in the sqlite store. 2020-03-27 14:35:51 +01:00
Damir Jelić e4dcca550c crypto: Move the sessions cache into the cryptostore. 2020-03-27 12:09:54 +01:00
Damir Jelić fca8062da0 crytpo: Implement session storing/loading for the sql store. 2020-03-27 09:24:15 +01:00
Damir Jelić 7595cab178 async_client: Allow setting the initial device display name. 2020-03-27 09:22:29 +01:00
Damir Jelić ddaf630063 crypto: Retire the memory store. 2020-03-26 12:24:53 +01:00
Damir Jelić 485296bc34 async_client: Replace the events with decrypted ones. 2020-03-26 11:23:39 +01:00
Damir Jelić abe13d7a2d crypto: Make the session stores thread safe. 2020-03-26 11:22:40 +01:00
Damir Jelić bb3b59ac37 crypto: Add initial support to decrypt megolm encrypted events. 2020-03-25 15:03:10 +01:00
Damir Jelić ae4d90057a crypto: Wrap inbound group sessions. 2020-03-25 11:32:40 +01:00
Damir Jelić d4f0799e6c crypto: Create inbound sessions from room key events. 2020-03-24 17:25:01 +01:00
Damir Jelić 765108a10c machine: Better room key parsing. 2020-03-24 16:21:06 +01:00
Damir Jelić c72a5defee rust-sdk: Changes for the new ruma-api version. 2020-03-24 16:18:56 +01:00
Damir Jelić 4759dea9bd crypto: Decrypt to-device events. 2020-03-23 16:14:10 +01:00
Damir Jelić 4215f98e91 crypto: Add initial code for olm message decryption. 2020-03-21 16:41:48 +01:00
Damir Jelić 70dda32949 async_client: Don't assume that there are any state events. 2020-03-19 14:17:56 +01:00
Damir Jelić 39dd9280cb rust-sdk: Document our feature flags. 2020-03-19 13:55:58 +01:00
Damir Jelić 426fe1df0f crypto: Propagate a sqlite store error correctly. 2020-03-19 13:55:35 +01:00
Damir Jelić 1b8b3da733 rust-sdk: Add initial tracing/logging setup. 2020-03-19 13:55:04 +01:00
Damir Jelić 6efd216f35 cryptpo: Add test that the account is updated correctly in the store. 2020-03-19 09:39:22 +01:00
Damir Jelić 06722635e7 crypto: Add missing license headers. 2020-03-19 09:37:15 +01:00
Damir Jelić 5adab040e6 crypto: Restore the account if we're using the sqlite store. 2020-03-18 16:05:59 +01:00
Damir Jelić 4aba058695 crypto: Hook up the crypto store to the Olm machine. 2020-03-18 15:50:32 +01:00
Damir Jelić d7ab847b98 store: Loading an account can fail because there is no account. 2020-03-18 14:29:01 +01:00
Damir Jelić 114911f800 base_client: Only import the std Result type if encryption is enabled. 2020-03-18 14:17:22 +01:00
Damir Jelić 7b70cb7e41 rust-sdk: Rework our error handling. 2020-03-18 14:15:56 +01:00
Damir Jelić f517ac6f37 store: Add a store specific error type. 2020-03-18 12:38:47 +01:00
Damir Jelić 6fb29451ce crypto: Add a memory only crypto store. 2020-03-18 10:42:46 +01:00
Damir Jelić 3b1f863419 crypto: Check the shared state of the account when checking for equality. 2020-03-18 10:42:11 +01:00
Damir Jelić 7a11a57b41 crypto: Add initial crypto store. 2020-03-18 09:41:49 +01:00
Damir Jelić 00138f7ae5 crypto: Expose the pickling methods for the account. 2020-03-18 09:38:41 +01:00
Damir Jelić 708a8b1b06 Cargo.toml: Use tokio's delay_for instead of async-std's sleep. 2020-03-16 13:31:03 +01:00
Damir Jelić bd53e18aa9 Cargo.toml: Use the tokio async test macro. 2020-03-16 13:24:54 +01:00
Damir Jelić fb6c6c89e8 crypto: Update to the ruma-event renames. 2020-03-13 16:58:59 +01:00
Damir Jelić 6438444275 base_client: Restore the olm machine if a session given at client creation. 2020-03-12 16:28:02 +01:00
Damir Jelić 545ebe8d9c crytpo: Get the one-time keys count out of the sync response as well. 2020-03-12 16:14:43 +01:00
Damir Jelić 8867b198f7 base_client: Forward the sync response to our olm machine. 2020-03-12 15:41:11 +01:00
Damir Jelić 2b389a8440 crypto: Mark the Account as Send. 2020-03-11 11:44:45 +01:00
Damir Jelić e271b17766 async_client: Upload encryption keys in the sync_forever method. 2020-03-11 11:43:58 +01:00
Damir Jelić 33ee5cce61 async_client: Fix the user agent. 2020-03-11 11:43:31 +01:00
Damir Jelić bc4416e7cd async_client: Add a method to upload encryption keys. 2020-03-11 11:42:59 +01:00
Damir Jelić e7d6a5a834 base_client: Expose some olm machine methods. 2020-03-11 10:10:43 +01:00
Damir Jelić e7b32ea155 crypto: Fix the one-time-key count updating. 2020-03-11 10:09:00 +01:00
Damir Jelić f3816d04f2 base_client: Create a Olm machine after logging in. 2020-03-11 10:08:22 +01:00
Damir Jelić 22a9154bd3 crypto: Expose some sturcts to be used by the clients. 2020-03-11 10:06:33 +01:00
Damir Jelić f15b7cccea crypto: Require a borrow of the user id when creating a new Olm machine. 2020-03-11 10:05:37 +01:00
Damir Jelić 740bc2a6c1 machine: Add a method to get the key tuple that need to be uploaded. 2020-03-10 14:06:30 +01:00
Damir Jelić 3e88839a68 crypto: Use ruma structs for the one-time keys as well. 2020-03-10 13:41:14 +01:00
Damir Jelić 003d514c14 crypto: Use ruma structs to represent the generated device keys. 2020-03-10 13:02:14 +01:00
Damir Jelić c41d3873b6 rust-sdk: Cleanup the docs and fix the examples up. 2020-03-02 11:31:03 +01:00
Damir Jelić de154e272a crypto: Add one-time key signing support. 2020-02-29 11:13:57 +01:00
Damir Jelić 0288376cfe async_client: Add a timeout to the sync forever even if the sync was successful. 2020-02-28 10:33:17 +01:00
Damir Jelić 8181d96bfb crypto: Rename the uploaded key count variable. 2020-02-26 09:36:52 +01:00
Damir Jelić b171f64f1d crypto: Use the serde feature of olm-rs. 2020-02-26 09:18:53 +01:00
Damir Jelić 7605f7e6e8 crypto: Remove a lingering println. 2020-02-25 18:01:49 +01:00
Damir Jelić 92067c400c crypto: Test signature verification with an invalid key. 2020-02-25 17:49:43 +01:00
Damir Jelić 45890a27f3 crypto: Add support for device keys signing. 2020-02-25 17:36:11 +01:00
Damir Jelić 478f0d7784 crypto: Format the repo. 2020-02-25 14:36:09 +01:00
Damir Jelić 15d8de56e1 crypto: Add an initial version of the olm state machine. 2020-02-25 14:24:18 +01:00
Damir Jelić d3903811c6 rust-sdk: Add initial crytpto code. 2020-02-24 17:19:00 +01:00
Damir Jelić f8b76c6af3 test: Use the new library name. 2020-02-24 12:51:42 +01:00
Damir Jelić dee13421f0 rust-sdk: Switch the license to Apache 2.0. 2020-02-21 16:54:05 +01:00
Damir Jelić 98da341a46 Cargo.toml: Bump the dependency versions. 2020-02-21 16:33:41 +01:00
Damir Jelić 63e0191f57 client: Fix clippy warnings. 2020-02-21 14:29:46 +01:00
Damir Jelić 49a24b6305 client: Add missing docs. 2020-02-21 14:29:25 +01:00
Damir Jelić 0a74c943ba async_client: Propagate an error properly. 2020-02-21 12:13:38 +01:00
Damir Jelić 19383fd28c async_client: Add a method to fetch the homeserver. 2020-01-11 22:24:32 +01:00
Damir Jelić 5688b2e70a async_client: Remove the response callbacks. 2019-12-04 22:35:19 +01:00
Damir Jelić e21806f3cc async_client: Add the sync_forever method. 2019-12-04 22:33:26 +01:00
Damir Jelić 41a183b4c0 nio: Upgrade ruma-client-api. 2019-12-04 19:31:33 +01:00
Damir Jelić 38ddad1874 async_client: Properly handle the EventResult for our timeline. 2019-11-26 20:47:02 +01:00