mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 10:37:41 +08:00
Merge #3047
3047: Fix soft deleted bug settings r=curquiza a=Kerollmops This PR fixes https://github.com/meilisearch/meilisearch/issues/3021 and fixes https://github.com/meilisearch/meilisearch/issues/2945 and is released as version 0.29.2. Co-authored-by: Kerollmops <clement@meilisearch.com>
This commit is contained in:
commit
0f0d1dccf0
18
Cargo.lock
generated
18
Cargo.lock
generated
@ -1126,7 +1126,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "filter-parser"
|
name = "filter-parser"
|
||||||
version = "0.33.4"
|
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 = [
|
dependencies = [
|
||||||
"nom",
|
"nom",
|
||||||
"nom_locate",
|
"nom_locate",
|
||||||
@ -1151,7 +1151,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "flatten-serde-json"
|
name = "flatten-serde-json"
|
||||||
version = "0.33.4"
|
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 = [
|
dependencies = [
|
||||||
"serde_json",
|
"serde_json",
|
||||||
]
|
]
|
||||||
@ -1668,7 +1668,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "json-depth-checker"
|
name = "json-depth-checker"
|
||||||
version = "0.33.4"
|
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 = [
|
dependencies = [
|
||||||
"serde_json",
|
"serde_json",
|
||||||
]
|
]
|
||||||
@ -2009,7 +2009,7 @@ checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "meilisearch-auth"
|
name = "meilisearch-auth"
|
||||||
version = "0.29.1"
|
version = "0.29.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"enum-iterator 0.7.0",
|
"enum-iterator 0.7.0",
|
||||||
"hmac",
|
"hmac",
|
||||||
@ -2026,7 +2026,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "meilisearch-http"
|
name = "meilisearch-http"
|
||||||
version = "0.29.1"
|
version = "0.29.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-cors",
|
"actix-cors",
|
||||||
"actix-rt",
|
"actix-rt",
|
||||||
@ -2101,7 +2101,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "meilisearch-lib"
|
name = "meilisearch-lib"
|
||||||
version = "0.29.1"
|
version = "0.29.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-rt",
|
"actix-rt",
|
||||||
"actix-web",
|
"actix-web",
|
||||||
@ -2164,7 +2164,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "meilisearch-types"
|
name = "meilisearch-types"
|
||||||
version = "0.29.1"
|
version = "0.29.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-web",
|
"actix-web",
|
||||||
"proptest",
|
"proptest",
|
||||||
@ -2200,7 +2200,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "milli"
|
name = "milli"
|
||||||
version = "0.33.4"
|
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 = [
|
dependencies = [
|
||||||
"bimap",
|
"bimap",
|
||||||
"bincode",
|
"bincode",
|
||||||
@ -2534,7 +2534,7 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "permissive-json-pointer"
|
name = "permissive-json-pointer"
|
||||||
version = "0.29.1"
|
version = "0.29.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"big_s",
|
"big_s",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "meilisearch-auth"
|
name = "meilisearch-auth"
|
||||||
version = "0.29.1"
|
version = "0.29.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
enum-iterator = "0.7.0"
|
enum-iterator = "0.7.0"
|
||||||
hmac = "0.12.1"
|
hmac = "0.12.1"
|
||||||
meilisearch-types = { path = "../meilisearch-types" }
|
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"
|
rand = "0.8.4"
|
||||||
serde = { version = "1.0.136", features = ["derive"] }
|
serde = { version = "1.0.136", features = ["derive"] }
|
||||||
serde_json = { version = "1.0.85", features = ["preserve_order"] }
|
serde_json = { version = "1.0.85", features = ["preserve_order"] }
|
||||||
|
@ -4,7 +4,7 @@ description = "Meilisearch HTTP server"
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
name = "meilisearch-http"
|
name = "meilisearch-http"
|
||||||
version = "0.29.1"
|
version = "0.29.2"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "meilisearch"
|
name = "meilisearch"
|
||||||
|
@ -99,7 +99,7 @@ async fn error_access_expired_key() {
|
|||||||
assert!(response["key"].is_string());
|
assert!(response["key"].is_string());
|
||||||
|
|
||||||
let key = response["key"].as_str().unwrap();
|
let key = response["key"].as_str().unwrap();
|
||||||
server.use_api_key(&key);
|
server.use_api_key(key);
|
||||||
|
|
||||||
// wait until the key is expired.
|
// wait until the key is expired.
|
||||||
thread::sleep(time::Duration::new(1, 0));
|
thread::sleep(time::Duration::new(1, 0));
|
||||||
@ -135,7 +135,7 @@ async fn error_access_unauthorized_index() {
|
|||||||
assert!(response["key"].is_string());
|
assert!(response["key"].is_string());
|
||||||
|
|
||||||
let key = response["key"].as_str().unwrap();
|
let key = response["key"].as_str().unwrap();
|
||||||
server.use_api_key(&key);
|
server.use_api_key(key);
|
||||||
|
|
||||||
for (method, route) in AUTHORIZATIONS
|
for (method, route) in AUTHORIZATIONS
|
||||||
.keys()
|
.keys()
|
||||||
@ -175,7 +175,7 @@ async fn error_access_unauthorized_action() {
|
|||||||
assert!(response["key"].is_string());
|
assert!(response["key"].is_string());
|
||||||
|
|
||||||
let key = response["key"].as_str().unwrap();
|
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;
|
let (response, code) = server.dummy_request(method, route).await;
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
@ -230,7 +230,7 @@ async fn access_authorized_restricted_index() {
|
|||||||
assert!(response["key"].is_string());
|
assert!(response["key"].is_string());
|
||||||
|
|
||||||
let key = response["key"].as_str().unwrap();
|
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;
|
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());
|
assert!(response["key"].is_string());
|
||||||
|
|
||||||
let key = response["key"].as_str().unwrap();
|
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;
|
let (response, code) = server.dummy_request(method, route).await;
|
||||||
|
|
||||||
@ -313,7 +313,7 @@ async fn access_authorized_stats_restricted_index() {
|
|||||||
|
|
||||||
// use created key.
|
// use created key.
|
||||||
let key = response["key"].as_str().unwrap();
|
let key = response["key"].as_str().unwrap();
|
||||||
server.use_api_key(&key);
|
server.use_api_key(key);
|
||||||
|
|
||||||
let (response, code) = server.stats().await;
|
let (response, code) = server.stats().await;
|
||||||
assert_eq!(200, code, "{:?}", &response);
|
assert_eq!(200, code, "{:?}", &response);
|
||||||
@ -353,7 +353,7 @@ async fn access_authorized_stats_no_index_restriction() {
|
|||||||
|
|
||||||
// use created key.
|
// use created key.
|
||||||
let key = response["key"].as_str().unwrap();
|
let key = response["key"].as_str().unwrap();
|
||||||
server.use_api_key(&key);
|
server.use_api_key(key);
|
||||||
|
|
||||||
let (response, code) = server.stats().await;
|
let (response, code) = server.stats().await;
|
||||||
assert_eq!(200, code, "{:?}", &response);
|
assert_eq!(200, code, "{:?}", &response);
|
||||||
@ -393,7 +393,7 @@ async fn list_authorized_indexes_restricted_index() {
|
|||||||
|
|
||||||
// use created key.
|
// use created key.
|
||||||
let key = response["key"].as_str().unwrap();
|
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;
|
let (response, code) = server.list_indexes(None, None).await;
|
||||||
assert_eq!(200, code, "{:?}", &response);
|
assert_eq!(200, code, "{:?}", &response);
|
||||||
@ -434,7 +434,7 @@ async fn list_authorized_indexes_no_index_restriction() {
|
|||||||
|
|
||||||
// use created key.
|
// use created key.
|
||||||
let key = response["key"].as_str().unwrap();
|
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;
|
let (response, code) = server.list_indexes(None, None).await;
|
||||||
assert_eq!(200, code, "{:?}", &response);
|
assert_eq!(200, code, "{:?}", &response);
|
||||||
@ -474,7 +474,7 @@ async fn list_authorized_tasks_restricted_index() {
|
|||||||
|
|
||||||
// use created key.
|
// use created key.
|
||||||
let key = response["key"].as_str().unwrap();
|
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;
|
let (response, code) = server.service.get("/tasks").await;
|
||||||
assert_eq!(200, code, "{:?}", &response);
|
assert_eq!(200, code, "{:?}", &response);
|
||||||
@ -514,7 +514,7 @@ async fn list_authorized_tasks_no_index_restriction() {
|
|||||||
|
|
||||||
// use created key.
|
// use created key.
|
||||||
let key = response["key"].as_str().unwrap();
|
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;
|
let (response, code) = server.service.get("/tasks").await;
|
||||||
assert_eq!(200, code, "{:?}", &response);
|
assert_eq!(200, code, "{:?}", &response);
|
||||||
@ -545,7 +545,7 @@ async fn error_creating_index_without_action() {
|
|||||||
|
|
||||||
// use created key.
|
// use created key.
|
||||||
let key = response["key"].as_str().unwrap();
|
let key = response["key"].as_str().unwrap();
|
||||||
server.use_api_key(&key);
|
server.use_api_key(key);
|
||||||
|
|
||||||
let expected_error = json!({
|
let expected_error = json!({
|
||||||
"message": "Index `test` not found.",
|
"message": "Index `test` not found.",
|
||||||
@ -625,7 +625,7 @@ async fn lazy_create_index() {
|
|||||||
|
|
||||||
// use created key.
|
// use created key.
|
||||||
let key = response["key"].as_str().unwrap();
|
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
|
// try to create a index via add documents route
|
||||||
let index = server.index("test");
|
let index = server.index("test");
|
||||||
@ -692,7 +692,7 @@ async fn error_creating_index_without_index() {
|
|||||||
|
|
||||||
// use created key.
|
// use created key.
|
||||||
let key = response["key"].as_str().unwrap();
|
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
|
// try to create a index via add documents route
|
||||||
let index = server.index("test");
|
let index = server.index("test");
|
||||||
|
@ -473,7 +473,7 @@ async fn error_access_forbidden_routes() {
|
|||||||
"searchRules" => json!(["*"]),
|
"searchRules" => json!(["*"]),
|
||||||
"exp" => json!((OffsetDateTime::now_utc() + Duration::hours(1)).unix_timestamp())
|
"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);
|
server.use_api_key(&web_token);
|
||||||
|
|
||||||
for ((method, route), actions) in AUTHORIZATIONS.iter() {
|
for ((method, route), actions) in AUTHORIZATIONS.iter() {
|
||||||
@ -509,7 +509,7 @@ async fn error_access_expired_parent_key() {
|
|||||||
"searchRules" => json!(["*"]),
|
"searchRules" => json!(["*"]),
|
||||||
"exp" => json!((OffsetDateTime::now_utc() + Duration::hours(1)).unix_timestamp())
|
"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);
|
server.use_api_key(&web_token);
|
||||||
|
|
||||||
// test search request while parent_key is not expired
|
// test search request while parent_key is not expired
|
||||||
@ -552,7 +552,7 @@ async fn error_access_modified_token() {
|
|||||||
"searchRules" => json!(["products"]),
|
"searchRules" => json!(["products"]),
|
||||||
"exp" => json!((OffsetDateTime::now_utc() + Duration::hours(1)).unix_timestamp())
|
"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);
|
server.use_api_key(&web_token);
|
||||||
|
|
||||||
// test search request while web_token is valid
|
// 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())
|
"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 = [
|
let altered_token = [
|
||||||
web_token.split('.').next().unwrap(),
|
web_token.split('.').next().unwrap(),
|
||||||
alt.split('.').nth(1).unwrap(),
|
alt.split('.').nth(1).unwrap(),
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "meilisearch-lib"
|
name = "meilisearch-lib"
|
||||||
version = "0.29.1"
|
version = "0.29.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
@ -28,7 +28,7 @@ lazy_static = "1.4.0"
|
|||||||
log = "0.4.14"
|
log = "0.4.14"
|
||||||
meilisearch-auth = { path = "../meilisearch-auth" }
|
meilisearch-auth = { path = "../meilisearch-auth" }
|
||||||
meilisearch-types = { path = "../meilisearch-types" }
|
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"
|
mime = "0.3.16"
|
||||||
num_cpus = "1.13.1"
|
num_cpus = "1.13.1"
|
||||||
obkv = "0.2.0"
|
obkv = "0.2.0"
|
||||||
|
@ -213,7 +213,7 @@ impl TaskQueue {
|
|||||||
let head = self.queue.pop()?;
|
let head = self.queue.pop()?;
|
||||||
let result = {
|
let result = {
|
||||||
let mut ref_head = head.borrow_mut();
|
let mut ref_head = head.borrow_mut();
|
||||||
f(&mut *ref_head)
|
f(&mut ref_head)
|
||||||
};
|
};
|
||||||
if !head.borrow().tasks.is_empty() {
|
if !head.borrow().tasks.is_empty() {
|
||||||
// After being mutated, the head is reinserted to the correct position.
|
// After being mutated, the head is reinserted to the correct position.
|
||||||
|
@ -117,7 +117,7 @@ impl TaskStore {
|
|||||||
match filter {
|
match filter {
|
||||||
Some(filter) => filter
|
Some(filter) => filter
|
||||||
.pass(&task)
|
.pass(&task)
|
||||||
.then(|| task)
|
.then_some(task)
|
||||||
.ok_or(TaskError::UnexistingTask(id)),
|
.ok_or(TaskError::UnexistingTask(id)),
|
||||||
None => Ok(task),
|
None => Ok(task),
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "meilisearch-types"
|
name = "meilisearch-types"
|
||||||
version = "0.29.1"
|
version = "0.29.2"
|
||||||
authors = ["marin <postma.marin@protonmail.com>"]
|
authors = ["marin <postma.marin@protonmail.com>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "permissive-json-pointer"
|
name = "permissive-json-pointer"
|
||||||
version = "0.29.1"
|
version = "0.29.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "A permissive json pointer"
|
description = "A permissive json pointer"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
Loading…
Reference in New Issue
Block a user