rm actor temp

This commit is contained in:
realaravinth
2021-03-29 21:07:01 +05:30
parent 1e25b66e42
commit 79348eaf85
9 changed files with 235 additions and 280 deletions

394
Cargo.lock generated
View File

@@ -40,32 +40,16 @@ dependencies = [
"tokio-util 0.3.1", "tokio-util 0.3.1",
] ]
[[package]]
name = "actix-codec"
version = "0.4.0-beta.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90673465c6187bd0829116b02be465dc0195a74d7719f76ffff0effef934a92e"
dependencies = [
"bitflags",
"bytes 1.0.1",
"futures-core",
"futures-sink",
"log",
"pin-project-lite 0.2.6",
"tokio 1.4.0",
"tokio-util 0.6.5",
]
[[package]] [[package]]
name = "actix-connect" name = "actix-connect"
version = "2.0.0" version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "177837a10863f15ba8d3ae3ec12fac1099099529ed20083a27fdfe247381d0dc" checksum = "177837a10863f15ba8d3ae3ec12fac1099099529ed20083a27fdfe247381d0dc"
dependencies = [ dependencies = [
"actix-codec 0.3.0", "actix-codec",
"actix-rt 1.1.1", "actix-rt 1.1.1",
"actix-service 1.0.6", "actix-service",
"actix-utils 2.0.0", "actix-utils",
"derive_more", "derive_more",
"either", "either",
"futures-util", "futures-util",
@@ -81,13 +65,13 @@ version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "452299e87817ae5673910e53c243484ca38be3828db819b6011736fc6982e874" checksum = "452299e87817ae5673910e53c243484ca38be3828db819b6011736fc6982e874"
dependencies = [ dependencies = [
"actix-codec 0.3.0", "actix-codec",
"actix-connect", "actix-connect",
"actix-rt 1.1.1", "actix-rt 1.1.1",
"actix-service 1.0.6", "actix-service",
"actix-threadpool", "actix-threadpool",
"actix-utils 2.0.0", "actix-utils",
"base64", "base64 0.13.0",
"bitflags", "bitflags",
"brotli2", "brotli2",
"bytes 0.5.6", "bytes 0.5.6",
@@ -101,7 +85,7 @@ dependencies = [
"futures-core", "futures-core",
"futures-util", "futures-util",
"fxhash", "fxhash",
"h2 0.2.7", "h2",
"http", "http",
"httparse", "httparse",
"indexmap", "indexmap",
@@ -111,7 +95,7 @@ dependencies = [
"log", "log",
"mime", "mime",
"percent-encoding", "percent-encoding",
"pin-project 1.0.5", "pin-project 1.0.6",
"rand 0.7.3", "rand 0.7.3",
"regex", "regex",
"serde 1.0.125", "serde 1.0.125",
@@ -122,58 +106,13 @@ dependencies = [
"time 0.2.26", "time 0.2.26",
] ]
[[package]]
name = "actix-http"
version = "3.0.0-beta.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a01f9e0681608afa887d4269a0857ac4226f09ba5ceda25939e8391c9da610a"
dependencies = [
"actix-codec 0.4.0-beta.1",
"actix-rt 2.1.0",
"actix-service 2.0.0-beta.5",
"actix-tls 3.0.0-beta.4",
"actix-utils 3.0.0-beta.2",
"ahash 0.7.2",
"base64",
"bitflags",
"brotli2",
"bytes 1.0.1",
"bytestring",
"cfg-if 1.0.0",
"cookie",
"derive_more",
"encoding_rs",
"flate2",
"futures-core",
"futures-util",
"h2 0.3.2",
"http",
"httparse",
"itoa",
"language-tags",
"log",
"mime",
"once_cell",
"percent-encoding",
"pin-project 1.0.5",
"rand 0.8.3",
"regex",
"serde 1.0.125",
"serde_json",
"serde_urlencoded",
"sha-1",
"smallvec",
"time 0.2.26",
"tokio 1.4.0",
]
[[package]] [[package]]
name = "actix-identity" name = "actix-identity"
version = "0.3.1" version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3263fe74cf505c6f9e18209c89fbdba5569cfd3905a7e907b42aa1c85c18fae5" checksum = "3263fe74cf505c6f9e18209c89fbdba5569cfd3905a7e907b42aa1c85c18fae5"
dependencies = [ dependencies = [
"actix-service 1.0.6", "actix-service",
"actix-web", "actix-web",
"futures-util", "futures-util",
"serde 1.0.125", "serde 1.0.125",
@@ -191,16 +130,6 @@ dependencies = [
"syn", "syn",
] ]
[[package]]
name = "actix-macros"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dbcb2b608f0accc2f5bcf3dd872194ce13d94ee45b571487035864cf966b04ef"
dependencies = [
"quote",
"syn",
]
[[package]] [[package]]
name = "actix-router" name = "actix-router"
version = "0.2.7" version = "0.2.7"
@@ -220,7 +149,7 @@ version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "143fcc2912e0d1de2bcf4e2f720d2a60c28652ab4179685a1ee159e0fb3db227" checksum = "143fcc2912e0d1de2bcf4e2f720d2a60c28652ab4179685a1ee159e0fb3db227"
dependencies = [ dependencies = [
"actix-macros 0.1.3", "actix-macros",
"actix-threadpool", "actix-threadpool",
"copyless", "copyless",
"futures-channel", "futures-channel",
@@ -235,7 +164,6 @@ version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b4e57bc1a3915e71526d128baf4323700bd1580bc676239e2298a4c5b001f18" checksum = "0b4e57bc1a3915e71526d128baf4323700bd1580bc676239e2298a4c5b001f18"
dependencies = [ dependencies = [
"actix-macros 0.2.0",
"futures-core", "futures-core",
"tokio 1.4.0", "tokio 1.4.0",
] ]
@@ -246,10 +174,10 @@ version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45407e6e672ca24784baa667c5d32ef109ccdd8d5e0b5ebb9ef8a67f4dfb708e" checksum = "45407e6e672ca24784baa667c5d32ef109ccdd8d5e0b5ebb9ef8a67f4dfb708e"
dependencies = [ dependencies = [
"actix-codec 0.3.0", "actix-codec",
"actix-rt 1.1.1", "actix-rt 1.1.1",
"actix-service 1.0.6", "actix-service",
"actix-utils 2.0.0", "actix-utils",
"futures-channel", "futures-channel",
"futures-util", "futures-util",
"log", "log",
@@ -270,26 +198,16 @@ dependencies = [
"pin-project 0.4.27", "pin-project 0.4.27",
] ]
[[package]]
name = "actix-service"
version = "2.0.0-beta.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf82340ad9f4e4caf43737fd3bbc999778a268015cdc54675f60af6240bd2b05"
dependencies = [
"futures-core",
"pin-project-lite 0.2.6",
]
[[package]] [[package]]
name = "actix-testing" name = "actix-testing"
version = "1.0.1" version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47239ca38799ab74ee6a8a94d1ce857014b2ac36f242f70f3f75a66f691e791c" checksum = "47239ca38799ab74ee6a8a94d1ce857014b2ac36f242f70f3f75a66f691e791c"
dependencies = [ dependencies = [
"actix-macros 0.1.3", "actix-macros",
"actix-rt 1.1.1", "actix-rt 1.1.1",
"actix-server", "actix-server",
"actix-service 1.0.6", "actix-service",
"log", "log",
"socket2", "socket2",
] ]
@@ -315,38 +233,21 @@ version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24789b7d7361cf5503a504ebe1c10806896f61e96eca9a7350e23001aca715fb" checksum = "24789b7d7361cf5503a504ebe1c10806896f61e96eca9a7350e23001aca715fb"
dependencies = [ dependencies = [
"actix-codec 0.3.0", "actix-codec",
"actix-service 1.0.6", "actix-service",
"actix-utils 2.0.0", "actix-utils",
"futures-util", "futures-util",
] ]
[[package]]
name = "actix-tls"
version = "3.0.0-beta.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2b1455e3f7a26d40cfc1080b571f41e8165e5a88e937ed579f7a4b3d55b0370"
dependencies = [
"actix-codec 0.4.0-beta.1",
"actix-rt 2.1.0",
"actix-service 2.0.0-beta.5",
"actix-utils 3.0.0-beta.2",
"derive_more",
"futures-core",
"http",
"log",
"tokio-util 0.6.5",
]
[[package]] [[package]]
name = "actix-utils" name = "actix-utils"
version = "2.0.0" version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e9022dec56632d1d7979e59af14f0597a28a830a9c1c7fec8b2327eb9f16b5a" checksum = "2e9022dec56632d1d7979e59af14f0597a28a830a9c1c7fec8b2327eb9f16b5a"
dependencies = [ dependencies = [
"actix-codec 0.3.0", "actix-codec",
"actix-rt 1.1.1", "actix-rt 1.1.1",
"actix-service 1.0.6", "actix-service",
"bitflags", "bitflags",
"bytes 0.5.6", "bytes 0.5.6",
"either", "either",
@@ -358,40 +259,25 @@ dependencies = [
"slab", "slab",
] ]
[[package]]
name = "actix-utils"
version = "3.0.0-beta.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "458795e09a29bc5557604f9ff6f32236fd0ee457d631672e4ec8f6a0103bb292"
dependencies = [
"actix-codec 0.4.0-beta.1",
"actix-rt 2.1.0",
"actix-service 2.0.0-beta.5",
"futures-core",
"futures-sink",
"log",
"pin-project-lite 0.2.6",
]
[[package]] [[package]]
name = "actix-web" name = "actix-web"
version = "3.3.2" version = "3.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e641d4a172e7faa0862241a20ff4f1f5ab0ab7c279f00c2d4587b77483477b86" checksum = "e641d4a172e7faa0862241a20ff4f1f5ab0ab7c279f00c2d4587b77483477b86"
dependencies = [ dependencies = [
"actix-codec 0.3.0", "actix-codec",
"actix-http 2.2.0", "actix-http",
"actix-macros 0.1.3", "actix-macros",
"actix-router", "actix-router",
"actix-rt 1.1.1", "actix-rt 1.1.1",
"actix-server", "actix-server",
"actix-service 1.0.6", "actix-service",
"actix-testing", "actix-testing",
"actix-threadpool", "actix-threadpool",
"actix-tls 2.0.0", "actix-tls",
"actix-utils 2.0.0", "actix-utils",
"actix-web-codegen", "actix-web-codegen",
"awc 2.0.3", "awc",
"bytes 0.5.6", "bytes 0.5.6",
"derive_more", "derive_more",
"encoding_rs", "encoding_rs",
@@ -401,7 +287,7 @@ dependencies = [
"fxhash", "fxhash",
"log", "log",
"mime", "mime",
"pin-project 1.0.5", "pin-project 1.0.6",
"regex", "regex",
"serde 1.0.125", "serde 1.0.125",
"serde_json", "serde_json",
@@ -511,17 +397,6 @@ dependencies = [
"version_check", "version_check",
] ]
[[package]]
name = "ahash"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f200cbb1e856866d9eade941cf3aa0c5d7dd36f74311c4273b494f4ef036957"
dependencies = [
"getrandom 0.2.2",
"once_cell",
"version_check",
]
[[package]] [[package]]
name = "aho-corasick" name = "aho-corasick"
version = "0.7.15" version = "0.7.15"
@@ -617,11 +492,11 @@ version = "2.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b381e490e7b0cfc37ebc54079b0413d8093ef43d14a4e4747083f7fa47a9e691" checksum = "b381e490e7b0cfc37ebc54079b0413d8093ef43d14a4e4747083f7fa47a9e691"
dependencies = [ dependencies = [
"actix-codec 0.3.0", "actix-codec",
"actix-http 2.2.0", "actix-http",
"actix-rt 1.1.1", "actix-rt 1.1.1",
"actix-service 1.0.6", "actix-service",
"base64", "base64 0.13.0",
"bytes 0.5.6", "bytes 0.5.6",
"cfg-if 1.0.0", "cfg-if 1.0.0",
"derive_more", "derive_more",
@@ -635,38 +510,18 @@ dependencies = [
"serde_urlencoded", "serde_urlencoded",
] ]
[[package]]
name = "awc"
version = "3.0.0-beta.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09aecd8728f6491a62b27454ea4b36fb7e50faf32928b0369b644e402c651f4e"
dependencies = [
"actix-codec 0.4.0-beta.1",
"actix-http 3.0.0-beta.4",
"actix-rt 2.1.0",
"actix-service 2.0.0-beta.5",
"base64",
"bytes 1.0.1",
"cfg-if 1.0.0",
"derive_more",
"futures-core",
"itoa",
"log",
"mime",
"percent-encoding",
"pin-project-lite 0.2.6",
"rand 0.8.3",
"serde 1.0.125",
"serde_json",
"serde_urlencoded",
]
[[package]] [[package]]
name = "base-x" name = "base-x"
version = "0.2.8" version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b"
[[package]]
name = "base64"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
[[package]] [[package]]
name = "base64" name = "base64"
version = "0.13.0" version = "0.13.0"
@@ -780,6 +635,28 @@ dependencies = [
"bytes 1.0.1", "bytes 1.0.1",
] ]
[[package]]
name = "cargo-platform"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0226944a63d1bf35a3b5f948dd7c59e263db83695c9e8bffc4037de02e30f1d7"
dependencies = [
"serde 1.0.125",
]
[[package]]
name = "cargo_metadata"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7714a157da7991e23d90686b9524b9e12e0407a108647f52e9328f4b3d51ac7f"
dependencies = [
"cargo-platform",
"semver 0.11.0",
"semver-parser 0.10.2",
"serde 1.0.125",
"serde_json",
]
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.0.67" version = "1.0.67"
@@ -825,9 +702,9 @@ dependencies = [
[[package]] [[package]]
name = "const_fn" name = "const_fn"
version = "0.4.5" version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28b9d6de7f49e22cf97ad17fc4036ece69300032f45f78f30b4a4482cdc3f4a6" checksum = "076a6803b0dacd6a88cfe64deba628b01533ff5ef265687e6938280c1afd0a28"
[[package]] [[package]]
name = "constant_time_eq" name = "constant_time_eq"
@@ -848,7 +725,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03a5d7b21829bc7b4bf4754a978a241ae54ea55a40f92bb20216e54096f4b951" checksum = "03a5d7b21829bc7b4bf4754a978a241ae54ea55a40f92bb20216e54096f4b951"
dependencies = [ dependencies = [
"aes-gcm", "aes-gcm",
"base64", "base64 0.13.0",
"hkdf", "hkdf",
"hmac", "hmac",
"percent-encoding", "percent-encoding",
@@ -1285,13 +1162,11 @@ name = "guard"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"actix", "actix",
"actix-http 2.2.0", "actix-http",
"actix-identity", "actix-identity",
"actix-rt 1.1.1", "actix-rt 1.1.1",
"actix-rt 2.1.0",
"actix-web", "actix-web",
"argon2-creds", "argon2-creds",
"awc 3.0.0-beta.3",
"config", "config",
"derive_builder", "derive_builder",
"derive_more", "derive_more",
@@ -1328,25 +1203,6 @@ dependencies = [
"tracing-futures", "tracing-futures",
] ]
[[package]]
name = "h2"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc018e188373e2777d0ef2467ebff62a08e66c3f5857b23c8fbec3018210dc00"
dependencies = [
"bytes 1.0.1",
"fnv",
"futures-core",
"futures-sink",
"futures-util",
"http",
"indexmap",
"slab",
"tokio 1.4.0",
"tokio-util 0.6.5",
"tracing",
]
[[package]] [[package]]
name = "hashbrown" name = "hashbrown"
version = "0.9.1" version = "0.9.1"
@@ -1615,7 +1471,7 @@ dependencies = [
[[package]] [[package]]
name = "m_captcha" name = "m_captcha"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/mCaptcha/mCaptcha#765ec62e4d7a4a208da81817383f2683275641a9" source = "git+https://github.com/mCaptcha/mCaptcha#ab2f418b571f41adb2c42414fed4415761a3fa52"
dependencies = [ dependencies = [
"actix", "actix",
"derive_builder", "derive_builder",
@@ -1897,6 +1753,15 @@ version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 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]] [[package]]
name = "phf" name = "phf"
version = "0.8.0" version = "0.8.0"
@@ -1946,11 +1811,11 @@ dependencies = [
[[package]] [[package]]
name = "pin-project" name = "pin-project"
version = "1.0.5" version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96fa8ebb90271c4477f144354485b8068bd8f6b78b428b01ba892ca26caf0b63" checksum = "bc174859768806e91ae575187ada95c91a29e96a98dc5d2cd9a1fed039501ba6"
dependencies = [ dependencies = [
"pin-project-internal 1.0.5", "pin-project-internal 1.0.6",
] ]
[[package]] [[package]]
@@ -1966,9 +1831,9 @@ dependencies = [
[[package]] [[package]]
name = "pin-project-internal" name = "pin-project-internal"
version = "1.0.5" version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "758669ae3558c6f74bd2a18b41f7ac0b5a195aea6639d6a9b5e5d1ad5ba24c0b" checksum = "a490329918e856ed1b083f244e3bfe2d8c4f336407e4ea9e1a9f479ff09049e5"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -2251,7 +2116,7 @@ version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb" checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb"
dependencies = [ dependencies = [
"base64", "base64 0.13.0",
"blake2b_simd", "blake2b_simd",
"constant_time_eq", "constant_time_eq",
"crossbeam-utils", "crossbeam-utils",
@@ -2269,16 +2134,16 @@ version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
dependencies = [ dependencies = [
"semver", "semver 0.9.0",
] ]
[[package]] [[package]]
name = "rustls" name = "rustls"
version = "0.19.0" version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "064fd21ff87c6e87ed4506e68beb42459caa4a0e2eb144932e6776768556980b" checksum = "5d1126dcf58e93cee7d098dbda643b5f92ed724f1f6a63007c1116eed6700c81"
dependencies = [ dependencies = [
"base64", "base64 0.12.3",
"log", "log",
"ring", "ring",
"sct", "sct",
@@ -2313,7 +2178,17 @@ version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
dependencies = [ dependencies = [
"semver-parser", "semver-parser 0.7.0",
]
[[package]]
name = "semver"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6"
dependencies = [
"semver-parser 0.10.2",
"serde 1.0.125",
] ]
[[package]] [[package]]
@@ -2322,6 +2197,15 @@ version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" 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]] [[package]]
name = "serde" name = "serde"
version = "0.8.23" version = "0.8.23"
@@ -2474,9 +2358,9 @@ dependencies = [
[[package]] [[package]]
name = "sqlx" name = "sqlx"
version = "0.5.1" version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2739d54a2ae9fdd0f545cb4e4b5574efb95e2ec71b7f921678e246fb20dcaaf" checksum = "e1a98f9bf17b690f026b6fec565293a995b46dfbd6293debcb654dcffd2d1b34"
dependencies = [ dependencies = [
"sqlx-core", "sqlx-core",
"sqlx-macros", "sqlx-macros",
@@ -2484,16 +2368,16 @@ dependencies = [
[[package]] [[package]]
name = "sqlx-core" name = "sqlx-core"
version = "0.5.1" version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1cad9cae4ca8947eba1a90e8ec7d3c59e7a768e2f120dc9013b669c34a90711" checksum = "36bb6a2ca3345a86493bc3b71eabc2c6c16a8bb1aa476cf5303bee27f67627d7"
dependencies = [ dependencies = [
"ahash 0.6.3", "ahash 0.6.3",
"atoi", "atoi",
"base64", "base64 0.13.0",
"bitflags", "bitflags",
"byteorder", "byteorder",
"bytes 1.0.1", "bytes 0.5.6",
"crc", "crc",
"crossbeam-channel", "crossbeam-channel",
"crossbeam-queue", "crossbeam-queue",
@@ -2515,8 +2399,6 @@ dependencies = [
"percent-encoding", "percent-encoding",
"rand 0.7.3", "rand 0.7.3",
"rustls", "rustls",
"serde 1.0.125",
"serde_json",
"sha-1", "sha-1",
"sha2", "sha2",
"smallvec", "smallvec",
@@ -2524,7 +2406,6 @@ dependencies = [
"sqlx-rt", "sqlx-rt",
"stringprep", "stringprep",
"thiserror", "thiserror",
"tokio-stream",
"url", "url",
"webpki", "webpki",
"webpki-roots", "webpki-roots",
@@ -2533,14 +2414,16 @@ dependencies = [
[[package]] [[package]]
name = "sqlx-macros" name = "sqlx-macros"
version = "0.5.1" version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01caee2b3935b4efe152f3262afbe51546ce3b1fc27ad61014e1b3cf5f55366e" checksum = "2b5ada8b3b565331275ce913368565a273a74faf2a34da58c4dc010ce3286844"
dependencies = [ dependencies = [
"cargo_metadata",
"dotenv", "dotenv",
"either", "either",
"futures", "futures",
"heck", "heck",
"lazy_static",
"proc-macro2", "proc-macro2",
"quote", "quote",
"sha2", "sha2",
@@ -2552,13 +2435,14 @@ dependencies = [
[[package]] [[package]]
name = "sqlx-rt" name = "sqlx-rt"
version = "0.3.0" version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ce2e16b6774c671cc183e1d202386fdf9cde1e8468c1894a7f2a63eb671c4f4" checksum = "63fc5454c9dd7aaea3a0eeeb65ca40d06d0d8e7413a8184f7c3a3ffa5056190b"
dependencies = [ dependencies = [
"actix-rt 2.1.0", "actix-rt 1.1.1",
"actix-threadpool",
"once_cell", "once_cell",
"tokio 1.4.0", "tokio 0.2.25",
"tokio-rustls", "tokio-rustls",
] ]
@@ -2675,9 +2559,9 @@ checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2"
[[package]] [[package]]
name = "syn" name = "syn"
version = "1.0.64" version = "1.0.65"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fd9d1e9976102a03c542daa2eff1b43f9d72306342f3f8b3ed5fb8908195d6f" checksum = "f3a1d708c221c5a612956ef9f75b37e454e88d1f7b899fbd3a18d4252012d663"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -2816,9 +2700,11 @@ dependencies = [
"memchr", "memchr",
"mio 0.6.23", "mio 0.6.23",
"mio-uds", "mio-uds",
"num_cpus",
"pin-project-lite 0.1.12", "pin-project-lite 0.1.12",
"signal-hook-registry", "signal-hook-registry",
"slab", "slab",
"tokio-macros",
"winapi 0.3.9", "winapi 0.3.9",
] ]
@@ -2833,7 +2719,6 @@ dependencies = [
"libc", "libc",
"memchr", "memchr",
"mio 0.7.11", "mio 0.7.11",
"num_cpus",
"once_cell", "once_cell",
"parking_lot", "parking_lot",
"pin-project-lite 0.2.6", "pin-project-lite 0.2.6",
@@ -2842,25 +2727,26 @@ dependencies = [
] ]
[[package]] [[package]]
name = "tokio-rustls" name = "tokio-macros"
version = "0.22.0" version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" checksum = "e44da00bfc73a25f814cd8d7e57a68a5c31b74b3152a0a1d1f590c97ed06265a"
dependencies = [ dependencies = [
"rustls", "proc-macro2",
"tokio 1.4.0", "quote",
"webpki", "syn",
] ]
[[package]] [[package]]
name = "tokio-stream" name = "tokio-rustls"
version = "0.1.5" version = "0.14.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e177a5d8c3bf36de9ebe6d58537d8879e964332f93fb3339e43f618c81361af0" checksum = "e12831b255bcfa39dc0436b01e19fea231a37db570686c06ee72c423479f889a"
dependencies = [ dependencies = [
"futures-core", "futures-core",
"pin-project-lite 0.2.6", "rustls",
"tokio 1.4.0", "tokio 0.2.25",
"webpki",
] ]
[[package]] [[package]]
@@ -2927,7 +2813,7 @@ version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2"
dependencies = [ dependencies = [
"pin-project 1.0.5", "pin-project 1.0.6",
"tracing", "tracing",
] ]
@@ -2976,6 +2862,12 @@ version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06"
[[package]]
name = "ucd-trie"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c"
[[package]] [[package]]
name = "unicode-bidi" name = "unicode-bidi"
version = "0.3.4" version = "0.3.4"

View File

@@ -22,16 +22,15 @@ name = "tests-migrate"
path = "./src/tests-migrate.rs" path = "./src/tests-migrate.rs"
[dependencies] [dependencies]
actix-web = "3" actix-web = "3.3.2"
actix = "0.11" actix = "0.11"
actix-identity = "0.3" actix-identity = "0.3"
actix-http = "2.2" actix-http = "2.2"
actix-rt = "2" actix-rt = "1"
awc = "3.0.0-beta.3"
futures = "0.3" futures = "0.3"
sqlx = { version = "0.5.0", features = [ "runtime-actix-rustls", "postgres" ] } sqlx = { version = "0.4.0", features = [ "runtime-actix-rustls", "postgres" ] }
argon2-creds = { version = "0.2", git = "https://github.com/realaravinth/argon2-creds", commit = "61f2d1d" } argon2-creds = { version = "0.2", git = "https://github.com/realaravinth/argon2-creds", commit = "61f2d1d" }
config = "0.11" config = "0.11"
@@ -54,6 +53,3 @@ lazy_static = "1.4"
m_captcha = { version = "0.1.2", git = "https://github.com/mCaptcha/mCaptcha" } m_captcha = { version = "0.1.2", git = "https://github.com/mCaptcha/mCaptcha" }
rand = "0.8" rand = "0.8"
[dev-dependencies]
rt = { package = "actix-rt", version = "1"}

View File

@@ -16,8 +16,8 @@
*/ */
use actix_identity::Identity; use actix_identity::Identity;
use actix_web::{post, web, HttpResponse, Responder}; use actix_web::{client::Client, post, web, HttpResponse, Responder};
use awc::Client; //use awc::Client;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use url::Url; use url::Url;
@@ -163,6 +163,8 @@ pub async fn delete_domain(
) )
.execute(&data.db) .execute(&data.db)
.await?; .await?;
// TODO check running actors and delete
// if domain(api_key) matches mcaptcha actor id
Ok(HttpResponse::Ok()) Ok(HttpResponse::Ok())
} }
@@ -246,7 +248,6 @@ mod tests {
#[actix_rt::test] #[actix_rt::test]
async fn domain_verification_works() { async fn domain_verification_works() {
use crate::api::v1::tests::*; use crate::api::v1::tests::*;
use awc::Client;
use std::sync::mpsc; use std::sync::mpsc;
use std::thread; use std::thread;
@@ -264,7 +265,7 @@ mod tests {
let (tx, rx) = mpsc::channel(); let (tx, rx) = mpsc::channel();
thread::spawn(move || { thread::spawn(move || {
rt::System::new("").block_on(server(IP, tx)); actix_rt::System::new("").block_on(server(IP, tx));
}); });
let srv = rx.recv().unwrap(); let srv = rx.recv().unwrap();

View File

@@ -19,6 +19,7 @@ pub mod domains;
pub mod duration; pub mod duration;
pub mod levels; pub mod levels;
pub mod mcaptcha; pub mod mcaptcha;
pub mod pow;
pub use super::auth::is_authenticated; pub use super::auth::is_authenticated;

View File

@@ -0,0 +1,59 @@
/*
* Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
*
* 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 <https://www.gnu.org/licenses/>.
*/
use actix_identity::Identity;
use actix_web::{post, web, HttpResponse, Responder};
use serde::{Deserialize, Serialize};
use super::{get_random, is_authenticated};
use crate::errors::*;
use crate::Data;
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct PoWConfig {
pub name: String,
pub domain: String,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct GetConfigPayload {
pub key: String,
}
// API keys are mcaptcha actor names
#[post("/api/v1/mcaptcha/pow/config")]
pub async fn get_config(
payload: web::Json<GetConfigPayload>,
data: web::Data<Data>,
id: Identity,
) -> ServiceResult<impl Responder> {
is_authenticated(&id)?;
let res = sqlx::query!(
"SELECT EXISTS (SELECT 1 from mcaptcha_config WHERE key = $1)",
&payload.key,
)
.fetch_one(&data.db)
.await?;
if let Some(x) = res.exists {
println!("{}", x);
}
Ok(HttpResponse::Ok())
}

View File

@@ -51,6 +51,9 @@ pub fn services(cfg: &mut ServiceConfig) {
cfg.service(mcaptcha::duration::update_duration); cfg.service(mcaptcha::duration::update_duration);
cfg.service(mcaptcha::duration::get_duration); cfg.service(mcaptcha::duration::get_duration);
// pow
cfg.service(mcaptcha::pow::get_config);
// meta // meta
cfg.service(meta::build_details); cfg.service(meta::build_details);
cfg.service(meta::health); cfg.service(meta::health);

View File

@@ -32,7 +32,7 @@ use crate::SETTINGS;
pub struct Data { pub struct Data {
pub db: PgPool, pub db: PgPool,
pub creds: Config, pub creds: Config,
pub captcha: System<HashCache>, // pub captcha: System<HashCache>,
} }
impl Data { impl Data {
@@ -52,20 +52,20 @@ impl Data {
.build() .build()
.unwrap(); .unwrap();
let master = Master::new(SETTINGS.pow.gc).start(); // let master = Master::new(SETTINGS.pow.gc).start();
let cache = HashCache::default().start(); // let cache = HashCache::default().start();
let pow = PoWConfigBuilder::default() // let pow = PoWConfigBuilder::default()
.salt(SETTINGS.pow.salt.clone()) // .salt(SETTINGS.pow.salt.clone())
.build() // .build()
.unwrap(); // .unwrap();
let captcha = SystemBuilder::default() // let captcha = SystemBuilder::default()
.master(master) // .master(master)
.cache(cache) // .cache(cache)
.pow(pow) // .pow(pow)
.build() // .build()
.unwrap(); // .unwrap();
Data { creds, db, captcha } Data { creds, db } //captcha }
} }
} }

View File

@@ -18,13 +18,14 @@
use std::convert::From; use std::convert::From;
use actix_web::{ use actix_web::{
client::SendRequestError,
dev::HttpResponseBuilder, dev::HttpResponseBuilder,
error::ResponseError, error::ResponseError,
http::{header, StatusCode}, http::{header, StatusCode},
HttpResponse, HttpResponse,
}; };
use argon2_creds::errors::CredsError; use argon2_creds::errors::CredsError;
use awc::error::SendRequestError; //use awc::error::SendRequestError;
use derive_more::{Display, Error}; use derive_more::{Display, Error};
use log::debug; use log::debug;
use m_captcha::errors::CaptchaError; use m_captcha::errors::CaptchaError;
@@ -78,6 +79,9 @@ pub enum ServiceError {
/// when the a host name is already taken /// when the a host name is already taken
#[display(fmt = "host name not available")] #[display(fmt = "host name not available")]
HostnameTaken, HostnameTaken,
/// token not found
#[display(fmt = "Token not found. Is token registered?")]
TokenNotFound,
#[display(fmt = "{}", _0)] #[display(fmt = "{}", _0)]
CaptchaError(CaptchaError), CaptchaError(CaptchaError),
@@ -109,7 +113,6 @@ impl ResponseError for ServiceError {
#[cfg(not(tarpaulin_include))] #[cfg(not(tarpaulin_include))]
fn status_code(&self) -> StatusCode { fn status_code(&self) -> StatusCode {
println!("{:?}", &self);
match self { match self {
ServiceError::InternalServerError => StatusCode::INTERNAL_SERVER_ERROR, ServiceError::InternalServerError => StatusCode::INTERNAL_SERVER_ERROR,
ServiceError::NotAnEmail => StatusCode::BAD_REQUEST, ServiceError::NotAnEmail => StatusCode::BAD_REQUEST,
@@ -124,6 +127,7 @@ impl ResponseError for ServiceError {
ServiceError::UsernameCaseMappedError => StatusCode::BAD_REQUEST, ServiceError::UsernameCaseMappedError => StatusCode::BAD_REQUEST,
ServiceError::UsernameTaken => StatusCode::BAD_REQUEST, ServiceError::UsernameTaken => StatusCode::BAD_REQUEST,
ServiceError::TokenNameTaken => StatusCode::BAD_REQUEST, ServiceError::TokenNameTaken => StatusCode::BAD_REQUEST,
ServiceError::TokenNotFound => StatusCode::NOT_FOUND,
ServiceError::HostnameTaken => StatusCode::BAD_REQUEST, ServiceError::HostnameTaken => StatusCode::BAD_REQUEST,
ServiceError::ClientServerUnreachable => StatusCode::SERVICE_UNAVAILABLE, ServiceError::ClientServerUnreachable => StatusCode::SERVICE_UNAVAILABLE,
ServiceError::ChallengeCourruption => StatusCode::BAD_REQUEST, ServiceError::ChallengeCourruption => StatusCode::BAD_REQUEST,
@@ -203,7 +207,6 @@ impl From<sqlx::Error> for ServiceError {
pub fn dup_error(e: sqlx::Error, dup_error: ServiceError) -> ServiceError { pub fn dup_error(e: sqlx::Error, dup_error: ServiceError) -> ServiceError {
use sqlx::error::Error; use sqlx::error::Error;
use std::borrow::Cow; use std::borrow::Cow;
println!("database error: {:?}", &e);
if let Error::Database(err) = e { if let Error::Database(err) = e {
if err.code() == Some(Cow::from("23505")) { if err.code() == Some(Cow::from("23505")) {
dup_error dup_error

View File

@@ -21,6 +21,7 @@ use actix_web::{
client::Client, error::InternalError, http::StatusCode, middleware, web::JsonConfig, App, client::Client, error::InternalError, http::StatusCode, middleware, web::JsonConfig, App,
HttpServer, HttpServer,
}; };
//use awc::Client;
use lazy_static::lazy_static; use lazy_static::lazy_static;
use log::info; use log::info;
@@ -59,7 +60,6 @@ async fn main() -> std::io::Result<()> {
); );
let data = Data::new().await; let data = Data::new().await;
sqlx::migrate!("./migrations/").run(&data.db).await.unwrap(); sqlx::migrate!("./migrations/").run(&data.db).await.unwrap();
HttpServer::new(move || { HttpServer::new(move || {