From 7ff66c551db2925322daf636e8caa7bec536a4c5 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Sat, 26 Mar 2022 12:45:36 +0530 Subject: [PATCH] feat & chore: update actix-web and deps and use actix-auth-middleware for guarding auth routes --- Cargo.lock | 1143 ++++++++++++++++------------ Cargo.toml | 15 +- sqlx-data.json | 260 +++---- src/api/v1/admin/auth.rs | 4 +- src/api/v1/admin/campaigns.rs | 2 +- src/api/v1/admin/mod.rs | 10 +- src/api/v1/bench.rs | 27 +- src/main.rs | 22 +- src/middleware/auth.rs | 245 ------ src/middleware/mod.rs | 18 - src/pages/auth/join.rs | 2 +- src/pages/auth/login.rs | 2 +- src/pages/auth/mod.rs | 2 +- src/pages/errors.rs | 4 +- src/pages/mod.rs | 7 +- src/pages/panel/campaigns/bench.rs | 2 +- src/pages/panel/campaigns/mod.rs | 2 +- src/pages/panel/campaigns/new.rs | 2 +- src/pages/routes.rs | 21 + src/static_assets/static_files.rs | 14 +- src/tests.rs | 22 +- 21 files changed, 877 insertions(+), 949 deletions(-) delete mode 100644 src/middleware/auth.rs delete mode 100644 src/middleware/mod.rs diff --git a/Cargo.lock b/Cargo.lock index 34de1ba..42e4699 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,29 +2,42 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "actix-auth-middleware" +version = "0.2.0" +source = "git+https://github.com/realaravinth/actix-auth-middleware?branch=v4#29737aeb5594487e4192b5f2fb1a76a15c36c8f2" +dependencies = [ + "actix-http", + "actix-identity", + "actix-service", + "actix-web", + "futures", +] + [[package]] name = "actix-codec" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d5dbeb2d9e51344cb83ca7cc170f1217f9fe25bfc50160e6e200b5c31c1019a" +checksum = "57a7559404a7f3573127aab53c08ce37a6c6a315c374a31070f3c91cd1b4a7fe" dependencies = [ "bitflags", "bytes", "futures-core", "futures-sink", "log", + "memchr", "pin-project-lite", "tokio", - "tokio-util", + "tokio-util 0.7.0", ] [[package]] name = "actix-cors" -version = "0.6.0-beta.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01552b8facccd5d7a4cc5d8e2b07d306160c97a4968181c2db965533389c8725" +checksum = "414360eed71ba2d5435b185ba43ecbe281dfab5df3898286d6b7be8074372c92" dependencies = [ - "actix-service", + "actix-utils", "actix-web", "derive_more", "futures-util", @@ -35,67 +48,61 @@ dependencies = [ [[package]] name = "actix-http" -version = "3.0.0-beta.10" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd38a862fa7fead2b47ee55e550982aba583ebc7365ccf0155b49934ad6f16f9" +checksum = "a5885cb81a0d4d0d322864bea1bb6c2a8144626b4fdc625d4c51eba197e7797a" dependencies = [ "actix-codec", "actix-rt", "actix-service", - "actix-tls", "actix-utils", "ahash", "base64", "bitflags", - "brotli2", + "brotli", "bytes", "bytestring", "derive_more", "encoding_rs", "flate2", "futures-core", - "futures-util", "h2", "http", "httparse", + "httpdate", "itoa", "language-tags", "local-channel", "log", "mime", - "once_cell", "percent-encoding", - "pin-project", "pin-project-lite", - "rand 0.8.4", - "regex", - "serde 1.0.130", - "sha-1", + "rand 0.8.5", + "sha-1 0.10.0", "smallvec", - "time 0.2.27", - "tokio", "zstd", ] [[package]] name = "actix-identity" -version = "0.4.0-beta.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50b26f099c3b3bd459a547abf391c3cbecdc077df757f56856e31e8cd5757f28" +checksum = "171fe3ed055b2dd50c61967911d253d47e76e1d4308acfbf99fc7affe5ec42aa" dependencies = [ "actix-service", + "actix-utils", "actix-web", "futures-util", - "serde 1.0.130", + "serde 1.0.136", "serde_json", - "time 0.2.27", + "time 0.3.9", ] [[package]] name = "actix-macros" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f86cd6857c135e6e9fe57b1619a88d1f94a7df34c00e11fe13e64fd3438837" +checksum = "465a6172cf69b960917811022d8f29bc0b7fa1398bc4f78b3c466673db1213b6" dependencies = [ "quote", "syn", @@ -103,23 +110,23 @@ dependencies = [ [[package]] name = "actix-router" -version = "0.5.0-beta.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36b95ce0d76d1aa2f98b681702807475ade0f99bd4552546a6843a966d42ea3d" +checksum = "eb60846b52c118f2f04a56cc90880a274271c489b2498623d58176f8ca21fa80" dependencies = [ "bytestring", "firestorm", "http", "log", "regex", - "serde 1.0.130", + "serde 1.0.136", ] [[package]] name = "actix-rt" -version = "2.3.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea360596a50aa9af459850737f99293e5cb9114ae831118cb6026b3bbc7583ad" +checksum = "7ea16c295198e958ef31930a6ef37d0fb64e9ca3b6116e6b93a8bdae96ee1000" dependencies = [ "actix-macros", "futures-core", @@ -128,25 +135,27 @@ dependencies = [ [[package]] name = "actix-server" -version = "2.0.0-beta.6" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7367665785765b066ad16e1086d26a087f696bc7c42b6f93004ced6cfcf1eeca" +checksum = "0da34f8e659ea1b077bb4637948b815cd3768ad5a188fdcd74ff4d84240cd824" dependencies = [ "actix-rt", "actix-service", "actix-utils", "futures-core", - "log", + "futures-util", "mio", "num_cpus", + "socket2", "tokio", + "tracing", ] [[package]] name = "actix-service" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3dc6a618b082974a08d7a4781d24d4691cba51500059bfebe6656a61ebfe1e" +checksum = "3b894941f818cfdc7ccc4b9e60fa7e53b5042a2e8567270f9147d5591893373a" dependencies = [ "futures-core", "paste", @@ -155,35 +164,20 @@ dependencies = [ [[package]] name = "actix-session" -version = "0.5.0-beta.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b853e383318e1074c1dc988871c33cd186b89bfadfd543758b2f7ffebb88f47" +checksum = "1a05f9a08018659f1dc02974580ec82e978a68faca0507b7267e76ba613fd639" dependencies = [ - "actix-service", - "actix-web", - "derive_more", - "futures-util", - "log", - "serde 1.0.130", - "serde_json", - "time 0.2.27", -] - -[[package]] -name = "actix-tls" -version = "3.0.0-beta.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65b7bb60840962ef0332f7ea01a57d73a24d2cb663708511ff800250bbfef569" -dependencies = [ - "actix-codec", - "actix-rt", "actix-service", "actix-utils", + "actix-web", + "anyhow", + "async-trait", "derive_more", - "futures-core", - "http", - "log", - "tokio-util", + "serde 1.0.136", + "serde_json", + "time 0.3.9", + "tracing", ] [[package]] @@ -198,9 +192,9 @@ dependencies = [ [[package]] name = "actix-web" -version = "4.0.0-beta.9" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34aa2b23ec9c7c9a799b3cf9258f67c91b18ac3f0f5f484e175c7ac46739bb5" +checksum = "f4e5ebffd51d50df56a3ae0de0e59487340ca456f05dd0b90c0a7a6dd6a74d31" dependencies = [ "actix-codec", "actix-http", @@ -210,13 +204,13 @@ dependencies = [ "actix-server", "actix-service", "actix-utils", - "actix-web-codegen 0.5.0-beta.4 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-web-codegen 4.0.0", "ahash", "bytes", + "bytestring", "cfg-if", "cookie", "derive_more", - "either", "encoding_rs", "futures-core", "futures-util", @@ -225,23 +219,21 @@ dependencies = [ "log", "mime", "once_cell", - "paste", - "pin-project", + "pin-project-lite", "regex", - "serde 1.0.130", + "serde 1.0.136", "serde_json", "serde_urlencoded", "smallvec", "socket2", - "time 0.2.27", + "time 0.3.9", "url", ] [[package]] name = "actix-web-codegen" -version = "0.5.0-beta.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a11fd6f322120a74b23327e778ef0a4950b1f44a2b76468a69316a150f5c6dd" +version = "0.5.0-rc.2" +source = "git+https://github.com/realaravinth/actix-web#d3881fe107fc8b7301ff36130e0725bd81f4c05c" dependencies = [ "actix-router", "proc-macro2", @@ -251,8 +243,9 @@ dependencies = [ [[package]] name = "actix-web-codegen" -version = "0.5.0-beta.4" -source = "git+https://github.com/realaravinth/actix-web#292317ff1eae7db38bd0aa9900ede5fadc9216d1" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7525bedf54704abb1d469e88d7e7e9226df73778798a69cea5022d53b2ae91bc" dependencies = [ "actix-router", "proc-macro2", @@ -268,29 +261,30 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aead" -version = "0.3.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" +checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" dependencies = [ "generic-array", ] [[package]] name = "aes" -version = "0.6.0" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" +checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" dependencies = [ - "aes-soft", - "aesni", + "cfg-if", "cipher", + "cpufeatures", + "opaque-debug", ] [[package]] name = "aes-gcm" -version = "0.8.0" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5278b5fabbb9bd46e24aa69b2fdea62c99088e0a950a9be40e3e0101298f88da" +checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" dependencies = [ "aead", "aes", @@ -300,33 +294,13 @@ dependencies = [ "subtle", ] -[[package]] -name = "aes-soft" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" -dependencies = [ - "cipher", - "opaque-debug", -] - -[[package]] -name = "aesni" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" -dependencies = [ - "cipher", - "opaque-debug", -] - [[package]] name = "ahash" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "991984e3fd003e7ba02eb724f87a0f997b78677c46c0e91f8424ad7394c9886a" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.3", + "getrandom 0.2.5", "once_cell", "version_check", ] @@ -341,30 +315,50 @@ dependencies = [ ] [[package]] -name = "ammonia" -version = "3.1.2" +name = "alloc-no-stdlib" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e445c26125ff80316eaea16e812d717b147b82a68682bd4730f74d4845c8b35" +checksum = "35ef4730490ad1c4eae5c4325b2a95f521d023e5c885853ff7aca0a6a1631db3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "697ed7edc0f1711de49ce108c541623a0af97c6c60b2f6e2b65229847ac843c2" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "ammonia" +version = "3.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea9f21d23d82bae9d33c21080572af1fa749788e68234b5d8fa5e39d3e0783ed" dependencies = [ "html5ever", "lazy_static", "maplit", "markup5ever_rcdom", - "matches", "tendril", "url", ] +[[package]] +name = "anyhow" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4361135be9122e0870de935d7c439aef945b9f9ddd4199a553b5270b49c82a27" + [[package]] name = "argon2-creds" version = "0.2.1" -source = "git+https://github.com/realaravinth/argon2-creds?branch=master#2a3df16a6148ac1f48121b87232f24975f45a9c0" +source = "git+https://github.com/realaravinth/argon2-creds?branch=master#81cf114b07fdb3ed952b9c40ae69c2df46386a36" dependencies = [ "ammonia", - "derive_builder", + "derive_builder 0.10.2", "derive_more", "lazy_static", - "rand 0.8.4", + "rand 0.8.5", "regex", "rust-argon2", "unicode-normalization", @@ -383,6 +377,23 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "async-trait" +version = "0.1.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "atoi" version = "0.4.0" @@ -405,9 +416,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base-x" @@ -429,12 +440,12 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "blake2b_simd" -version = "0.5.11" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" +checksum = "72936ee4afc7f8f736d1c38383b56480b5497b4617b4a77bdbf1d2ababc76127" dependencies = [ "arrayref", - "arrayvec", + "arrayvec 0.7.2", "constant_time_eq", ] @@ -448,30 +459,40 @@ dependencies = [ ] [[package]] -name = "brotli-sys" -version = "0.3.2" +name = "block-buffer" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4445dea95f4c2b41cde57cc9fee236ae4dbae88d8fcbdb4750fc1bb5d86aaecd" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" dependencies = [ - "cc", - "libc", + "generic-array", ] [[package]] -name = "brotli2" -version = "0.3.2" +name = "brotli" +version = "3.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cb036c3eade309815c15ddbacec5b22c4d1f3983a774ab2eac2e3e9ea85568e" +checksum = "f838e47a451d5a8fa552371f80024dd6ace9b7acdf25c4c3d0f9bc6816fb1c39" dependencies = [ - "brotli-sys", - "libc", + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ad2d4653bf5ca36ae797b1f4bb4dbddb60ce49ca4aed8a2ce4829f60425b80" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", ] [[package]] name = "bumpalo" -version = "3.7.1" +version = "3.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" +checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" [[package]] name = "byteorder" @@ -497,23 +518,23 @@ dependencies = [ [[package]] name = "cache-buster" version = "0.2.0" -source = "git+https://github.com/realaravinth/cache-buster#e01e7bcc1d0c79b6f51648e42e8c027f894dc514" +source = "git+https://github.com/realaravinth/cache-buster#59b7e21c9fa3d84fdf564119096e1743e15011ad" dependencies = [ "data-encoding", - "derive_builder", + "derive_builder 0.10.2", "mime", "mime_guess", - "serde 1.0.130", + "serde 1.0.136", "serde_json", - "sha2", + "sha2 0.10.2", "walkdir", ] [[package]] name = "cc" -version = "1.0.71" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" dependencies = [ "jobserver", ] @@ -526,9 +547,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cipher" -version = "0.2.5" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" dependencies = [ "generic-array", ] @@ -542,7 +563,7 @@ dependencies = [ "lazy_static", "nom 5.1.2", "rust-ini", - "serde 1.0.130", + "serde 1.0.136", "serde-hjson", "serde_json", "toml", @@ -551,9 +572,9 @@ dependencies = [ [[package]] name = "const_fn" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f92cfa0fd5690b3cf8c1ef2cabbd9b7ef22fa53cf5e1f92b05103f6d5d1cf6e7" +checksum = "fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935" [[package]] name = "constant_time_eq" @@ -569,42 +590,36 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "cookie" -version = "0.15.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f1c7727e460397e56abc4bddc1d49e07a1ad78fc98eb2e1c8f032a58a2f80d" +checksum = "94d4706de1b0fa5b132270cddffa8585166037822e260a944fe161acd137ca05" dependencies = [ "aes-gcm", "base64", "hkdf", - "hmac 0.10.1", + "hmac 0.12.1", "percent-encoding", - "rand 0.8.4", - "sha2", + "rand 0.8.5", + "sha2 0.10.2", "subtle", - "time 0.2.27", + "time 0.3.9", "version_check", ] [[package]] name = "cpufeatures" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" +checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" dependencies = [ "libc", ] -[[package]] -name = "cpuid-bool" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" - [[package]] name = "crc" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10c2722795460108a7872e1cd933a85d6ec38abc4baecad51028f702da28889f" +checksum = "49fc9a695bca7f35f5f4c15cddc84415f66a74ea78eef08e90c5024f2b540e23" dependencies = [ "crc-catalog", ] @@ -617,28 +632,18 @@ checksum = "ccaeedb56da03b09f598226e25e80088cb4cd25f316e6e4df7d695f0feeb1403" [[package]] name = "crc32fast" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - [[package]] name = "crossbeam-queue" -version = "0.3.2" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b10ddc024425c88c2ad148c1b0fd53f4c6d38db9697c9f1588381212fa657c9" +checksum = "1f25d8400f4a7a5778f0e4e52384a48cbd9b5c495d110786187fc750075277a2" dependencies = [ "cfg-if", "crossbeam-utils", @@ -646,22 +651,22 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.5" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" +checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" dependencies = [ "cfg-if", "lazy_static", ] [[package]] -name = "crypto-mac" -version = "0.10.1" +name = "crypto-common" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff07008ec701e8028e2ceb8f83f0e4274ee62bd2dbdc4fefff2e9a91824081a" +checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8" dependencies = [ "generic-array", - "subtle", + "typenum", ] [[package]] @@ -676,9 +681,9 @@ dependencies = [ [[package]] name = "ctr" -version = "0.6.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb4a30d54f7443bf3d6191dcd486aca19e67cb3c49fa7a06a319966346707e7f" +checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" dependencies = [ "cipher", ] @@ -730,7 +735,16 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d13202debe11181040ae9063d739fa32cfcaaebe2275fe387703460ae2365b30" dependencies = [ - "derive_builder_macro", + "derive_builder_macro 0.10.2", +] + +[[package]] +name = "derive_builder" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d918e7dabe374a51dae0f29d818fece3b218b8b4eabec3bc4d42c537e7ed8f" +dependencies = [ + "derive_builder_macro 0.11.1", ] [[package]] @@ -745,26 +759,48 @@ dependencies = [ "syn", ] +[[package]] +name = "derive_builder_core" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f712c2d4e52d5fcae53584e461dcb92fb2202e144ebf83ab0ba4360d18b767c7" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "derive_builder_macro" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58a94ace95092c5acb1e97a7e846b310cfbd499652f72297da7493f618a98d73" dependencies = [ - "derive_builder_core", + "derive_builder_core 0.10.2", + "syn", +] + +[[package]] +name = "derive_builder_macro" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8a2ac71b4a9a590dde6cee3ca4687aca5e7ce06f4ee297c5a959de5f1e42b2e" +dependencies = [ + "derive_builder_core 0.11.1", "syn", ] [[package]] name = "derive_more" -version = "0.99.16" +version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40eebddd2156ce1bb37b20bbe5151340a31828b1f2d22ba4141f3531710e38df" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version 0.3.3", + "rustc_version 0.4.0", "syn", ] @@ -778,19 +814,30 @@ dependencies = [ ] [[package]] -name = "dirs" -version = "3.0.2" +name = "digest" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +dependencies = [ + "block-buffer 0.10.2", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" dependencies = [ "dirs-sys", ] [[package]] name = "dirs-sys" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" dependencies = [ "libc", "redox_users", @@ -815,14 +862,14 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" dependencies = [ - "serde 1.0.130", + "serde 1.0.136", ] [[package]] name = "encoding_rs" -version = "0.8.28" +version = "0.8.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065" +checksum = "7896dc8abb250ffdda33912550faa54c88ec8b998dec0b2c55ab224921ce11df" dependencies = [ "cfg-if", ] @@ -854,9 +901,9 @@ dependencies = [ [[package]] name = "firestorm" -version = "0.4.6" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31586bda1b136406162e381a3185a506cdfc1631708dd40cba2f6628d8634499" +checksum = "4d3d6188b8804df28032815ea256b6955c9625c24da7525f387a7af02fbb8f01" [[package]] name = "flate2" @@ -888,9 +935,9 @@ dependencies = [ [[package]] name = "futf" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c9c1ce3fa9336301af935ab852c437817d14cd33690446569392e65170aac3b" +checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843" dependencies = [ "mac", "new_debug_unreachable", @@ -898,9 +945,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12aa0eb539080d55c3f2d45a67c3b58b6b0773c1a3ca2dfec66d58c97fd66ca" +checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" dependencies = [ "futures-channel", "futures-core", @@ -913,9 +960,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888" +checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" dependencies = [ "futures-core", "futures-sink", @@ -923,15 +970,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d" +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" [[package]] name = "futures-executor" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45025be030969d763025784f7f355043dc6bc74093e4ecc5000ca4dc50d8745c" +checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" dependencies = [ "futures-core", "futures-task", @@ -946,23 +993,21 @@ checksum = "62007592ac46aa7c2b6416f7deb9a8a8f63a01e0f1d6e1787d5630170db2b63e" dependencies = [ "futures-core", "lock_api", - "parking_lot", + "parking_lot 0.11.2", ] [[package]] name = "futures-io" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377" +checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" [[package]] name = "futures-macro" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18e4a4b95cea4b4ccbcf1c5675ca7c4ee4e9e75eb79944d07defde18068f79bb" +checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ - "autocfg", - "proc-macro-hack", "proc-macro2", "quote", "syn", @@ -970,23 +1015,22 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11" +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" [[package]] name = "futures-task" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99" +checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" [[package]] name = "futures-util" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481" +checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" dependencies = [ - "autocfg", "futures-channel", "futures-core", "futures-io", @@ -996,16 +1040,14 @@ dependencies = [ "memchr", "pin-project-lite", "pin-utils", - "proc-macro-hack", - "proc-macro-nested", "slab", ] [[package]] name = "generic-array" -version = "0.14.4" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" dependencies = [ "typenum", "version_check", @@ -1024,9 +1066,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "d39cd93900197114fa1fcb7ae84ca742095eed9442088988ae74fa744e930e77" dependencies = [ "cfg-if", "libc", @@ -1035,9 +1077,9 @@ dependencies = [ [[package]] name = "ghash" -version = "0.3.1" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97304e4cd182c3846f7575ced3890c53012ce534ad9114046b0a9e00bb30a375" +checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" dependencies = [ "opaque-debug", "polyval", @@ -1045,9 +1087,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.6" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c06815895acec637cd6ed6e9662c935b866d20a106f8361892893a7d9234964" +checksum = "62eeb471aa3e3c9197aa4bfeabfe02982f6dc96f750486c0bb0009ac58b26d2b" dependencies = [ "bytes", "fnv", @@ -1058,7 +1100,7 @@ dependencies = [ "indexmap", "slab", "tokio", - "tokio-util", + "tokio-util 0.6.9", "tracing", ] @@ -1106,22 +1148,11 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hkdf" -version = "0.10.0" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51ab2f639c231793c5f6114bdb9bbe50a7dbbfcd7c7c6bd8475dec2d991e964f" +checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" dependencies = [ - "digest", - "hmac 0.10.1", -] - -[[package]] -name = "hmac" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" -dependencies = [ - "crypto-mac 0.10.1", - "digest", + "hmac 0.12.1", ] [[package]] @@ -1130,8 +1161,17 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" dependencies = [ - "crypto-mac 0.11.1", - "digest", + "crypto-mac", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.3", ] [[package]] @@ -1145,9 +1185,9 @@ dependencies = [ [[package]] name = "html5ever" -version = "0.25.1" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aafcf38a1a36118242d29b92e1b08ef84e67e4a5ed06e0a80be20e6a32bfed6b" +checksum = "e5c13fb08e5d4dfc151ee5e88bae63f7773d61852f3bdc73c9f4b9e1bde03148" dependencies = [ "log", "mac", @@ -1159,9 +1199,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1323096b05d41827dadeaee54c9981958c0f94e670bc94ed80037d1a7b8b186b" +checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" dependencies = [ "bytes", "fnv", @@ -1170,9 +1210,15 @@ dependencies = [ [[package]] name = "httparse" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503" +checksum = "9100414882e15fb7feccb4897e5f0ff0ff1ca7d1a86a23208ada4d7a18e6c6c4" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "humantime" @@ -1208,9 +1254,9 @@ checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" [[package]] name = "indexmap" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" dependencies = [ "autocfg", "hashbrown", @@ -1218,27 +1264,27 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "716d3d89f35ac6a34fd0eed635395f4c3b76fa889338a4632e5231a8684216bd" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if", ] [[package]] name = "itertools" -version = "0.10.1" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" dependencies = [ "either", ] [[package]] name = "itoa" -version = "0.4.8" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" [[package]] name = "itoap" @@ -1257,9 +1303,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.55" +version = "0.3.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" +checksum = "a38fc24e30fd564ce974c02bf1d337caddff65be6cc4735a1f7eab22a7440f04" dependencies = [ "wasm-bindgen", ] @@ -1282,7 +1328,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" dependencies = [ - "arrayvec", + "arrayvec 0.5.2", "bitflags", "cfg-if", "ryu", @@ -1291,9 +1337,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.103" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8f7255a17a627354f321ef0055d63b898c6fb27eff628af4d1b66b7331edf6" +checksum = "efaa7b300f3b5fe8eb6bf21ce3895e1751d9665086af2d64b42f19701015ff4f" [[package]] name = "linked-hash-map" @@ -1315,24 +1361,24 @@ dependencies = [ [[package]] name = "local-waker" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f9a2d3e27ce99ce2c3aad0b09b1a7b916293ea9b2bf624c13fe646fadd8da4" +checksum = "902eb695eb0591864543cbfbf6d742510642a605a61fc5e97fe6ceb5a30ac4fb" [[package]] name = "lock_api" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" +checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b" dependencies = [ "scopeguard", ] [[package]] name = "log" -version = "0.4.14" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" dependencies = [ "cfg-if", ] @@ -1387,8 +1433,8 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b5a279bb9607f9f53c22d496eade00d138d1bdcccd07d74650387cf94942a15" dependencies = [ - "block-buffer", - "digest", + "block-buffer 0.9.0", + "digest 0.9.0", "opaque-debug", ] @@ -1406,9 +1452,9 @@ checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] name = "mime_guess" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" dependencies = [ "mime", "unicase", @@ -1416,9 +1462,9 @@ dependencies = [ [[package]] name = "minimal-lexical" -version = "0.1.4" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c64630dcdd71f1a64c435f54885086a0de5d6a12d104d69b165fb7d5286d677" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" @@ -1432,14 +1478,15 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.13" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" +checksum = "52da4364ffb0e4fe33a9841a98a3f3014fb964045ce4f7a45a398243c8d6b0c9" dependencies = [ "libc", "log", "miow", "ntapi", + "wasi 0.11.0+wasi-snapshot-preview1", "winapi", ] @@ -1471,20 +1518,19 @@ dependencies = [ [[package]] name = "nom" -version = "7.0.0" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffd9d26838a953b4af82cbeb9f1592c6798916983959be223a7124e992742c1" +checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" dependencies = [ "memchr", "minimal-lexical", - "version_check", ] [[package]] name = "ntapi" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" +checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" dependencies = [ "winapi", ] @@ -1509,19 +1555,28 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ "hermit-abi", "libc", ] [[package]] -name = "once_cell" -version = "1.8.0" +name = "num_threads" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "aba1801fb138d8e85e11d0fc70baf4fe1cdfffda7c6cd34a854905df588e5ed0" +dependencies = [ + "libc", +] + +[[package]] +name = "once_cell" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" [[package]] name = "opaque-debug" @@ -1537,7 +1592,17 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", - "parking_lot_core", + "parking_lot_core 0.8.5", +] + +[[package]] +name = "parking_lot" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.1", ] [[package]] @@ -1555,10 +1620,23 @@ dependencies = [ ] [[package]] -name = "paste" -version = "1.0.5" +name = "parking_lot_core" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58" +checksum = "28141e0cc4143da2443301914478dc976a61ffdb3f043058310c70df2fed8954" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys", +] + +[[package]] +name = "paste" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0744126afe1a6dd7f394cb50a716dbe086cb06e255e53d8d0185d82828358fb5" [[package]] name = "percent-encoding" @@ -1566,22 +1644,13 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" -[[package]] -name = "pest" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" -dependencies = [ - "ucd-trie", -] - [[package]] name = "phf" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" dependencies = [ - "phf_shared", + "phf_shared 0.8.0", ] [[package]] @@ -1591,7 +1660,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" dependencies = [ "phf_generator", - "phf_shared", + "phf_shared 0.8.0", ] [[package]] @@ -1600,7 +1669,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" dependencies = [ - "phf_shared", + "phf_shared 0.8.0", "rand 0.7.3", ] @@ -1614,30 +1683,19 @@ dependencies = [ ] [[package]] -name = "pin-project" -version = "1.0.8" +name = "phf_shared" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576bc800220cc65dac09e99e97b08b358cfab6e17078de8dc5fee223bd2d0c08" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389" -dependencies = [ - "proc-macro2", - "quote", - "syn", + "siphasher", ] [[package]] name = "pin-project-lite" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" +checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" [[package]] name = "pin-utils" @@ -1647,20 +1705,21 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "polyval" -version = "0.4.5" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eebcc4aa140b9abd2bc40d9c3f7ccec842679cd79045ac3a7ac698c1a064b7cd" +checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" dependencies = [ - "cpuid-bool", + "cfg-if", + "cpufeatures", "opaque-debug", "universal-hash", ] [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] name = "precomputed-hash" @@ -1708,17 +1767,11 @@ version = "0.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" -[[package]] -name = "proc-macro-nested" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" - [[package]] name = "proc-macro2" -version = "1.0.26" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec" +checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" dependencies = [ "unicode-xid", ] @@ -1731,9 +1784,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.10" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" +checksum = "b4af2ec4714533fcdf07e886f17025ace8b997b9ce51204ee69b6da831c3da57" dependencies = [ "proc-macro2", ] @@ -1748,20 +1801,19 @@ dependencies = [ "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", - "rand_hc 0.2.0", + "rand_hc", "rand_pcg", ] [[package]] name = "rand" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha 0.3.1", "rand_core 0.6.3", - "rand_hc 0.3.1", ] [[package]] @@ -1799,7 +1851,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "getrandom 0.2.3", + "getrandom 0.2.5", ] [[package]] @@ -1811,15 +1863,6 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "rand_hc" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" -dependencies = [ - "rand_core 0.6.3", -] - [[package]] name = "rand_pcg" version = "0.2.1" @@ -1831,28 +1874,29 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.10" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +checksum = "8ae183fc1b06c149f0c1793e1eb447c8b04bfe46d48e9e48bfb8d2d7ed64ecf0" dependencies = [ "bitflags", ] [[package]] name = "redox_users" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +checksum = "7776223e2696f1aa4c6b0170e83212f47296a00424305117d013dfe86fb0fe55" dependencies = [ - "getrandom 0.2.3", + "getrandom 0.2.5", "redox_syscall", + "thiserror", ] [[package]] name = "regex" -version = "1.5.4" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" dependencies = [ "aho-corasick", "memchr", @@ -1882,9 +1926,9 @@ dependencies = [ [[package]] name = "rust-argon2" -version = "0.8.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb" +checksum = "b50162d19404029c1ceca6f6980fe40d45c8b369f6f44446fa14bb39573b5bb9" dependencies = [ "base64", "blake2b_simd", @@ -1894,9 +1938,9 @@ dependencies = [ [[package]] name = "rust-embed" -version = "6.2.0" +version = "6.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1be44a6694859b7cfc955699935944a6844aa9fe416aeda5d40829e3e38dfee6" +checksum = "d40377bff8cceee81e28ddb73ac97f5c2856ce5522f0b260b763f434cdfae602" dependencies = [ "rust-embed-impl", "rust-embed-utils", @@ -1905,9 +1949,9 @@ dependencies = [ [[package]] name = "rust-embed-impl" -version = "6.1.0" +version = "6.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f567ca01565c50c67b29e535f5f67b8ea8aeadaeed16a88f10792ab57438b957" +checksum = "94e763e24ba2bf0c72bc6be883f967f794a019fafd1b86ba1daff9c91a7edd30" dependencies = [ "proc-macro2", "quote", @@ -1918,11 +1962,11 @@ dependencies = [ [[package]] name = "rust-embed-utils" -version = "7.0.0" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6116e7ab9ea963f60f2f20291d8fcf6c7273192cdd7273b3c80729a9605c97b2" +checksum = "ad22c7226e4829104deab21df575e995bfbc4adfad13a595e387477f238c1aec" dependencies = [ - "sha2", + "sha2 0.9.9", "walkdir", ] @@ -1943,11 +1987,11 @@ dependencies = [ [[package]] name = "rustc_version" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 0.11.0", + "semver 1.0.6", ] [[package]] @@ -1965,15 +2009,15 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" [[package]] name = "sailfish" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "816920a08514d9741242b3efe70c16c350ed548bc4a5ba03426e56faf9d45f77" +checksum = "31f030905cfc5f869b6784dc4e5c83a20d1f77c92bae1a0d158baf9404100c3e" dependencies = [ "itoap", "ryu", @@ -1983,9 +2027,9 @@ dependencies = [ [[package]] name = "sailfish-compiler" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4276e7b848bde8e7813d534f014bc35ce5acd2b9e2b6b075727113fcf478ba63" +checksum = "f7a8620f80b37af2e55153ee142bfdb8085f30c454be453e922466d483b0d184" dependencies = [ "filetime", "home", @@ -1998,9 +2042,9 @@ dependencies = [ [[package]] name = "sailfish-macros" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bba2458ef07ae12c9aed2edb866c3db2f9c21cf19a2c3f2613b2982bc1a4a46" +checksum = "b31ded532bded4637d49297e3247476ebc266efab4b054dc48037fa88846fdeb" dependencies = [ "proc-macro2", "sailfish-compiler", @@ -2037,17 +2081,14 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" dependencies = [ - "semver-parser 0.7.0", + "semver-parser", ] [[package]] name = "semver" -version = "0.11.0" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" -dependencies = [ - "semver-parser 0.10.2", -] +checksum = "a4a3381e03edd24287172047536f20cabde766e2cd3e65e6b00fb3af51c4f38d" [[package]] name = "semver-parser" @@ -2055,15 +2096,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -[[package]] -name = "semver-parser" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" -dependencies = [ - "pest", -] - [[package]] name = "serde" version = "0.8.23" @@ -2072,9 +2104,9 @@ checksum = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8" [[package]] name = "serde" -version = "1.0.130" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" +checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" dependencies = [ "serde_derive", ] @@ -2093,9 +2125,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.130" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" +checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" dependencies = [ "proc-macro2", "quote", @@ -2104,26 +2136,25 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.68" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8" +checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" dependencies = [ - "indexmap", "itoa", "ryu", - "serde 1.0.130", + "serde 1.0.136", ] [[package]] name = "serde_urlencoded" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", "itoa", "ryu", - "serde 1.0.130", + "serde 1.0.136", ] [[package]] @@ -2132,32 +2163,63 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ - "block-buffer", + "block-buffer 0.9.0", "cfg-if", "cpufeatures", - "digest", + "digest 0.9.0", "opaque-debug", ] [[package]] -name = "sha1" -version = "0.6.0" +name = "sha-1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" +checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.3", +] + +[[package]] +name = "sha1" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" +dependencies = [ + "sha1_smol", +] + +[[package]] +name = "sha1_smol" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" [[package]] name = "sha2" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b69f9a4c9740d74c5baa3fd2e547f9525fa8088a8a958e0ca2409a514e33f5fa" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ - "block-buffer", + "block-buffer 0.9.0", "cfg-if", "cpufeatures", - "digest", + "digest 0.9.0", "opaque-debug", ] +[[package]] +name = "sha2" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.3", +] + [[package]] name = "signal-hook-registry" version = "1.4.0" @@ -2169,9 +2231,9 @@ dependencies = [ [[package]] name = "siphasher" -version = "0.3.7" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "533494a8f9b724d33625ab53c6c4800f7cc445895924a8ef649222dcb76e938b" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" [[package]] name = "slab" @@ -2181,15 +2243,15 @@ checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" [[package]] name = "smallvec" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "socket2" -version = "0.4.2" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dc90fe6c7be1a323296982db1836d1ea9e47b6839496dde9a541bc496df3516" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" dependencies = [ "libc", "winapi", @@ -2208,15 +2270,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4b7922be017ee70900be125523f38bdd644f4f06a1b16e8fa5a8ee8c34bffd4" dependencies = [ "itertools", - "nom 7.0.0", + "nom 7.1.1", "unicode_categories", ] [[package]] name = "sqlx" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7911b0031a0247af40095838002999c7a52fba29d9739e93326e71a5a1bc9d43" +checksum = "fc15591eb44ffb5816a4a70a7efd5dd87bfd3aa84c4c200401c4396140525826" dependencies = [ "sqlx-core", "sqlx-macros", @@ -2224,9 +2286,9 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aec89bfaca8f7737439bad16d52b07f1ccd0730520d3bf6ae9d069fe4b641fb1" +checksum = "195183bf6ff8328bb82c0511a83faf60aacf75840103388851db61d7a9854ae3" dependencies = [ "ahash", "atoi", @@ -2235,9 +2297,7 @@ dependencies = [ "byteorder", "bytes", "crc", - "crossbeam-channel", "crossbeam-queue", - "crossbeam-utils", "dirs", "either", "futures-channel", @@ -2254,14 +2314,14 @@ dependencies = [ "md-5", "memchr", "once_cell", - "parking_lot", + "paste", "percent-encoding", - "rand 0.8.4", + "rand 0.8.5", "rustls", - "serde 1.0.130", + "serde 1.0.136", "serde_json", - "sha-1", - "sha2", + "sha-1 0.9.8", + "sha2 0.9.9", "smallvec", "sqlformat", "sqlx-rt", @@ -2278,9 +2338,9 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "584866c833511b1a152e87a7ee20dee2739746f60c858b3c5209150bc4b466f5" +checksum = "eee35713129561f5e55c554bba1c378e2a7e67f81257b7311183de98c50e6f94" dependencies = [ "dotenv", "either", @@ -2289,9 +2349,9 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "serde 1.0.130", + "serde 1.0.136", "serde_json", - "sha2", + "sha2 0.9.9", "sqlx-core", "sqlx-rt", "syn", @@ -2300,9 +2360,9 @@ dependencies = [ [[package]] name = "sqlx-rt" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d1bd069de53442e7a320f525a6d4deb8bb0621ac7a55f7eccbc2b58b57f43d0" +checksum = "b555e70fbbf84e269ec3858b7a6515bcfe7a166a7cc9c636dd6efd20431678b6" dependencies = [ "actix-rt", "once_cell", @@ -2347,7 +2407,7 @@ checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" dependencies = [ "proc-macro2", "quote", - "serde 1.0.130", + "serde 1.0.136", "serde_derive", "syn", ] @@ -2361,7 +2421,7 @@ dependencies = [ "base-x", "proc-macro2", "quote", - "serde 1.0.130", + "serde 1.0.136", "serde_derive", "serde_json", "sha1", @@ -2376,16 +2436,16 @@ checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" [[package]] name = "string_cache" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "923f0f39b6267d37d23ce71ae7235602134b250ace715dd2c90421998ddac0c6" +checksum = "33994d0838dc2d152d17a62adf608a869b5e846b65b389af7f3dbc1de45c5b26" dependencies = [ "lazy_static", "new_debug_unreachable", - "parking_lot", - "phf_shared", + "parking_lot 0.11.2", + "phf_shared 0.10.0", "precomputed-hash", - "serde 1.0.130", + "serde 1.0.136", ] [[package]] @@ -2395,7 +2455,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f24c8e5e19d22a726626f1a5e16fe15b132dcf21d10177fa5a45ce7962996b97" dependencies = [ "phf_generator", - "phf_shared", + "phf_shared 0.8.0", "proc-macro2", "quote", ] @@ -2426,6 +2486,7 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" name = "survey" version = "0.1.0" dependencies = [ + "actix-auth-middleware", "actix-cors", "actix-http", "actix-identity", @@ -2433,11 +2494,11 @@ dependencies = [ "actix-service", "actix-session", "actix-web", - "actix-web-codegen 0.5.0-beta.4 (git+https://github.com/realaravinth/actix-web)", + "actix-web-codegen 0.5.0-rc.2", "argon2-creds", "cache-buster", "config", - "derive_builder", + "derive_builder 0.11.1", "derive_more", "futures", "lazy_static", @@ -2445,10 +2506,10 @@ dependencies = [ "mime", "mime_guess", "pretty_env_logger", - "rand 0.8.4", + "rand 0.8.5", "rust-embed", "sailfish", - "serde 1.0.130", + "serde 1.0.136", "serde_json", "sqlx", "url", @@ -2459,9 +2520,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.80" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194" +checksum = "ea297be220d52398dcc07ce15a209fce436d361735ac1db700cab3b6cdfb9f54" dependencies = [ "proc-macro2", "quote", @@ -2481,9 +2542,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" dependencies = [ "winapi-util", ] @@ -2528,11 +2589,23 @@ dependencies = [ "libc", "standback", "stdweb", - "time-macros", + "time-macros 0.1.1", "version_check", "winapi", ] +[[package]] +name = "time" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd" +dependencies = [ + "itoa", + "libc", + "num_threads", + "time-macros 0.2.4", +] + [[package]] name = "time-macros" version = "0.1.1" @@ -2543,6 +2616,12 @@ dependencies = [ "time-macros-impl", ] +[[package]] +name = "time-macros" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" + [[package]] name = "time-macros-impl" version = "0.1.2" @@ -2558,9 +2637,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83b2a3d4d9091d0abd7eba4dc2710b1718583bd4d8992e2190720ea38f391f7" +checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" dependencies = [ "tinyvec_macros", ] @@ -2573,20 +2652,20 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.12.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2c2416fdedca8443ae44b4527de1ea633af61d8f7169ffa6e72c5b53d24efcc" +checksum = "2af73ac49756f3f7c01172e34a23e5d0216f6c32333757c2c61feb2bbff5a5ee" dependencies = [ - "autocfg", "bytes", "libc", "memchr", "mio", "num_cpus", "once_cell", - "parking_lot", + "parking_lot 0.12.0", "pin-project-lite", "signal-hook-registry", + "socket2", "winapi", ] @@ -2603,9 +2682,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b2f3f698253f03119ac0102beaa64f67a67e08074d03a22d18784104543727f" +checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" dependencies = [ "futures-core", "pin-project-lite", @@ -2614,9 +2693,23 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d3725d3efa29485e87311c5b699de63cde14b00ed4d256b8318aa30ca452cd" +checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64910e1b9c1901aaf5375561e35b9c057d95ff41a44ede043a03e09279eabaf1" dependencies = [ "bytes", "futures-core", @@ -2632,40 +2725,35 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" dependencies = [ - "serde 1.0.130", + "serde 1.0.136", ] [[package]] name = "tracing" -version = "0.1.29" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" +checksum = "4a1bdf54a7c28a2bbf701e1d2233f6c77f473486b94bee4f9678da5a148dca7f" dependencies = [ "cfg-if", + "log", "pin-project-lite", "tracing-core", ] [[package]] name = "tracing-core" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" +checksum = "aa31669fa42c09c34d94d8165dd2012e8ff3c66aca50f3bb226b68f216f2706c" dependencies = [ "lazy_static", ] [[package]] name = "typenum" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec" - -[[package]] -name = "ucd-trie" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "unicase" @@ -2693,9 +2781,9 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" [[package]] name = "unicode-xid" @@ -2755,7 +2843,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom 0.2.3", + "getrandom 0.2.5", ] [[package]] @@ -2767,7 +2855,7 @@ dependencies = [ "idna", "lazy_static", "regex", - "serde 1.0.130", + "serde 1.0.136", "serde_derive", "serde_json", "url", @@ -2803,9 +2891,9 @@ dependencies = [ [[package]] name = "version_check" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" @@ -2831,10 +2919,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] -name = "wasm-bindgen" -version = "0.2.78" +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2842,9 +2936,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.78" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" +checksum = "8b21c0df030f5a177f3cba22e9bc4322695ec43e7257d865302900290bcdedca" dependencies = [ "bumpalo", "lazy_static", @@ -2857,9 +2951,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.78" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" +checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2867,9 +2961,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.78" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" +checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" dependencies = [ "proc-macro2", "quote", @@ -2880,15 +2974,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.78" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" +checksum = "3d958d035c4438e28c70e4321a2911302f10135ce78a9c7834c0cab4123d06a2" [[package]] name = "web-sys" -version = "0.3.55" +version = "0.3.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" +checksum = "c060b319f29dd25724f09a2ba1418f142f539b2be99fbf4d2d5a8f7330afb8eb" dependencies = [ "js-sys", "wasm-bindgen", @@ -2915,9 +3009,9 @@ dependencies = [ [[package]] name = "whoami" -version = "1.1.5" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "483a59fee1a93fec90eb08bc2eb4315ef10f4ebc478b3a5fadc969819cb66117" +checksum = "524b58fa5a20a2fb3014dd6358b70e6579692a56ef6fce928834e488f42f65e8" dependencies = [ "wasm-bindgen", "web-sys", @@ -2955,10 +3049,53 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "xml5ever" -version = "0.16.1" +name = "windows-sys" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b1b52e6e8614d4a58b8e70cf51ec0cc21b256ad8206708bcff8139b5bbd6a59" +checksum = "3df6e476185f92a12c072be4a189a0210dcdcf512a1891d6dff9edb874deadc6" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8e92753b1c443191654ec532f14c199742964a061be25d77d7a96f09db20bf5" + +[[package]] +name = "windows_i686_gnu" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a711c68811799e017b6038e0922cb27a5e2f43a2ddb609fe0b6f3eeda9de615" + +[[package]] +name = "windows_i686_msvc" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c11bb1a02615db74680b32a68e2d61f553cc24c4eb5b4ca10311740e44172" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c912b12f7454c6620635bbff3450962753834be2a594819bd5e945af18ec64bc" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "504a2476202769977a040c6364301a3f65d0cc9e3fb08600b2bda150a0488316" + +[[package]] +name = "xml5ever" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9234163818fd8e2418fcde330655e757900d4236acd8cc70fef345ef91f6d865" dependencies = [ "log", "mac", @@ -2977,18 +3114,18 @@ dependencies = [ [[package]] name = "zstd" -version = "0.7.0+zstd.1.4.9" +version = "0.10.0+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9428752481d8372e15b1bf779ea518a179ad6c771cca2d2c60e4fbff3cc2cd52" +checksum = "3b1365becbe415f3f0fcd024e2f7b45bacfb5bdd055f0dc113571394114e7bdd" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "3.1.0+zstd.1.4.9" +version = "4.1.4+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa1926623ad7fe406e090555387daf73db555b948134b4d73eac5eb08fb666d" +checksum = "2f7cd17c9af1a4d6c24beb1cc54b17e2ef7b593dc92f19e9d9acad8b182bbaee" dependencies = [ "libc", "zstd-sys", @@ -2996,9 +3133,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "1.5.0+zstd.1.4.9" +version = "1.6.3+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e6c094340240369025fc6b731b054ee2a834328fa584310ac96aa4baebdc465" +checksum = "fc49afa5c8d634e75761feda8c592051e7eeb4683ba827211eb0d731d3402ea8" dependencies = [ "cc", "libc", diff --git a/Cargo.toml b/Cargo.toml index 43c3dd0..aa476bf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,10 +22,10 @@ name = "tests-migrate" path = "./src/tests-migrate.rs" [dependencies] -actix-web = "4.0.0-beta.9" +actix-web = "4.0.1" actix-identity = "0.4.0-beta.2" -actix-session = "0.5.0-beta.2" -actix-http = "3.0.0-beta.8" +actix-session = { version = "0.6.1", features = ["cookie-session"]} +actix-http = "3.0.4" actix-rt = "2" actix-cors = "0.6.0-beta.2" actix-service = "2.0.0" @@ -40,7 +40,7 @@ sqlx = { version = "0.5.9", features = [ "runtime-actix-rustls", "postgres", "ti argon2-creds = { branch = "master", git = "https://github.com/realaravinth/argon2-creds"} -derive_builder = "0.10" +derive_builder = "0.11" validator = { version = "0.14", features = ["derive"]} derive_more = "0.99" @@ -69,6 +69,13 @@ sailfish = "0.3.2" #tokio = "1.11.0" +[dependencies.actix-auth-middleware] +branch = "v4" +features = ["actix_identity_backend"] +git = "https://github.com/realaravinth/actix-auth-middleware" +version = "0.2" + + [build-dependencies] sqlx = { version = "0.5.9", features = [ "runtime-actix-rustls", "uuid", "postgres", "time", "offline" ] } #serde_yaml = "0.8.17" diff --git a/sqlx-data.json b/sqlx-data.json index 5090a5f..818f16e 100644 --- a/sqlx-data.json +++ b/sqlx-data.json @@ -1,82 +1,82 @@ { "db": "PostgreSQL", "03c9789e83a398bed96354924a0e63ccaa97bec667fda1b8277bb9afda9a6fcd": { - "query": "DELETE \n FROM survey_campaigns \n WHERE \n user_id = (\n SELECT \n ID \n FROM \n survey_admins \n WHERE \n name = $1\n )\n AND\n id = ($2)", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Text", "Uuid" ] - }, - "nullable": [] - } + } + }, + "query": "DELETE \n FROM survey_campaigns \n WHERE \n user_id = (\n SELECT \n ID \n FROM \n survey_admins \n WHERE \n name = $1\n )\n AND\n id = ($2)" }, "0d22134cc5076304b7895827f006ee8269cc500f400114a7472b83f0f1c568b5": { - "query": "INSERT INTO survey_admins \n (name , password, secret) VALUES ($1, $2, $3)", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", "Text", "Varchar" ] - }, - "nullable": [] - } + } + }, + "query": "INSERT INTO survey_admins \n (name , password, secret) VALUES ($1, $2, $3)" }, "1373df097fa0e58b23a374753318ae53a44559aa0e7eb64680185baf1c481723": { - "query": "SELECT password FROM survey_admins WHERE name = ($1)", "describe": { "columns": [ { - "ordinal": 0, "name": "password", + "ordinal": 0, "type_info": "Text" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Text" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "SELECT password FROM survey_admins WHERE name = ($1)" }, "19686bfe8772cbc6831d46d18994e2b9aa40c7181eae9a31e51451cce95f04e8": { - "query": "SELECT name, password FROM survey_admins WHERE email = ($1)", "describe": { "columns": [ { - "ordinal": 0, "name": "name", + "ordinal": 0, "type_info": "Varchar" }, { - "ordinal": 1, "name": "password", + "ordinal": 1, "type_info": "Text" } ], + "nullable": [ + false, + false + ], "parameters": { "Left": [ "Text" ] - }, - "nullable": [ - false, - false - ] - } + } + }, + "query": "SELECT name, password FROM survey_admins WHERE email = ($1)" }, "1b7e17bfc949fa97e8dec1f95e35a02bcf3aa1aa72a1f6f6c8884e885fc3b953": { - "query": "insert into survey_admins \n (name , password, email, secret) values ($1, $2, $3, $4)", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", @@ -84,152 +84,152 @@ "Varchar", "Varchar" ] - }, - "nullable": [] - } + } + }, + "query": "insert into survey_admins \n (name , password, email, secret) values ($1, $2, $3, $4)" }, "2ccaecfee4d2f29ef5278188b304017719720aa986d680d4727a1facbb869c7a": { - "query": "DELETE FROM survey_admins WHERE name = ($1)", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Text" ] - }, - "nullable": [] - } + } + }, + "query": "DELETE FROM survey_admins WHERE name = ($1)" }, "43b3e771f38bf8059832169227705be06a28925af1b3799ffef5371d511fd138": { - "query": "\n INSERT INTO survey_users (created_at, id) VALUES($1, $2)", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Timestamptz", "Uuid" ] - }, - "nullable": [] - } + } + }, + "query": "\n INSERT INTO survey_users (created_at, id) VALUES($1, $2)" }, "536541ecf2e1c0403c74b6e2e09b42b73a7741ae4a348ff539ac410022e03ace": { - "query": "SELECT EXISTS (SELECT 1 from survey_admins WHERE name = $1)", "describe": { "columns": [ { - "ordinal": 0, "name": "exists", + "ordinal": 0, "type_info": "Bool" } ], + "nullable": [ + null + ], "parameters": { "Left": [ "Text" ] - }, - "nullable": [ - null - ] - } + } + }, + "query": "SELECT EXISTS (SELECT 1 from survey_admins WHERE name = $1)" }, "55dde28998a6d12744806035f0a648494a403c7d09ea3caf91bf54869a81aa73": { - "query": "UPDATE survey_admins set password = $1\n WHERE name = $2", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Text", "Text" ] - }, - "nullable": [] - } + } + }, + "query": "UPDATE survey_admins set password = $1\n WHERE name = $2" }, "58ec3b8f98c27e13ec2732f8ee23f6eb9845ac5d9fd97b1e5c9f2eed4b1f5693": { - "query": "SELECT name \n FROM survey_campaigns\n WHERE \n id = $1\n AND\n user_id = (SELECT ID from survey_admins WHERE name = $2)", "describe": { "columns": [ { - "ordinal": 0, "name": "name", + "ordinal": 0, "type_info": "Varchar" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Uuid", "Text" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "SELECT name \n FROM survey_campaigns\n WHERE \n id = $1\n AND\n user_id = (SELECT ID from survey_admins WHERE name = $2)" }, "683707dbc847b37c58c29aaad0d1a978c9fe0657da13af99796e4461134b5a43": { - "query": "UPDATE survey_admins set email = $1\n WHERE name = $2", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", "Text" ] - }, - "nullable": [] - } + } + }, + "query": "UPDATE survey_admins set email = $1\n WHERE name = $2" }, "6a26daa84578aed2b2085697cb8358ed7c0a50ba9597fd387b4b09b0a8a154db": { - "query": "SELECT EXISTS (SELECT 1 from survey_admins WHERE email = $1)", "describe": { "columns": [ { - "ordinal": 0, "name": "exists", + "ordinal": 0, "type_info": "Bool" } ], - "parameters": { - "Left": [ - "Text" - ] - }, "nullable": [ null - ] - } - }, - "70cc7bfc9b6ff5b68db70c069c0947d51bfc4a53cedc020016ee25ff98586c93": { - "query": "SELECT \n name, id\n FROM \n survey_campaigns \n WHERE\n user_id = (\n SELECT \n ID\n FROM \n survey_admins\n WHERE\n name = $1\n )", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "name", - "type_info": "Varchar" - }, - { - "ordinal": 1, - "name": "id", - "type_info": "Uuid" - } ], "parameters": { "Left": [ "Text" ] - }, + } + }, + "query": "SELECT EXISTS (SELECT 1 from survey_admins WHERE email = $1)" + }, + "70cc7bfc9b6ff5b68db70c069c0947d51bfc4a53cedc020016ee25ff98586c93": { + "describe": { + "columns": [ + { + "name": "name", + "ordinal": 0, + "type_info": "Varchar" + }, + { + "name": "id", + "ordinal": 1, + "type_info": "Uuid" + } + ], "nullable": [ false, false - ] - } + ], + "parameters": { + "Left": [ + "Text" + ] + } + }, + "query": "SELECT \n name, id\n FROM \n survey_campaigns \n WHERE\n user_id = (\n SELECT \n ID\n FROM \n survey_admins\n WHERE\n name = $1\n )" }, "82feafc36533144e49ba374c8c47ca4aa0d6558a9803778ad28cfa7b62382c3e": { - "query": "\n INSERT INTO survey_campaigns (\n user_id, ID, name, difficulties, created_at\n ) VALUES(\n (SELECT id FROM survey_admins WHERE name = $1),\n $2, $3, $4, $5\n );", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Text", @@ -238,82 +238,82 @@ "Int4Array", "Timestamptz" ] - }, - "nullable": [] - } + } + }, + "query": "\n INSERT INTO survey_campaigns (\n user_id, ID, name, difficulties, created_at\n ) VALUES(\n (SELECT id FROM survey_admins WHERE name = $1),\n $2, $3, $4, $5\n );" }, "8320dda2b3e107d1451fdfb35eb2a4b8e97364e7b1b74ffe4d6913faf132fb61": { - "query": "SELECT ID \n FROM survey_responses \n WHERE \n user_id = $1 \n AND \n device_software_recognised = $2;", "describe": { "columns": [ { - "ordinal": 0, "name": "id", + "ordinal": 0, "type_info": "Int4" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Uuid", "Text" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "SELECT ID \n FROM survey_responses \n WHERE \n user_id = $1 \n AND \n device_software_recognised = $2;" }, "9cdade613ce724631cc3f187510758ee0929e93ff3f8ce81fe35594756644246": { - "query": "SELECT difficulties FROM survey_campaigns WHERE id = $1;", "describe": { "columns": [ { - "ordinal": 0, "name": "difficulties", + "ordinal": 0, "type_info": "Int4Array" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Uuid" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "SELECT difficulties FROM survey_campaigns WHERE id = $1;" }, "a721cfa249acf328c2f29c4cf8c2aeba1a635bcf49d18ced5474caa10b7cae4f": { - "query": "INSERT INTO survey_benches \n (resp_id, difficulty, duration) \n VALUES ($1, $2, $3);", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int4", "Int4", "Float4" ] - }, - "nullable": [] - } + } + }, + "query": "INSERT INTO survey_benches \n (resp_id, difficulty, duration) \n VALUES ($1, $2, $3);" }, "ab951c5c318174c6538037947c2f52c61bcfe5e5be1901379b715e77f5214dd2": { - "query": "UPDATE survey_admins set secret = $1\n WHERE name = $2", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", "Text" ] - }, - "nullable": [] - } + } + }, + "query": "UPDATE survey_admins set secret = $1\n WHERE name = $2" }, "b4cd1e5240de1968c8b6d56672cec639b22f41ebf2754dadbf00efe0948c7e68": { - "query": "INSERT INTO survey_responses (\n user_id, \n campaign_id,\n device_user_provided,\n device_software_recognised,\n threads\n ) VALUES ($1, $2, $3, $4, $5);", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Uuid", @@ -322,55 +322,55 @@ "Varchar", "Int4" ] - }, - "nullable": [] - } + } + }, + "query": "INSERT INTO survey_responses (\n user_id, \n campaign_id,\n device_user_provided,\n device_software_recognised,\n threads\n ) VALUES ($1, $2, $3, $4, $5);" }, "c757589ef26a005e3285e7ab20d8a44c4f2e1cb125f8db061dd198cc380bf807": { - "query": "UPDATE survey_admins set name = $1\n WHERE name = $2", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Varchar", "Text" ] - }, - "nullable": [] - } + } + }, + "query": "UPDATE survey_admins set name = $1\n WHERE name = $2" }, "e9cf5d6d8c9e8327d5c809d47a14a933f324e267f1e7dbb48e1caf1c021adc3f": { - "query": "SELECT secret FROM survey_admins WHERE name = ($1)", "describe": { "columns": [ { - "ordinal": 0, "name": "secret", + "ordinal": 0, "type_info": "Varchar" } ], + "nullable": [ + false + ], "parameters": { "Left": [ "Text" ] - }, - "nullable": [ - false - ] - } + } + }, + "query": "SELECT secret FROM survey_admins WHERE name = ($1)" }, "fcdc5fe5d496eb516c805e64ec96d9626b74ab33cd6e75e5a08ae88967403b72": { - "query": "INSERT INTO survey_response_tokens \n (resp_id, user_id, id)\n VALUES ($1, $2, $3);", "describe": { "columns": [], + "nullable": [], "parameters": { "Left": [ "Int4", "Uuid", "Uuid" ] - }, - "nullable": [] - } + } + }, + "query": "INSERT INTO survey_response_tokens \n (resp_id, user_id, id)\n VALUES ($1, $2, $3);" } } \ No newline at end of file diff --git a/src/api/v1/admin/auth.rs b/src/api/v1/admin/auth.rs index 30a2cd8..67a1f6d 100644 --- a/src/api/v1/admin/auth.rs +++ b/src/api/v1/admin/auth.rs @@ -25,8 +25,8 @@ use crate::errors::*; use crate::AppData; pub mod routes { - use crate::middleware::auth::GetLoginRoute; - use url::Url; + use actix_auth_middleware::GetLoginRoute; + pub struct Auth { pub logout: &'static str, pub login: &'static str, diff --git a/src/api/v1/admin/campaigns.rs b/src/api/v1/admin/campaigns.rs index a6a4f9a..a8d3eac 100644 --- a/src/api/v1/admin/campaigns.rs +++ b/src/api/v1/admin/campaigns.rs @@ -352,10 +352,10 @@ mod tests { use crate::api::v1::bench::Submission; use crate::data::Data; use crate::errors::*; - use crate::middleware::auth::GetLoginRoute; use crate::tests::*; use crate::*; + use actix_auth_middleware::GetLoginRoute; use actix_web::{http::header, test}; #[actix_rt::test] diff --git a/src/api/v1/admin/mod.rs b/src/api/v1/admin/mod.rs index 3dfed4a..5b74321 100644 --- a/src/api/v1/admin/mod.rs +++ b/src/api/v1/admin/mod.rs @@ -14,6 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ +use actix_auth_middleware::*; use actix_web::web::ServiceConfig; pub mod account; @@ -23,6 +24,7 @@ pub mod campaigns; mod tests; pub use super::{get_random, get_uuid, RedirectQuery}; +use crate::api::v1::bench::SURVEY_USER_ID; pub fn services(cfg: &mut ServiceConfig) { auth::services(cfg); @@ -30,12 +32,8 @@ pub fn services(cfg: &mut ServiceConfig) { campaigns::services(cfg); } -pub fn get_admin_check_login() -> crate::CheckLogin { - use crate::middleware::auth::*; - CheckLogin::new( - crate::V1_API_ROUTES.admin.auth, - AuthenticatedSession::ActixIdentity, - ) +pub fn get_admin_check_login() -> Authentication { + Authentication::with_identity(super::ROUTES.admin.auth) } pub mod routes { diff --git a/src/api/v1/bench.rs b/src/api/v1/bench.rs index 59b4a8b..bf29042 100644 --- a/src/api/v1/bench.rs +++ b/src/api/v1/bench.rs @@ -17,7 +17,9 @@ use std::borrow::Cow; use std::str::FromStr; +use actix_auth_middleware::*; use actix_session::Session; +use actix_web::{dev::Payload, HttpRequest}; use actix_web::{http, web, HttpResponse, Responder}; use futures::future::try_join_all; use serde::{Deserialize, Serialize}; @@ -32,7 +34,7 @@ pub const SURVEY_USER_ID: &str = "survey_user_id"; pub mod routes { - use crate::middleware::auth::GetLoginRoute; + use actix_auth_middleware::GetLoginRoute; pub struct Benches { pub submit: &'static str, @@ -173,14 +175,27 @@ pub struct SubmissionProof { pub proof: String, } -pub fn get_check_login() -> crate::CheckLogin { - use crate::middleware::auth::*; - CheckLogin::new( - crate::V1_API_ROUTES.benches, - AuthenticatedSession::ActixSession, +fn is_session_authenticated(r: &HttpRequest, mut pl: &mut Payload) -> bool { + use actix_web::FromRequest; + matches!( + Session::from_request(&r, &mut pl).into_inner().map(|x| { + let val = x.get::(SURVEY_USER_ID); + println!("{:#?}", val); + val + }), + Ok(Ok(Some(_))) ) } +pub fn get_check_login() -> Authentication { + Authentication::new(crate::V1_API_ROUTES.benches, is_session_authenticated) +} +// +// pub fn get_auth_middleware() -> Authentication { +// Authentication::with_identity(V1_API_ROUTES) +// } +//} + #[my_codegen::post( path = "crate::V1_API_ROUTES.benches.submit", wrap = "get_check_login()" diff --git a/src/main.rs b/src/main.rs index 0b83cac..ff0cf25 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,6 +18,7 @@ use std::env; use std::sync::Arc; use actix_identity::{CookieIdentityPolicy, IdentityService}; +use actix_session::{storage::CookieSessionStore, SessionMiddleware}; use actix_web::{ error::InternalError, http::StatusCode, middleware as actix_middleware, web::JsonConfig, App, HttpServer, @@ -28,7 +29,6 @@ use log::info; mod api; mod data; mod errors; -mod middleware; mod pages; mod settings; mod static_assets; @@ -38,7 +38,6 @@ mod tests; pub use crate::data::Data; pub use api::v1::ROUTES as V1_API_ROUTES; -pub use middleware::auth::CheckLogin; pub use pages::routes::ROUTES as PAGES; pub use settings::Settings; pub use static_assets::static_files::assets; @@ -136,16 +135,17 @@ pub fn get_json_err() -> JsonConfig { } #[cfg(not(tarpaulin_include))] -pub fn get_survey_session() -> actix_session::CookieSession { +pub fn get_survey_session() -> actix_session::SessionMiddleware { + use actix_web::cookie::Key; let cookie_secret = &SETTINGS.server.cookie_secret2; - actix_session::CookieSession::signed(cookie_secret.as_bytes()) - .lazy(true) - .domain(&SETTINGS.server.domain) - .name("survey-id") - .http_only(true) - .path("/") - .max_age(30 * 60) - .secure(false) + let key = Key::from(cookie_secret.as_bytes()); + SessionMiddleware::builder(CookieSessionStore::default(), key) + .cookie_domain(Some(SETTINGS.server.domain.clone())) + .cookie_name("survey-id".into()) + .cookie_path("/".to_string()) + .cookie_secure(false) + .cookie_http_only(true) + .build() } #[cfg(not(tarpaulin_include))] diff --git a/src/middleware/auth.rs b/src/middleware/auth.rs deleted file mode 100644 index 742aae6..0000000 --- a/src/middleware/auth.rs +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Copyright (C) 2021 Aravinth Manivannan - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ -#![allow(clippy::type_complexity)] - -use std::rc::Rc; - -use crate::api::v1::bench::SURVEY_USER_ID; -use actix_http::body::AnyBody; -use actix_identity::Identity; -use actix_service::{Service, Transform}; -use actix_session::Session; -use actix_web::dev::{ServiceRequest, ServiceResponse}; -use actix_web::{http, Error, FromRequest, HttpResponse}; - -#[derive(Clone)] -pub enum AuthenticatedSession { - ActixIdentity, - ActixSession, -} - -use futures::future::{ok, Either, Ready}; - -pub trait GetLoginRoute { - fn get_login_route(&self, src: Option<&str>) -> String; -} - -pub struct CheckLogin { - login: Rc, - session_type: AuthenticatedSession, -} - -impl CheckLogin { - pub fn new(login: T, session_type: AuthenticatedSession) -> Self { - let login = Rc::new(login); - Self { - login, - session_type, - } - } -} - -impl Transform for CheckLogin -where - S: Service, Error = Error>, - S::Future: 'static, - GT: GetLoginRoute, -{ - type Response = ServiceResponse; - type Error = Error; - type Transform = CheckLoginMiddleware; - type InitError = (); - type Future = Ready>; - - fn new_transform(&self, service: S) -> Self::Future { - ok(CheckLoginMiddleware { - service, - login: self.login.clone(), - session_type: self.session_type.clone(), - }) - } -} -pub struct CheckLoginMiddleware { - service: S, - login: Rc, - session_type: AuthenticatedSession, -} - -impl Service for CheckLoginMiddleware -where - S: Service, Error = Error>, - S::Future: 'static, - GT: GetLoginRoute, -{ - type Response = ServiceResponse; - type Error = Error; - type Future = Either>>; - - actix_service::forward_ready!(service); - - fn call(&self, req: ServiceRequest) -> Self::Future { - let (r, mut pl) = req.into_parts(); - let mut is_authenticated = || match self.session_type { - AuthenticatedSession::ActixSession => matches!( - Session::from_request(&r, &mut pl) - .into_inner() - .map(|x| x.get::(SURVEY_USER_ID)), - Ok(Ok(Some(_))) - ), - - AuthenticatedSession::ActixIdentity => matches!( - Identity::from_request(&r, &mut pl) - .into_inner() - .map(|x| x.identity()), - Ok(Some(_)) - ), - }; - if is_authenticated() { - let req = ServiceRequest::from_parts(r, pl); - Either::Left(self.service.call(req)) - } else { - let path = r.uri().path_and_query().map(|path| path.as_str()); - let path = self.login.get_login_route(path); - let req = ServiceRequest::from_parts(r, pl); - Either::Right(ok(req.into_response( - HttpResponse::Found() - .insert_header((http::header::LOCATION, path)) - .finish(), - ))) - } - } -} - -#[cfg(test)] -mod tests { - use url::Url; - - use crate::api::v1::bench::Submission; - use crate::data::Data; - use crate::middleware::auth::GetLoginRoute; - use crate::tests::*; - use crate::*; - - use actix_web::{http::header, test}; - - #[actix_rt::test] - async fn auth_middleware_works() { - fn make_uri(path: &str, queries: &Option>) -> String { - let mut url = Url::parse("http://x/").unwrap(); - let final_path; - url.set_path(path); - - if let Some(queries) = queries { - { - let mut query_pairs = url.query_pairs_mut(); - queries.iter().for_each(|(k, v)| { - query_pairs.append_pair(k, v); - }); - } - - final_path = format!("{}?{}", url.path(), url.query().unwrap()); - } else { - final_path = url.path().to_string(); - } - final_path - } - - const NAME: &str = "testmiddlewareuser"; - const EMAIL: &str = "testuserupda@testmiddlewareuser.com"; - const PASSWORD: &str = "longpassword2"; - const DEVICE_USER_PROVIDED: &str = "foo"; - const DEVICE_SOFTWARE_RECOGNISED: &str = "Foobar.v2"; - const THREADS: i32 = 4; - let queries = Some(vec![ - ("foo", "bar"), - ("src", "/x/y/z"), - ("with_q", "/a/b/c/?goo=x"), - ]); - - { - let data = Data::new().await; - delete_user(NAME, &data).await; - } - let (data, _creds, signin_resp) = - register_and_signin(NAME, EMAIL, PASSWORD).await; - let cookies = get_cookie!(signin_resp); - let survey = get_survey_user(data.clone()).await; - let survey_cookie = get_cookie!(survey); - - let campaign = create_new_campaign(NAME, data.clone(), cookies.clone()).await; - - let bench_submit_route = - V1_API_ROUTES.benches.submit_route(&campaign.campaign_id); - let bench_routes = vec![ - (&bench_submit_route, queries.clone()), - (&bench_submit_route, None), - ]; - - let app = get_app!(data).await; - - // let campaign_routes = vec![ - // (Some(V1_API_ROUTES.camp.submit), queries.clone()), - // (None, None), - // (Some(V1_API_ROUTES.benches.submit), None), - // ]; - - let bench_submit_payload = Submission { - device_user_provided: DEVICE_USER_PROVIDED.into(), - device_software_recognised: DEVICE_SOFTWARE_RECOGNISED.into(), - threads: THREADS, - benches: BENCHES.clone(), - }; - - for (from, query) in bench_routes.iter() { - let route = make_uri(from, query); - let signin_resp = test::call_service( - &app, - post_request!(&bench_submit_payload, &route).to_request(), - ) - .await; - assert_eq!(signin_resp.status(), StatusCode::FOUND); - - let redirect_to = V1_API_ROUTES.benches.get_login_route(Some(&route)); - let headers = signin_resp.headers(); - assert_eq!(headers.get(header::LOCATION).unwrap(), &redirect_to); - - let add_feedback_resp = test::call_service( - &app, - post_request!(&bench_submit_payload, &route) - .cookie(survey_cookie.clone()) - .to_request(), - ) - .await; - assert_eq!(add_feedback_resp.status(), StatusCode::OK); - } - } - - // let signin_resp = test::call_service( - // &app, - // test::TestRequest::get() - // .uri(V1_API_ROUTES.benches.get_login_route(redirect_to).as_ref().unwrap()) - // .to_request(), - // ) - // .await; - // assert_eq!(signin_resp.status(), StatusCode::FOUND); - // let headers = signin_resp.headers(); - // assert_eq!( - // headers.get(header::LOCATION).unwrap(), - // redirect_to.as_ref().unwrap() - // ) - // -} diff --git a/src/middleware/mod.rs b/src/middleware/mod.rs deleted file mode 100644 index 1f5d11b..0000000 --- a/src/middleware/mod.rs +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (C) 2021 Aravinth Manivannan - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -pub mod auth; diff --git a/src/pages/auth/join.rs b/src/pages/auth/join.rs index 77b5972..2e04734 100644 --- a/src/pages/auth/join.rs +++ b/src/pages/auth/join.rs @@ -55,7 +55,7 @@ lazy_static! { pub async fn join() -> impl Responder { HttpResponse::Ok() .content_type("text/html; charset=utf-8") - .body(&*INDEX) + .body(&*INDEX.as_str()) } #[my_codegen::post(path = "PAGES.auth.join")] diff --git a/src/pages/auth/login.rs b/src/pages/auth/login.rs index 55e26c1..8ede2bb 100644 --- a/src/pages/auth/login.rs +++ b/src/pages/auth/login.rs @@ -58,7 +58,7 @@ lazy_static! { pub async fn login() -> impl Responder { HttpResponse::Ok() .content_type("text/html; charset=utf-8") - .body(&*INDEX) + .body(&*INDEX.as_str()) } #[post(path = "PAGES.auth.login")] diff --git a/src/pages/auth/mod.rs b/src/pages/auth/mod.rs index 5f6165b..b37e2f7 100644 --- a/src/pages/auth/mod.rs +++ b/src/pages/auth/mod.rs @@ -26,7 +26,7 @@ pub fn services(cfg: &mut actix_web::web::ServiceConfig) { } pub mod routes { - use crate::middleware::auth::GetLoginRoute; + use actix_auth_middleware::GetLoginRoute; use url::Url; pub struct Auth { diff --git a/src/pages/errors.rs b/src/pages/errors.rs index 657c55f..f7101ef 100644 --- a/src/pages/errors.rs +++ b/src/pages/errors.rs @@ -58,11 +58,11 @@ async fn error(path: web::Path) -> impl Responder { let resp = match path.into_inner() { 500 => HttpResponse::InternalServerError() .content_type("text/html; charset=utf-8") - .body(&*INTERNAL_SERVER_ERROR_BODY), + .body(&*INTERNAL_SERVER_ERROR_BODY.as_str()), _ => HttpResponse::InternalServerError() .content_type("text/html; charset=utf-8") - .body(&*UNKNOWN_ERROR_BODY), + .body(&*UNKNOWN_ERROR_BODY.as_str()), }; resp diff --git a/src/pages/mod.rs b/src/pages/mod.rs index bb7784f..80455e1 100644 --- a/src/pages/mod.rs +++ b/src/pages/mod.rs @@ -13,7 +13,7 @@ * * You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ - +use actix_auth_middleware::*; use actix_web::web::ServiceConfig; pub mod auth; @@ -30,9 +30,8 @@ pub fn services(cfg: &mut ServiceConfig) { errors::services(cfg); } -pub fn get_page_check_login() -> crate::CheckLogin { - use crate::middleware::auth::*; - CheckLogin::new(crate::PAGES.auth, AuthenticatedSession::ActixIdentity) +pub fn get_page_check_login() -> Authentication { + Authentication::with_identity(crate::PAGES.auth) } #[cfg(not(tarpaulin_include))] diff --git a/src/pages/panel/campaigns/bench.rs b/src/pages/panel/campaigns/bench.rs index 7726310..30e6e00 100644 --- a/src/pages/panel/campaigns/bench.rs +++ b/src/pages/panel/campaigns/bench.rs @@ -54,6 +54,6 @@ pub async fn bench(path: web::Path) -> PageResult { Err(_) => Err(PageError::PageDoesntExist), Ok(_) => Ok(HttpResponse::Ok() .content_type("text/html; charset=utf-8") - .body(&*BENCH)), + .body(&*BENCH.as_str())), } } diff --git a/src/pages/panel/campaigns/mod.rs b/src/pages/panel/campaigns/mod.rs index 17637c2..8379a23 100644 --- a/src/pages/panel/campaigns/mod.rs +++ b/src/pages/panel/campaigns/mod.rs @@ -102,7 +102,7 @@ pub async fn home(data: AppData, id: Identity) -> impl Responder { HttpResponse::Ok() .content_type("text/html; charset=utf-8") - .body(&page) + .body(page) } #[cfg(test)] diff --git a/src/pages/panel/campaigns/new.rs b/src/pages/panel/campaigns/new.rs index 67e9c91..a699012 100644 --- a/src/pages/panel/campaigns/new.rs +++ b/src/pages/panel/campaigns/new.rs @@ -60,7 +60,7 @@ lazy_static! { pub async fn new_campaign() -> impl Responder { HttpResponse::Ok() .content_type("text/html; charset=utf-8") - .body(&*INDEX) + .body(&*INDEX.as_str()) } #[post( diff --git a/src/pages/routes.rs b/src/pages/routes.rs index 551932c..f6113f2 100644 --- a/src/pages/routes.rs +++ b/src/pages/routes.rs @@ -14,6 +14,8 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ +use actix_auth_middleware::GetLoginRoute; + use super::auth::routes::Auth; use super::errors::routes::Errors; use super::panel::routes::Panel; @@ -57,6 +59,25 @@ impl Routes { } } +impl GetLoginRoute for Routes { + fn get_login_route(&self, src: Option<&str>) -> String { + if let Some(redirect_to) = src { + // uri::Builder::new().path_and_query( + format!( + "{}?redirect_to={}", + self.auth.join.to_string(), + urlencoding::encode(redirect_to) + ) + // let mut url: Uri = self.register.parse().unwrap(); + // url.qu + // url.query_pairs_mut() + // .append_pair("redirect_to", redirect_to); + } else { + self.auth.join.to_string() + } + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/src/static_assets/static_files.rs b/src/static_assets/static_files.rs index 39b0f30..a78aabd 100644 --- a/src/static_assets/static_files.rs +++ b/src/static_assets/static_files.rs @@ -16,7 +16,7 @@ */ use std::borrow::Cow; -use actix_web::body::Body; +use actix_web::body::BoxBody; use actix_web::{get, http::header, web, HttpResponse, Responder}; use log::debug; use mime_guess::from_path; @@ -61,9 +61,9 @@ struct Asset; fn handle_assets(path: &str) -> HttpResponse { match Asset::get(path) { Some(content) => { - let body: Body = match content.data { - Cow::Borrowed(bytes) => bytes.into(), - Cow::Owned(bytes) => bytes.into(), + let body: BoxBody = match content.data { + Cow::Borrowed(bytes) => BoxBody::new(bytes), + Cow::Owned(bytes) => BoxBody::new(bytes), }; HttpResponse::Ok() @@ -91,9 +91,9 @@ struct Favicons; fn handle_favicons(path: &str) -> HttpResponse { match Favicons::get(path) { Some(content) => { - let body: Body = match content.data { - Cow::Borrowed(bytes) => bytes.into(), - Cow::Owned(bytes) => bytes.into(), + let body: BoxBody = match content.data { + Cow::Borrowed(bytes) => BoxBody::new(bytes), + Cow::Owned(bytes) => BoxBody::new(bytes), }; HttpResponse::Ok() diff --git a/src/tests.rs b/src/tests.rs index 4dd469a..a6312be 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -19,7 +19,13 @@ use std::sync::Arc; use actix_web::cookie::Cookie; use actix_web::test; -use actix_web::{dev::ServiceResponse, error::ResponseError, http::StatusCode}; +use actix_web::{ + body::{BoxBody, EitherBody}, + dev::ServiceResponse, + error::ResponseError, + http::StatusCode, +}; + use lazy_static::lazy_static; use serde::Serialize; use uuid::Uuid; @@ -110,7 +116,7 @@ pub async fn register_and_signin( name: &str, email: &str, password: &str, -) -> (Arc, Login, ServiceResponse) { +) -> (Arc, Login, ServiceResponse>) { register(name, email, password).await; signin(name, password).await } @@ -136,7 +142,10 @@ pub async fn register(name: &str, email: &str, password: &str) { } /// signin util -pub async fn signin(name: &str, password: &str) -> (Arc, Login, ServiceResponse) { +pub async fn signin( + name: &str, + password: &str, +) -> (Arc, Login, ServiceResponse>) { let data = Data::new().await; let app = get_app!(data.clone()).await; @@ -226,7 +235,7 @@ pub async fn create_new_campaign( uuid } -pub async fn get_survey_user(data: Arc) -> ServiceResponse { +pub async fn get_survey_user(data: Arc) -> ServiceResponse> { let app = get_app!(data).await; let signin_resp = test::call_service( &app, @@ -306,6 +315,11 @@ pub async fn submit_bench( post_request!(&payload, &route).cookie(cookies).to_request(), ) .await; + if add_feedback_resp.status() != StatusCode::OK { + let headers = add_feedback_resp.headers(); + println!("{:#?}", headers); + } + assert_eq!(add_feedback_resp.status(), StatusCode::OK); let proof: SubmissionProof = test::read_body_json(add_feedback_resp).await;