From 4c8412f4a1a5e63d212854a6e7a383d6166d9887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Thu, 9 Sep 2021 20:26:09 +0200 Subject: [PATCH 1/9] docs(qrcode): Use the readme for the crate docs --- matrix_qrcode/README.md | 24 +++++------------------- matrix_qrcode/src/lib.rs | 19 +------------------ 2 files changed, 6 insertions(+), 37 deletions(-) diff --git a/matrix_qrcode/README.md b/matrix_qrcode/README.md index 9da0daeb..5f6335fa 100644 --- a/matrix_qrcode/README.md +++ b/matrix_qrcode/README.md @@ -1,28 +1,16 @@ -[![Build Status](https://img.shields.io/travis/matrix-org/matrix-rust-sdk.svg?style=flat-square)](https://travis-ci.org/matrix-org/matrix-rust-sdk) -[![codecov](https://img.shields.io/codecov/c/github/matrix-org/matrix-rust-sdk/master.svg?style=flat-square)](https://codecov.io/gh/matrix-org/matrix-rust-sdk) -[![License](https://img.shields.io/badge/License-Apache%202.0-yellowgreen.svg?style=flat-square)](https://opensource.org/licenses/Apache-2.0) -[![#matrix-rust-sdk](https://img.shields.io/badge/matrix-%23matrix--rust--sdk-blue?style=flat-square)](https://matrix.to/#/#matrix-rust-sdk:matrix.org) - -# matrix-qrcode - **matrix-qrcode** is a crate to easily generate and parse QR codes for interactive verification using [QR codes] in Matrix. -[Matrix]: https://matrix.org/ -[Rust]: https://www.rust-lang.org/ -[QR codes]: https://spec.matrix.org/unstable/client-server-api/#qr-codes - ## Usage This is probably not the crate you are looking for, it's used internally in the -matrix-rust-sdk. +[matrix-sdk]. If you still want to play with QR codes, here are a couple of helpful examples. - ### Decode an image -```rust +```rust,no_run use image; use matrix_qrcode::{QrVerificationData, DecodingError}; @@ -36,7 +24,7 @@ fn main() -> Result<(), DecodingError> { ### Encode into a QR code -```rust +```rust,no_run use matrix_qrcode::{QrVerificationData, DecodingError}; use image::Luma; @@ -56,7 +44,5 @@ fn main() -> Result<(), DecodingError> { } ``` - -## License - -[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0) +[matrix-sdk]: https://github.com/matrix-org/matrix-rust-sdk/ +[QR codes]: https://spec.matrix.org/unstable/client-server-api/#qr-codes diff --git a/matrix_qrcode/src/lib.rs b/matrix_qrcode/src/lib.rs index bf8f18d5..86c34e3a 100644 --- a/matrix_qrcode/src/lib.rs +++ b/matrix_qrcode/src/lib.rs @@ -12,24 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! This crate implements methods to parse and generate QR codes that are used -//! for interactive verification in [Matrix](https://matrix.org/). -//! -//! It implements the QR format defined in the Matrix [spec]. -//! -//! [spec]: https://spec.matrix.org/unstable/client-server-api/#qr-code-format -//! -//! ```no_run -//! # use matrix_qrcode::{QrVerificationData, DecodingError}; -//! # fn main() -> Result<(), DecodingError> { -//! use image; -//! -//! let image = image::open("/path/to/my/image.png").unwrap(); -//! let result = QrVerificationData::from_image(image)?; -//! # Ok(()) -//! # } -//! ``` - +#![doc = include_str!("../README.md")] #![cfg_attr(feature = "docs", feature(doc_cfg))] #![deny( missing_debug_implementations, From 924405270a670e2fd7df7059db44a98f76e88194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Thu, 9 Sep 2021 20:26:53 +0200 Subject: [PATCH 2/9] fix(sdk): Use the markdown feature flag of ruma dirrectly --- matrix_sdk/Cargo.toml | 2 +- matrix_sdk_base/Cargo.toml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/matrix_sdk/Cargo.toml b/matrix_sdk/Cargo.toml index dbcac6f8..5242a7b5 100644 --- a/matrix_sdk/Cargo.toml +++ b/matrix_sdk/Cargo.toml @@ -20,7 +20,7 @@ default = ["encryption", "sled_cryptostore", "sled_state_store", "require_auth_f encryption = ["matrix-sdk-base/encryption"] sled_state_store = ["matrix-sdk-base/sled_state_store"] sled_cryptostore = ["matrix-sdk-base/sled_cryptostore"] -markdown = ["matrix-sdk-base/markdown"] +markdown = ["ruma/markdown"] native-tls = ["reqwest/native-tls"] rustls-tls = ["reqwest/rustls-tls"] socks = ["reqwest/socks"] diff --git a/matrix_sdk_base/Cargo.toml b/matrix_sdk_base/Cargo.toml index 43a3367c..3818b5ab 100644 --- a/matrix_sdk_base/Cargo.toml +++ b/matrix_sdk_base/Cargo.toml @@ -19,7 +19,6 @@ default = [] encryption = ["matrix-sdk-crypto"] sled_state_store = ["sled", "pbkdf2", "hmac", "sha2", "rand", "chacha20poly1305"] sled_cryptostore = ["matrix-sdk-crypto/sled_cryptostore"] -markdown = ["ruma/markdown"] docs = ["encryption", "sled_cryptostore"] From a7b83d9cd10c9c12d4458732b2297700188a97bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Thu, 9 Sep 2021 20:28:14 +0200 Subject: [PATCH 3/9] docs(sdk): Improve the docs docs and use the readme for the crate docs --- matrix_sdk/README.md | 86 ++++++++++++++++++++++++++++++++++++++----- matrix_sdk/src/lib.rs | 42 +-------------------- 2 files changed, 77 insertions(+), 51 deletions(-) diff --git a/matrix_sdk/README.md b/matrix_sdk/README.md index f7a0eac1..6fa378ec 100644 --- a/matrix_sdk/README.md +++ b/matrix_sdk/README.md @@ -1,16 +1,82 @@ -[![Build Status](https://img.shields.io/travis/matrix-org/matrix-rust-sdk.svg?style=flat-square)](https://travis-ci.org/matrix-org/matrix-rust-sdk) -[![codecov](https://img.shields.io/codecov/c/github/matrix-org/matrix-rust-sdk/master.svg?style=flat-square)](https://codecov.io/gh/matrix-org/matrix-rust-sdk) -[![License](https://img.shields.io/badge/License-Apache%202.0-yellowgreen.svg?style=flat-square)](https://opensource.org/licenses/Apache-2.0) -[![#matrix-rust-sdk](https://img.shields.io/badge/matrix-%23matrix--rust--sdk-blue?style=flat-square)](https://matrix.to/#/#matrix-rust-sdk:matrix.org) +A [Matrix](https://matrix.org/) client library written in Rust. -# matrix-sdk +The matrix-sdk aims to be a general purpose client library for writing Matrix +clients, bots, and other Matrix related things that use the client-server API to +communicate with a Matrix homeserver. -**matrix-sdk** is an implementation of a [Matrix][] client-server library in [Rust][]. +# Examples +Connecting and logging in to a homeserver is pretty starightforward: -[Matrix]: https://matrix.org/ -[Rust]: https://www.rust-lang.org/ +```rust,no_run +use std::convert::TryFrom; +use matrix_sdk::{ + Client, SyncSettings, Result, + ruma::{UserId, events::{SyncMessageEvent, room::message::MessageEventContent}}, +}; +#[tokio::main] +async fn main() -> Result<()> { + let alice = UserId::try_from("@alice:example.org")?; + let client = Client::new_from_user_id(alice.clone()).await?; -## License + // First we need to log in. + client.login(alice.localpart(), "password", None, None).await?; -[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0) + client + .register_event_handler( + |ev: SyncMessageEvent| async move { + println!("Received a message {:?}", ev); + }, + ) + .await; + + // Syncing is important to synchronize the client state with the server. + // This method will never return. + client.sync(SyncSettings::default()).await; + + Ok(()) +} +``` + +More examples can be found in the [examples] directory. + +# Crate Feature Flags + +The following crate feature flags are available: + +* `encryption`: Enables end-to-end encryption support in the library. +* `sled_cryptostore`: Enables a Sled based store for the encryption keys. If + this is disabled and `encryption` support is enabled the keys will by + default be stored only in memory and thus lost after the client is + destroyed. +* `markdown`: Support for sending markdown formatted messages. +* `socks`: Enables SOCKS support in reqwest, the default HTTP client. +* `sso_login`: Enables SSO login with a local http server. +* `require_auth_for_profile_requests`: Whether to send the access token in + the authentication header when calling endpoints that retrieve profile + data. This matches the synapse configuration + `require_auth_for_profile_requests`. Enabled by default. +* `appservice`: Enables low-level appservice functionality. For an + high-level API there's the `matrix-sdk-appservice` crate +* `anyhow`: Support for returning `anyhow::Result<()>` from event handlers. + +# Enabling logging + +Users of the matrix-sdk crate can enable log output by depending on the +`tracing-subscriber` crate and including the following line in their +application (e.g. at the start of `main`): + +```rust +tracing_subscriber::fmt::init(); +``` + +The log output is controlled via the `RUST_LOG` environment variable by +setting it to one of the `error`, `warn`, `info`, `debug` or `trace` levels. +The output is printed to stdout. + +The `RUST_LOG` variable also supports a more advanced syntax for filtering +log output more precisely, for instance with crate-level granularity. For +more information on this, check out the [tracing_subscriber documentation]. + +[examples]: https://github.com/matrix-org/matrix-rust-sdk/tree/master/matrix_sdk/examples +[tracing_subscriber documentation]: https://tracing.rs/tracing_subscriber/filter/struct.envfilter diff --git a/matrix_sdk/src/lib.rs b/matrix_sdk/src/lib.rs index e7a5497f..1cfcec8e 100644 --- a/matrix_sdk/src/lib.rs +++ b/matrix_sdk/src/lib.rs @@ -13,47 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! This crate implements a [Matrix](https://matrix.org/) client library. -//! -//! # Enabling logging -//! -//! Users of the matrix-sdk crate can enable log output by depending on the -//! `tracing-subscriber` crate and including the following line in their -//! application (e.g. at the start of `main`): -//! -//! ```rust -//! tracing_subscriber::fmt::init(); -//! ``` -//! -//! The log output is controlled via the `RUST_LOG` environment variable by -//! setting it to one of the `error`, `warn`, `info`, `debug` or `trace` levels. -//! The output is printed to stdout. -//! -//! The `RUST_LOG` variable also supports a more advanced syntax for filtering -//! log output more precisely, for instance with crate-level granularity. For -//! more information on this, check out the [tracing_subscriber -//! documentation](https://tracing.rs/tracing_subscriber/filter/struct.envfilter). -//! -//! # Crate Feature Flags -//! -//! The following crate feature flags are available: -//! -//! * `encryption`: Enables end-to-end encryption support in the library. -//! * `sled_cryptostore`: Enables a Sled based store for the encryption keys. If -//! this is disabled and `encryption` support is enabled the keys will by -//! default be stored only in memory and thus lost after the client is -//! destroyed. -//! * `markdown`: Support for sending markdown formatted messages. -//! * `socks`: Enables SOCKS support in reqwest, the default HTTP client. -//! * `sso_login`: Enables SSO login with a local http server. -//! * `require_auth_for_profile_requests`: Whether to send the access token in -//! the authentication header when calling endpoints that retrieve profile -//! data. This matches the synapse configuration -//! `require_auth_for_profile_requests`. Enabled by default. -//! * `appservice`: Enables low-level appservice functionality. For an -//! high-level API there's the `matrix-sdk-appservice` crate -//! * `anyhow`: Support for returning `anyhow::Result<()>` from event handlers. - +#![doc = include_str!("../README.md")] #![deny( missing_debug_implementations, missing_docs, From 804a94176237ac3a9f3e171fa06c1a2c8db4864e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Thu, 9 Sep 2021 20:29:04 +0200 Subject: [PATCH 4/9] docs(rust): Run the register event handler doc example --- matrix_sdk/src/client.rs | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/matrix_sdk/src/client.rs b/matrix_sdk/src/client.rs index 272c49e3..e1634dda 100644 --- a/matrix_sdk/src/client.rs +++ b/matrix_sdk/src/client.rs @@ -920,8 +920,10 @@ impl Client { /// /// # Examples /// - /// ```no_run - /// # let client: matrix_sdk::Client = unimplemented!(); + /// ``` + /// # use url::Url; + /// # let homeserver = Url::parse("http://localhost:8080").unwrap(); + /// # let client = Client::new(homeserver).unwrap(); /// use matrix_sdk::{ /// room::Room, /// ruma::{ @@ -940,18 +942,21 @@ impl Client { /// # let _ = async { /// client /// .register_event_handler( - /// |ev: SyncMessageEvent, room: Room, client: Client| async move { + /// |ev: SyncMessageEvent, + /// room: Room, + /// client: Client| async move { /// // Common usage: Room event plus room and client. /// }, /// ) /// .await - /// .register_event_handler(|ev: SyncStateEvent| async move { - /// // Also possible: Omit any or all arguments after the first. - /// }) - /// .await; + /// .register_event_handler( + /// |ev: SyncStateEvent| async move { + /// // Also possible: Omit any or all arguments after the first. + /// } + /// ).await; /// - /// // Custom events work exactly the same way, you just need to declare the content struct and - /// // use the EventContent derive macro on it. + /// // Custom events work exactly the same way, you just need to declare + /// // the content struct and use the EventContent derive macro on it. /// #[derive(Clone, Debug, Deserialize, Serialize, EventContent)] /// #[ruma_event(type = "org.shiny_new_2fa.token", kind = Message)] /// struct TokenEventContent { From 913cb39d28a73d464e3ab348a8b7bc891015ac6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Thu, 9 Sep 2021 20:29:28 +0200 Subject: [PATCH 5/9] docs(sdk): Add an example that attaches data to an event handler --- matrix_sdk/src/client.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/matrix_sdk/src/client.rs b/matrix_sdk/src/client.rs index e1634dda..4734ed51 100644 --- a/matrix_sdk/src/client.rs +++ b/matrix_sdk/src/client.rs @@ -970,6 +970,19 @@ impl Client { /// todo!("Display the token"); /// }, /// ).await; + /// + /// // Adding your custom data to the handler can be done as well + /// let data = "MyCustomIdentifier".to_string(); + /// + /// client.register_event_handler({ + /// let data = data.clone(); + /// move |ev: SyncMessageEvent | { + /// let data = data.clone(); + /// async move { + /// println!("Calling the handler with identifier {}", data); + /// } + /// } + /// }).await; /// # }; /// ``` pub async fn register_event_handler(&self, handler: H) -> &Self From 9c62908162210bfb2f0d19697f848ad11eb27423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Thu, 9 Sep 2021 20:30:25 +0200 Subject: [PATCH 6/9] docs(base): Use the readme for the crate docs --- matrix_sdk_base/README.md | 23 +++++++++++------------ matrix_sdk_base/src/lib.rs | 15 ++------------- 2 files changed, 13 insertions(+), 25 deletions(-) diff --git a/matrix_sdk_base/README.md b/matrix_sdk_base/README.md index 9d6609ad..f266252d 100644 --- a/matrix_sdk_base/README.md +++ b/matrix_sdk_base/README.md @@ -1,15 +1,14 @@ -[![Build Status](https://img.shields.io/travis/matrix-org/matrix-rust-sdk.svg?style=flat-square)](https://travis-ci.org/matrix-org/matrix-rust-sdk) -[![codecov](https://img.shields.io/codecov/c/github/matrix-org/matrix-rust-sdk/master.svg?style=flat-square)](https://codecov.io/gh/matrix-org/matrix-rust-sdk) -[![License](https://img.shields.io/badge/License-Apache%202.0-yellowgreen.svg?style=flat-square)](https://opensource.org/licenses/Apache-2.0) -[![#matrix-rust-sdk](https://img.shields.io/badge/matrix-%23matrix--rust--sdk-blue?style=flat-square)](https://matrix.to/#/#matrix-rust-sdk:matrix.org) +This crate implements the base to build a [Matrix](https://matrix.org/) client +library. -# matrix-sdk-base +## Crate Feature Flags -**matrix-rust-sdk** is an implementation of a [Matrix][] client-server library in [Rust][]. +The following crate feature flags are available: -**NOTE:** This is the no IO client state machine, you're -probably interested in the main -[rust-sdk](https://github.com/matrix-org/matrix-rust-sdk/) crate. - -[Matrix]: https://matrix.org/ -[Rust]: https://www.rust-lang.org/ +* `encryption`: Enables end-to-end encryption support in the library. +* `sled_cryptostore`: Enables a Sled based store for the encryption + keys. If this is disabled and `encryption` support is enabled the keys will + by default be stored only in memory and thus lost after the client is + destroyed. +* `sled_state_store`: Enables a Sled based store for the storage of the local + client state. diff --git a/matrix_sdk_base/src/lib.rs b/matrix_sdk_base/src/lib.rs index 0b3c9991..c5ef8128 100644 --- a/matrix_sdk_base/src/lib.rs +++ b/matrix_sdk_base/src/lib.rs @@ -13,18 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! This crate implements a [Matrix](https://matrix.org/) client library. -//! -//! ## Crate Feature Flags -//! -//! The following crate feature flags are available: -//! -//! * `encryption`: Enables end-to-end encryption support in the library. -//! * `sled_cryptostore`: Enables a Sled based store for the encryption -//! keys. If this is disabled and `encryption` support is enabled the keys will -//! by default be stored only in memory and thus lost after the client is -//! destroyed. -//! * `markdown`: Support for sending markdown formatted messages. +#![doc = include_str!("../README.md")] +#![cfg_attr(feature = "docs", feature(doc_cfg))] #![deny( missing_debug_implementations, missing_docs, @@ -34,7 +24,6 @@ unused_import_braces, unused_qualifications )] -#![cfg_attr(feature = "docs", feature(doc_cfg))] pub use matrix_sdk_common::*; From 44dcd1abdf3a55a9437dedd76e89373fac92ffba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Thu, 9 Sep 2021 20:30:51 +0200 Subject: [PATCH 7/9] docs(crypto): Improve the docs and use the readme for the crate docs --- matrix_sdk_crypto/README.md | 50 +++++++++++++++++++++++++++++------- matrix_sdk_crypto/src/lib.rs | 6 ++--- 2 files changed, 43 insertions(+), 13 deletions(-) diff --git a/matrix_sdk_crypto/README.md b/matrix_sdk_crypto/README.md index d44f4f6d..25cbb7b7 100644 --- a/matrix_sdk_crypto/README.md +++ b/matrix_sdk_crypto/README.md @@ -1,14 +1,46 @@ -[![Build Status](https://img.shields.io/travis/matrix-org/matrix-rust-sdk.svg?style=flat-square)](https://travis-ci.org/matrix-org/matrix-rust-sdk) -[![codecov](https://img.shields.io/codecov/c/github/matrix-org/matrix-rust-sdk/master.svg?style=flat-square)](https://codecov.io/gh/matrix-org/matrix-rust-sdk) -[![License](https://img.shields.io/badge/License-Apache%202.0-yellowgreen.svg?style=flat-square)](https://opensource.org/licenses/Apache-2.0) -[![#matrix-rust-sdk](https://img.shields.io/badge/matrix-%23matrix--rust--sdk-blue?style=flat-square)](https://matrix.to/#/#matrix-rust-sdk:matrix.org) +A no-io implementation of a state machine that handles E2EE for [Matrix] clients. -# matrix-sdk-crypto +# Usage -**matrix-rust-sdk** is an implementation of a [Matrix][] client-server library in [Rust][]. +This is probably not the crate you are looking for, it’s used internally in the [matrix-sdk]. -**NOTE:** This is a E2EE implementation for Matrix, you are probably interested in the main -[rust-sdk](https://github.com/matrix-org/matrix-rust-sdk/) crate. +If you're still interested in this crate it can be used to introduce E2EE +support into your client or client library. + +The state machine works in a push/pull manner, you push state changes and events +that we receive from a sync response from the server, and we pull requests that +we need to send to the server out of the state machine. + +```rust,no_run +use std::{collections::BTreeMap, convert::TryFrom}; + +use matrix_sdk_crypto::{OlmMachine, OlmError}; +use ruma::{UserId, api::client::r0::sync::sync_events::{ToDevice, DeviceLists}}; + +#[tokio::main] +async fn main() -> Result<(), OlmError> { + let alice = UserId::try_from("@alice:example.org").unwrap(); + let machine = OlmMachine::new(&alice, "DEVICEID".into()); + + let to_device_events = ToDevice::default(); + let changed_devices = DeviceLists::default(); + let one_time_key_counts = BTreeMap::default(); + + // Push changes that the server sent to us in a sync response. + let decrypted_to_device = machine.receive_sync_changes( + to_device_events, + &changed_devices, + &one_time_key_counts + ).await?; + + // Pull requests that we need to send out. + let outgoing_requests = machine.outgoing_requests().await?; + + // Send the requests here out and call machine.mark_request_as_sent(). + + Ok(()) +} +``` [Matrix]: https://matrix.org/ -[Rust]: https://www.rust-lang.org/ +[matrix-sdk]: https://github.com/matrix-org/matrix-rust-sdk/ diff --git a/matrix_sdk_crypto/src/lib.rs b/matrix_sdk_crypto/src/lib.rs index f78bf857..8080cb22 100644 --- a/matrix_sdk_crypto/src/lib.rs +++ b/matrix_sdk_crypto/src/lib.rs @@ -12,9 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! This is the encryption part of the matrix-sdk. It contains a state machine -//! that will aid in adding encryption support to a client library. - +#![doc = include_str!("../README.md")] +#![cfg_attr(feature = "docs", feature(doc_cfg))] #![deny( missing_debug_implementations, dead_code, @@ -25,7 +24,6 @@ unused_import_braces, unused_qualifications )] -#![cfg_attr(feature = "docs", feature(doc_cfg))] mod error; mod file_encryption; From 018544b7752c3ccce0f17dac7f0ae99198904553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Thu, 9 Sep 2021 20:32:37 +0200 Subject: [PATCH 8/9] fix(crypto): Remove some dead code --- matrix_sdk_crypto/src/machine.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/matrix_sdk_crypto/src/machine.rs b/matrix_sdk_crypto/src/machine.rs index 9b098e9e..f458e936 100644 --- a/matrix_sdk_crypto/src/machine.rs +++ b/matrix_sdk_crypto/src/machine.rs @@ -102,7 +102,6 @@ pub struct OlmMachine { /// State machine handling public user identities and devices, keeping track /// of when a key query needs to be done and handling one. identity_manager: IdentityManager, - cross_signing_request: Arc>>, } #[cfg(not(tarpaulin_include))] @@ -190,7 +189,6 @@ impl OlmMachine { verification_machine, key_request_machine, identity_manager, - cross_signing_request: Arc::new(Mutex::new(None)), } } From 48b3307934cee814919f828e2aa5b22011b8cc3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Fri, 10 Sep 2021 10:08:48 +0200 Subject: [PATCH 9/9] chore: Bump our deps --- matrix_sdk/Cargo.toml | 2 +- matrix_sdk_appservice/Cargo.toml | 2 +- matrix_sdk_base/Cargo.toml | 10 +++++----- matrix_sdk_common/Cargo.toml | 2 +- matrix_sdk_crypto/Cargo.toml | 6 +++--- matrix_sdk_test/Cargo.toml | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/matrix_sdk/Cargo.toml b/matrix_sdk/Cargo.toml index 5242a7b5..50fd2295 100644 --- a/matrix_sdk/Cargo.toml +++ b/matrix_sdk/Cargo.toml @@ -58,7 +58,7 @@ version = "0.11.3" default_features = false [dependencies.ruma] -version = "0.3.0" +version = "0.4.0" features = ["client-api-c", "compat", "unstable-pre-spec"] [dependencies.tokio-stream] diff --git a/matrix_sdk_appservice/Cargo.toml b/matrix_sdk_appservice/Cargo.toml index 8191bc4f..da082a23 100644 --- a/matrix_sdk_appservice/Cargo.toml +++ b/matrix_sdk_appservice/Cargo.toml @@ -39,7 +39,7 @@ warp = { git = "https://github.com/seanmonstar/warp.git", rev = "629405", option matrix-sdk = { version = "0.3", path = "../matrix_sdk", default-features = false, features = ["appservice"] } [dependencies.ruma] -version = "0.3.0" +version = "0.4.0" features = ["client-api-c", "appservice-api-s", "unstable-pre-spec"] [dev-dependencies] diff --git a/matrix_sdk_base/Cargo.toml b/matrix_sdk_base/Cargo.toml index 3818b5ab..b9d9722a 100644 --- a/matrix_sdk_base/Cargo.toml +++ b/matrix_sdk_base/Cargo.toml @@ -25,7 +25,7 @@ docs = ["encryption", "sled_cryptostore"] [dependencies] dashmap = "4.0.2" lru = "0.6.5" -ruma = { version = "0.3.0", features = ["client-api-c", "unstable-pre-spec"] } +ruma = { version = "0.4.0", features = ["client-api-c", "unstable-pre-spec"] } serde = { version = "1.0.126", features = ["rc"] } serde_json = "1.0.64" tracing = "0.1.26" @@ -40,8 +40,8 @@ zeroize = { version = "1.3.0", features = ["zeroize_derive"] } # Deps for the sled state store sled = { version = "0.34.6", optional = true } -chacha20poly1305 = { version = "0.8.0", optional = true } -pbkdf2 = { version = "0.8.0", default-features = false, optional = true } +chacha20poly1305 = { version = "0.9.0", optional = true } +pbkdf2 = { version = "0.9.0", default-features = false, optional = true } hmac = { version = "0.11.0", optional = true } sha2 = { version = "0.9.5", optional = true } rand = { version = "0.8.4", optional = true } @@ -58,8 +58,8 @@ http = "0.2.4" [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] tokio = { version = "1.7.1", default-features = false, features = ["rt-multi-thread", "macros"] } tempfile = "3.2.0" -rustyline = "8.2.0" -rustyline-derive = "0.4.0" +rustyline = "9.0.0" +rustyline-derive = "0.5.0" atty = "0.2.14" clap = "2.33.3" syntect = "4.5.0" diff --git a/matrix_sdk_common/Cargo.toml b/matrix_sdk_common/Cargo.toml index 6913b707..f640b4e2 100644 --- a/matrix_sdk_common/Cargo.toml +++ b/matrix_sdk_common/Cargo.toml @@ -13,7 +13,7 @@ version = "0.3.0" [dependencies] async-trait = "0.1.50" instant = { version = "0.1.9", features = ["wasm-bindgen", "now"] } -ruma = { version = "0.3.0", features = ["client-api-c"] } +ruma = { version = "0.4.0", features = ["client-api-c"] } serde = "1.0.126" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] diff --git a/matrix_sdk_crypto/Cargo.toml b/matrix_sdk_crypto/Cargo.toml index b32074cb..87251b9a 100644 --- a/matrix_sdk_crypto/Cargo.toml +++ b/matrix_sdk_crypto/Cargo.toml @@ -22,9 +22,9 @@ docs = ["sled_cryptostore"] [dependencies] matrix-qrcode = { version = "0.1.0", path = "../matrix_qrcode" } matrix-sdk-common = { version = "0.3.0", path = "../matrix_sdk_common" } -ruma = { version = "0.3.0", features = ["client-api-c", "unstable-pre-spec"] } +ruma = { version = "0.4.0", features = ["client-api-c", "unstable-pre-spec"] } -olm-rs = { version = "2.0", features = ["serde"] } +olm-rs = { version = "2.0.1", features = ["serde"] } getrandom = "0.2.3" serde = { version = "1.0.126", features = ["derive", "rc"] } serde_json = "1.0.64" @@ -40,7 +40,7 @@ dashmap = "4.0.2" sha2 = "0.9.5" aes-gcm = "0.9.2" aes = { version = "0.7.4", features = ["ctr"] } -pbkdf2 = { version = "0.8.0", default-features = false } +pbkdf2 = { version = "0.9.0", default-features = false } hmac = "0.11.0" base64 = "0.13.0" byteorder = "1.4.3" diff --git a/matrix_sdk_test/Cargo.toml b/matrix_sdk_test/Cargo.toml index aa892329..a93a7d16 100644 --- a/matrix_sdk_test/Cargo.toml +++ b/matrix_sdk_test/Cargo.toml @@ -18,6 +18,6 @@ http = "0.2.4" lazy_static = "1.4.0" matrix-sdk-common = { version = "0.3.0", path = "../matrix_sdk_common" } matrix-sdk-test-macros = { version = "0.1.0", path = "../matrix_sdk_test_macros" } -ruma = { version = "0.3.0", features = ["client-api-c"] } +ruma = { version = "0.4.0", features = ["client-api-c"] } serde = "1.0.126" serde_json = "1.0.64"