matrix-sdk: Rename the types subproject to matrix-sdk-common.
parent
e9d6e28e13
commit
6cbdbdcd2f
|
@ -2,5 +2,5 @@
|
||||||
members = [
|
members = [
|
||||||
"matrix_sdk",
|
"matrix_sdk",
|
||||||
"matrix_sdk_crypto",
|
"matrix_sdk_crypto",
|
||||||
"matrix_sdk_types",
|
"matrix_sdk_common",
|
||||||
]
|
]
|
||||||
|
|
|
@ -26,7 +26,7 @@ serde = "1.0.106"
|
||||||
serde_json = "1.0.52"
|
serde_json = "1.0.52"
|
||||||
uuid = { version = "0.8.1", features = ["v4"] }
|
uuid = { version = "0.8.1", features = ["v4"] }
|
||||||
|
|
||||||
matrix-sdk-types = { path = "../matrix_sdk_types" }
|
matrix-sdk-common = { path = "../matrix_sdk_common" }
|
||||||
matrix-sdk-crypto = { path = "../matrix_sdk_crypto", optional = true }
|
matrix-sdk-crypto = { path = "../matrix_sdk_crypto", optional = true }
|
||||||
|
|
||||||
# Misc dependencies
|
# Misc dependencies
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#![deny(missing_docs)]
|
#![deny(missing_docs)]
|
||||||
|
|
||||||
pub use crate::{error::Error, error::Result, session::Session};
|
pub use crate::{error::Error, error::Result, session::Session};
|
||||||
pub use matrix_sdk_types::*;
|
pub use matrix_sdk_common::*;
|
||||||
pub use reqwest::header::InvalidHeaderValue;
|
pub use reqwest::header::InvalidHeaderValue;
|
||||||
|
|
||||||
mod async_client;
|
mod async_client;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
[package]
|
[package]
|
||||||
authors = ["Damir Jelić <poljar@termina.org.uk"]
|
authors = ["Damir Jelić <poljar@termina.org.uk"]
|
||||||
description = "Collection of Matrix types used in the matrix-sdk"
|
description = "Collection of common types used in the matrix-sdk"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
homepage = "https://github.com/matrix-org/matrix-rust-sdk"
|
homepage = "https://github.com/matrix-org/matrix-rust-sdk"
|
||||||
keywords = ["matrix", "chat", "messaging", "ruma", "nio"]
|
keywords = ["matrix", "chat", "messaging", "ruma", "nio"]
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
name = "matrix-sdk-types"
|
name = "matrix-sdk-common"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
repository = "https://github.com/matrix-org/matrix-rust-sdk"
|
repository = "https://github.com/matrix-org/matrix-rust-sdk"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
|
@ -18,7 +18,7 @@ sqlite-cryptostore = ["sqlx"]
|
||||||
futures = "0.3.4"
|
futures = "0.3.4"
|
||||||
async-trait = "0.1.30"
|
async-trait = "0.1.30"
|
||||||
|
|
||||||
matrix-sdk-types = { path = "../matrix_sdk_types" }
|
matrix-sdk-common = { path = "../matrix_sdk_common" }
|
||||||
|
|
||||||
olm-rs = { version = "0.5.0", features = ["serde"] }
|
olm-rs = { version = "0.5.0", features = ["serde"] }
|
||||||
serde = { version = "1.0.106", features = ["derive"] }
|
serde = { version = "1.0.106", features = ["derive"] }
|
||||||
|
|
|
@ -23,9 +23,9 @@ use atomic::Atomic;
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
use super::OlmMachine;
|
use super::OlmMachine;
|
||||||
use matrix_sdk_types::api::r0::keys::{DeviceKeys, KeyAlgorithm};
|
use matrix_sdk_common::api::r0::keys::{DeviceKeys, KeyAlgorithm};
|
||||||
use matrix_sdk_types::events::Algorithm;
|
use matrix_sdk_common::events::Algorithm;
|
||||||
use matrix_sdk_types::identifiers::{DeviceId, UserId};
|
use matrix_sdk_common::identifiers::{DeviceId, UserId};
|
||||||
|
|
||||||
/// A device represents a E2EE capable client of an user.
|
/// A device represents a E2EE capable client of an user.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
@ -224,8 +224,8 @@ pub(crate) mod test {
|
||||||
use std::convert::{From, TryFrom};
|
use std::convert::{From, TryFrom};
|
||||||
|
|
||||||
use crate::device::{Device, TrustState};
|
use crate::device::{Device, TrustState};
|
||||||
use matrix_sdk_types::api::r0::keys::{DeviceKeys, KeyAlgorithm};
|
use matrix_sdk_common::api::r0::keys::{DeviceKeys, KeyAlgorithm};
|
||||||
use matrix_sdk_types::identifiers::UserId;
|
use matrix_sdk_common::identifiers::UserId;
|
||||||
|
|
||||||
fn device_keys() -> DeviceKeys {
|
fn device_keys() -> DeviceKeys {
|
||||||
let user_id = UserId::try_from("@alice:example.org").unwrap();
|
let user_id = UserId::try_from("@alice:example.org").unwrap();
|
||||||
|
|
|
@ -31,8 +31,8 @@ use super::store::memorystore::MemoryStore;
|
||||||
use super::store::sqlite::SqliteStore;
|
use super::store::sqlite::SqliteStore;
|
||||||
use super::{device::Device, store::Result as StoreError, CryptoStore};
|
use super::{device::Device, store::Result as StoreError, CryptoStore};
|
||||||
|
|
||||||
use matrix_sdk_types::api;
|
use matrix_sdk_common::api;
|
||||||
use matrix_sdk_types::events::{
|
use matrix_sdk_common::events::{
|
||||||
collections::all::RoomEvent,
|
collections::all::RoomEvent,
|
||||||
room::encrypted::{
|
room::encrypted::{
|
||||||
CiphertextInfo, EncryptedEvent, EncryptedEventContent, MegolmV1AesSha2Content,
|
CiphertextInfo, EncryptedEvent, EncryptedEventContent, MegolmV1AesSha2Content,
|
||||||
|
@ -45,7 +45,7 @@ use matrix_sdk_types::events::{
|
||||||
},
|
},
|
||||||
Algorithm, EventJson, EventType,
|
Algorithm, EventJson, EventType,
|
||||||
};
|
};
|
||||||
use matrix_sdk_types::identifiers::{DeviceId, RoomId, UserId};
|
use matrix_sdk_common::identifiers::{DeviceId, RoomId, UserId};
|
||||||
|
|
||||||
use api::r0::keys;
|
use api::r0::keys;
|
||||||
use api::r0::{
|
use api::r0::{
|
||||||
|
@ -1550,7 +1550,7 @@ mod test {
|
||||||
static USER_ID: &str = "@bob:example.org";
|
static USER_ID: &str = "@bob:example.org";
|
||||||
static DEVICE_ID: &str = "DEVICEID";
|
static DEVICE_ID: &str = "DEVICEID";
|
||||||
|
|
||||||
use matrix_sdk_types::js_int::UInt;
|
use matrix_sdk_common::js_int::UInt;
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
|
@ -1564,10 +1564,10 @@ mod test {
|
||||||
use crate::machine::{OlmMachine, OneTimeKeys};
|
use crate::machine::{OlmMachine, OneTimeKeys};
|
||||||
use crate::Device;
|
use crate::Device;
|
||||||
|
|
||||||
use matrix_sdk_types::api::r0::{
|
use matrix_sdk_common::api::r0::{
|
||||||
keys, to_device::send_event_to_device::Request as ToDeviceRequest,
|
keys, to_device::send_event_to_device::Request as ToDeviceRequest,
|
||||||
};
|
};
|
||||||
use matrix_sdk_types::events::{
|
use matrix_sdk_common::events::{
|
||||||
collections::all::RoomEvent,
|
collections::all::RoomEvent,
|
||||||
room::{
|
room::{
|
||||||
encrypted::{EncryptedEvent, EncryptedEventContent},
|
encrypted::{EncryptedEvent, EncryptedEventContent},
|
||||||
|
@ -1576,7 +1576,7 @@ mod test {
|
||||||
to_device::{AnyToDeviceEvent, ToDeviceEncrypted},
|
to_device::{AnyToDeviceEvent, ToDeviceEncrypted},
|
||||||
EventJson, EventType, UnsignedData,
|
EventJson, EventType, UnsignedData,
|
||||||
};
|
};
|
||||||
use matrix_sdk_types::identifiers::{DeviceId, EventId, RoomId, UserId};
|
use matrix_sdk_common::identifiers::{DeviceId, EventId, RoomId, UserId};
|
||||||
|
|
||||||
fn alice_id() -> UserId {
|
fn alice_id() -> UserId {
|
||||||
UserId::try_from("@alice:example.org").unwrap()
|
UserId::try_from("@alice:example.org").unwrap()
|
||||||
|
|
|
@ -20,7 +20,7 @@ use tokio::sync::Mutex;
|
||||||
|
|
||||||
use super::device::Device;
|
use super::device::Device;
|
||||||
use super::olm::{InboundGroupSession, Session};
|
use super::olm::{InboundGroupSession, Session};
|
||||||
use matrix_sdk_types::identifiers::{DeviceId, RoomId, UserId};
|
use matrix_sdk_common::identifiers::{DeviceId, RoomId, UserId};
|
||||||
|
|
||||||
/// In-memory store for Olm Sessions.
|
/// In-memory store for Olm Sessions.
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
|
@ -215,7 +215,7 @@ mod test {
|
||||||
use crate::memory_stores::{DeviceStore, GroupSessionStore, SessionStore};
|
use crate::memory_stores::{DeviceStore, GroupSessionStore, SessionStore};
|
||||||
use crate::olm::test::get_account_and_session;
|
use crate::olm::test::get_account_and_session;
|
||||||
use crate::olm::{InboundGroupSession, OutboundGroupSession};
|
use crate::olm::{InboundGroupSession, OutboundGroupSession};
|
||||||
use matrix_sdk_types::identifiers::RoomId;
|
use matrix_sdk_common::identifiers::RoomId;
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_session_store() {
|
async fn test_session_store() {
|
||||||
|
|
|
@ -35,8 +35,8 @@ pub use olm_rs::{
|
||||||
utility::OlmUtility,
|
utility::OlmUtility,
|
||||||
};
|
};
|
||||||
|
|
||||||
use matrix_sdk_types::api::r0::keys::SignedKey;
|
use matrix_sdk_common::api::r0::keys::SignedKey;
|
||||||
use matrix_sdk_types::identifiers::RoomId;
|
use matrix_sdk_common::identifiers::RoomId;
|
||||||
|
|
||||||
/// Account holding identity keys for which sessions can be created.
|
/// Account holding identity keys for which sessions can be created.
|
||||||
///
|
///
|
||||||
|
@ -627,8 +627,8 @@ impl std::fmt::Debug for OutboundGroupSession {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
pub(crate) mod test {
|
pub(crate) mod test {
|
||||||
use crate::olm::{Account, InboundGroupSession, OutboundGroupSession, Session};
|
use crate::olm::{Account, InboundGroupSession, OutboundGroupSession, Session};
|
||||||
use matrix_sdk_types::api::r0::keys::SignedKey;
|
use matrix_sdk_common::api::r0::keys::SignedKey;
|
||||||
use matrix_sdk_types::identifiers::RoomId;
|
use matrix_sdk_common::identifiers::RoomId;
|
||||||
use olm_rs::session::OlmMessage;
|
use olm_rs::session::OlmMessage;
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
|
|
|
@ -21,7 +21,7 @@ use tokio::sync::Mutex;
|
||||||
use super::{Account, CryptoStore, InboundGroupSession, Result, Session};
|
use super::{Account, CryptoStore, InboundGroupSession, Result, Session};
|
||||||
use crate::device::Device;
|
use crate::device::Device;
|
||||||
use crate::memory_stores::{DeviceStore, GroupSessionStore, SessionStore, UserDevices};
|
use crate::memory_stores::{DeviceStore, GroupSessionStore, SessionStore, UserDevices};
|
||||||
use matrix_sdk_types::identifiers::{DeviceId, RoomId, UserId};
|
use matrix_sdk_common::identifiers::{DeviceId, RoomId, UserId};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct MemoryStore {
|
pub struct MemoryStore {
|
||||||
|
@ -119,7 +119,7 @@ mod test {
|
||||||
use crate::olm::{InboundGroupSession, OutboundGroupSession};
|
use crate::olm::{InboundGroupSession, OutboundGroupSession};
|
||||||
use crate::store::memorystore::MemoryStore;
|
use crate::store::memorystore::MemoryStore;
|
||||||
use crate::store::CryptoStore;
|
use crate::store::CryptoStore;
|
||||||
use matrix_sdk_types::identifiers::RoomId;
|
use matrix_sdk_common::identifiers::RoomId;
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_session_store() {
|
async fn test_session_store() {
|
||||||
|
|
|
@ -26,7 +26,7 @@ use tokio::sync::Mutex;
|
||||||
use super::device::Device;
|
use super::device::Device;
|
||||||
use super::memory_stores::UserDevices;
|
use super::memory_stores::UserDevices;
|
||||||
use super::olm::{Account, InboundGroupSession, Session};
|
use super::olm::{Account, InboundGroupSession, Session};
|
||||||
use matrix_sdk_types::identifiers::{DeviceId, RoomId, UserId};
|
use matrix_sdk_common::identifiers::{DeviceId, RoomId, UserId};
|
||||||
use olm_rs::errors::{OlmAccountError, OlmGroupSessionError, OlmSessionError};
|
use olm_rs::errors::{OlmAccountError, OlmGroupSessionError, OlmSessionError};
|
||||||
|
|
||||||
pub mod memorystore;
|
pub mod memorystore;
|
||||||
|
|
|
@ -30,9 +30,9 @@ use zeroize::Zeroizing;
|
||||||
use super::{Account, CryptoStore, CryptoStoreError, InboundGroupSession, Result, Session};
|
use super::{Account, CryptoStore, CryptoStoreError, InboundGroupSession, Result, Session};
|
||||||
use crate::device::{Device, TrustState};
|
use crate::device::{Device, TrustState};
|
||||||
use crate::memory_stores::{DeviceStore, GroupSessionStore, SessionStore, UserDevices};
|
use crate::memory_stores::{DeviceStore, GroupSessionStore, SessionStore, UserDevices};
|
||||||
use matrix_sdk_types::api::r0::keys::KeyAlgorithm;
|
use matrix_sdk_common::api::r0::keys::KeyAlgorithm;
|
||||||
use matrix_sdk_types::events::Algorithm;
|
use matrix_sdk_common::events::Algorithm;
|
||||||
use matrix_sdk_types::identifiers::{DeviceId, RoomId, UserId};
|
use matrix_sdk_common::identifiers::{DeviceId, RoomId, UserId};
|
||||||
|
|
||||||
/// SQLite based implementation of a `CryptoStore`.
|
/// SQLite based implementation of a `CryptoStore`.
|
||||||
pub struct SqliteStore {
|
pub struct SqliteStore {
|
||||||
|
@ -694,7 +694,7 @@ impl std::fmt::Debug for SqliteStore {
|
||||||
mod test {
|
mod test {
|
||||||
use crate::device::test::get_device;
|
use crate::device::test::get_device;
|
||||||
use crate::olm::GroupSessionKey;
|
use crate::olm::GroupSessionKey;
|
||||||
use matrix_sdk_types::api::r0::keys::SignedKey;
|
use matrix_sdk_common::api::r0::keys::SignedKey;
|
||||||
use olm_rs::outbound_group_session::OlmOutboundGroupSession;
|
use olm_rs::outbound_group_session::OlmOutboundGroupSession;
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
use tempfile::tempdir;
|
use tempfile::tempdir;
|
||||||
|
|
Loading…
Reference in New Issue