From 6dfc9119f7a46ffb380c380c61e25624671750d5 Mon Sep 17 00:00:00 2001 From: projectmoon Date: Sat, 5 Jun 2021 14:48:40 +0000 Subject: [PATCH] Working graphql --- Cargo.lock | 628 +++++++++++++++++++++++++++++++++++++----------- api/src/main.rs | 7 +- 2 files changed, 496 insertions(+), 139 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1cdca59..d2d6e96 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -187,6 +187,17 @@ dependencies = [ "autocfg", ] +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi 0.3.9", +] + [[package]] name = "autocfg" version = "1.0.1" @@ -204,7 +215,7 @@ dependencies = [ "instant", "pin-project 1.0.7", "rand 0.8.3", - "tokio 1.6.0", + "tokio 1.6.1", ] [[package]] @@ -231,6 +242,12 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "binascii" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72" + [[package]] name = "bincode" version = "1.3.3" @@ -319,9 +336,9 @@ checksum = "b4ae4235e6dac0694637c763029ecea1a2ec9e4e06ec2729bd21ba4d9c863eb7" [[package]] name = "bumpalo" -version = "3.6.1" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe" +checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631" [[package]] name = "byteorder" @@ -343,9 +360,9 @@ checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" [[package]] name = "cc" -version = "1.0.67" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" +checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" [[package]] name = "cfg-if" @@ -464,6 +481,23 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "cookie" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf8865bac3d9a3bde5bde9088ca431b11f5d37c7a578b8086af77248b76627" +dependencies = [ + "percent-encoding", + "time 0.2.26", + "version_check", +] + [[package]] name = "core-foundation" version = "0.9.1" @@ -525,9 +559,9 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52fb27eab85b17fbb9f6fd667089e07d6a2eb8743d02639ee7f6a7a7729c9c94" +checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -538,9 +572,9 @@ dependencies = [ [[package]] name = "crossbeam-queue" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f6cb3c7f5b8e51bc3ebb73a2327ad4abdbd119dc13223f14f961d2f38486756" +checksum = "9b10ddc024425c88c2ad148c1b0fd53f4c6d38db9697c9f1588381212fa657c9" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -548,11 +582,10 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4feb231f0d4d6af81aed15928e58ecf5816aa62a2393e2c82f46973e92a9a278" +checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" dependencies = [ - "autocfg", "cfg-if 1.0.0", "lazy_static", ] @@ -586,6 +619,18 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "derive_more" +version = "0.99.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc7b9cef1e351660e5443924e4f43ab25fbbed3e9a5f052df3677deb4d6b320" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "derive_utils" version = "0.11.2" @@ -597,6 +642,36 @@ dependencies = [ "syn", ] +[[package]] +name = "devise" +version = "0.3.0" +source = "git+https://github.com/SergioBenitez/Devise.git?rev=f2431b#f2431bd122f55b03c3bc5b1c8d2267894d3c8142" +dependencies = [ + "devise_codegen", + "devise_core", +] + +[[package]] +name = "devise_codegen" +version = "0.3.0" +source = "git+https://github.com/SergioBenitez/Devise.git?rev=f2431b#f2431bd122f55b03c3bc5b1c8d2267894d3c8142" +dependencies = [ + "devise_core", + "quote", +] + +[[package]] +name = "devise_core" +version = "0.3.0" +source = "git+https://github.com/SergioBenitez/Devise.git?rev=f2431b#f2431bd122f55b03c3bc5b1c8d2267894d3c8142" +dependencies = [ + "bitflags", + "proc-macro2", + "proc-macro2-diagnostics", + "quote", + "syn", +] + [[package]] name = "digest" version = "0.9.0" @@ -674,6 +749,20 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" +[[package]] +name = "figment" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca029e813a72b7526d28273d25f3e4a2f365d1b7a1018a6f93ec9053a119763" +dependencies = [ + "atomic", + "pear", + "serde", + "toml", + "uncased", + "version_check", +] + [[package]] name = "fixedbitset" version = "0.2.0" @@ -895,6 +984,19 @@ dependencies = [ "byteorder", ] +[[package]] +name = "generator" +version = "0.6.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "061d3be1afec479d56fa3bd182bf966c7999ec175fcfdb87ac14d417241366c6" +dependencies = [ + "cc", + "libc", + "log", + "rustversion", + "winapi 0.3.9", +] + [[package]] name = "generic-array" version = "0.14.4" @@ -939,6 +1041,12 @@ dependencies = [ "polyval", ] +[[package]] +name = "glob" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" + [[package]] name = "gloo" version = "0.2.1" @@ -1019,7 +1127,7 @@ dependencies = [ "http", "http-body 0.4.2", "httparse", - "hyper 0.14.7", + "hyper 0.14.8", "js-sys", "prost", "tonic", @@ -1063,7 +1171,7 @@ dependencies = [ "http", "indexmap", "slab", - "tokio 1.6.0", + "tokio 1.6.1", "tokio-util 0.6.7", "tracing", ] @@ -1113,9 +1221,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" dependencies = [ "unicode-segmentation", ] @@ -1216,9 +1324,9 @@ checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" [[package]] name = "httpdate" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05842d0d43232b23ccb7060ecb0f0626922c21f30012e97b767b30afd4a5d4b9" +checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" [[package]] name = "hyper" @@ -1246,9 +1354,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.7" +version = "0.14.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e5f105c494081baa3bf9e200b279e27ec1623895cd504c7dbef8d0b080fcf54" +checksum = "d3f71a7eea53a3f8257a7b4795373ff886397178cd634430ea94e12d7fe4fe34" dependencies = [ "bytes 1.0.1", "futures-channel", @@ -1258,11 +1366,11 @@ dependencies = [ "http", "http-body 0.4.2", "httparse", - "httpdate 1.0.0", + "httpdate 1.0.1", "itoa", "pin-project 1.0.7", "socket2 0.4.0", - "tokio 1.6.0", + "tokio 1.6.1", "tower-service", "tracing", "want", @@ -1275,9 +1383,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes 1.0.1", - "hyper 0.14.7", + "hyper 0.14.8", "native-tls", - "tokio 1.6.0", + "tokio 1.6.1", "tokio-native-tls", ] @@ -1312,6 +1420,12 @@ dependencies = [ "unindent", ] +[[package]] +name = "inlinable_string" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3094308123a0e9fd59659ce45e22de9f53fc1d2ac6e1feb9fef988e4f76cad77" + [[package]] name = "input_buffer" version = "0.3.1" @@ -1384,9 +1498,9 @@ dependencies = [ [[package]] name = "js_int" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcae89e078a96b781b38f36225bb3a174b8f6e905dfec550dd16a13539c82acc" +checksum = "defaba9bcd19568a4b4b3736b23e368e5b75e3ea126fd4cb3e4ad2ea5af274fd" dependencies = [ "serde", ] @@ -1394,8 +1508,7 @@ dependencies = [ [[package]] name = "juniper" version = "0.15.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a0b1228e9cd2c1cf43186b593c2d09408e65a196f86f98e8520d85ac26b9c7a" +source = "git+https://github.com/graphql-rust/juniper?branch=master#92ad8b46ff4d34cf10925f0a86b56950a354d2ec" dependencies = [ "async-trait", "bson", @@ -1416,8 +1529,7 @@ dependencies = [ [[package]] name = "juniper_codegen" version = "0.15.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d86d3ba9151f4ba09a8ea8d15601d38b2289cecda77be081ee5c8951f013d54" +source = "git+https://github.com/graphql-rust/juniper?branch=master#92ad8b46ff4d34cf10925f0a86b56950a354d2ec" dependencies = [ "proc-macro-error", "proc-macro2", @@ -1426,20 +1538,14 @@ dependencies = [ ] [[package]] -name = "juniper_warp" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d087dadaae0b71123f25b227afdc130de7e91d3a7ebd9ae3ee1dc4344569748f" +name = "juniper_rocket_async" +version = "0.5.1" +source = "git+https://github.com/graphql-rust/juniper?branch=master#92ad8b46ff4d34cf10925f0a86b56950a354d2ec" dependencies = [ - "anyhow", - "bytes 0.5.6", "futures", "juniper", - "serde", + "rocket", "serde_json", - "thiserror", - "tokio 0.2.25", - "warp", ] [[package]] @@ -1473,9 +1579,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.94" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18794a8ad5b29321f790b55d93dfba91e125cb1a9edbd4f8e3150acc771c1a5e" +checksum = "789da6d93f1b866ffe175afc5322a4d76c038605a1c3319bb57b06967ca98a36" [[package]] name = "libsqlite3-sys" @@ -1512,6 +1618,28 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "loom" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0e8460f2f2121162705187214720353c517b97bdfb3494c0b1e33d83ebe4bed" +dependencies = [ + "cfg-if 0.1.10", + "generator", + "scoped-tls", + "serde", + "serde_json", +] + +[[package]] +name = "lru" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f374d42cdfc1d7dbf3d3dec28afab2eb97ffbf43a3234d795b5986dbf4b90ba" +dependencies = [ + "hashbrown", +] + [[package]] name = "mac" version = "0.1.1" @@ -1568,7 +1696,7 @@ checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" [[package]] name = "matrix-sdk" version = "0.2.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk?branch=master#fe17dce813f500b4c633669a7078ee843bb44886" +source = "git+https://github.com/matrix-org/matrix-rust-sdk?branch=master#0df782e93ee2d9d9c338775adbe2cf1b35048740" dependencies = [ "backoff", "bytes 1.0.1", @@ -1582,7 +1710,7 @@ dependencies = [ "reqwest", "serde_json", "thiserror", - "tokio 1.6.0", + "tokio 1.6.1", "tracing", "tracing-futures", "url", @@ -1592,12 +1720,13 @@ dependencies = [ [[package]] name = "matrix-sdk-base" version = "0.2.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk?branch=master#fe17dce813f500b4c633669a7078ee843bb44886" +source = "git+https://github.com/matrix-org/matrix-rust-sdk?branch=master#0df782e93ee2d9d9c338775adbe2cf1b35048740" dependencies = [ "chacha20poly1305", "dashmap", "futures", "hmac", + "lru", "matrix-sdk-common", "matrix-sdk-crypto", "pbkdf2", @@ -1607,7 +1736,7 @@ dependencies = [ "sha2", "sled", "thiserror", - "tokio 1.6.0", + "tokio 1.6.1", "tracing", "zeroize", ] @@ -1615,7 +1744,7 @@ dependencies = [ [[package]] name = "matrix-sdk-common" version = "0.2.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk?branch=master#fe17dce813f500b4c633669a7078ee843bb44886" +source = "git+https://github.com/matrix-org/matrix-rust-sdk?branch=master#0df782e93ee2d9d9c338775adbe2cf1b35048740" dependencies = [ "async-trait", "futures", @@ -1623,7 +1752,7 @@ dependencies = [ "instant", "ruma", "serde", - "tokio 1.6.0", + "tokio 1.6.1", "uuid", "wasm-bindgen-futures", ] @@ -1631,7 +1760,7 @@ dependencies = [ [[package]] name = "matrix-sdk-crypto" version = "0.2.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk?branch=master#fe17dce813f500b4c633669a7078ee843bb44886" +source = "git+https://github.com/matrix-org/matrix-rust-sdk?branch=master#0df782e93ee2d9d9c338775adbe2cf1b35048740" dependencies = [ "aes-ctr", "aes-gcm", @@ -1662,9 +1791,9 @@ checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" [[package]] name = "memoffset" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83fb6581e8ed1f85fd45c116db8405483899489e38406156c25eb743554361d" +checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" dependencies = [ "autocfg", ] @@ -1717,29 +1846,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "mio-named-pipes" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656" -dependencies = [ - "log", - "mio 0.6.23", - "miow 0.3.7", - "winapi 0.3.9", -] - -[[package]] -name = "mio-uds" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" -dependencies = [ - "iovec", - "libc", - "mio 0.6.23", -] - [[package]] name = "miow" version = "0.2.2" @@ -1761,6 +1867,27 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "multer" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fdd568fea4758b30d6423f013f7171e193c34aa97828d1bd9f924fb3af30a8c" +dependencies = [ + "bytes 1.0.1", + "derive_more", + "encoding_rs", + "futures-util", + "http", + "httparse", + "log", + "mime", + "spin 0.9.0", + "tokio 1.6.1", + "tokio-util 0.6.7", + "twoway 0.2.2", + "version_check", +] + [[package]] name = "multimap" version = "0.8.3" @@ -1782,7 +1909,7 @@ dependencies = [ "rand 0.7.3", "safemem", "tempfile", - "twoway", + "twoway 0.1.8", ] [[package]] @@ -1989,6 +2116,29 @@ dependencies = [ "crypto-mac", ] +[[package]] +name = "pear" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15e44241c5e4c868e3eaa78b7c1848cadd6344ed4f54d029832d32b415a58702" +dependencies = [ + "inlinable_string", + "pear_codegen", + "yansi", +] + +[[package]] +name = "pear_codegen" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82a5ca643c2303ecb740d506539deba189e16f2754040a42901cd8105d0282d0" +dependencies = [ + "proc-macro2", + "proc-macro2-diagnostics", + "quote", + "syn", +] + [[package]] name = "percent-encoding" version = "2.1.0" @@ -2211,6 +2361,19 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "proc-macro2-diagnostics" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "version_check", + "yansi", +] + [[package]] name = "prost" version = "0.7.0" @@ -2393,6 +2556,26 @@ dependencies = [ "redox_syscall", ] +[[package]] +name = "ref-cast" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300f2a835d808734ee295d45007adacb9ebb29dd3ae2424acfa17930cae541da" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c38e3aecd2b21cb3959637b883bb3714bc7e43f0268b9a29d3743ee3e55cdd2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "refinery" version = "0.5.0" @@ -2450,11 +2633,10 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "byteorder", "regex-syntax", ] @@ -2486,7 +2668,7 @@ dependencies = [ "futures-util", "http", "http-body 0.4.2", - "hyper 0.14.7", + "hyper 0.14.8", "hyper-tls", "ipnet", "js-sys", @@ -2498,7 +2680,7 @@ dependencies = [ "pin-project-lite 0.2.6", "serde", "serde_urlencoded 0.7.0", - "tokio 1.6.0", + "tokio 1.6.1", "tokio-native-tls", "url", "wasm-bindgen", @@ -2508,10 +2690,104 @@ dependencies = [ ] [[package]] -name = "ruma" -version = "0.1.0" +name = "ring" +version = "0.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b4014a3def1ed10e7fa0fe28fec48418f2deb6135e7f5fe15901ba1302b581c" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin 0.5.2", + "untrusted", + "web-sys", + "winapi 0.3.9", +] + +[[package]] +name = "rocket" +version = "0.5.0-dev" +source = "git+https://github.com/SergioBenitez/Rocket?branch=master#0d53e23bf6cb86f9136fa8b37a92ba8076aacf67" +dependencies = [ + "async-stream", + "async-trait", + "atomic", + "atty", + "binascii", + "bytes 1.0.1", + "either", + "figment", + "futures", + "indexmap", + "log", + "memchr", + "multer", + "num_cpus", + "parking_lot", + "pin-project-lite 0.2.6", + "rand 0.8.3", + "ref-cast", + "rocket_codegen", + "rocket_http", + "serde", + "state", + "tempfile", + "time 0.2.26", + "tokio 1.6.1", + "tokio-stream", + "tokio-util 0.6.7", + "ubyte", + "version_check", + "yansi", +] + +[[package]] +name = "rocket_codegen" +version = "0.5.0-dev" +source = "git+https://github.com/SergioBenitez/Rocket?branch=master#0d53e23bf6cb86f9136fa8b37a92ba8076aacf67" +dependencies = [ + "devise", + "glob", + "indexmap", + "proc-macro2", + "quote", + "rocket_http", + "syn", + "unicode-xid", +] + +[[package]] +name = "rocket_http" +version = "0.5.0-dev" +source = "git+https://github.com/SergioBenitez/Rocket?branch=master#0d53e23bf6cb86f9136fa8b37a92ba8076aacf67" +dependencies = [ + "cookie", + "either", + "http", + "hyper 0.14.8", + "indexmap", + "log", + "memchr", + "mime", + "parking_lot", + "pear", + "percent-encoding", + "pin-project-lite 0.2.6", + "ref-cast", + "serde", + "smallvec", + "stable-pattern", + "state", + "time 0.2.26", + "tokio 1.6.1", + "uncased", +] + +[[package]] +name = "ruma" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20e5a6a79642e893e655aa955bd1f602871d7d56f491fb36e7fa87d2b062919e" dependencies = [ "assign", "js_int", @@ -2522,6 +2798,7 @@ dependencies = [ "ruma-federation-api", "ruma-identifiers", "ruma-serde", + "ruma-signatures", ] [[package]] @@ -2555,9 +2832,9 @@ dependencies = [ [[package]] name = "ruma-client-api" -version = "0.10.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda53002660ebdf6eca81102bf4362d0f9234a4d3f7a3e5f9878ed7c1f133843" +checksum = "84275808626b3411b0d40f6a8de0ed271920fe306c9e28f437244fba68a0a165" dependencies = [ "assign", "bytes 1.0.1", @@ -2576,9 +2853,9 @@ dependencies = [ [[package]] name = "ruma-common" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c87e1a95f3625cae17772e98b3479059e7aa18593fb623bcff498d32d399d956" +checksum = "ff5b76aea09861f6bedc5dc83c59bb0ad74a22850af2d301d6f8912ec80da543" dependencies = [ "indexmap", "js_int", @@ -2592,9 +2869,9 @@ dependencies = [ [[package]] name = "ruma-events" -version = "0.22.1" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c222b0f008461b00b039e76319c3184633346605b8201b24f54a6be99cbd98" +checksum = "7f3b0aa9e199d77a89a88721ea01b6fd0f2102eff3c4c745c9adff2bc5fe4f5e" dependencies = [ "indoc", "js_int", @@ -2608,9 +2885,9 @@ dependencies = [ [[package]] name = "ruma-events-macros" -version = "0.22.1" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "270df7148218b4d45d11bc1621c4ce5da8571abaf2db3f407a4b0f983a48625c" +checksum = "55a7f9697f093c404f0e797fe88eb4dd5d2a6d5505171e05f76caebf95f15a86" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2692,6 +2969,21 @@ dependencies = [ "syn", ] +[[package]] +name = "ruma-signatures" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7007ae39c0ae535438e5b8047e89d50d5dc1f0d6ed0f8c19c54c8ad1d814817" +dependencies = [ + "base64 0.13.0", + "ring", + "ruma-identifiers", + "ruma-serde", + "serde_json", + "tracing", + "untrusted", +] + [[package]] name = "rusqlite" version = "0.24.2" @@ -2728,6 +3020,12 @@ dependencies = [ "semver", ] +[[package]] +name = "rustversion" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" + [[package]] name = "ryu" version = "1.0.5" @@ -2773,9 +3071,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "security-framework" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3670b1d2fdf6084d192bc71ead7aabe6c06aa2ea3fbd9cc3ac111fa5c2b1bd84" +checksum = "b239a3d5db51252f6f48f42172c65317f37202f4a21021bf5f9d40a408f4592c" dependencies = [ "bitflags", "core-foundation", @@ -2786,9 +3084,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3676258fd3cfe2c9a0ec99ce3038798d847ce3e4bb17746373eb9f0f1ac16339" +checksum = "7e4effb91b4b8b6fb7732e670b6cee160278ff8e6bf485c7805d9e319d76e284" dependencies = [ "core-foundation-sys", "libc", @@ -2914,9 +3212,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" dependencies = [ "libc", ] @@ -2985,6 +3283,18 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b87bbf98cb81332a56c1ee8929845836f85e8ddd693157c30d76660196014478" + [[package]] name = "sqlformat" version = "0.1.6" @@ -3080,10 +3390,19 @@ checksum = "4ce2e16b6774c671cc183e1d202386fdf9cde1e8468c1894a7f2a63eb671c4f4" dependencies = [ "native-tls", "once_cell", - "tokio 1.6.0", + "tokio 1.6.1", "tokio-native-tls", ] +[[package]] +name = "stable-pattern" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4564168c00635f88eaed410d5efa8131afa8d8699a612c80c455a0ba05c21045" +dependencies = [ + "memchr", +] + [[package]] name = "standback" version = "0.2.17" @@ -3093,6 +3412,14 @@ dependencies = [ "version_check", ] +[[package]] +name = "state" +version = "0.4.2" +source = "git+https://github.com/SergioBenitez/state.git?rev=8f94dc#8f94dce673b7d4b0e7b96c808a84f5e2a4be4a60" +dependencies = [ + "loom", +] + [[package]] name = "static_assertions" version = "1.1.0" @@ -3257,12 +3584,12 @@ name = "tenebrous-api" version = "0.1.0" dependencies = [ "juniper", - "juniper_warp", + "juniper_rocket_async", "log", "once_cell", "prost", + "rocket", "tenebrous-rpc", - "tokio 0.2.25", "tonic", "tracing-subscriber", "warp", @@ -3295,7 +3622,7 @@ dependencies = [ "tempfile", "tenebrous-rpc", "thiserror", - "tokio 1.6.0", + "tokio 1.6.1", "toml", "tonic", "tonic-build", @@ -3326,18 +3653,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" +checksum = "fa6f76457f59514c7eeb4e59d891395fab0b2fd1d40723ae737d64153392e9c6" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" +checksum = "8a36768c0fbf1bb15eca10defa29526bda730a2376c2ab4393ccfa16fb1a318d" dependencies = [ "proc-macro2", "quote", @@ -3427,24 +3754,17 @@ dependencies = [ "futures-core", "iovec", "lazy_static", - "libc", "memchr", "mio 0.6.23", - "mio-named-pipes", - "mio-uds", - "num_cpus", "pin-project-lite 0.1.12", - "signal-hook-registry", "slab", - "tokio-macros 0.2.6", - "winapi 0.3.9", ] [[package]] name = "tokio" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd3076b5c8cc18138b8f8814895c11eb4de37114a5d127bafdc5e55798ceef37" +checksum = "0a38d31d7831c6ed7aad00aa4c12d9375fd225a6dd77da1d25b707346319a975" dependencies = [ "autocfg", "bytes 1.0.1", @@ -3456,21 +3776,10 @@ dependencies = [ "parking_lot", "pin-project-lite 0.2.6", "signal-hook-registry", - "tokio-macros 1.2.0", + "tokio-macros", "winapi 0.3.9", ] -[[package]] -name = "tokio-macros" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e44da00bfc73a25f814cd8d7e57a68a5c31b74b3152a0a1d1f590c97ed06265a" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "tokio-macros" version = "1.2.0" @@ -3489,7 +3798,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" dependencies = [ "native-tls", - "tokio 1.6.0", + "tokio 1.6.1", ] [[package]] @@ -3500,7 +3809,7 @@ checksum = "f8864d706fdb3cc0843a49647ac892720dac98a6eeb818b77190592cf4994066" dependencies = [ "futures-core", "pin-project-lite 0.2.6", - "tokio 1.6.0", + "tokio 1.6.1", ] [[package]] @@ -3541,7 +3850,7 @@ dependencies = [ "futures-sink", "log", "pin-project-lite 0.2.6", - "tokio 1.6.0", + "tokio 1.6.1", ] [[package]] @@ -3568,12 +3877,12 @@ dependencies = [ "h2 0.3.3", "http", "http-body 0.4.2", - "hyper 0.14.7", + "hyper 0.14.8", "percent-encoding", "pin-project 1.0.7", "prost", "prost-derive", - "tokio 1.6.0", + "tokio 1.6.1", "tokio-stream", "tokio-util 0.6.7", "tower", @@ -3606,7 +3915,7 @@ dependencies = [ "pin-project 1.0.7", "rand 0.8.3", "slab", - "tokio 1.6.0", + "tokio 1.6.1", "tokio-stream", "tokio-util 0.6.7", "tower-layer", @@ -3746,12 +4055,47 @@ dependencies = [ "memchr", ] +[[package]] +name = "twoway" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c57ffb460d7c24cd6eda43694110189030a3d1dfe418416d9468fd1c1d290b47" +dependencies = [ + "memchr", + "unchecked-index", +] + [[package]] name = "typenum" version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" +[[package]] +name = "ubyte" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42756bb9e708855de2f8a98195643dff31a97f0485d90d8467b39dc24be9e8fe" +dependencies = [ + "serde", +] + +[[package]] +name = "uncased" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baeed7327e25054889b9bd4f975f32e5f4c5d434042d59ab6cd4142c0a76ed0" +dependencies = [ + "serde", + "version_check", +] + +[[package]] +name = "unchecked-index" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c" + [[package]] name = "unicase" version = "2.6.0" @@ -3772,9 +4116,9 @@ dependencies = [ [[package]] name = "unicode-normalization" -version = "0.1.17" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07fbfce1c8a97d547e8b5334978438d9d6ec8c20e38f56d4a4374d181493eaef" +checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" dependencies = [ "tinyvec", ] @@ -3828,6 +4172,12 @@ dependencies = [ "void", ] +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "url" version = "2.2.2" @@ -3864,9 +4214,9 @@ dependencies = [ [[package]] name = "vcpkg" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdbff6266a24120518560b5dc983096efb98462e51d0d68169895b237be3e5d" +checksum = "025ce40a007e1907e58d5bc1a594def78e5573bb0b1160bc389634e8f12e4faa" [[package]] name = "version_check" @@ -4138,6 +4488,12 @@ dependencies = [ "time 0.1.43", ] +[[package]] +name = "yansi" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fc79f4a1e39857fc00c3f662cbf2651c771f00e9c15fe2abc341806bd46bd71" + [[package]] name = "yew" version = "0.17.4" diff --git a/api/src/main.rs b/api/src/main.rs index 6f22cd8..9633d87 100644 --- a/api/src/main.rs +++ b/api/src/main.rs @@ -125,15 +125,16 @@ fn post_graphql_handler( #[rocket::main] pub async fn main() -> Result<(), Box> { + println!("hi"); let filter = if env::var("RUST_LOG").is_ok() { EnvFilter::from_default_env() } else { - EnvFilter::new("warp_async") + EnvFilter::new("tenebrous_api=info,tonic=info,rocket=info") }; tracing_subscriber::fmt().with_env_filter(filter).init(); - let log = warp::log("warp_server"); + log::info!("Setting up gRPC connection"); let client = create_client("abc123").await?; log::info!("Listening on 127.0.0.1:8080"); @@ -142,7 +143,7 @@ pub async fn main() -> Result<(), Box> { }; Rocket::build() - .manage(client) + .manage(context) .manage(schema()) .mount( "/",