sdk: Don't enable store encryption by default

This commit is contained in:
Kévin Commaille
2022-03-10 11:27:35 +01:00
parent 8c7bbb0e07
commit ad31540b10
6 changed files with 16 additions and 15 deletions
+5 -4
View File
@@ -24,12 +24,13 @@ default = [
"native-tls"
]
indexeddb_stores = ["matrix-sdk-indexeddb"]
indexeddb_state_store = ["matrix-sdk-indexeddb"]
indexeddb_cryptostore = ["matrix-sdk-indexeddb/encryption", "encryption"]
encryption = ["matrix-sdk-base/encryption"]
qrcode = ["encryption", "matrix-sdk-base/qrcode"]
# TODO merge those two sled features
sled_state_store = ["matrix-sdk-sled"]
sled_cryptostore = ["matrix-sdk-sled", "encryption"]
sled_cryptostore = ["matrix-sdk-sled/encryption", "encryption"]
markdown = ["ruma/markdown"]
native-tls = ["reqwest/native-tls"]
rustls-tls = ["reqwest/rustls-tls"]
@@ -69,8 +70,8 @@ url = "2.2.2"
zeroize = "1.3.0"
async-stream = "0.3.2"
matrix-sdk-sled = { path = "../matrix-sdk-sled", optional = true }
matrix-sdk-indexeddb = { path = "../matrix-sdk-indexeddb", optional = true }
matrix-sdk-sled = { path = "../matrix-sdk-sled", default-features = false, optional = true }
matrix-sdk-indexeddb = { path = "../matrix-sdk-indexeddb", default-features = false, optional = true }
[dependencies.image]
version = "0.24.0"
+3 -3
View File
@@ -45,9 +45,9 @@ async fn login_and_sync(
username: &str,
password: &str,
) -> Result<(), matrix_sdk::Error> {
#[cfg(not(any(feature = "sled_state_store", feature = "indexeddb_stores")))]
#[cfg(not(any(feature = "sled_state_store", feature = "indexeddb_state_store")))]
let client_config = ClientConfig::new();
#[cfg(any(feature = "sled_state_store", feature = "indexeddb_stores"))]
#[cfg(any(feature = "sled_state_store", feature = "indexeddb_state_store"))]
let mut client_config = ClientConfig::new();
#[cfg(feature = "sled_state_store")]
@@ -59,7 +59,7 @@ async fn login_and_sync(
client_config = client_config.state_store(Box::new(state_store));
}
#[cfg(feature = "indexeddb_stores")]
#[cfg(feature = "indexeddb_state_store")]
{
let state_store = matrix_sdk_indexeddb::StateStore::open();
client_config = client_config.state_store(Box::new(state_store));
+3 -3
View File
@@ -37,9 +37,9 @@ async fn login_and_sync(
username: String,
password: String,
) -> Result<(), matrix_sdk::Error> {
#[cfg(not(any(feature = "sled_state_store", feature = "indexeddb_stores")))]
#[cfg(not(any(feature = "sled_state_store", feature = "indexeddb_state_store")))]
let client_config = ClientConfig::new();
#[cfg(any(feature = "sled_state_store", feature = "indexeddb_stores"))]
#[cfg(any(feature = "sled_state_store", feature = "indexeddb_state_store"))]
let mut client_config = ClientConfig::new();
#[cfg(feature = "sled_state_store")]
@@ -51,7 +51,7 @@ async fn login_and_sync(
client_config = client_config.state_store(Box::new(state_store));
}
#[cfg(feature = "indexeddb_stores")]
#[cfg(feature = "indexeddb_state_store")]
{
let state_store = matrix_sdk_indexeddb::StateStore::open();
client_config = client_config.state_store(Box::new(state_store));
@@ -25,9 +25,9 @@ getrandom = { version = "0.2.4", features = ["js"] }
[dependencies.matrix-sdk]
path = "../.."
default-features = false
features = ["native-tls", "encryption", "indexeddb_stores"]
features = ["native-tls", "encryption", "indexeddb_state_store", "indexeddb_cryptostore"]
[workspace]
[dev-dependencies]
wasm-bindgen-test = "0.2"
wasm-bindgen-test = "0.2"
+1 -1
View File
@@ -29,7 +29,7 @@
//! [`StoreConfig`]: crate::config::StoreConfig
//! [`ClientConfig::with_store_config()`]: crate::config::ClientConfig::with_store_config()
#[cfg(feature = "indexeddb_stores")]
#[cfg(any(feature = "indexeddb_state_store", feature = "indexeddb_cryptostore"))]
pub use matrix_sdk_indexeddb::*;
#[cfg(any(feature = "sled_state_store", feature = "sled_cryptostore"))]
pub use matrix_sdk_sled::*;
+2 -2
View File
@@ -187,14 +187,14 @@ fn run_wasm_checks(cmd: Option<WasmFeatureSet>) -> Result<()> {
WasmFeatureSet::MatrixSdkNoDefault,
"-p matrix-sdk \
--no-default-features \
--features qrcode,encryption,indexeddb_stores,rustls-tls",
--features qrcode,encryption,indexeddb_state_store,indexeddb_cryptostore,rustls-tls",
),
(WasmFeatureSet::MatrixSdkBase, "-p matrix-sdk-base"),
(WasmFeatureSet::MatrixSdkCommon, "-p matrix-sdk-common"),
(WasmFeatureSet::MatrixSdkCrypto, "-p matrix-sdk-crypto"),
(
WasmFeatureSet::MatrixSdkIndexeddbStores,
"-p matrix-sdk --no-default-features --features indexeddb_stores,encryption,rustls-tls",
"-p matrix-sdk --no-default-features --features indexeddb_state_store,indexeddb_cryptostore,encryption,rustls-tls",
),
]);