Bump to rust-s3 0.3.5-alpha to avoid 0.34 compile issue

This commit is contained in:
mdecimus 2024-06-22 17:30:11 +02:00
parent b357bbcba8
commit a1aa12f165
5 changed files with 59 additions and 2381 deletions

142
Cargo.lock generated
View file

@ -369,17 +369,17 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
[[package]] [[package]]
name = "attohttpc" name = "attohttpc"
version = "0.26.1" version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f77d243921b0979fbbd728dd2d5162e68ac8252976797c24eb5b3a6af9090dc" checksum = "9a13149d0cf3f7f9b9261fad4ec63b2efbf9a80665f52def86282d26255e6331"
dependencies = [ dependencies = [
"http 0.2.12", "http 1.1.0",
"log", "log",
"rustls 0.21.12", "rustls 0.22.4",
"serde", "serde",
"serde_json", "serde_json",
"url", "url",
"webpki-roots 0.25.4", "webpki-roots 0.26.3",
] ]
[[package]] [[package]]
@ -390,14 +390,14 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
[[package]] [[package]]
name = "aws-creds" name = "aws-creds"
version = "0.36.0" version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "390ad3b77f3e21e01a4a0355865853b681daf1988510b0b15e31c0c4ae7eb0f6" checksum = "7f84143206b9c72b3c5cb65415de60c7539c79cd1559290fddec657939131be0"
dependencies = [ dependencies = [
"attohttpc", "attohttpc",
"home", "home",
"log", "log",
"quick-xml 0.30.0", "quick-xml 0.32.0",
"rust-ini", "rust-ini",
"serde", "serde",
"thiserror", "thiserror",
@ -1764,6 +1764,24 @@ dependencies = [
"spki", "spki",
] ]
[[package]]
name = "ece"
version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2ea1d2f2cc974957a4e2575d8e5bb494549bab66338d6320c2789abcfff5746"
dependencies = [
"base64 0.21.7",
"byteorder",
"hex",
"hkdf",
"lazy_static",
"once_cell",
"openssl",
"serde",
"sha2 0.10.8",
"thiserror",
]
[[package]] [[package]]
name = "ed25519" name = "ed25519"
version = "2.2.3" version = "2.2.3"
@ -1941,12 +1959,6 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95765f67b4b18863968b4a1bd5bb576f732b29a4a28c7cd84c09fa3e2875f33c" checksum = "95765f67b4b18863968b4a1bd5bb576f732b29a4a28c7cd84c09fa3e2875f33c"
[[package]]
name = "fastrand"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a"
[[package]] [[package]]
name = "ff" name = "ff"
version = "0.13.0" version = "0.13.0"
@ -2357,12 +2369,6 @@ dependencies = [
"ahash 0.7.8", "ahash 0.7.8",
] ]
[[package]]
name = "hashbrown"
version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e"
[[package]] [[package]]
name = "hashbrown" name = "hashbrown"
version = "0.14.5" version = "0.14.5"
@ -2702,19 +2708,6 @@ dependencies = [
"tokio-io-timeout", "tokio-io-timeout",
] ]
[[package]]
name = "hyper-tls"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
dependencies = [
"bytes",
"hyper 0.14.29",
"native-tls",
"tokio",
"tokio-native-tls",
]
[[package]] [[package]]
name = "hyper-util" name = "hyper-util"
version = "0.1.5" version = "0.1.5"
@ -3836,23 +3829,6 @@ dependencies = [
"zstd", "zstd",
] ]
[[package]]
name = "native-tls"
version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466"
dependencies = [
"libc",
"log",
"openssl",
"openssl-probe",
"openssl-sys",
"schannel",
"security-framework",
"security-framework-sys",
"tempfile",
]
[[package]] [[package]]
name = "new_debug_unreachable" name = "new_debug_unreachable"
version = "1.0.6" version = "1.0.6"
@ -4192,12 +4168,12 @@ dependencies = [
[[package]] [[package]]
name = "ordered-multimap" name = "ordered-multimap"
version = "0.6.0" version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ed8acf08e98e744e5384c8bc63ceb0364e68a6854187221c18df61c4797690e" checksum = "49203cdcae0030493bad186b28da2fa25645fa276a51b6fec8010d281e02ef79"
dependencies = [ dependencies = [
"dlv-list", "dlv-list",
"hashbrown 0.13.2", "hashbrown 0.14.5",
] ]
[[package]] [[package]]
@ -4667,16 +4643,6 @@ version = "1.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
[[package]]
name = "quick-xml"
version = "0.30.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956"
dependencies = [
"memchr",
"serde",
]
[[package]] [[package]]
name = "quick-xml" name = "quick-xml"
version = "0.31.0" version = "0.31.0"
@ -4693,6 +4659,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2" checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2"
dependencies = [ dependencies = [
"memchr", "memchr",
"serde",
] ]
[[package]] [[package]]
@ -5285,24 +5252,25 @@ dependencies = [
[[package]] [[package]]
name = "rust-ini" name = "rust-ini"
version = "0.19.0" version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e2a3bcec1f113553ef1c88aae6c020a369d03d55b58de9869a0908930385091" checksum = "0d625ed57d8f49af6cfa514c42e1a71fadcff60eb0b1c517ff82fe41aa025b41"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"ordered-multimap", "ordered-multimap",
"trim-in-place",
] ]
[[package]] [[package]]
name = "rust-s3" name = "rust-s3"
version = "0.34.0" version = "0.35.0-alpha.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6679da8efaf4c6f0c161de0961dfe95fb6e9049c398d6fbdada2639f053aedb" checksum = "ec48e3a4e58d3bc73949db3dda917e8fb0d31d635fbe496084847b8d45049787"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"aws-creds", "aws-creds",
"aws-region", "aws-region",
"base64 0.21.7", "base64 0.22.1",
"bytes", "bytes",
"cfg-if", "cfg-if",
"futures", "futures",
@ -5310,13 +5278,14 @@ dependencies = [
"hmac 0.12.1", "hmac 0.12.1",
"http 0.2.12", "http 0.2.12",
"hyper 0.14.29", "hyper 0.14.29",
"hyper-tls", "hyper-rustls 0.24.2",
"log", "log",
"maybe-async", "maybe-async",
"md5", "md5",
"native-tls",
"percent-encoding", "percent-encoding",
"quick-xml 0.30.0", "quick-xml 0.32.0",
"rustls 0.21.12",
"rustls-native-certs 0.6.3",
"serde", "serde",
"serde_derive", "serde_derive",
"serde_json", "serde_json",
@ -5324,7 +5293,7 @@ dependencies = [
"thiserror", "thiserror",
"time", "time",
"tokio", "tokio",
"tokio-native-tls", "tokio-rustls 0.24.1",
"tokio-stream", "tokio-stream",
"url", "url",
] ]
@ -6328,18 +6297,6 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
[[package]]
name = "tempfile"
version = "3.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1"
dependencies = [
"cfg-if",
"fastrand",
"rustix",
"windows-sys 0.52.0",
]
[[package]] [[package]]
name = "term" name = "term"
version = "0.7.0" version = "0.7.0"
@ -6373,6 +6330,7 @@ dependencies = [
"csv", "csv",
"dashmap", "dashmap",
"directory", "directory",
"ece",
"flate2", "flate2",
"futures", "futures",
"http-body-util", "http-body-util",
@ -6556,16 +6514,6 @@ dependencies = [
"syn 2.0.67", "syn 2.0.67",
] ]
[[package]]
name = "tokio-native-tls"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
dependencies = [
"native-tls",
"tokio",
]
[[package]] [[package]]
name = "tokio-postgres" name = "tokio-postgres"
version = "0.7.10" version = "0.7.10"
@ -6842,6 +6790,12 @@ dependencies = [
"tracing-log", "tracing-log",
] ]
[[package]]
name = "trim-in-place"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "343e926fc669bc8cde4fa3129ab681c63671bae288b1f1081ceee6d9d37904fc"
[[package]] [[package]]
name = "try-lock" name = "try-lock"
version = "0.2.5" version = "0.2.5"

View file

@ -10,7 +10,7 @@ nlp = { path = "../nlp" }
rocksdb = { version = "0.22", optional = true, features = ["multi-threaded-cf"] } rocksdb = { version = "0.22", optional = true, features = ["multi-threaded-cf"] }
foundationdb = { version = "0.9.0", features = ["embedded-fdb-include", "fdb-7_1"], optional = true } foundationdb = { version = "0.9.0", features = ["embedded-fdb-include", "fdb-7_1"], optional = true }
rusqlite = { version = "0.31.0", features = ["bundled"], optional = true } rusqlite = { version = "0.31.0", features = ["bundled"], optional = true }
rust-s3 = { version = "0.34.0", default-features = false, features = ["tokio-rustls-tls", "no-verify-ssl"], optional = true } rust-s3 = { version = "=0.35.0-alpha.2", default-features = false, features = ["tokio-rustls-tls", "no-verify-ssl"], optional = true }
tokio = { version = "1.23", features = ["sync", "fs", "io-util"] } tokio = { version = "1.23", features = ["sync", "fs", "io-util"] }
r2d2 = { version = "0.8.10", optional = true } r2d2 = { version = "0.8.10", optional = true }
futures = { version = "0.3", optional = true } futures = { version = "0.3", optional = true }

2257
pepe.txt

File diff suppressed because it is too large Load diff

View file

@ -50,6 +50,7 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls-webpki-roots", "multipart", "http2"]} reqwest = { version = "0.12", default-features = false, features = ["rustls-tls-webpki-roots", "multipart", "http2"]}
bytes = "1.4.0" bytes = "1.4.0"
futures = "0.3" futures = "0.3"
ece = "2.2"
hyper = { version = "1.0.1", features = ["server", "http1", "http2"] } hyper = { version = "1.0.1", features = ["server", "http1", "http2"] }
hyper-util = { version = "0.1.1", features = ["tokio"] } hyper-util = { version = "0.1.1", features = ["tokio"] }
http-body-util = "0.1.0" http-body-util = "0.1.0"

View file

@ -29,25 +29,20 @@ use std::{
time::Duration, time::Duration,
}; };
#[cfg(feature = "test_push_encryption")]
use base64::{engine::general_purpose, Engine}; use base64::{engine::general_purpose, Engine};
use common::{config::server::Servers, listener::SessionData, Core}; use common::{config::server::Servers, listener::SessionData, Core};
use directory::backend::internal::manage::ManageDirectory; use directory::backend::internal::manage::ManageDirectory;
#[cfg(feature = "test_push_encryption")]
use ece::EcKeyComponents; use ece::EcKeyComponents;
#[cfg(feature = "test_push_encryption")] use hyper::{body, header::CONTENT_ENCODING, server::conn::http1, service::service_fn, StatusCode};
use hyper::header::CONTENT_ENCODING;
use hyper::{body, server::conn::http1, service::service_fn, StatusCode};
use hyper_util::rt::TokioIo; use hyper_util::rt::TokioIo;
use jmap::api::{ use jmap::{
http::{fetch_body, ToHttpResponse}, api::{
HtmlResponse, StateChangeResponse, http::{fetch_body, ToHttpResponse},
HtmlResponse, StateChangeResponse,
},
push::ece::ece_encrypt,
}; };
use jmap_client::{mailbox::Role, push_subscription::Keys};
#[cfg(feature = "test_push_encryption")]
use jmap_client::push_subscription::Keys;
use jmap_client::mailbox::Role;
use jmap_proto::types::{id::Id, type_state::DataType}; use jmap_proto::types::{id::Id, type_state::DataType};
use store::ahash::AHashSet; use store::ahash::AHashSet;
@ -106,17 +101,12 @@ pub async fn test(params: &mut JMAPTest) {
let (event_tx, mut event_rx) = mpsc::channel::<PushMessage>(100); let (event_tx, mut event_rx) = mpsc::channel::<PushMessage>(100);
// Create subscription keys // Create subscription keys
#[cfg(feature = "test_push_encryption")]
let (keypair, auth_secret) = ece::generate_keypair_and_auth_secret().unwrap(); let (keypair, auth_secret) = ece::generate_keypair_and_auth_secret().unwrap();
#[cfg(feature = "test_push_encryption")]
let pubkey = keypair.pub_as_raw().unwrap(); let pubkey = keypair.pub_as_raw().unwrap();
#[cfg(feature = "test_push_encryption")]
let keys = Keys::new(&pubkey, &auth_secret); let keys = Keys::new(&pubkey, &auth_secret);
let push_server = Arc::new(PushServer { let push_server = Arc::new(PushServer {
#[cfg(feature = "test_push_encryption")]
keypair: keypair.raw_components().unwrap(), keypair: keypair.raw_components().unwrap(),
#[cfg(feature = "test_push_encryption")]
auth_secret: auth_secret.to_vec(), auth_secret: auth_secret.to_vec(),
tx: event_tx, tx: event_tx,
fail_requests: false.into(), fail_requests: false.into(),
@ -195,10 +185,7 @@ pub async fn test(params: &mut JMAPTest) {
.push_subscription_create( .push_subscription_create(
"123", "123",
"https://127.0.0.1:9000/push?skip_checks=true", // skip_checks only works in cfg(test) "https://127.0.0.1:9000/push?skip_checks=true", // skip_checks only works in cfg(test)
#[cfg(feature = "test_push_encryption")]
keys.into(), keys.into(),
#[cfg(not(feature = "test_push_encryption"))]
None,
) )
.await .await
.unwrap() .unwrap()
@ -262,9 +249,7 @@ impl From<Arc<PushServer>> for SessionManager {
} }
} }
pub struct PushServer { pub struct PushServer {
#[cfg(feature = "test_push_encryption")]
keypair: EcKeyComponents, keypair: EcKeyComponents,
#[cfg(feature = "test_push_encryption")]
auth_secret: Vec<u8>, auth_secret: Vec<u8>,
tx: mpsc::Sender<PushMessage>, tx: mpsc::Sender<PushMessage>,
fail_requests: AtomicBool, fail_requests: AtomicBool,
@ -331,7 +316,6 @@ impl common::listener::SessionManager for SessionManager {
) )
.into_http_response()); .into_http_response());
} }
#[cfg(feature = "test_push_encryption")]
let is_encrypted = req let is_encrypted = req
.headers() .headers()
.get(CONTENT_ENCODING) .get(CONTENT_ENCODING)
@ -339,7 +323,6 @@ impl common::listener::SessionManager for SessionManager {
encoding.to_str().unwrap() == "aes128gcm" encoding.to_str().unwrap() == "aes128gcm"
}); });
let body = fetch_body(&mut req, 1024 * 1024).await.unwrap(); let body = fetch_body(&mut req, 1024 * 1024).await.unwrap();
#[cfg(feature = "test_push_encryption")]
let message = serde_json::from_slice::<PushMessage>(&if is_encrypted { let message = serde_json::from_slice::<PushMessage>(&if is_encrypted {
ece::decrypt( ece::decrypt(
&push.keypair, &push.keypair,
@ -351,8 +334,6 @@ impl common::listener::SessionManager for SessionManager {
body body
}) })
.unwrap(); .unwrap();
#[cfg(not(feature = "test_push_encryption"))]
let message = serde_json::from_slice::<PushMessage>(&body).unwrap();
//println!("Push received ({}): {:?}", is_encrypted, message); //println!("Push received ({}): {:?}", is_encrypted, message);
@ -410,7 +391,6 @@ async fn assert_state(event_rx: &mut mpsc::Receiver<PushMessage>, id: &Id, state
); );
} }
#[cfg(feature = "test_push_encryption")]
#[test] #[test]
fn ece_roundtrip() { fn ece_roundtrip() {
for len in [1, 2, 5, 16, 256, 1024, 2048, 4096, 1024 * 1024] { for len in [1, 2, 5, 16, 256, 1024, 2048, 4096, 1024 * 1024] {
@ -419,7 +399,7 @@ fn ece_roundtrip() {
let bytes: Vec<u8> = (0..len).map(|_| store::rand::random::<u8>()).collect(); let bytes: Vec<u8> = (0..len).map(|_| store::rand::random::<u8>()).collect();
let encrypted_bytes = let encrypted_bytes =
push::ece::ece_encrypt(&keypair.pub_as_raw().unwrap(), &auth_secret, &bytes).unwrap(); ece_encrypt(&keypair.pub_as_raw().unwrap(), &auth_secret, &bytes).unwrap();
let decrypted_bytes = ece::decrypt( let decrypted_bytes = ece::decrypt(
&keypair.raw_components().unwrap(), &keypair.raw_components().unwrap(),