From b311089435d15516741273705ff11b3a8b9c3d17 Mon Sep 17 00:00:00 2001 From: ManyTheFish Date: Mon, 7 Aug 2023 14:20:01 +0200 Subject: [PATCH] Update zookeeper client --- Cargo.lock | 23 ++++++++++++----------- meilisearch-auth/Cargo.toml | 2 +- meilisearch-auth/src/lib.rs | 4 ++-- meilisearch/Cargo.toml | 2 +- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eda18882e..1005b3d9d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1265,7 +1265,7 @@ dependencies = [ "tempfile", "thiserror", "time", - "uuid 1.3.3", + "uuid 1.4.1", ] [[package]] @@ -1464,7 +1464,7 @@ dependencies = [ "faux", "tempfile", "thiserror", - "uuid 1.3.3", + "uuid 1.4.1", ] [[package]] @@ -1994,7 +1994,7 @@ dependencies = [ "tempfile", "thiserror", "time", - "uuid 1.3.3", + "uuid 1.4.1", ] [[package]] @@ -2665,7 +2665,7 @@ dependencies = [ "tokio-stream", "toml", "urlencoding", - "uuid 1.3.3", + "uuid 1.4.1", "vergen", "walkdir", "yaup", @@ -2691,7 +2691,7 @@ dependencies = [ "thiserror", "time", "tokio", - "uuid 1.3.3", + "uuid 1.4.1", "zookeeper-client", ] @@ -2722,7 +2722,7 @@ dependencies = [ "thiserror", "time", "tokio", - "uuid 1.3.3", + "uuid 1.4.1", ] [[package]] @@ -2802,7 +2802,7 @@ dependencies = [ "tempfile", "thiserror", "time", - "uuid 1.3.3", + "uuid 1.4.1", ] [[package]] @@ -4420,9 +4420,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.3.3" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" dependencies = [ "getrandom", "serde", @@ -4865,9 +4865,9 @@ dependencies = [ [[package]] name = "zookeeper-client" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade019937af9b1e2160582cb8d905bcff5d4b71da82444b7bf2ccc9c93f344f2" +checksum = "4d69dd5ba1592db2f385d3ff8fee13ed3a50024d2cf65bf4b49ca8ba7cfb9070" dependencies = [ "bytes", "compact_str", @@ -4882,6 +4882,7 @@ dependencies = [ "strum", "thiserror", "tokio", + "uuid 1.4.1", ] [[package]] diff --git a/meilisearch-auth/Cargo.toml b/meilisearch-auth/Cargo.toml index 317bd78c9..15b3a6031 100644 --- a/meilisearch-auth/Cargo.toml +++ b/meilisearch-auth/Cargo.toml @@ -26,4 +26,4 @@ thiserror = "1.0.40" time = { version = "0.3.20", features = ["serde-well-known", "formatting", "parsing", "macros"] } tokio = { version = "1.27.0", features = ["full"] } uuid = { version = "1.3.1", features = ["serde", "v4"] } -zookeeper-client = "0.4.0" +zookeeper-client = "0.5.0" diff --git a/meilisearch-auth/src/lib.rs b/meilisearch-auth/src/lib.rs index 3cca14957..4e6afd0b8 100644 --- a/meilisearch-auth/src/lib.rs +++ b/meilisearch-auth/src/lib.rs @@ -38,7 +38,7 @@ impl AuthController { // setup the auth zk environment, the `auth` node Some(ref zk) => { let options = - zk::CreateOptions::new(zk::CreateMode::Persistent, zk::Acl::anyone_all()); + zk::CreateMode::Persistent.with_acls(zk::Acls::anyone_all()); // TODO: we should catch the potential unexpected errors here https://docs.rs/zookeeper-client/latest/zookeeper_client/struct.Client.html#method.create // for the moment we consider that `create` only returns Error::NodeExists. match zk.create("/auth", &[], &options).await { @@ -159,7 +159,7 @@ impl AuthController { // TODO: we may commit only after zk persisted the keys let key = tokio::task::spawn_blocking(move || store.put_api_key(key)).await??; if let Some(ref zk) = self.zk { - let options = zk::CreateOptions::new(zk::CreateMode::Persistent, zk::Acl::anyone_all()); + let options = zk::CreateMode::Persistent.with_acls(zk::Acls::anyone_all()); zk.create(&format!("/auth/{}", key.uid), &serde_json::to_vec_pretty(&key)?, &options) .await?; diff --git a/meilisearch/Cargo.toml b/meilisearch/Cargo.toml index 76a4e4979..bf5501d63 100644 --- a/meilisearch/Cargo.toml +++ b/meilisearch/Cargo.toml @@ -105,7 +105,7 @@ walkdir = "2.3.3" yaup = "0.2.1" serde_urlencoded = "0.7.1" termcolor = "1.2.0" -zookeeper-client = "0.4.0" +zookeeper-client = "0.5.0" [dev-dependencies] actix-rt = "2.8.0"