diff --git a/Cargo.lock b/Cargo.lock index cdb159ae5..2c96a6a61 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,19 +1,5 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -[[package]] -name = "accept-encoding" -version = "0.2.0-alpha.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "adler32" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "ahash" version = "0.2.17" @@ -54,18 +40,46 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "async-compression" -version = "0.1.0-alpha.7" +name = "async-attributes" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "brotli2 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "flate2 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-core-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "async-std" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "async-attributes 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "async-task 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "broadcaster 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-channel 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-io 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-timer 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "kv-log-macro 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "pin-project 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "zstd 0.5.1+zstd.1.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "zstd-safe 2.0.3+zstd.1.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", + "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "once_cell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-lite 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "async-task" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -131,21 +145,16 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "brotli-sys" -version = "0.3.2" +name = "broadcaster" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "brotli2" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "brotli-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-channel-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -159,15 +168,6 @@ dependencies = [ "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "buf_redux" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "bumpalo" version = "2.6.0" @@ -208,10 +208,6 @@ dependencies = [ name = "cc" version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "jobserver 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.0 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "cfg-if" @@ -289,14 +285,6 @@ dependencies = [ "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "crc32fast" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "criterion" version = "0.3.0" @@ -427,11 +415,6 @@ name = "doc-comment" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "dtoa" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "either" version = "1.5.3" @@ -478,17 +461,6 @@ dependencies = [ "synstructure 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "flate2" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "miniz_oxide 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "fnv" version = "1.0.6" @@ -531,6 +503,29 @@ name = "futures" version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "futures" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures-channel 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-executor 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-io 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-task 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "futures-channel" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures-core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "futures-channel-preview" version = "0.3.0-alpha.19" @@ -540,6 +535,11 @@ dependencies = [ "futures-sink-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "futures-core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "futures-core-preview" version = "0.3.0-alpha.19" @@ -551,56 +551,84 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "futures-executor-preview" -version = "0.3.0-alpha.19" +name = "futures-executor" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures-core-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-task 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "futures-io-preview" -version = "0.3.0-alpha.19" +name = "futures-io" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "futures-preview" -version = "0.3.0-alpha.19" +name = "futures-macro" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures-channel-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-core-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-executor-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-io-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-sink-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "futures-sink" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "futures-sink-preview" version = "0.3.0-alpha.19" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "futures-task" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-timer" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-util" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-channel 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-io 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-macro 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-task 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "futures-util-preview" version = "0.3.0-alpha.19" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-channel-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", "futures-core-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-io-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", "futures-sink-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -621,11 +649,6 @@ dependencies = [ "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "glob" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "h2" version = "0.1.26" @@ -709,25 +732,36 @@ dependencies = [ [[package]] name = "http-service" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "async-std 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "http 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-lite 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "http-service-hyper" -version = "0.3.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "http 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "http-service 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "http-service 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "http-service-mock" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "http-service 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "httparse" version = "1.3.4" @@ -847,16 +881,6 @@ dependencies = [ "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "jobserver" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "js-sys" version = "0.3.32" @@ -874,6 +898,14 @@ dependencies = [ "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "kv-log-macro" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -910,14 +942,6 @@ dependencies = [ "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "log" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "log" version = "0.4.8" @@ -987,13 +1011,15 @@ dependencies = [ name = "meilisearch-http" version = "0.8.4" dependencies = [ - "async-compression 0.1.0-alpha.7 (registry+https://github.com/rust-lang/crates.io-index)", + "async-std 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-channel 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "heed 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "http 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", + "http-service 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "http-service-mock 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "jemallocator 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1009,10 +1035,8 @@ dependencies = [ "siphasher 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "structopt 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "sysinfo 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", - "tide 0.2.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)", - "tide-compression 0.1.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)", - "tide-log 0.1.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)", - "tide-slog 0.1.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)", + "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tide 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "ureq 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", "vergen 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1064,30 +1088,8 @@ dependencies = [ [[package]] name = "mime" -version = "0.2.6" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "mime_guess" -version = "1.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", - "phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", - "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "miniz_oxide" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "mio" @@ -1106,6 +1108,16 @@ dependencies = [ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "mio-uds" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "miow" version = "0.2.1" @@ -1117,23 +1129,6 @@ dependencies = [ "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "multipart" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "buf_redux 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)", - "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "mime_guess 1.8.7 (registry+https://github.com/rust-lang/crates.io-index)", - "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "twoway 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "net2" version = "0.2.33" @@ -1184,7 +1179,7 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1250,57 +1245,9 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "phf" -version = "0.7.24" +name = "pin-project-lite" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "phf_codegen" -version = "0.7.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "phf_generator 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", - "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "phf_generator" -version = "0.7.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "phf_shared" -version = "0.7.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pin-project" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "pin-project-internal 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pin-project-internal" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "pin-utils" @@ -1346,6 +1293,11 @@ dependencies = [ "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "proc-macro-nested" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "proc-macro2" version = "0.4.30" @@ -1393,19 +1345,13 @@ dependencies = [ [[package]] name = "rand" -version = "0.6.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1421,15 +1367,6 @@ dependencies = [ "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "rand_chacha" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rand_chacha" version = "0.2.1" @@ -1460,14 +1397,6 @@ dependencies = [ "getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "rand_hc" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rand_hc" version = "0.2.0" @@ -1476,37 +1405,6 @@ dependencies = [ "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "rand_isaac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rand_jitter" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rand_os" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rand_os" version = "0.2.2" @@ -1516,23 +1414,6 @@ dependencies = [ "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "rand_pcg" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rand_xorshift" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rand_xoshiro" version = "0.3.1" @@ -1560,7 +1441,7 @@ dependencies = [ "crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1672,11 +1553,6 @@ name = "ryu" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "safemem" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "same-file" version = "1.0.5" @@ -1757,27 +1633,11 @@ dependencies = [ "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "serde_urlencoded" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "sha1" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "siphasher" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "siphasher" version = "0.3.1" @@ -1793,11 +1653,6 @@ name = "slice-group-by" version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "slog" -version = "2.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "smallvec" version = "0.6.13" @@ -1956,6 +1811,15 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "tempdir" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "tempfile" version = "3.1.0" @@ -1995,133 +1859,21 @@ dependencies = [ [[package]] name = "tide" -version = "0.2.0" -source = "git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1#e77709370bb24cf776fe6da902467c35131535b1" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", + "async-std 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "http 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "http-service 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "http-service-hyper 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "route-recognizer 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tide-cookies 0.2.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)", - "tide-core 0.2.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)", - "tide-cors 0.2.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)", - "tide-forms 0.1.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)", - "tide-headers 0.1.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)", - "tide-log 0.1.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)", - "tide-querystring 0.1.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)", -] - -[[package]] -name = "tide-compression" -version = "0.1.0" -source = "git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1#e77709370bb24cf776fe6da902467c35131535b1" -dependencies = [ - "accept-encoding 0.2.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)", - "async-compression 0.1.0-alpha.7 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "http-service 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tide 0.2.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)", -] - -[[package]] -name = "tide-cookies" -version = "0.2.0" -source = "git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1#e77709370bb24cf776fe6da902467c35131535b1" -dependencies = [ - "cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "http-service 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tide-core 0.2.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)", -] - -[[package]] -name = "tide-core" -version = "0.2.0" -source = "git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1#e77709370bb24cf776fe6da902467c35131535b1" -dependencies = [ - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "http-service 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "http-service 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "http-service-hyper 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-lite 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "route-recognizer 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tide-cors" -version = "0.2.0" -source = "git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1#e77709370bb24cf776fe6da902467c35131535b1" -dependencies = [ - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "http-service 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tide-core 0.2.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)", -] - -[[package]] -name = "tide-forms" -version = "0.1.0" -source = "git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1#e77709370bb24cf776fe6da902467c35131535b1" -dependencies = [ - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "http-service 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "multipart 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tide-core 0.2.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)", -] - -[[package]] -name = "tide-headers" -version = "0.1.0" -source = "git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1#e77709370bb24cf776fe6da902467c35131535b1" -dependencies = [ - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "tide-core 0.2.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)", -] - -[[package]] -name = "tide-log" -version = "0.1.0" -source = "git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1#e77709370bb24cf776fe6da902467c35131535b1" -dependencies = [ - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "tide-core 0.2.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)", -] - -[[package]] -name = "tide-querystring" -version = "0.1.0" -source = "git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1#e77709370bb24cf776fe6da902467c35131535b1" -dependencies = [ - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", "serde_qs 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tide-core 0.2.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)", -] - -[[package]] -name = "tide-slog" -version = "0.1.0" -source = "git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1#e77709370bb24cf776fe6da902467c35131535b1" -dependencies = [ - "futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "slog 2.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tide-core 0.2.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)", ] [[package]] @@ -2151,7 +1903,7 @@ dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-current-thread 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2208,7 +1960,7 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2249,7 +2001,7 @@ dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2279,22 +2031,6 @@ name = "try-lock" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "twoway" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "unicase" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "unicode-bidi" version = "0.3.4" @@ -2610,43 +2346,16 @@ dependencies = [ "synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "zstd" -version = "0.5.1+zstd.1.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "zstd-safe 2.0.3+zstd.1.4.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "zstd-safe" -version = "2.0.3+zstd.1.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "zstd-sys 1.4.15+zstd.1.4.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "zstd-sys" -version = "1.4.15+zstd.1.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", - "glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", -] - [metadata] -"checksum accept-encoding 0.2.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30a322c52e6267da6b6695b47c7284b85f128dbc6e3ec990faa8c5eed8ee1506" -"checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" "checksum ahash 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "2f00e10d4814aa20900e7948174384f79f1317f24f0ba7494e735111653fc330" "checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" "checksum anyhow 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "9267dff192e68f3399525901e709a48c1d3982c9c072fa32f2127a0cb0babf14" "checksum arc-swap 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f1a1eca3195b729bbd64e292ef2f5fff6b1c28504fed762ce2b1013dde4d8e92" "checksum assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7deb0a829ca7bcfaf5da70b073a8d128619259a7be8216a355e23f00763059e5" -"checksum async-compression 0.1.0-alpha.7 (registry+https://github.com/rust-lang/crates.io-index)" = "111a881dbe8c614f7905f52bd305d7c57c3bcd47feb0aba9da976fee662b98af" +"checksum async-attributes 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "efd3d156917d94862e779f356c5acae312b08fd3121e792c857d7928c8088423" +"checksum async-std 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0bf6039b315300e057d198b9d3ab92ee029e31c759b7f1afae538145e6f18a3e" +"checksum async-task 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d22dc86693d375d2733b536fd8914bea0fa93adf4b1e6bcbd9c7c500cb62d920" "checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" "checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" "checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" @@ -2655,10 +2364,8 @@ dependencies = [ "checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" "checksum bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8ab639324e3ee8774d296864fbc0dbbb256cf1a41c490b94cba90c082915f92" "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" -"checksum brotli-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4445dea95f4c2b41cde57cc9fee236ae4dbae88d8fcbdb4750fc1bb5d86aaecd" -"checksum brotli2 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0cb036c3eade309815c15ddbacec5b22c4d1f3983a774ab2eac2e3e9ea85568e" +"checksum broadcaster 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "07a1446420a56f1030271649ba0da46d23239b3a68c73591cea5247f15a788a0" "checksum bstr 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8d6c2c5b58ab920a4f5aeaaca34b4488074e8cc7596af94e6f8c6ff247c60245" -"checksum buf_redux 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b953a6887648bb07a535631f2bc00fbdb2a2216f135552cb3f534ed136b9c07f" "checksum bumpalo 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ad807f2fc2bf185eeb98ff3a901bd46dc5ad58163d0fa4577ba0d25674d71708" "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" "checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" @@ -2674,7 +2381,6 @@ dependencies = [ "checksum const-random 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7b641a8c9867e341f3295564203b1c250eb8ce6cb6126e007941f78c4d2ed7fe" "checksum const-random-macro 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c750ec12b83377637110d5a57f5ae08e895b06c4b16e2bdbf1a94ef717428c59" "checksum cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "888604f00b3db336d2af898ec3c1d5d0ddf5e6d462220f2ededc33a87ac4bbd5" -"checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" "checksum criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "938703e165481c8d612ea3479ac8342e5615185db37765162e762ec3523e2fc6" "checksum criterion-plot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eccdc6ce8bbe352ca89025bee672aa6d24f4eb8c53e3a8b5d1bc58011da072a2" "checksum crossbeam-channel 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "acec9a3b0b3559f15aee4f90746c4e5e293b701c0f7d3925d24e01645267b68c" @@ -2689,13 +2395,11 @@ dependencies = [ "checksum deunicode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca8a0f5bbdedde60605d0719b998e282af68e2b1c50203110211fe4abe857560" "checksum discard 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" "checksum doc-comment 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "923dea538cea0aa3025e8685b20d6ee21ef99c4f77e954a30febbaac5ec73a97" -"checksum dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ea57b42383d091c85abcc2706240b94ab2a8fa1fc81c10ff23c4de06e2a90b5e" "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" "checksum env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" "checksum error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3ab49e9dcb602294bc42f9a7dfc9bc6e936fca4418ea300dbfb84fe16de0b7d9" "checksum failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f8273f13c977665c5db7eb2b99ae520952fe5ac831ae4cd09d80c4c7042b5ed9" "checksum failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0bc225b78e0391e4b8683440bf2e63c2deeeb2ce5189eab46e2b68c6d3725d08" -"checksum flate2 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)" = "ad3c5233c9a940c8719031b423d7e6c16af66e031cb0420b0896f5245bf181d3" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "checksum fs_extra 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5f2a4a2034423744d2cc7ca2068453168dcdb82c438419e639a26bd87839c674" "checksum fst 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "927fb434ff9f0115b215dc0efd2e4fbdd7448522a92a1aa37c77d6a2f8f1ebd6" @@ -2703,17 +2407,23 @@ dependencies = [ "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" "checksum futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)" = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" +"checksum futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b6f16056ecbb57525ff698bb955162d0cd03bee84e6241c27ff75c08d8ca5987" +"checksum futures-channel 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fcae98ca17d102fd8a3603727b9259fcf7fa4239b603d2142926189bc8999b86" "checksum futures-channel-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "d5e5f4df964fa9c1c2f8bddeb5c3611631cacd93baf810fc8bb2fb4b495c263a" +"checksum futures-core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "79564c427afefab1dfb3298535b21eda083ef7935b4f0ecbfcb121f0aec10866" "checksum futures-core-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "b35b6263fb1ef523c3056565fa67b1d16f0a8604ff12b11b08c25f28a734c60a" "checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" -"checksum futures-executor-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "75236e88bd9fe88e5e8bfcd175b665d0528fe03ca4c5207fabc028c8f9d93e98" -"checksum futures-io-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "f4914ae450db1921a56c91bde97a27846287d062087d4a652efc09bb3a01ebda" -"checksum futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "3b1dce2a0267ada5c6ff75a8ba864b4e679a9e2aa44262af7a3b5516d530d76e" +"checksum futures-executor 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1e274736563f686a837a0568b478bdabfeaec2dca794b5649b04e2fe1627c231" +"checksum futures-io 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e676577d229e70952ab25f3945795ba5b16d63ca794ca9d2c860e5595d20b5ff" +"checksum futures-macro 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "52e7c56c15537adb4f76d0b7a76ad131cb4d2f4f32d3b0bcabcbe1c7c5e87764" +"checksum futures-sink 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "171be33efae63c2d59e6dbba34186fe0d6394fb378069a76dfd80fdcffd43c16" "checksum futures-sink-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "86f148ef6b69f75bb610d4f9a2336d4fc88c4b5b67129d1a340dd0fd362efeec" +"checksum futures-task 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0bae52d6b29cf440e298856fec3965ee6fa71b06aa7495178615953fd669e5f9" +"checksum futures-timer 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a1de7508b218029b0f01662ed8f61b1c964b3ae99d6f25462d0f55a595109df6" +"checksum futures-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c0d66274fb76985d3c62c886d1da7ac4c0903a8c9f754e8fe0f35a6a6cc39e76" "checksum futures-util-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "5ce968633c17e5f97936bd2797b6e38fb56cf16a7422319f7ec2e30d3c470e8d" "checksum getopts 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)" = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5" "checksum getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e7db7ca94ed4cd01190ceee0d8a8052f08a247aa1b469a7f68c6a3b71afcf407" -"checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" "checksum h2 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" "checksum hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" @@ -2721,8 +2431,9 @@ dependencies = [ "checksum hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "307c3c9f937f38e3534b1d6447ecf090cafcc9744e4a6360e8b037b2cf5af120" "checksum http 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)" = "d7e06e336150b178206af098a055e3621e8336027e2b4d126bda0bc64824baaf" "checksum http-body 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" -"checksum http-service 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "25c8f5ec0cd178a4f7f1750ef816be157b50c943c6570ec5c16e847844e88de7" -"checksum http-service-hyper 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e1448396b4b59718d3d4ea7c2cdcc267df1587d88485b168020e1e8a8c4b8c87" +"checksum http-service 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9625f605ddfaf894bf78a544a7b8e31f562dc843654723a49892d9c7e75ac708" +"checksum http-service-hyper 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e33d5dae94e0fdb82f9524ea2f2b98458b3d8448526d8cc8beccb3d3fded8aff" +"checksum http-service-mock 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "893e67bcfcd552717ddfcc3af17fa5397d39a2b1a64a8266271efff619d6af45" "checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" "checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" "checksum hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)" = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" @@ -2735,33 +2446,30 @@ dependencies = [ "checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" "checksum jemalloc-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0d3b9f3f5c9b31aa0f5ed3260385ac205db665baa41d49bb8338008ae94ede45" "checksum jemallocator 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "43ae63fcfc45e99ab3d1b29a46782ad679e98436c3169d15a167a1108a724b69" -"checksum jobserver 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b1d42ef453b30b7387e113da1c83ab1605d90c5b4e0eb8e96d016ed3b8c160" "checksum js-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)" = "1c840fdb2167497b0bd0db43d6dfe61e91637fa72f9d061f8bd17ddc44ba6414" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +"checksum kv-log-macro 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c54d9f465d530a752e6ebdc217e081a7a614b48cb200f6f0aee21ba6bc9aabb" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" "checksum levenshtein_automata 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73a004f877f468548d8d0ac4977456a249d8fabbdb8416c36db163dfc8f2e8ca" "checksum libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)" = "1a31a0627fdf1f6a39ec0dd577e101440b7db22672c0901fe00a9a6fbb5c24e8" "checksum lmdb-rkv-sys 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "74168edb46923d92c3833b41a5a55b712e1b3fcf2050a142b3873902fd79aab4" "checksum lock_api 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f8912e782533a93a167888781b836336a6ca5da6175c05944c86cf28c31104dc" -"checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" "checksum main_error 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3516df0fb44d98fe6d6e859d224adfb7b6686447937e5b96308d6061595eed04" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" "checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" "checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" -"checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" -"checksum mime_guess 1.8.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0d977de9ee851a0b16e932979515c0f3da82403183879811bc97d50bd9cc50f7" -"checksum miniz_oxide 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6f3f74f726ae935c3f514300cc6773a0c9492abc5e972d42ba0c0ebb88757625" +"checksum mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" "checksum mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)" = "83f51996a3ed004ef184e16818edc51fadffe8e7ca68be67f9dee67d84d0ff23" +"checksum mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "966257a94e196b11bb43aca423754d87429960a768de9414f3691d6957abf125" "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" -"checksum multipart 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)" = "136eed74cadb9edd2651ffba732b19a450316b680e4f48d6c79e905799e19d01" "checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" "checksum nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" "checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" "checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" "checksum num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6ba9a427cfca2be13aa6f6403b0b7e7368fe982bfa16fccc450ce74c46cd9b32" -"checksum num_cpus 1.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "155394f924cdddf08149da25bfb932d226b4a593ca7468b08191ff6335941af5" +"checksum num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76dac5ed2a876980778b8b85f75a71b6cbf0db0b1232ee12f826bccb00d09d72" "checksum once_cell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "891f486f630e5c5a4916c7e16c4b24a53e78c860b646e9f8e005e4f16847bfed" "checksum ordered-float 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "18869315e81473c951eb56ad5558bbc56978562d3ecfb87abb7a1e944cea4518" "checksum page_size 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f89ef58b3d32420dbd1a43d2f38ae92f6239ef12bb556ab09ca55445f5a67242" @@ -2769,39 +2477,28 @@ dependencies = [ "checksum parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" "checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" -"checksum phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b3da44b85f8e8dfaec21adae67f95d93244b2ecf6ad2a692320598dcc8e6dd18" -"checksum phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b03e85129e324ad4166b06b2c7491ae27fe3ec353af72e72cd1654c7225d517e" -"checksum phf_generator 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "09364cc93c159b8b06b1f4dd8a4398984503483891b0c26b867cf431fb132662" -"checksum phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "234f71a15de2288bcb7e3b6515828d22af7ec8598ee6d24c3b526fa0a80b67a0" -"checksum pin-project 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c5fce7042b4e4338a3f868e563fff394709c3ff62cf6908d407dd9e2caff96ed" -"checksum pin-project-internal 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "7644b4721cc27235f667e735da8732f5b781c442157315674c0cb7f28b4cabf3" +"checksum pin-project-lite 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e8822eb8bb72452f038ebf6048efa02c3fe22bf83f76519c9583e47fc194a422" "checksum pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5894c618ce612a3fa23881b152b608bafb8c56cfc22f434a3ba3120b40f7b587" "checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" "checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" "checksum pretty-bytes 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "009d6edd2c1dbf2e1c0cd48a2f7766e03498d49ada7109a01c6911815c685316" "checksum proc-macro-error 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aeccfe4d5d8ea175d5f0e4a2ad0637e0f4121d63bd99d356fb1f39ab2e7c6097" "checksum proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" +"checksum proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" "checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" "checksum qstring 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "267047d2df92990367cbbf6b686c363c1518eb98e225b5193c8b936e52ab565a" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" "checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" -"checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" +"checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" "checksum rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3ae1b169243eaf61759b8475a998f0a385e42042370f3a7dbaf35246eacc8412" -"checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" "checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" "checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" "checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" "checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -"checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" "checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -"checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -"checksum rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" -"checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" "checksum rand_os 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a788ae3edb696cfcba1c19bfd388cc4b8c21f8a408432b199c072825084da58a" -"checksum rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" -"checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" "checksum rand_xoshiro 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0e18c91676f670f6f0312764c759405f13afb98d5d73819840cf72a518487bff" "checksum rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "83a27732a533a1be0a0035a111fe76db89ad312f6f0347004c220c57f209a123" "checksum rayon-core 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "98dcf634205083b17d0861252431eb2acbfb698ab7478a2d20de07954f47ec7b" @@ -2818,7 +2515,6 @@ dependencies = [ "checksum rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e" "checksum rustyline 5.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e9d8eb9912bc492db051324d36f5cea56984fc2afeaa5c6fa84e0b0e3cde550f" "checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" -"checksum safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" "checksum same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "585e8ddcedc187886a30fa705c47985c3fa88d06624095856b36ca0b82ff4421" "checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" "checksum sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" @@ -2829,13 +2525,10 @@ dependencies = [ "checksum serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "ca13fc1a832f793322228923fbb3aba9f3f44444898f835d31ad1b74fa0a2bf8" "checksum serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)" = "2f72eb2a68a7dc3f9a691bfda9305a1c017a6215e5a4545c258500d2099a37c2" "checksum serde_qs 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "36278a86e341c46a42b0413ac3aa781902af93f5f4b10af098c704f4b96d81d8" -"checksum serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" "checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" -"checksum siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" "checksum siphasher 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "83da420ee8d1a89e640d0948c646c1c088758d3a3c538f943bfa97bdac17929d" "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" "checksum slice-group-by 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1f7474f0b646d228360ab62ed974744617bc869d959eac8403bfa3665931a7fb" -"checksum slog 2.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1cc9c640a4adbfbcc11ffb95efe5aa7af7309e002adab54b185507dbf2377b99" "checksum smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" "checksum smallvec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44e59e0c9fa00817912ae6e4e6e3c4fe04455e75699d06eedc7d85917ed8e8f4" "checksum sourcefile 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4bf77cb82ba8453b42b6ae1d692e4cdc92f9a47beaf89a847c8be83f4e328ad3" @@ -2853,20 +2546,12 @@ dependencies = [ "checksum synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "02353edf96d6e4dc81aea2d8490a7e9db177bf8acb0e951c24940bf866cb313f" "checksum synstructure 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "575be94ccb86e8da37efb894a87e2b660be299b41d8ef347f9d6d79fbe61b1ba" "checksum sysinfo 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)" = "6f4b2468c629cffba39c0a4425849ab3cdb03d9dfacba69684609aea04d08ff9" +"checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" "checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" "checksum termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e" "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" -"checksum tide 0.2.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)" = "" -"checksum tide-compression 0.1.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)" = "" -"checksum tide-cookies 0.2.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)" = "" -"checksum tide-core 0.2.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)" = "" -"checksum tide-cors 0.2.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)" = "" -"checksum tide-forms 0.1.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)" = "" -"checksum tide-headers 0.1.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)" = "" -"checksum tide-log 0.1.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)" = "" -"checksum tide-querystring 0.1.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)" = "" -"checksum tide-slog 0.1.0 (git+https://github.com/rustasync/tide?rev=e77709370bb24cf776fe6da902467c35131535b1)" = "" +"checksum tide 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13c99b1991db81e611a2614cd1b07fec89ae33c5f755e1f8eb70826fb5af0eea" "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" "checksum tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4574b75faccaacddb9b284faecdf0b544b80b6b294f3d062d325c5726a209c20" "checksum tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" @@ -2881,8 +2566,6 @@ dependencies = [ "checksum tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "f2106812d500ed25a4f38235b9cae8f78a09edf43203e16e59c3b769a342a60e" "checksum toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "01d1404644c8b12b16bfcffa4322403a91a451584daaaa7c28d3152e6cbc98cf" "checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" -"checksum twoway 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" -"checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" "checksum unicode-normalization 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "09c8070a9942f5e7cfccd93f490fdebd230ee3c3c9f107cb25bad5351ef671cf" "checksum unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" @@ -2922,6 +2605,3 @@ dependencies = [ "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" "checksum zerocopy 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "992b9b31f80fd4a167f903f879b8ca43d6716cc368ea01df90538baa2dd34056" "checksum zerocopy-derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b090467ecd0624026e8a6405d343ac7382592530d54881330b3fc8e400280fa5" -"checksum zstd 0.5.1+zstd.1.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5c5d978b793ae64375b80baf652919b148f6a496ac8802922d9999f5a553194f" -"checksum zstd-safe 2.0.3+zstd.1.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bee25eac9753cfedd48133fa1736cbd23b774e253d89badbeac7d12b23848d3f" -"checksum zstd-sys 1.4.15+zstd.1.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "89719b034dc22d240d5b407fb0a3fe6d29952c181cff9a9f95c0bd40b4f8f7d8" diff --git a/meilisearch-http/Cargo.toml b/meilisearch-http/Cargo.toml index 3d583252e..f7e8a1e2e 100644 --- a/meilisearch-http/Cargo.toml +++ b/meilisearch-http/Cargo.toml @@ -37,27 +37,14 @@ sysinfo = "0.9.5" ureq = { version = "0.11.2", features = ["tls"], default-features = false } walkdir = "2.2.9" whoami = "0.6" +tide = "0.5.1" +async-std = { version = "1.0.1", features = ["unstable", "attributes"] } -[dependencies.async-compression] -default-features = false -features = ["stream", "gzip", "zlib", "brotli", "zstd"] -version = "=0.1.0-alpha.7" +[dev-dependencies] +http-service-mock = "0.4.0" +http-service = "0.4.0" -[dependencies.tide] -git = "https://github.com/rustasync/tide" -rev = "e77709370bb24cf776fe6da902467c35131535b1" - -[dependencies.tide-log] -git = "https://github.com/rustasync/tide" -rev = "e77709370bb24cf776fe6da902467c35131535b1" - -[dependencies.tide-slog] -git = "https://github.com/rustasync/tide" -rev = "e77709370bb24cf776fe6da902467c35131535b1" - -[dependencies.tide-compression] -git = "https://github.com/rustasync/tide" -rev = "e77709370bb24cf776fe6da902467c35131535b1" +tempdir = "0.3.7" [build-dependencies] vergen = "3.0.4" diff --git a/meilisearch-http/src/error.rs b/meilisearch-http/src/error.rs index 6d6310cd0..b0f7a1272 100644 --- a/meilisearch-http/src/error.rs +++ b/meilisearch-http/src/error.rs @@ -3,7 +3,7 @@ use std::fmt::Display; use http::status::StatusCode; use log::{error, warn}; use serde::{Deserialize, Serialize}; -use tide::response::IntoResponse; +use tide::IntoResponse; use tide::Response; pub type SResult = Result; @@ -120,7 +120,5 @@ struct ErrorMessage { fn error(message: String, status: StatusCode) -> Response { let message = ErrorMessage { message }; - tide::response::json(message) - .with_status(status) - .into_response() + tide::Response::new(status.as_u16()).body_json(&message).unwrap() } diff --git a/meilisearch-http/src/helpers/tide.rs b/meilisearch-http/src/helpers/tide.rs index 52c785fee..23eda399f 100644 --- a/meilisearch-http/src/helpers/tide.rs +++ b/meilisearch-http/src/helpers/tide.rs @@ -4,9 +4,9 @@ use crate::Data; use chrono::Utc; use heed::types::{SerdeBincode, Str}; use meilisearch_core::Index; -use tide::Context; +use tide::Request; -pub trait ContextExt { +pub trait RequestExt { fn is_allowed(&self, acl: ACL) -> SResult<()>; fn header(&self, name: &str) -> Result; fn url_param(&self, name: &str) -> Result; @@ -14,14 +14,16 @@ pub trait ContextExt { fn identifier(&self) -> Result; } -impl ContextExt for Context { +impl RequestExt for Request { fn is_allowed(&self, acl: ACL) -> SResult<()> { let api_key = match &self.state().api_key { Some(api_key) => api_key, None => return Ok(()), }; - let user_api_key = self.header("X-Meili-API-Key")?; + let user_api_key = self.header("X-Meili-API-Key") + .ok_or(ResponseError::missing_header("X-Meili-API-Key"))?; + if user_api_key == *api_key { return Ok(()); } diff --git a/meilisearch-http/src/main.rs b/meilisearch-http/src/main.rs index e38bc5956..1fa5079ee 100644 --- a/meilisearch-http/src/main.rs +++ b/meilisearch-http/src/main.rs @@ -1,12 +1,12 @@ use std::env::VarError::NotPresent; use std::{env, thread}; -use http::header::HeaderValue; +use async_std::task; use log::info; use main_error::MainError; use structopt::StructOpt; -use tide::middleware::{CorsMiddleware, CorsOrigin}; -use tide_log::RequestLogger; +// use tide::middleware::{CorsMiddleware, CorsOrigin}; +// use tide_log::RequestLogger; use meilisearch_http::data::Data; use meilisearch_http::option::Opt; @@ -34,21 +34,23 @@ pub fn main() -> Result<(), MainError> { index_update_callback(name, &data_cloned, status); })); - let mut app = tide::App::with_state(data); + let mut app = tide::with_state(data); - app.middleware( - CorsMiddleware::new() - .allow_origin(CorsOrigin::from("*")) - .allow_methods(HeaderValue::from_static("GET, POST, OPTIONS")), - ); - app.middleware(RequestLogger::new()); - app.middleware(tide_compression::Compression::new()); - app.middleware(tide_compression::Decompression::new()); + // app.middleware( + // CorsMiddleware::new() + // .allow_origin(CorsOrigin::from("*")) + // .allow_methods(HeaderValue::from_static("GET, POST, OPTIONS")), + // ); + // app.middleware(RequestLogger::new()); + // app.middleware(tide_compression::Compression::new()); + // app.middleware(tide_compression::Decompression::new()); routes::load_routes(&mut app); info!("Server HTTP enabled"); - app.run(opt.http_addr)?; + task::block_on(async { + app.listen(opt.http_addr).await.unwrap(); + }); Ok(()) } diff --git a/meilisearch-http/src/routes/document.rs b/meilisearch-http/src/routes/document.rs index 3312975db..fb9eaf681 100644 --- a/meilisearch-http/src/routes/document.rs +++ b/meilisearch-http/src/routes/document.rs @@ -1,21 +1,18 @@ use std::collections::{BTreeSet, HashSet}; -use http::StatusCode; use indexmap::IndexMap; use serde::{Deserialize, Serialize}; use serde_json::Value; -use tide::querystring::ContextExt as QSContextExt; -use tide::response::IntoResponse; -use tide::{Context, Response}; +use tide::{Request, Response}; use meilisearch_core::settings::Settings; use crate::error::{ResponseError, SResult}; -use crate::helpers::tide::ContextExt; +use crate::helpers::tide::RequestExt; use crate::models::token::ACL::*; use crate::Data; -pub async fn get_document(ctx: Context) -> SResult { +pub async fn get_document(ctx: Request) -> SResult { ctx.is_allowed(DocumentsRead)?; let index = ctx.index()?; @@ -35,7 +32,7 @@ pub async fn get_document(ctx: Context) -> SResult { return Err(ResponseError::document_not_found(identifier)); } - Ok(tide::response::json(response)) + Ok(tide::Response::new(200).body_json(&response).unwrap()) } #[derive(Default, Serialize)] @@ -44,7 +41,7 @@ pub struct IndexUpdateResponse { pub update_id: u64, } -pub async fn delete_document(ctx: Context) -> SResult { +pub async fn delete_document(ctx: Request) -> SResult { ctx.is_allowed(DocumentsWrite)?; let index = ctx.index()?; @@ -63,9 +60,7 @@ pub async fn delete_document(ctx: Context) -> SResult { update_writer.commit().map_err(ResponseError::internal)?; let response_body = IndexUpdateResponse { update_id }; - Ok(tide::response::json(response_body) - .with_status(StatusCode::ACCEPTED) - .into_response()) + Ok(tide::Response::new(202).body_json(&response_body).unwrap()) } #[derive(Default, Deserialize)] @@ -76,11 +71,11 @@ struct BrowseQuery { attributes_to_retrieve: Option, } -pub async fn get_all_documents(ctx: Context) -> SResult { +pub async fn get_all_documents(ctx: Request) -> SResult { ctx.is_allowed(DocumentsRead)?; let index = ctx.index()?; - let query: BrowseQuery = ctx.url_query().unwrap_or(BrowseQuery::default()); + let query: BrowseQuery = ctx.query().unwrap_or(BrowseQuery::default()); let offset = query.offset.unwrap_or(0); let limit = query.limit.unwrap_or(20); @@ -116,7 +111,7 @@ pub async fn get_all_documents(ctx: Context) -> SResult { } } - Ok(tide::response::json(response_body)) + Ok(tide::Response::new(200).body_json(&response_body).unwrap()) } fn find_identifier(document: &IndexMap) -> Option { @@ -134,15 +129,14 @@ struct UpdateDocumentsQuery { identifier: Option, } -async fn update_multiple_documents(mut ctx: Context, is_partial: bool) -> SResult { +async fn update_multiple_documents(mut ctx: Request, is_partial: bool) -> SResult { ctx.is_allowed(DocumentsWrite)?; let index = ctx.index()?; let data: Vec> = ctx.body_json().await.map_err(ResponseError::bad_request)?; - let query: UpdateDocumentsQuery = ctx - .url_query().unwrap_or_default(); + let query: UpdateDocumentsQuery = ctx.query().unwrap_or_default(); let db = &ctx.state().db; let reader = db.main_read_txn().map_err(ResponseError::internal)?; @@ -188,20 +182,18 @@ async fn update_multiple_documents(mut ctx: Context, is_partial: bool) -> update_writer.commit().map_err(ResponseError::internal)?; let response_body = IndexUpdateResponse { update_id }; - Ok(tide::response::json(response_body) - .with_status(StatusCode::ACCEPTED) - .into_response()) + Ok(tide::Response::new(202).body_json(&response_body).unwrap()) } -pub async fn add_or_replace_multiple_documents(ctx: Context) -> SResult { +pub async fn add_or_replace_multiple_documents(ctx: Request) -> SResult { update_multiple_documents(ctx, false).await } -pub async fn add_or_update_multiple_documents(ctx: Context) -> SResult { +pub async fn add_or_update_multiple_documents(ctx: Request) -> SResult { update_multiple_documents(ctx, true).await } -pub async fn delete_multiple_documents(mut ctx: Context) -> SResult { +pub async fn delete_multiple_documents(mut ctx: Request) -> SResult { ctx.is_allowed(DocumentsWrite)?; let data: Vec = ctx.body_json().await.map_err(ResponseError::bad_request)?; @@ -226,12 +218,10 @@ pub async fn delete_multiple_documents(mut ctx: Context) -> SResult) -> SResult { +pub async fn clear_all_documents(ctx: Request) -> SResult { ctx.is_allowed(DocumentsWrite)?; let index = ctx.index()?; @@ -245,7 +235,5 @@ pub async fn clear_all_documents(ctx: Context) -> SResult { writer.commit().map_err(ResponseError::internal)?; let response_body = IndexUpdateResponse { update_id }; - Ok(tide::response::json(response_body) - .with_status(StatusCode::ACCEPTED) - .into_response()) + Ok(tide::Response::new(202).body_json(&response_body).unwrap()) } diff --git a/meilisearch-http/src/routes/health.rs b/meilisearch-http/src/routes/health.rs index 4582ebc90..dae4fa17f 100644 --- a/meilisearch-http/src/routes/health.rs +++ b/meilisearch-http/src/routes/health.rs @@ -1,15 +1,15 @@ use crate::error::{ResponseError, SResult}; -use crate::helpers::tide::ContextExt; +use crate::helpers::tide::RequestExt; use crate::models::token::ACL::*; use crate::Data; use heed::types::{Str, Unit}; use serde::Deserialize; -use tide::Context; +use tide::{Response, Request}; const UNHEALTHY_KEY: &str = "_is_unhealthy"; -pub async fn get_health(ctx: Context) -> SResult<()> { +pub async fn get_health(ctx: Request) -> SResult { let db = &ctx.state().db; let reader = db.main_read_txn().map_err(ResponseError::internal)?; @@ -19,10 +19,10 @@ pub async fn get_health(ctx: Context) -> SResult<()> { return Err(ResponseError::Maintenance); } - Ok(()) + Ok(tide::Response::new(200)) } -pub async fn set_healthy(ctx: Context) -> SResult<()> { +pub async fn set_healthy(ctx: Request) -> SResult { ctx.is_allowed(Admin)?; let db = &ctx.state().db; @@ -38,10 +38,10 @@ pub async fn set_healthy(ctx: Context) -> SResult<()> { return Err(ResponseError::internal(e)); } - Ok(()) + Ok(tide::Response::new(200)) } -pub async fn set_unhealthy(ctx: Context) -> SResult<()> { +pub async fn set_unhealthy(ctx: Request) -> SResult { ctx.is_allowed(Admin)?; let db = &ctx.state().db; @@ -57,7 +57,7 @@ pub async fn set_unhealthy(ctx: Context) -> SResult<()> { return Err(ResponseError::internal(e)); } - Ok(()) + Ok(tide::Response::new(200)) } #[derive(Deserialize, Clone)] @@ -65,7 +65,7 @@ struct HealtBody { health: bool, } -pub async fn change_healthyness(mut ctx: Context) -> SResult<()> { +pub async fn change_healthyness(mut ctx: Request) -> SResult { let body: HealtBody = ctx.body_json().await.map_err(ResponseError::bad_request)?; if body.health { diff --git a/meilisearch-http/src/routes/index.rs b/meilisearch-http/src/routes/index.rs index 379a4d40f..7e6eb4716 100644 --- a/meilisearch-http/src/routes/index.rs +++ b/meilisearch-http/src/routes/index.rs @@ -1,16 +1,13 @@ use chrono::{DateTime, Utc}; -use http::StatusCode; use log::error; use meilisearch_core::ProcessedUpdateResult; -// use meilisearch_schema::Schema; use rand::seq::SliceRandom; use serde::{Deserialize, Serialize}; use serde_json::json; -use tide::response::IntoResponse; -use tide::{Context, Response}; +use tide::{Request, Response}; use crate::error::{ResponseError, SResult}; -use crate::helpers::tide::ContextExt; +use crate::helpers::tide::RequestExt; use crate::models::token::ACL::*; use crate::Data; @@ -23,7 +20,7 @@ fn generate_uid() -> String { .collect() } -pub async fn list_indexes(ctx: Context) -> SResult { +pub async fn list_indexes(ctx: Request) -> SResult { ctx.is_allowed(IndexesRead)?; let indexes_uids = ctx.state().db.indexes_uids(); @@ -69,7 +66,7 @@ pub async fn list_indexes(ctx: Context) -> SResult { } } - Ok(tide::response::json(response_body)) + Ok(tide::Response::new(200).body_json(&response_body).unwrap()) } #[derive(Debug, Serialize)] @@ -81,7 +78,7 @@ struct IndexResponse { updated_at: DateTime, } -pub async fn get_index(ctx: Context) -> SResult { +pub async fn get_index(ctx: Request) -> SResult { ctx.is_allowed(IndexesRead)?; let index = ctx.index()?; @@ -113,7 +110,7 @@ pub async fn get_index(ctx: Context) -> SResult { updated_at, }; - Ok(tide::response::json(response_body)) + Ok(tide::Response::new(200).body_json(&response_body).unwrap()) } #[derive(Debug, Deserialize)] @@ -129,14 +126,11 @@ struct IndexCreateRequest { struct IndexCreateResponse { name: String, uid: String, - // schema: Option, - // #[serde(skip_serializing_if = "Option::is_none")] - // update_id: Option, created_at: DateTime, updated_at: DateTime, } -pub async fn create_index(mut ctx: Context) -> SResult { +pub async fn create_index(mut ctx: Request) -> SResult { ctx.is_allowed(IndexesWrite)?; let body = ctx @@ -171,27 +165,17 @@ pub async fn create_index(mut ctx: Context) -> SResult { // let schema: Option = body.schema.clone().map(Into::into); // let mut response_update_id = None; // if let Some(schema) = schema { - // let update_id = created_index - // .schema_update(&mut update_writer, schema) - // .map_err(ResponseError::internal)?; - // response_update_id = Some(update_id) - // } - // writer.commit().map_err(ResponseError::internal)?; - // update_writer.commit().map_err(ResponseError::internal)?; + writer.commit().map_err(ResponseError::internal)?; let response_body = IndexCreateResponse { - name: body.name, + name: name, uid, - // schema: body.schema, - // update_id: update_id, created_at: Utc::now(), updated_at: Utc::now(), }; - Ok(tide::response::json(response_body) - .with_status(StatusCode::CREATED) - .into_response()) + Ok(tide::Response::new(201).body_json(&response_body).unwrap()) } #[derive(Debug, Deserialize)] @@ -209,7 +193,7 @@ struct UpdateIndexResponse { updated_at: DateTime, } -pub async fn update_index(mut ctx: Context) -> SResult { +pub async fn update_index(mut ctx: Request) -> SResult { ctx.is_allowed(IndexesWrite)?; let body = ctx @@ -254,12 +238,10 @@ pub async fn update_index(mut ctx: Context) -> SResult { updated_at, }; - Ok(tide::response::json(response_body) - .with_status(StatusCode::OK) - .into_response()) + Ok(tide::Response::new(200).body_json(&response_body).unwrap()) } -pub async fn get_update_status(ctx: Context) -> SResult { +pub async fn get_update_status(ctx: Request) -> SResult { ctx.is_allowed(IndexesRead)?; let db = &ctx.state().db; @@ -275,41 +257,33 @@ pub async fn get_update_status(ctx: Context) -> SResult { .map_err(ResponseError::internal)?; let response = match status { - Some(status) => tide::response::json(status) - .with_status(StatusCode::OK) - .into_response(), - None => tide::response::json(json!({ "message": "unknown update id" })) - .with_status(StatusCode::NOT_FOUND) - .into_response(), + Some(status) => tide::Response::new(200).body_json(&status).unwrap(), + None => tide::Response::new(404).body_json(&json!({ "message": "unknown update id" })).unwrap(), }; Ok(response) } -pub async fn get_all_updates_status(ctx: Context) -> SResult { +pub async fn get_all_updates_status(ctx: Request) -> SResult { ctx.is_allowed(IndexesRead)?; let db = &ctx.state().db; let reader = db.update_read_txn().map_err(ResponseError::internal)?; let index = ctx.index()?; - let all_status = index + let response = index .all_updates_status(&reader) .map_err(ResponseError::internal)?; - let response = tide::response::json(all_status) - .with_status(StatusCode::OK) - .into_response(); - - Ok(response) + Ok(tide::Response::new(200).body_json(&response).unwrap()) } -pub async fn delete_index(ctx: Context) -> SResult { +pub async fn delete_index(ctx: Request) -> SResult { ctx.is_allowed(IndexesWrite)?; let _ = ctx.index()?; let index_uid = ctx.url_param("index")?; ctx.state().db.delete_index(&index_uid).map_err(ResponseError::internal)?; - Ok(StatusCode::NO_CONTENT) + Ok(tide::Response::new(204)) } pub fn index_update_callback(index_uid: &str, data: &Data, status: ProcessedUpdateResult) { diff --git a/meilisearch-http/src/routes/key.rs b/meilisearch-http/src/routes/key.rs index ed9143410..693674bd1 100644 --- a/meilisearch-http/src/routes/key.rs +++ b/meilisearch-http/src/routes/key.rs @@ -1,14 +1,12 @@ use chrono::serde::ts_seconds; use chrono::{DateTime, Utc}; use heed::types::{SerdeBincode, Str}; -use http::StatusCode; use rand::seq::SliceRandom; use serde::{Deserialize, Serialize}; -use tide::response::IntoResponse; -use tide::{Context, Response}; +use tide::{Request, Response}; use crate::error::{ResponseError, SResult}; -use crate::helpers::tide::ContextExt; +use crate::helpers::tide::RequestExt; use crate::models::token::ACL::*; use crate::models::token::*; use crate::Data; @@ -22,7 +20,7 @@ fn generate_api_key() -> String { .collect() } -pub async fn list(ctx: Context) -> SResult { +pub async fn list(ctx: Request) -> SResult { ctx.is_allowed(Admin)?; let db = &ctx.state().db; @@ -41,10 +39,10 @@ pub async fn list(ctx: Context) -> SResult { response.push(token); } - Ok(tide::response::json(response)) + Ok(tide::Response::new(200).body_json(&response).unwrap()) } -pub async fn get(ctx: Context) -> SResult { +pub async fn get(ctx: Request) -> SResult { ctx.is_allowed(Admin)?; let request_key = ctx.url_param("key")?; @@ -62,7 +60,7 @@ pub async fn get(ctx: Context) -> SResult { token_key )))?; - Ok(tide::response::json(token_config)) + Ok(tide::Response::new(200).body_json(&token_config).unwrap()) } #[derive(Debug, Serialize, Deserialize)] @@ -75,7 +73,7 @@ pub struct CreatedRequest { expires_at: DateTime, } -pub async fn create(mut ctx: Context) -> SResult { +pub async fn create(mut ctx: Request) -> SResult { ctx.is_allowed(Admin)?; let data: CreatedRequest = ctx.body_json().await.map_err(ResponseError::bad_request)?; @@ -103,9 +101,7 @@ pub async fn create(mut ctx: Context) -> SResult { writer.commit().map_err(ResponseError::internal)?; - Ok(tide::response::json(token_definition) - .with_status(StatusCode::CREATED) - .into_response()) + Ok(tide::Response::new(201).body_json(&token_definition).unwrap()) } #[derive(Debug, Serialize, Deserialize)] @@ -118,7 +114,7 @@ pub struct UpdatedRequest { revoked: Option, } -pub async fn update(mut ctx: Context) -> SResult { +pub async fn update(mut ctx: Request) -> SResult { ctx.is_allowed(Admin)?; let request_key = ctx.url_param("key")?; @@ -168,12 +164,10 @@ pub async fn update(mut ctx: Context) -> SResult { writer.commit().map_err(ResponseError::internal)?; - Ok(tide::response::json(token_config) - .with_status(StatusCode::OK) - .into_response()) + Ok(tide::Response::new(200).body_json(&token_config).unwrap()) } -pub async fn delete(ctx: Context) -> SResult { +pub async fn delete(ctx: Request) -> SResult { ctx.is_allowed(Admin)?; let request_key = ctx.url_param("key")?; @@ -190,5 +184,5 @@ pub async fn delete(ctx: Context) -> SResult { writer.commit().map_err(ResponseError::internal)?; - Ok(StatusCode::NO_CONTENT) + Ok(tide::Response::new(204)) } diff --git a/meilisearch-http/src/routes/mod.rs b/meilisearch-http/src/routes/mod.rs index 128ceeddd..6c026fb83 100644 --- a/meilisearch-http/src/routes/mod.rs +++ b/meilisearch-http/src/routes/mod.rs @@ -1,3 +1,6 @@ +use tide::Response; +use tide::IntoResponse; +use std::future::Future; use crate::data::Data; pub mod document; @@ -10,113 +13,108 @@ pub mod stats; pub mod stop_words; pub mod synonym; -pub fn load_routes(app: &mut tide::App) { +async fn into_response(x: impl Future>) -> Response { + match x.await { + Ok(resp) => resp.into_response(), + Err(resp) => resp.into_response(), + } +} + +pub fn load_routes(app: &mut tide::Server) { app.at("").nest(|router| { // expose the web interface static files - router.at("/").get(|_| async { - let content = include_str!("../../public/interface.html").to_owned(); - tide::http::Response::builder() - .header(tide::http::header::CONTENT_TYPE, "text/html; charset=utf-8") - .status(tide::http::StatusCode::OK) - .body(content).unwrap() + router.at("/").get(|_| async move { + let response = include_str!("../../public/interface.html"); + response }); router.at("/bulma.min.css").get(|_| async { - let content = include_str!("../../public/bulma.min.css"); - tide::http::Response::builder() - .header(tide::http::header::CONTENT_TYPE, "text/css; charset=utf-8") - .status(tide::http::StatusCode::OK) - .body(content).unwrap() + let response = include_str!("../../public/bulma.min.css"); + response }); router.at("/indexes").nest(|router| { router .at("/") - .get(index::list_indexes) - .post(index::create_index); + .get(|ctx| into_response(index::list_indexes(ctx))) + .post(|ctx| into_response(index::create_index(ctx))); - router.at("/search").post(search::search_multi_index); + router.at("/search").post(|ctx| into_response(search::search_multi_index(ctx))); router.at("/:index").nest(|router| { - router.at("/search").get(search::search_with_url_query); + router.at("/search").get(|ctx| into_response(search::search_with_url_query(ctx))); router.at("/updates").nest(|router| { - router.at("/").get(index::get_all_updates_status); + router.at("/").get(|ctx| into_response(index::get_all_updates_status(ctx))); - router.at("/:update_id").get(index::get_update_status); + router.at("/:update_id").get(|ctx| into_response(index::get_update_status(ctx))); }); router .at("/") - .get(index::get_index) - .put(index::update_index) - .delete(index::delete_index); - - // router - // .at("/schema") - // .get(index::get_index_schema) - // .put(index::update_schema); + .get(|ctx| into_response(index::get_index(ctx))) + .put(|ctx| into_response(index::update_index(ctx))) + .delete(|ctx| into_response(index::delete_index(ctx))); router.at("/documents").nest(|router| { router .at("/") - .get(document::get_all_documents) - .post(document::add_or_replace_multiple_documents) - .put(document::add_or_update_multiple_documents) - .delete(document::clear_all_documents); + .get(|ctx| into_response(document::get_all_documents(ctx))) + .post(|ctx| into_response(document::add_or_replace_multiple_documents(ctx))) + .put(|ctx| into_response(document::add_or_update_multiple_documents(ctx))) + .delete(|ctx| into_response(document::clear_all_documents(ctx))); router.at("/:identifier").nest(|router| { router .at("/") - .get(document::get_document) - .delete(document::delete_document); + .get(|ctx| into_response(document::get_document(ctx))) + .delete(|ctx| into_response(document::delete_document(ctx))); }); router .at("/delete-batch") - .post(document::delete_multiple_documents); + .post(|ctx| into_response(document::delete_multiple_documents(ctx))); }); router.at("/settings").nest(|router| { router.at("/synonyms") - .get(synonym::get) - .post(synonym::update) - .delete(synonym::delete); + .get(|ctx| into_response(synonym::get(ctx))) + .post(|ctx| into_response(synonym::update(ctx))) + .delete(|ctx| into_response(synonym::delete(ctx))); router.at("/stop-words") - .get(stop_words::get) - .post(stop_words::update) - .delete(stop_words::delete); + .get(|ctx| into_response(stop_words::get(ctx))) + .post(|ctx| into_response(stop_words::update(ctx))) + .delete(|ctx| into_response(stop_words::delete(ctx))); }) - .get(setting::get) - .post(setting::update); + .get(|ctx| into_response(setting::get(ctx))) + .post(|ctx| into_response(setting::update(ctx))); - - router.at("/stats").get(stats::index_stat); + router.at("/stats").get(|ctx| into_response(stats::index_stat(ctx))); }); }); router.at("/keys").nest(|router| { - router.at("/").get(key::list).post(key::create); + router.at("/").get(|ctx| into_response(key::list(ctx))).post(|ctx| into_response(key::create(ctx))); router .at("/:key") - .get(key::get) - .put(key::update) - .delete(key::delete); + .get(|ctx| into_response(key::get(ctx))) + .put(|ctx| into_response(key::update(ctx))) + .delete(|ctx| into_response(key::delete(ctx))); }); }); app.at("").nest(|router| { router .at("/health") - .get(health::get_health) - .put(health::change_healthyness); + .get(|ctx| into_response(health::get_health(ctx))) + .put(|ctx| into_response(health::change_healthyness(ctx))); - router.at("/stats").get(stats::get_stats); - router.at("/version").get(stats::get_version); - router.at("/sys-info").get(stats::get_sys_info); + router.at("/stats").get(|ctx| into_response(stats::get_stats(ctx))); + router.at("/version").get(|ctx| into_response(stats::get_version(ctx))); + router.at("/sys-info").get(|ctx| into_response(stats::get_sys_info(ctx))); router .at("/sys-info/pretty") - .get(stats::get_sys_info_pretty); + .get(|ctx| into_response(stats::get_sys_info_pretty(ctx))); }); } diff --git a/meilisearch-http/src/routes/search.rs b/meilisearch-http/src/routes/search.rs index 88ac24fd0..ebf0e5974 100644 --- a/meilisearch-http/src/routes/search.rs +++ b/meilisearch-http/src/routes/search.rs @@ -5,12 +5,11 @@ use std::time::Duration; use meilisearch_core::Index; use rayon::iter::{IntoParallelIterator, ParallelIterator}; use serde::{Deserialize, Serialize}; -use tide::querystring::ContextExt as QSContextExt; -use tide::{Context, Response}; +use tide::{Request, Response}; use crate::error::{ResponseError, SResult}; use crate::helpers::meilisearch::{Error, IndexSearchExt, SearchHit}; -use crate::helpers::tide::ContextExt; +use crate::helpers::tide::RequestExt; use crate::Data; #[derive(Deserialize)] @@ -28,7 +27,7 @@ struct SearchQuery { matches: Option, } -pub async fn search_with_url_query(ctx: Context) -> SResult { +pub async fn search_with_url_query(ctx: Request) -> SResult { // ctx.is_allowed(DocumentsRead)?; let index = ctx.index()?; @@ -41,8 +40,7 @@ pub async fn search_with_url_query(ctx: Context) -> SResult { .map_err(ResponseError::internal)? .ok_or(ResponseError::open_index("No Schema found"))?; - let query: SearchQuery = ctx - .url_query() + let query: SearchQuery = ctx.query() .map_err(|_| ResponseError::bad_request("invalid query parameter"))?; let mut search_builder = index.new_search(query.q.clone()); @@ -111,7 +109,7 @@ pub async fn search_with_url_query(ctx: Context) -> SResult { Err(others) => return Err(ResponseError::bad_request(others)), }; - Ok(tide::response::json(response)) + Ok(tide::Response::new(200).body_json(&response).unwrap()) } #[derive(Clone, Deserialize)] @@ -140,7 +138,7 @@ struct SearchMultiBodyResponse { query: String, } -pub async fn search_multi_index(mut ctx: Context) -> SResult { +pub async fn search_multi_index(mut ctx: Request) -> SResult { // ctx.is_allowed(DocumentsRead)?; let body = ctx .body_json::() @@ -232,5 +230,5 @@ pub async fn search_multi_index(mut ctx: Context) -> SResult { query: body.query, }; - Ok(tide::response::json(response)) + Ok(tide::Response::new(200).body_json(&response).unwrap()) } diff --git a/meilisearch-http/src/routes/setting.rs b/meilisearch-http/src/routes/setting.rs index 08cb861e3..79a2b799d 100644 --- a/meilisearch-http/src/routes/setting.rs +++ b/meilisearch-http/src/routes/setting.rs @@ -1,11 +1,8 @@ -use http::StatusCode; use serde::{Deserialize, Serialize, Deserializer}; -use tide::response::IntoResponse; -use tide::{Context, Response}; -// use indexmap::IndexMap; +use tide::{Request, Response}; use crate::error::{ResponseError, SResult}; -use crate::helpers::tide::ContextExt; +use crate::helpers::tide::RequestExt; use crate::models::token::ACL::*; use crate::routes::document::IndexUpdateResponse; use crate::Data; @@ -13,7 +10,6 @@ use crate::Data; #[derive(Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct Setting { - // pub ranking_order: Option, pub distinct_field: Option, pub ranking_rules: Option, } @@ -25,11 +21,10 @@ pub enum RankingOrdering { Dsc, } -// pub type RankingOrder = Vec; pub type DistinctField = String; pub type RankingRules = Vec; -pub async fn get(ctx: Context) -> SResult { +pub async fn get(ctx: Request) -> SResult { ctx.is_allowed(SettingsRead)?; let index = ctx.index()?; @@ -41,14 +36,12 @@ pub async fn get(ctx: Context) -> SResult { None => Setting::default(), }; - Ok(tide::response::json(settings)) + Ok(tide::Response::new(200).body_json(&settings).unwrap()) } #[derive(Deserialize)] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SettingBody { - // #[serde(default, deserialize_with = "deserialize_some")] - // pub ranking_order: Option>, #[serde(default, deserialize_with = "deserialize_some")] pub distinct_field: Option>, #[serde(default, deserialize_with = "deserialize_some")] @@ -63,7 +56,7 @@ fn deserialize_some<'de, T, D>(deserializer: D) -> Result, D::Error> Deserialize::deserialize(deserializer).map(Some) } -pub async fn update(mut ctx: Context) -> SResult { +pub async fn update(mut ctx: Request) -> SResult { ctx.is_allowed(SettingsWrite)?; let settings: SettingBody = ctx.body_json().await.map_err(ResponseError::bad_request)?; @@ -79,10 +72,6 @@ pub async fn update(mut ctx: Context) -> SResult { None => Setting::default(), }; - // if let Some(ranking_order) = settings.ranking_order { - // current_settings.ranking_order = ranking_order; - // } - if let Some(distinct_field) = settings.distinct_field { current_settings.distinct_field = distinct_field; } @@ -100,7 +89,5 @@ pub async fn update(mut ctx: Context) -> SResult { writer.commit().map_err(ResponseError::internal)?; let response_body = IndexUpdateResponse { update_id }; - Ok(tide::response::json(response_body) - .with_status(StatusCode::ACCEPTED) - .into_response()) + Ok(tide::Response::new(202).body_json(&response_body).unwrap()) } diff --git a/meilisearch-http/src/routes/stats.rs b/meilisearch-http/src/routes/stats.rs index 1428e5662..f0eac878a 100644 --- a/meilisearch-http/src/routes/stats.rs +++ b/meilisearch-http/src/routes/stats.rs @@ -5,11 +5,11 @@ use log::error; use pretty_bytes::converter::convert; use serde::Serialize; use sysinfo::{NetworkExt, Pid, ProcessExt, ProcessorExt, System, SystemExt}; -use tide::{Context, Response}; +use tide::{Request, Response}; use walkdir::WalkDir; use crate::error::{ResponseError, SResult}; -use crate::helpers::tide::ContextExt; +use crate::helpers::tide::RequestExt; use crate::models::token::ACL::*; use crate::Data; @@ -21,7 +21,7 @@ struct IndexStatsResponse { fields_frequency: HashMap, } -pub async fn index_stat(ctx: Context) -> SResult { +pub async fn index_stat(ctx: Request) -> SResult { ctx.is_allowed(Admin)?; let index_uid = ctx.url_param("index")?; let index = ctx.index()?; @@ -52,7 +52,7 @@ pub async fn index_stat(ctx: Context) -> SResult { is_indexing, fields_frequency, }; - Ok(tide::response::json(response)) + Ok(tide::Response::new(200).body_json(&response).unwrap()) } #[derive(Serialize)] @@ -63,7 +63,7 @@ struct StatsResult { indexes: HashMap, } -pub async fn get_stats(ctx: Context) -> SResult { +pub async fn get_stats(ctx: Request) -> SResult { ctx.is_allowed(Admin)?; let mut index_list = HashMap::new(); @@ -127,7 +127,7 @@ pub async fn get_stats(ctx: Context) -> SResult { indexes: index_list, }; - Ok(tide::response::json(response)) + Ok(tide::Response::new(200).body_json(&response).unwrap()) } #[derive(Serialize)] @@ -138,7 +138,7 @@ struct VersionResponse { pkg_version: String, } -pub async fn get_version(ctx: Context) -> SResult { +pub async fn get_version(ctx: Request) -> SResult { ctx.is_allowed(Admin)?; let response = VersionResponse { commit_sha: env!("VERGEN_SHA").to_string(), @@ -146,7 +146,7 @@ pub async fn get_version(ctx: Context) -> SResult { pkg_version: env!("CARGO_PKG_VERSION").to_string(), }; - Ok(tide::response::json(response)) + Ok(tide::Response::new(200).body_json(&response).unwrap()) } #[derive(Serialize)] @@ -236,9 +236,10 @@ pub(crate) fn report(pid: Pid) -> SysInfo { info } -pub async fn get_sys_info(ctx: Context) -> SResult { +pub async fn get_sys_info(ctx: Request) -> SResult { ctx.is_allowed(Admin)?; - Ok(tide::response::json(report(ctx.state().server_pid))) + let response = report(ctx.state().server_pid); + Ok(tide::Response::new(200).body_json(&response).unwrap()) } #[derive(Serialize)] @@ -332,7 +333,8 @@ pub(crate) fn report_pretty(pid: Pid) -> SysInfoPretty { info } -pub async fn get_sys_info_pretty(ctx: Context) -> SResult { +pub async fn get_sys_info_pretty(ctx: Request) -> SResult { ctx.is_allowed(Admin)?; - Ok(tide::response::json(report_pretty(ctx.state().server_pid))) + let response = report_pretty(ctx.state().server_pid); + Ok(tide::Response::new(200).body_json(&response).unwrap()) } diff --git a/meilisearch-http/src/routes/stop_words.rs b/meilisearch-http/src/routes/stop_words.rs index c654b0072..8cc4f6ce1 100644 --- a/meilisearch-http/src/routes/stop_words.rs +++ b/meilisearch-http/src/routes/stop_words.rs @@ -1,17 +1,15 @@ use std::collections::BTreeSet; -use http::StatusCode; -use tide::response::IntoResponse; -use tide::{Context, Response}; +use tide::{Request, Response}; use meilisearch_core::settings::{SettingsUpdate, UpdateState}; use crate::error::{ResponseError, SResult}; -use crate::helpers::tide::ContextExt; +use crate::helpers::tide::RequestExt; use crate::models::token::ACL::*; use crate::routes::document::IndexUpdateResponse; use crate::Data; -pub async fn get(ctx: Context) -> SResult { +pub async fn get(ctx: Request) -> SResult { ctx.is_allowed(SettingsRead)?; let index = ctx.index()?; @@ -29,10 +27,10 @@ pub async fn get(ctx: Context) -> SResult { .into_strs() .map_err(ResponseError::internal)?; - Ok(tide::response::json(stop_words)) + Ok(tide::Response::new(200).body_json(&stop_words).unwrap()) } -pub async fn update(mut ctx: Context) -> SResult { +pub async fn update(mut ctx: Request) -> SResult { ctx.is_allowed(SettingsRead)?; let index = ctx.index()?; @@ -52,12 +50,10 @@ pub async fn update(mut ctx: Context) -> SResult { writer.commit().map_err(ResponseError::internal)?; let response_body = IndexUpdateResponse { update_id }; - Ok(tide::response::json(response_body) - .with_status(StatusCode::ACCEPTED) - .into_response()) + Ok(tide::Response::new(202).body_json(&response_body).unwrap()) } -pub async fn delete(ctx: Context) -> SResult { +pub async fn delete(ctx: Request) -> SResult { ctx.is_allowed(SettingsRead)?; let index = ctx.index()?; @@ -75,7 +71,5 @@ pub async fn delete(ctx: Context) -> SResult { writer.commit().map_err(ResponseError::internal)?; let response_body = IndexUpdateResponse { update_id }; - Ok(tide::response::json(response_body) - .with_status(StatusCode::ACCEPTED) - .into_response()) + Ok(tide::Response::new(202).body_json(&response_body).unwrap()) } diff --git a/meilisearch-http/src/routes/synonym.rs b/meilisearch-http/src/routes/synonym.rs index a8aef2685..9ee0f5b99 100644 --- a/meilisearch-http/src/routes/synonym.rs +++ b/meilisearch-http/src/routes/synonym.rs @@ -1,18 +1,16 @@ use std::collections::BTreeMap; -use http::StatusCode; -use tide::response::IntoResponse; -use tide::{Context, Response}; +use tide::{Request, Response}; use indexmap::IndexMap; use meilisearch_core::settings::{SettingsUpdate, UpdateState}; use crate::error::{ResponseError, SResult}; -use crate::helpers::tide::ContextExt; +use crate::helpers::tide::RequestExt; use crate::models::token::ACL::*; use crate::routes::document::IndexUpdateResponse; use crate::Data; -pub async fn get(ctx: Context) -> SResult { +pub async fn get(ctx: Request) -> SResult { ctx.is_allowed(SettingsRead)?; let index = ctx.index()?; @@ -42,10 +40,10 @@ pub async fn get(ctx: Context) -> SResult { } } - Ok(tide::response::json(response)) + Ok(tide::Response::new(200).body_json(&response).unwrap()) } -pub async fn update(mut ctx: Context) -> SResult { +pub async fn update(mut ctx: Request) -> SResult { ctx.is_allowed(SettingsWrite)?; let data: BTreeMap> = ctx.body_json().await.map_err(ResponseError::bad_request)?; @@ -66,13 +64,11 @@ pub async fn update(mut ctx: Context) -> SResult { writer.commit().map_err(ResponseError::internal)?; let response_body = IndexUpdateResponse { update_id }; - Ok(tide::response::json(response_body) - .with_status(StatusCode::ACCEPTED) - .into_response()) + Ok(tide::Response::new(202).body_json(&response_body).unwrap()) } -pub async fn delete(ctx: Context) -> SResult { +pub async fn delete(ctx: Request) -> SResult { ctx.is_allowed(SettingsWrite)?; let index = ctx.index()?; @@ -91,7 +87,5 @@ pub async fn delete(ctx: Context) -> SResult { writer.commit().map_err(ResponseError::internal)?; let response_body = IndexUpdateResponse { update_id }; - Ok(tide::response::json(response_body) - .with_status(StatusCode::ACCEPTED) - .into_response()) + Ok(tide::Response::new(202).body_json(&response_body).unwrap()) }