diff --git a/meilisearch/src/routes/metrics.rs b/meilisearch/src/routes/metrics.rs index 4b328adb0..59cff9b58 100644 --- a/meilisearch/src/routes/metrics.rs +++ b/meilisearch/src/routes/metrics.rs @@ -22,9 +22,9 @@ pub async fn get_metrics( let auth_filters = index_scheduler.filters(); if !auth_filters.all_indexes_authorized() { let mut error = ResponseError::from(AuthenticationError::InvalidToken); - error.message.push_str( - " The API key for the `/metrics` route must have no limitation on the indexes.", - ); + error + .message + .push_str(" The API key for the `/metrics` route must allow access to all indexes."); return Err(error); } diff --git a/meilisearch/tests/auth/authorization.rs b/meilisearch/tests/auth/authorization.rs index d226f019a..ef4a7eaa1 100644 --- a/meilisearch/tests/auth/authorization.rs +++ b/meilisearch/tests/auth/authorization.rs @@ -76,7 +76,7 @@ static INVALID_RESPONSE: Lazy = Lazy::new(|| { }); static INVALID_METRICS_RESPONSE: Lazy = Lazy::new(|| { - json!({"message": "The provided API key is invalid. The API key for the `/metrics` route must have no limitation on the indexes.", + json!({"message": "The provided API key is invalid. The API key for the `/metrics` route must allow access to all indexes.", "code": "invalid_api_key", "type": "auth", "link": "https://docs.meilisearch.com/errors#invalid_api_key"