mirror of
https://github.com/rustmailer/bichon.git
synced 2026-08-03 07:48:34 +02:00
update
This commit is contained in:
Generated
-1
@@ -566,7 +566,6 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"snafu",
|
"snafu",
|
||||||
"tantivy",
|
|
||||||
"timeago",
|
"timeago",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
|||||||
@@ -82,7 +82,6 @@ rustls-pemfile = "2.2.0"
|
|||||||
blake3 = "1.8.5"
|
blake3 = "1.8.5"
|
||||||
uuid = { version = "1.23.1", features = ["v4", "serde"] }
|
uuid = { version = "1.23.1", features = ["v4", "serde"] }
|
||||||
fjall = { version = "3.1.4", features = ["lz4", "metrics", "bytes_1"] }
|
fjall = { version = "3.1.4", features = ["lz4", "metrics", "bytes_1"] }
|
||||||
tantivy = { version = "0.26.0", features = ["zstd-compression"] }
|
|
||||||
tracing-log = "0.2.0"
|
tracing-log = "0.2.0"
|
||||||
tokio-util = "0.7.18"
|
tokio-util = "0.7.18"
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ async-imap = { git = "https://github.com/rustmailer/async-imap.git", branch = "m
|
|||||||
"runtime-tokio",
|
"runtime-tokio",
|
||||||
"compress",
|
"compress",
|
||||||
] }
|
] }
|
||||||
|
tantivy = { version = "0.26.0", features = ["zstd-compression"] }
|
||||||
webpki-roots.workspace = true
|
webpki-roots.workspace = true
|
||||||
rustls.workspace = true
|
rustls.workspace = true
|
||||||
rustls-pki-types.workspace = true
|
rustls-pki-types.workspace = true
|
||||||
@@ -65,6 +66,5 @@ mail-send.workspace = true
|
|||||||
blake3.workspace = true
|
blake3.workspace = true
|
||||||
uuid.workspace = true
|
uuid.workspace = true
|
||||||
fjall.workspace = true
|
fjall.workspace = true
|
||||||
tantivy.workspace = true
|
|
||||||
tracing-log.workspace = true
|
tracing-log.workspace = true
|
||||||
tokio-util.workspace = true
|
tokio-util.workspace = true
|
||||||
|
|||||||
@@ -16,7 +16,12 @@
|
|||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use tantivy::IndexWriter;
|
use tantivy::{schema::Facet, IndexWriter};
|
||||||
|
|
||||||
|
use crate::{
|
||||||
|
error::{code::ErrorCode, BichonResult},
|
||||||
|
raise_error,
|
||||||
|
};
|
||||||
|
|
||||||
pub mod attachment;
|
pub mod attachment;
|
||||||
pub mod envelope;
|
pub mod envelope;
|
||||||
@@ -66,3 +71,9 @@ pub fn fatal_commit(writer: &mut IndexWriter) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn validate_facet(tag: &str) -> BichonResult<()> {
|
||||||
|
Facet::from_text(tag)
|
||||||
|
.map(|_| ())
|
||||||
|
.map_err(|e| raise_error!(format!("{:#?}", e), ErrorCode::InvalidParameter))
|
||||||
|
}
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ poem-openapi = { version = "5.1.16", features = [
|
|||||||
] }
|
] }
|
||||||
rust-embed = "8.11.0"
|
rust-embed = "8.11.0"
|
||||||
email_address.workspace = true
|
email_address.workspace = true
|
||||||
tantivy.workspace = true
|
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
serde_json.workspace = true
|
serde_json.workspace = true
|
||||||
governor.workspace = true
|
governor.workspace = true
|
||||||
|
|||||||
@@ -29,12 +29,12 @@ use bichon_core::message::tags::TagsRequest;
|
|||||||
use bichon_core::raise_error;
|
use bichon_core::raise_error;
|
||||||
use bichon_core::store::tantivy::attachment::ATTACHMENT_MANAGER;
|
use bichon_core::store::tantivy::attachment::ATTACHMENT_MANAGER;
|
||||||
use bichon_core::store::tantivy::model::AttachmentModel;
|
use bichon_core::store::tantivy::model::AttachmentModel;
|
||||||
|
use bichon_core::store::tantivy::validate_facet;
|
||||||
use bichon_core::users::permissions::Permission;
|
use bichon_core::users::permissions::Permission;
|
||||||
use poem_openapi::param::Path;
|
use poem_openapi::param::Path;
|
||||||
use poem_openapi::payload::Json;
|
use poem_openapi::payload::Json;
|
||||||
use poem_openapi::OpenApi;
|
use poem_openapi::OpenApi;
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use tantivy::schema::Facet;
|
|
||||||
|
|
||||||
pub struct AttachmentApi;
|
pub struct AttachmentApi;
|
||||||
|
|
||||||
@@ -133,8 +133,7 @@ impl AttachmentApi {
|
|||||||
) -> ApiResult<()> {
|
) -> ApiResult<()> {
|
||||||
let req = req.0;
|
let req = req.0;
|
||||||
for tag in &req.tags {
|
for tag in &req.tags {
|
||||||
Facet::from_text(tag)
|
validate_facet(tag)?;
|
||||||
.map_err(|e| raise_error!(format!("{:#?}", e), ErrorCode::InvalidParameter))?;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for account_id in req.updates.keys() {
|
for account_id in req.updates.keys() {
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ use bichon_core::raise_error;
|
|||||||
use bichon_core::store::envelope::Envelope;
|
use bichon_core::store::envelope::Envelope;
|
||||||
use bichon_core::store::storage::get_reader;
|
use bichon_core::store::storage::get_reader;
|
||||||
use bichon_core::store::tantivy::envelope::ENVELOPE_MANAGER;
|
use bichon_core::store::tantivy::envelope::ENVELOPE_MANAGER;
|
||||||
|
use bichon_core::store::tantivy::validate_facet;
|
||||||
use bichon_core::users::permissions::Permission;
|
use bichon_core::users::permissions::Permission;
|
||||||
use poem::Body;
|
use poem::Body;
|
||||||
use poem_openapi::param::{Path, Query};
|
use poem_openapi::param::{Path, Query};
|
||||||
@@ -45,7 +46,6 @@ use poem_openapi::payload::{Attachment, AttachmentType, Json};
|
|||||||
use poem_openapi::OpenApi;
|
use poem_openapi::OpenApi;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use tantivy::schema::Facet;
|
|
||||||
|
|
||||||
pub struct MessageApi;
|
pub struct MessageApi;
|
||||||
|
|
||||||
@@ -350,8 +350,7 @@ impl MessageApi {
|
|||||||
) -> ApiResult<()> {
|
) -> ApiResult<()> {
|
||||||
let req = req.0;
|
let req = req.0;
|
||||||
for tag in &req.tags {
|
for tag in &req.tags {
|
||||||
Facet::from_text(tag)
|
validate_facet(tag)?;
|
||||||
.map_err(|e| raise_error!(format!("{:#?}", e), ErrorCode::InvalidParameter))?;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for account_id in req.updates.keys() {
|
for account_id in req.updates.keys() {
|
||||||
|
|||||||
Reference in New Issue
Block a user