mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-11-22 13:29:21 +00:00
Update dependencies
This commit is contained in:
parent
243351cae2
commit
6ab6278bd4
49
Cargo.lock
generated
49
Cargo.lock
generated
@ -6,7 +6,7 @@ version = "0.10.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1be241f88f3b1e7e9a3fbe3b5a8a0f6915b5a1d7ee0d9a248d3376d01068cc60"
|
checksum = "1be241f88f3b1e7e9a3fbe3b5a8a0f6915b5a1d7ee0d9a248d3376d01068cc60"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-rt 1.1.1",
|
"actix-rt",
|
||||||
"actix_derive",
|
"actix_derive",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"bytes 0.5.6",
|
"bytes 0.5.6",
|
||||||
@ -48,7 +48,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "177837a10863f15ba8d3ae3ec12fac1099099529ed20083a27fdfe247381d0dc"
|
checksum = "177837a10863f15ba8d3ae3ec12fac1099099529ed20083a27fdfe247381d0dc"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-codec",
|
"actix-codec",
|
||||||
"actix-rt 1.1.1",
|
"actix-rt",
|
||||||
"actix-service",
|
"actix-service",
|
||||||
"actix-utils",
|
"actix-utils",
|
||||||
"derive_more",
|
"derive_more",
|
||||||
@ -68,7 +68,7 @@ checksum = "452299e87817ae5673910e53c243484ca38be3828db819b6011736fc6982e874"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-codec",
|
"actix-codec",
|
||||||
"actix-connect",
|
"actix-connect",
|
||||||
"actix-rt 1.1.1",
|
"actix-rt",
|
||||||
"actix-service",
|
"actix-service",
|
||||||
"actix-threadpool",
|
"actix-threadpool",
|
||||||
"actix-utils",
|
"actix-utils",
|
||||||
@ -117,16 +117,6 @@ dependencies = [
|
|||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "actix-macros"
|
|
||||||
version = "0.2.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "dbcb2b608f0accc2f5bcf3dd872194ce13d94ee45b571487035864cf966b04ef"
|
|
||||||
dependencies = [
|
|
||||||
"quote",
|
|
||||||
"syn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "actix-multipart"
|
name = "actix-multipart"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
@ -164,7 +154,7 @@ version = "1.1.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "143fcc2912e0d1de2bcf4e2f720d2a60c28652ab4179685a1ee159e0fb3db227"
|
checksum = "143fcc2912e0d1de2bcf4e2f720d2a60c28652ab4179685a1ee159e0fb3db227"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-macros 0.1.3",
|
"actix-macros",
|
||||||
"actix-threadpool",
|
"actix-threadpool",
|
||||||
"copyless",
|
"copyless",
|
||||||
"futures-channel",
|
"futures-channel",
|
||||||
@ -173,17 +163,6 @@ dependencies = [
|
|||||||
"tokio 0.2.25",
|
"tokio 0.2.25",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "actix-rt"
|
|
||||||
version = "2.0.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "c88cf46527e27f66efcd5831f60b3d9c2dac795b6d255ed17791752d6c36a8ea"
|
|
||||||
dependencies = [
|
|
||||||
"actix-macros 0.2.0",
|
|
||||||
"futures-core",
|
|
||||||
"tokio 1.2.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "actix-server"
|
name = "actix-server"
|
||||||
version = "1.0.4"
|
version = "1.0.4"
|
||||||
@ -191,7 +170,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "45407e6e672ca24784baa667c5d32ef109ccdd8d5e0b5ebb9ef8a67f4dfb708e"
|
checksum = "45407e6e672ca24784baa667c5d32ef109ccdd8d5e0b5ebb9ef8a67f4dfb708e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-codec",
|
"actix-codec",
|
||||||
"actix-rt 1.1.1",
|
"actix-rt",
|
||||||
"actix-service",
|
"actix-service",
|
||||||
"actix-utils",
|
"actix-utils",
|
||||||
"futures-channel",
|
"futures-channel",
|
||||||
@ -220,8 +199,8 @@ version = "1.0.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "47239ca38799ab74ee6a8a94d1ce857014b2ac36f242f70f3f75a66f691e791c"
|
checksum = "47239ca38799ab74ee6a8a94d1ce857014b2ac36f242f70f3f75a66f691e791c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-macros 0.1.3",
|
"actix-macros",
|
||||||
"actix-rt 1.1.1",
|
"actix-rt",
|
||||||
"actix-server",
|
"actix-server",
|
||||||
"actix-service",
|
"actix-service",
|
||||||
"log",
|
"log",
|
||||||
@ -262,7 +241,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "2e9022dec56632d1d7979e59af14f0597a28a830a9c1c7fec8b2327eb9f16b5a"
|
checksum = "2e9022dec56632d1d7979e59af14f0597a28a830a9c1c7fec8b2327eb9f16b5a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-codec",
|
"actix-codec",
|
||||||
"actix-rt 1.1.1",
|
"actix-rt",
|
||||||
"actix-service",
|
"actix-service",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"bytes 0.5.6",
|
"bytes 0.5.6",
|
||||||
@ -283,9 +262,9 @@ checksum = "e641d4a172e7faa0862241a20ff4f1f5ab0ab7c279f00c2d4587b77483477b86"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-codec",
|
"actix-codec",
|
||||||
"actix-http",
|
"actix-http",
|
||||||
"actix-macros 0.1.3",
|
"actix-macros",
|
||||||
"actix-router",
|
"actix-router",
|
||||||
"actix-rt 1.1.1",
|
"actix-rt",
|
||||||
"actix-server",
|
"actix-server",
|
||||||
"actix-service",
|
"actix-service",
|
||||||
"actix-testing",
|
"actix-testing",
|
||||||
@ -456,7 +435,7 @@ checksum = "b381e490e7b0cfc37ebc54079b0413d8093ef43d14a4e4747083f7fa47a9e691"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-codec",
|
"actix-codec",
|
||||||
"actix-http",
|
"actix-http",
|
||||||
"actix-rt 1.1.1",
|
"actix-rt",
|
||||||
"actix-service",
|
"actix-service",
|
||||||
"base64 0.13.0",
|
"base64 0.13.0",
|
||||||
"bytes 0.5.6",
|
"bytes 0.5.6",
|
||||||
@ -714,7 +693,7 @@ version = "0.1.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"actix",
|
"actix",
|
||||||
"actix-multipart",
|
"actix-multipart",
|
||||||
"actix-rt 2.0.2",
|
"actix-rt",
|
||||||
"actix-web",
|
"actix-web",
|
||||||
"actix-web-actors",
|
"actix-web-actors",
|
||||||
"bcrypt",
|
"bcrypt",
|
||||||
@ -2851,11 +2830,7 @@ dependencies = [
|
|||||||
"memchr",
|
"memchr",
|
||||||
"mio 0.7.8",
|
"mio 0.7.8",
|
||||||
"num_cpus",
|
"num_cpus",
|
||||||
"once_cell",
|
|
||||||
"parking_lot",
|
|
||||||
"pin-project-lite 0.2.4",
|
"pin-project-lite 0.2.4",
|
||||||
"signal-hook-registry",
|
|
||||||
"winapi 0.3.9",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -11,7 +11,7 @@ yaml-rust = "0.4.5"
|
|||||||
mysql = "20.1.0"
|
mysql = "20.1.0"
|
||||||
actix = "0.10.0"
|
actix = "0.10.0"
|
||||||
actix-web = "3.3.2"
|
actix-web = "3.3.2"
|
||||||
actix-rt = "2.0.2"
|
actix-rt = "1.1.1"
|
||||||
actix-multipart = "0.3.0"
|
actix-multipart = "0.3.0"
|
||||||
actix-web-actors = "3.0.0"
|
actix-web-actors = "3.0.0"
|
||||||
serde = { version = "1.0.123", features = ["derive"] }
|
serde = { version = "1.0.123", features = ["derive"] }
|
||||||
|
@ -36,7 +36,7 @@ struct SuccessMessage {
|
|||||||
|
|
||||||
pub struct PostFile {
|
pub struct PostFile {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub buff: bytes::Bytes,
|
pub buff: actix_web::web::Bytes,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Single request body value
|
/// Single request body value
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
use core::fmt;
|
use core::fmt;
|
||||||
use std::error;
|
use std::error;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
|
use std::fmt::Formatter;
|
||||||
use serde::export::Formatter;
|
|
||||||
|
|
||||||
/// Simple rust error
|
/// Simple rust error
|
||||||
///
|
///
|
||||||
@ -37,4 +36,5 @@ impl fmt::Display for ExecError {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl error::Error for ExecError {}
|
impl error::Error for ExecError {}
|
@ -4,8 +4,7 @@ use std::pin::Pin;
|
|||||||
use actix_web::{App, FromRequest, http, HttpMessage, HttpRequest, HttpResponse, HttpServer, web};
|
use actix_web::{App, FromRequest, http, HttpMessage, HttpRequest, HttpResponse, HttpServer, web};
|
||||||
use actix_web::dev::{Decompress, Payload, PayloadStream};
|
use actix_web::dev::{Decompress, Payload, PayloadStream};
|
||||||
use actix_web::error::{ErrorBadRequest, ErrorInternalServerError, PayloadError};
|
use actix_web::error::{ErrorBadRequest, ErrorInternalServerError, PayloadError};
|
||||||
use actix_web::web::{Bytes, BytesMut};
|
use actix_web::web::{Bytes, BytesMut, BufMut, Buf};
|
||||||
use bytes::{Buf, BufMut};
|
|
||||||
use encoding_rs::UTF_8;
|
use encoding_rs::UTF_8;
|
||||||
use futures::{FutureExt, Stream, StreamExt};
|
use futures::{FutureExt, Stream, StreamExt};
|
||||||
use futures::future::LocalBoxFuture;
|
use futures::future::LocalBoxFuture;
|
||||||
|
@ -59,6 +59,7 @@ pub fn legacy_crypt_pass(pass: &str) -> ResultBoxError<String> {
|
|||||||
pub fn rand_str(len: usize) -> String {
|
pub fn rand_str(len: usize) -> String {
|
||||||
thread_rng()
|
thread_rng()
|
||||||
.sample_iter(&Alphanumeric)
|
.sample_iter(&Alphanumeric)
|
||||||
|
.map(char::from)
|
||||||
.take(len)
|
.take(len)
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
@ -7,10 +7,12 @@ use pdf::backend::Backend;
|
|||||||
use crate::data::error::{ExecError, ResultBoxError};
|
use crate::data::error::{ExecError, ResultBoxError};
|
||||||
|
|
||||||
/// Check out whether a PDF is a valid PDF or not, by trying to open it
|
/// Check out whether a PDF is a valid PDF or not, by trying to open it
|
||||||
pub fn is_valid_pdf(file: &bytes::Bytes) -> ResultBoxError<bool> {
|
pub fn is_valid_pdf(file: &actix_web::web::Bytes) -> ResultBoxError<bool> {
|
||||||
let backend = file.to_vec();
|
let backend = file.to_vec();
|
||||||
|
|
||||||
match backend.read_xref_table_and_trailer() {
|
let start_offset = backend.locate_start_offset()?;
|
||||||
|
|
||||||
|
match backend.read_xref_table_and_trailer(start_offset) {
|
||||||
Ok((refs, _)) => {
|
Ok((refs, _)) => {
|
||||||
if refs.is_empty() {
|
if refs.is_empty() {
|
||||||
Err(ExecError::boxed_string(format!("Detected a PDF with 0 references (file size: {})!", file.len())))
|
Err(ExecError::boxed_string(format!("Detected a PDF with 0 references (file size: {})!", file.len())))
|
||||||
@ -20,7 +22,7 @@ pub fn is_valid_pdf(file: &bytes::Bytes) -> ResultBoxError<bool> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
println!("Error while parsing PDF: {}", e);
|
println!("Error while parsing PDF: {:?}", e);
|
||||||
Ok(false)
|
Ok(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user