From c77c3a90a0ca8cc978e96322d098e5d096df4ccf Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Mon, 14 Nov 2022 17:26:31 +0100 Subject: [PATCH 1/3] Use milli v0.33.5 --- Cargo.lock | 8 ++++---- meilisearch-auth/Cargo.toml | 2 +- meilisearch-lib/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7037c0cf7..099fd5bb8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1126,7 +1126,7 @@ dependencies = [ [[package]] name = "filter-parser" version = "0.33.4" -source = "git+https://github.com/meilisearch/milli.git?tag=v0.33.4#4fc6331cb6526c07f3137584564cfe3493fb25bd" +source = "git+https://github.com/meilisearch/milli.git?tag=v0.33.5#4fc6331cb6526c07f3137584564cfe3493fb25bd" dependencies = [ "nom", "nom_locate", @@ -1151,7 +1151,7 @@ dependencies = [ [[package]] name = "flatten-serde-json" version = "0.33.4" -source = "git+https://github.com/meilisearch/milli.git?tag=v0.33.4#4fc6331cb6526c07f3137584564cfe3493fb25bd" +source = "git+https://github.com/meilisearch/milli.git?tag=v0.33.5#4fc6331cb6526c07f3137584564cfe3493fb25bd" dependencies = [ "serde_json", ] @@ -1668,7 +1668,7 @@ dependencies = [ [[package]] name = "json-depth-checker" version = "0.33.4" -source = "git+https://github.com/meilisearch/milli.git?tag=v0.33.4#4fc6331cb6526c07f3137584564cfe3493fb25bd" +source = "git+https://github.com/meilisearch/milli.git?tag=v0.33.5#4fc6331cb6526c07f3137584564cfe3493fb25bd" dependencies = [ "serde_json", ] @@ -2200,7 +2200,7 @@ dependencies = [ [[package]] name = "milli" version = "0.33.4" -source = "git+https://github.com/meilisearch/milli.git?tag=v0.33.4#4fc6331cb6526c07f3137584564cfe3493fb25bd" +source = "git+https://github.com/meilisearch/milli.git?tag=v0.33.5#4fc6331cb6526c07f3137584564cfe3493fb25bd" dependencies = [ "bimap", "bincode", diff --git a/meilisearch-auth/Cargo.toml b/meilisearch-auth/Cargo.toml index 093a9e4a0..b045cb34b 100644 --- a/meilisearch-auth/Cargo.toml +++ b/meilisearch-auth/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" enum-iterator = "0.7.0" hmac = "0.12.1" meilisearch-types = { path = "../meilisearch-types" } -milli = { git = "https://github.com/meilisearch/milli.git", tag = "v0.33.4" } +milli = { git = "https://github.com/meilisearch/milli.git", tag = "v0.33.5" } rand = "0.8.4" serde = { version = "1.0.136", features = ["derive"] } serde_json = { version = "1.0.85", features = ["preserve_order"] } diff --git a/meilisearch-lib/Cargo.toml b/meilisearch-lib/Cargo.toml index 4cd4ad7a3..4bdcbe7f9 100644 --- a/meilisearch-lib/Cargo.toml +++ b/meilisearch-lib/Cargo.toml @@ -28,7 +28,7 @@ lazy_static = "1.4.0" log = "0.4.14" meilisearch-auth = { path = "../meilisearch-auth" } meilisearch-types = { path = "../meilisearch-types" } -milli = { git = "https://github.com/meilisearch/milli.git", tag = "v0.33.4" } +milli = { git = "https://github.com/meilisearch/milli.git", tag = "v0.33.5" } mime = "0.3.16" num_cpus = "1.13.1" obkv = "0.2.0" From 5cfcdbb55afdc4b3762cde06c22e55d230595a96 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Mon, 14 Nov 2022 17:28:00 +0100 Subject: [PATCH 2/3] Bump the version to v0.29.2 --- Cargo.lock | 10 +++++----- meilisearch-auth/Cargo.toml | 2 +- meilisearch-http/Cargo.toml | 2 +- meilisearch-lib/Cargo.toml | 2 +- meilisearch-types/Cargo.toml | 2 +- permissive-json-pointer/Cargo.toml | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 099fd5bb8..33da05183 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2009,7 +2009,7 @@ checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" [[package]] name = "meilisearch-auth" -version = "0.29.1" +version = "0.29.2" dependencies = [ "enum-iterator 0.7.0", "hmac", @@ -2026,7 +2026,7 @@ dependencies = [ [[package]] name = "meilisearch-http" -version = "0.29.1" +version = "0.29.2" dependencies = [ "actix-cors", "actix-rt", @@ -2101,7 +2101,7 @@ dependencies = [ [[package]] name = "meilisearch-lib" -version = "0.29.1" +version = "0.29.2" dependencies = [ "actix-rt", "actix-web", @@ -2164,7 +2164,7 @@ dependencies = [ [[package]] name = "meilisearch-types" -version = "0.29.1" +version = "0.29.2" dependencies = [ "actix-web", "proptest", @@ -2534,7 +2534,7 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "permissive-json-pointer" -version = "0.29.1" +version = "0.29.2" dependencies = [ "big_s", "serde_json", diff --git a/meilisearch-auth/Cargo.toml b/meilisearch-auth/Cargo.toml index b045cb34b..e8bd9bd63 100644 --- a/meilisearch-auth/Cargo.toml +++ b/meilisearch-auth/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "meilisearch-auth" -version = "0.29.1" +version = "0.29.2" edition = "2021" [dependencies] diff --git a/meilisearch-http/Cargo.toml b/meilisearch-http/Cargo.toml index 487c5dd5c..63f2fb200 100644 --- a/meilisearch-http/Cargo.toml +++ b/meilisearch-http/Cargo.toml @@ -4,7 +4,7 @@ description = "Meilisearch HTTP server" edition = "2021" license = "MIT" name = "meilisearch-http" -version = "0.29.1" +version = "0.29.2" [[bin]] name = "meilisearch" diff --git a/meilisearch-lib/Cargo.toml b/meilisearch-lib/Cargo.toml index 4bdcbe7f9..8d2e07dd1 100644 --- a/meilisearch-lib/Cargo.toml +++ b/meilisearch-lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "meilisearch-lib" -version = "0.29.1" +version = "0.29.2" edition = "2021" [dependencies] diff --git a/meilisearch-types/Cargo.toml b/meilisearch-types/Cargo.toml index a07708202..5e03e050f 100644 --- a/meilisearch-types/Cargo.toml +++ b/meilisearch-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "meilisearch-types" -version = "0.29.1" +version = "0.29.2" authors = ["marin "] edition = "2021" diff --git a/permissive-json-pointer/Cargo.toml b/permissive-json-pointer/Cargo.toml index e504a1b68..21fad5f53 100644 --- a/permissive-json-pointer/Cargo.toml +++ b/permissive-json-pointer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "permissive-json-pointer" -version = "0.29.1" +version = "0.29.2" edition = "2021" description = "A permissive json pointer" readme = "README.md" From 0331fc7c7152e20902eabf4d529fb914a3b142a2 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Mon, 14 Nov 2022 17:37:18 +0100 Subject: [PATCH 3/3] Make clippy happy --- meilisearch-http/tests/auth/authorization.rs | 28 ++++++++++---------- meilisearch-http/tests/auth/tenant_token.rs | 8 +++--- meilisearch-lib/src/tasks/scheduler.rs | 2 +- meilisearch-lib/src/tasks/task_store/mod.rs | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/meilisearch-http/tests/auth/authorization.rs b/meilisearch-http/tests/auth/authorization.rs index 5b23749c5..824ea7b8e 100644 --- a/meilisearch-http/tests/auth/authorization.rs +++ b/meilisearch-http/tests/auth/authorization.rs @@ -99,7 +99,7 @@ async fn error_access_expired_key() { assert!(response["key"].is_string()); let key = response["key"].as_str().unwrap(); - server.use_api_key(&key); + server.use_api_key(key); // wait until the key is expired. thread::sleep(time::Duration::new(1, 0)); @@ -135,7 +135,7 @@ async fn error_access_unauthorized_index() { assert!(response["key"].is_string()); let key = response["key"].as_str().unwrap(); - server.use_api_key(&key); + server.use_api_key(key); for (method, route) in AUTHORIZATIONS .keys() @@ -175,7 +175,7 @@ async fn error_access_unauthorized_action() { assert!(response["key"].is_string()); let key = response["key"].as_str().unwrap(); - server.use_api_key(&key); + server.use_api_key(key); let (response, code) = server.dummy_request(method, route).await; assert_eq!( @@ -230,7 +230,7 @@ async fn access_authorized_restricted_index() { assert!(response["key"].is_string()); let key = response["key"].as_str().unwrap(); - server.use_api_key(&key); + server.use_api_key(key); let (response, code) = server.dummy_request(method, route).await; @@ -268,7 +268,7 @@ async fn access_authorized_no_index_restriction() { assert!(response["key"].is_string()); let key = response["key"].as_str().unwrap(); - server.use_api_key(&key); + server.use_api_key(key); let (response, code) = server.dummy_request(method, route).await; @@ -313,7 +313,7 @@ async fn access_authorized_stats_restricted_index() { // use created key. let key = response["key"].as_str().unwrap(); - server.use_api_key(&key); + server.use_api_key(key); let (response, code) = server.stats().await; assert_eq!(200, code, "{:?}", &response); @@ -353,7 +353,7 @@ async fn access_authorized_stats_no_index_restriction() { // use created key. let key = response["key"].as_str().unwrap(); - server.use_api_key(&key); + server.use_api_key(key); let (response, code) = server.stats().await; assert_eq!(200, code, "{:?}", &response); @@ -393,7 +393,7 @@ async fn list_authorized_indexes_restricted_index() { // use created key. let key = response["key"].as_str().unwrap(); - server.use_api_key(&key); + server.use_api_key(key); let (response, code) = server.list_indexes(None, None).await; assert_eq!(200, code, "{:?}", &response); @@ -434,7 +434,7 @@ async fn list_authorized_indexes_no_index_restriction() { // use created key. let key = response["key"].as_str().unwrap(); - server.use_api_key(&key); + server.use_api_key(key); let (response, code) = server.list_indexes(None, None).await; assert_eq!(200, code, "{:?}", &response); @@ -474,7 +474,7 @@ async fn list_authorized_tasks_restricted_index() { // use created key. let key = response["key"].as_str().unwrap(); - server.use_api_key(&key); + server.use_api_key(key); let (response, code) = server.service.get("/tasks").await; assert_eq!(200, code, "{:?}", &response); @@ -514,7 +514,7 @@ async fn list_authorized_tasks_no_index_restriction() { // use created key. let key = response["key"].as_str().unwrap(); - server.use_api_key(&key); + server.use_api_key(key); let (response, code) = server.service.get("/tasks").await; assert_eq!(200, code, "{:?}", &response); @@ -545,7 +545,7 @@ async fn error_creating_index_without_action() { // use created key. let key = response["key"].as_str().unwrap(); - server.use_api_key(&key); + server.use_api_key(key); let expected_error = json!({ "message": "Index `test` not found.", @@ -625,7 +625,7 @@ async fn lazy_create_index() { // use created key. let key = response["key"].as_str().unwrap(); - server.use_api_key(&key); + server.use_api_key(key); // try to create a index via add documents route let index = server.index("test"); @@ -692,7 +692,7 @@ async fn error_creating_index_without_index() { // use created key. let key = response["key"].as_str().unwrap(); - server.use_api_key(&key); + server.use_api_key(key); // try to create a index via add documents route let index = server.index("test"); diff --git a/meilisearch-http/tests/auth/tenant_token.rs b/meilisearch-http/tests/auth/tenant_token.rs index 6e2127aeb..712c73993 100644 --- a/meilisearch-http/tests/auth/tenant_token.rs +++ b/meilisearch-http/tests/auth/tenant_token.rs @@ -473,7 +473,7 @@ async fn error_access_forbidden_routes() { "searchRules" => json!(["*"]), "exp" => json!((OffsetDateTime::now_utc() + Duration::hours(1)).unix_timestamp()) }; - let web_token = generate_tenant_token(&uid, &key, tenant_token); + let web_token = generate_tenant_token(uid, key, tenant_token); server.use_api_key(&web_token); for ((method, route), actions) in AUTHORIZATIONS.iter() { @@ -509,7 +509,7 @@ async fn error_access_expired_parent_key() { "searchRules" => json!(["*"]), "exp" => json!((OffsetDateTime::now_utc() + Duration::hours(1)).unix_timestamp()) }; - let web_token = generate_tenant_token(&uid, &key, tenant_token); + let web_token = generate_tenant_token(uid, key, tenant_token); server.use_api_key(&web_token); // test search request while parent_key is not expired @@ -552,7 +552,7 @@ async fn error_access_modified_token() { "searchRules" => json!(["products"]), "exp" => json!((OffsetDateTime::now_utc() + Duration::hours(1)).unix_timestamp()) }; - let web_token = generate_tenant_token(&uid, &key, tenant_token); + let web_token = generate_tenant_token(uid, key, tenant_token); server.use_api_key(&web_token); // test search request while web_token is valid @@ -567,7 +567,7 @@ async fn error_access_modified_token() { "exp" => json!((OffsetDateTime::now_utc() + Duration::hours(1)).unix_timestamp()) }; - let alt = generate_tenant_token(&uid, &key, tenant_token); + let alt = generate_tenant_token(uid, key, tenant_token); let altered_token = [ web_token.split('.').next().unwrap(), alt.split('.').nth(1).unwrap(), diff --git a/meilisearch-lib/src/tasks/scheduler.rs b/meilisearch-lib/src/tasks/scheduler.rs index c592b71fa..435503d6c 100644 --- a/meilisearch-lib/src/tasks/scheduler.rs +++ b/meilisearch-lib/src/tasks/scheduler.rs @@ -213,7 +213,7 @@ impl TaskQueue { let head = self.queue.pop()?; let result = { let mut ref_head = head.borrow_mut(); - f(&mut *ref_head) + f(&mut ref_head) }; if !head.borrow().tasks.is_empty() { // After being mutated, the head is reinserted to the correct position. diff --git a/meilisearch-lib/src/tasks/task_store/mod.rs b/meilisearch-lib/src/tasks/task_store/mod.rs index 621d66dd3..55dfe17d3 100644 --- a/meilisearch-lib/src/tasks/task_store/mod.rs +++ b/meilisearch-lib/src/tasks/task_store/mod.rs @@ -117,7 +117,7 @@ impl TaskStore { match filter { Some(filter) => filter .pass(&task) - .then(|| task) + .then_some(task) .ok_or(TaskError::UnexistingTask(id)), None => Ok(task), }