diff --git a/server/Cargo.lock b/server/Cargo.lock index 2d92930c..1ed3cc53 100644 --- a/server/Cargo.lock +++ b/server/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -42,9 +42,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -57,9 +57,9 @@ checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" [[package]] name = "allocator-api2" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56fc6cf8dc8c4158eed8649f9b8b0ea1518eb62b544fe9490d66fa0b349eafe9" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "android-tzdata" @@ -78,30 +78,29 @@ dependencies = [ [[package]] name = "anstream" -version = "0.3.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is-terminal", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.1" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" dependencies = [ "utf8parse", ] @@ -117,9 +116,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "1.0.1" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" dependencies = [ "anstyle", "windows-sys", @@ -136,9 +135,9 @@ dependencies = [ [[package]] name = "arbitrary" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d098ff73c1ca148721f37baad5ea6a465a13f9573aba8641fbbbae8164a54e" +checksum = "a2e1373abdaa212b704512ec2bd8b26bd0b7d5c3f70117411a5d9a451383c859" dependencies = [ "derive_arbitrary", ] @@ -161,9 +160,9 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", "event-listener", @@ -172,14 +171,14 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" +checksum = "4b0c4a4f319e45986f347ee47fef8bf5e81c9abc3f6f58dc2391439f30df65f0" dependencies = [ "async-lock", "async-task", "concurrent-queue", - "fastrand", + "fastrand 2.0.1", "futures-lite", "slab", ] @@ -214,17 +213,17 @@ dependencies = [ "log", "parking", "polling", - "rustix 0.37.22", + "rustix 0.37.26", "slab", - "socket2 0.4.9", + "socket2 0.4.10", "waker-fn", ] [[package]] name = "async-lock" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ "event-listener", ] @@ -275,14 +274,14 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] name = "async-task" -version = "4.4.0" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" +checksum = "b4eb2cdb97421e01129ccb49169d8279ed21e829929144f4a22a6e54ac549ca1" [[package]] name = "async-trait" @@ -292,7 +291,7 @@ checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -306,9 +305,9 @@ dependencies = [ [[package]] name = "atomic-waker" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" @@ -368,9 +367,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -383,15 +382,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.13.1" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "base64" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "base64ct" @@ -433,9 +426,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" dependencies = [ "serde", ] @@ -463,17 +456,18 @@ dependencies = [ [[package]] name = "blocking" -version = "1.3.1" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" +checksum = "8c36a4d0d48574b3dd360b4b7d95cc651d2b6557b6402848a27d4b228a473e2a" dependencies = [ "async-channel", "async-lock", "async-task", - "atomic-waker", - "fastrand", + "fastrand 2.0.1", + "futures-io", "futures-lite", - "log", + "piper", + "tracing", ] [[package]] @@ -523,9 +517,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytecheck" @@ -551,15 +545,15 @@ dependencies = [ [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "cargo-husky" @@ -569,9 +563,12 @@ checksum = "7b02b629252fe8ef6460461409564e2c21d0c8e77e0944f3d189ff06c4e932ad" [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -597,20 +594,19 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.19" +version = "4.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd304a20bff958a57f04c4e96a2e7594cc4490a0e809cbd48bb6437edaa452d" +checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" dependencies = [ "clap_builder", "clap_derive", - "once_cell", ] [[package]] name = "clap_builder" -version = "4.3.19" +version = "4.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01c6a3f08f1fe5662a35cfe393aec09c4df95f60ee93b7556505260f75eee9e1" +checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" dependencies = [ "anstream", "anstyle", @@ -620,21 +616,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.3.12" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] name = "clap_lex" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" [[package]] name = "colorchoice" @@ -655,18 +651,18 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" dependencies = [ "crossbeam-utils", ] [[package]] name = "const-oid" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] name = "convert_case" @@ -695,9 +691,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c" +checksum = "3fbc60abd742b35f2492f808e1abbb83d45f72db402e14c55057edc9c7b1e9e4" dependencies = [ "libc", ] @@ -758,15 +754,25 @@ dependencies = [ [[package]] name = "der" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7ed52955ce76b1554f509074bb357d3fb8ac9b51288a65a3fd480d1dfba946" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ "const-oid", "pem-rfc7468", "zeroize", ] +[[package]] +name = "deranged" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +dependencies = [ + "powerfmt", + "serde", +] + [[package]] name = "derivative" version = "2.2.0" @@ -797,7 +803,7 @@ checksum = "53e0efad4403bfc52dc201159c4b842a246a14b98c64b55dfd0f2d89729dfeb8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -809,7 +815,7 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -825,7 +831,7 @@ dependencies = [ "quote", "strum", "strum_macros", - "syn 2.0.28", + "syn 2.0.38", "typed-builder 0.15.2", ] @@ -884,18 +890,18 @@ checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" dependencies = [ "serde", ] [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] @@ -946,25 +952,14 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.1" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" dependencies = [ - "errno-dragonfly", "libc", "windows-sys", ] -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "errors" version = "0.1.0" @@ -1001,6 +996,12 @@ dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + [[package]] name = "findshlibs" version = "0.10.2" @@ -1013,6 +1014,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "finl_unicode" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" + [[package]] name = "float-cmp" version = "0.9.0" @@ -1024,13 +1031,12 @@ dependencies = [ [[package]] name = "flume" -version = "0.10.14" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" dependencies = [ "futures-core", "futures-sink", - "pin-project", "spin 0.9.8", ] @@ -1126,7 +1132,7 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ - "fastrand", + "fastrand 1.9.0", "futures-core", "futures-io", "memchr", @@ -1143,7 +1149,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -1199,9 +1205,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "glob" @@ -1223,9 +1229,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.20" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -1260,9 +1266,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" dependencies = [ "ahash 0.8.3", "allocator-api2", @@ -1270,21 +1276,20 @@ dependencies = [ [[package]] name = "hashlink" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "312f66718a2d7789ffef4f4b7b213138ed9f1eb3aa1d0d82fc99f88fb3ffd26f" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.0", + "hashbrown 0.14.2", ] [[package]] name = "headers" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" +checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" dependencies = [ - "base64 0.13.1", - "bitflags 1.3.2", + "base64", "bytes", "headers-core", "http", @@ -1313,9 +1318,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hex" @@ -1385,9 +1390,9 @@ dependencies = [ [[package]] name = "http-range-header" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" +checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" [[package]] name = "httparse" @@ -1397,9 +1402,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" @@ -1418,7 +1423,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.9", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -1427,10 +1432,11 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" dependencies = [ + "futures-util", "http", "hyper", "rustls", @@ -1440,16 +1446,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.57" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows", + "windows-core", ] [[package]] @@ -1483,12 +1489,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.2", ] [[package]] @@ -1499,7 +1505,7 @@ checksum = "ce243b1bfa62ffc028f1cc3b6034ec63d649f3031bc8a4fbbb004e1ac17d1f68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -1528,17 +1534,6 @@ version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" -[[package]] -name = "is-terminal" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" -dependencies = [ - "hermit-abi", - "rustix 0.38.6", - "windows-sys", -] - [[package]] name = "itertools" version = "0.10.5" @@ -1559,9 +1554,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" @@ -1592,15 +1587,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.147" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "libm" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libsqlite3-sys" @@ -1621,15 +1616,15 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.5" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -1637,9 +1632,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" dependencies = [ "value-bag", ] @@ -1661,24 +1656,25 @@ dependencies = [ [[package]] name = "matchit" -version = "0.7.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b87248edafb776e59e6ee64a79086f65890d3510f2c656c000bf2a7e8a0aea40" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" [[package]] name = "md-5" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ + "cfg-if", "digest", ] [[package]] name = "memchr" -version = "2.6.3" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "migration" @@ -1777,9 +1773,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", @@ -1846,9 +1842,9 @@ dependencies = [ [[package]] name = "object" -version = "0.31.1" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -1861,9 +1857,9 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "ordered-float" -version = "3.7.0" +version = "3.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fc2dbde8f8a79f2102cc474ceb0ad68e3b80b85289ea62389b60e66777e4213" +checksum = "f1e1c390732d15f1d48471625cd92d154e66db2c56645e29a9cd26f4699f72dc" dependencies = [ "num-traits", ] @@ -1900,7 +1896,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -1923,9 +1919,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parking" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" @@ -1939,22 +1935,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.4.1", "smallvec", "windows-targets", ] [[package]] name = "paste" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b27ab7be369122c218afc2079489cdcb4b517c0a3fc386ff11e1fedfcc2b35" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "pem-rfc7468" @@ -1973,29 +1969,29 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pin-project" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] name = "pin-project-lite" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -2003,6 +1999,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +dependencies = [ + "atomic-waker", + "fastrand 2.0.1", + "futures-io", +] + [[package]] name = "pkcs1" version = "0.7.5" @@ -2046,6 +2053,12 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -2090,7 +2103,9 @@ dependencies = [ "common", "domain", "errors", + "reqwest", "resource", + "serde", "serde_json", "tracing", "usecase", @@ -2132,9 +2147,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.64" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -2147,7 +2162,7 @@ checksum = "7c003ac8c77cb07bb74f5f198bce836a689bcd5a42574612bf14d17bfd08c20e" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.3.3", + "bitflags 2.4.1", "lazy_static", "num-traits", "rand", @@ -2198,9 +2213,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.29" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -2259,6 +2274,15 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "regex" version = "1.10.2" @@ -2311,9 +2335,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rend" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581008d2099240d37fb08d77ad713bcaec2c4d89d50b5b21a8bb1996bbab68ab" +checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" dependencies = [ "bytecheck", ] @@ -2324,7 +2348,7 @@ version = "0.11.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ - "base64 0.21.2", + "base64", "bytes", "encoding_rs", "futures-core", @@ -2450,14 +2474,12 @@ dependencies = [ [[package]] name = "rust_decimal" -version = "1.30.0" +version = "1.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0446843641c69436765a35a5a77088e28c2e6a12da93e84aa3ab1cd4aa5a042" +checksum = "a4c4216490d5a413bc6d10fa4742bd7d4955941d062c0ef873141d6b0e7b30fd" dependencies = [ "arrayvec", "borsh", - "bytecheck", - "byteorder", "bytes", "num-traits", "rand", @@ -2483,9 +2505,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.22" +version = "0.37.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8818fa822adcc98b18fedbb3632a6a33213c070556b5aa7c4c8cc21cff565c4c" +checksum = "84f3f8f960ed3b5a59055428714943298bf3fa2d4a1d53135084e0544829d995" dependencies = [ "bitflags 1.3.2", "errno", @@ -2497,26 +2519,26 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.6" +version = "0.38.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee020b1716f0a80e2ace9b03441a749e402e86712f15f16fe8a8f75afac732f" +checksum = "67ce50cb2e16c2903e30d1cbccfd8387a74b9d4c938b6a4c5ec6cc7556f7a8a0" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.1", "errno", "libc", - "linux-raw-sys 0.4.5", + "linux-raw-sys 0.4.10", "windows-sys", ] [[package]] name = "rustls" -version = "0.21.6" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ "log", "ring", - "rustls-webpki 0.101.2", + "rustls-webpki", "sct", ] @@ -2526,24 +2548,14 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.2", -] - -[[package]] -name = "rustls-webpki" -version = "0.100.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" -dependencies = [ - "ring", - "untrusted", + "base64", ] [[package]] name = "rustls-webpki" -version = "0.101.2" +version = "0.101.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "513722fd73ad80a71f72b61009ea1b584bcfa1483ca93949c8f290298837fa59" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" dependencies = [ "ring", "untrusted", @@ -2551,9 +2563,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc31bd9b61a32c31f9650d18add92aa83a49ba979c143eefd27fe7177b05bd5f" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "rusty-fork" @@ -2569,15 +2581,15 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" @@ -2599,7 +2611,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -2657,7 +2669,7 @@ dependencies = [ "proc-macro2", "quote", "sea-bae", - "syn 2.0.28", + "syn 2.0.38", "unicode-ident", ] @@ -2714,14 +2726,14 @@ dependencies = [ [[package]] name = "sea-query-derive" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd78f2e0ee8e537e9195d1049b752e0433e2cac125426bccb7b5c3e508096117" +checksum = "25a82fcb49253abcb45cdcb2adf92956060ec0928635eb21b4f7a6d8f25ab0bc" dependencies = [ "heck", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.38", "thiserror", ] @@ -2756,9 +2768,9 @@ checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" [[package]] name = "semver" -version = "1.0.17" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "sentry" @@ -2913,7 +2925,7 @@ checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -2929,9 +2941,9 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.12" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b1b6471d7496b051e03f1958802a73f88b947866f5146f329e47e36554f4e55" +checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" dependencies = [ "itoa", "serde", @@ -2951,9 +2963,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -2962,9 +2974,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -2973,9 +2985,9 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] @@ -3007,24 +3019,24 @@ checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -3032,9 +3044,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", "windows-sys", @@ -3067,20 +3079,20 @@ dependencies = [ [[package]] name = "sqlformat" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c12bc9199d1db8234678b7051747c07f517cdcf019262d1847b94ec8b1aee3e" +checksum = "6b7b278788e7be4d0d29c0f39497a0eef3fba6bbc8e70d8bf7fde46edeaa9e85" dependencies = [ - "itertools 0.10.5", + "itertools 0.11.0", "nom", "unicode_categories", ] [[package]] name = "sqlx" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e58421b6bc416714d5115a2ca953718f6c621a51b68e4f4922aea5a4391a721" +checksum = "0e50c216e3624ec8e7ecd14c6a6a6370aad6ee5d8cfc3ab30b5162eeeef2ed33" dependencies = [ "sqlx-core", "sqlx-macros", @@ -3091,9 +3103,9 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4cef4251aabbae751a3710927945901ee1d97ee96d757f6880ebb9a79bfd53" +checksum = "8d6753e460c998bbd4cd8c6f0ed9a64346fcca0723d6e75e52fdc351c5d2169d" dependencies = [ "ahash 0.8.3", "atoi", @@ -3113,7 +3125,7 @@ dependencies = [ "futures-util", "hashlink", "hex", - "indexmap 2.0.0", + "indexmap 2.0.2", "log", "memchr", "once_cell", @@ -3139,9 +3151,9 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "208e3165167afd7f3881b16c1ef3f2af69fa75980897aac8874a0696516d12c2" +checksum = "9a793bb3ba331ec8359c1853bd39eed32cdd7baaf22c35ccf5c92a7e8d1189ec" dependencies = [ "proc-macro2", "quote", @@ -3152,9 +3164,9 @@ dependencies = [ [[package]] name = "sqlx-macros-core" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a4a8336d278c62231d87f24e8a7a74898156e34c1c18942857be2acb29c7dfc" +checksum = "0a4ee1e104e00dedb6aa5ffdd1343107b0a4702e862a84320ee7cc74782d96fc" dependencies = [ "dotenvy", "either", @@ -3178,14 +3190,14 @@ dependencies = [ [[package]] name = "sqlx-mysql" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca69bf415b93b60b80dc8fda3cb4ef52b2336614d8da2de5456cc942a110482" +checksum = "864b869fdf56263f4c95c45483191ea0af340f9f3e3e7b4d57a61c7c87a970db" dependencies = [ "atoi", - "base64 0.21.2", + "base64", "bigdecimal", - "bitflags 2.3.3", + "bitflags 2.4.1", "byteorder", "bytes", "chrono", @@ -3225,14 +3237,14 @@ dependencies = [ [[package]] name = "sqlx-postgres" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0db2df1b8731c3651e204629dd55e52adbae0462fa1bdcbed56a2302c18181e" +checksum = "eb7ae0e6a97fb3ba33b23ac2671a5ce6e3cabe003f451abd5a56e7951d975624" dependencies = [ "atoi", - "base64 0.21.2", + "base64", "bigdecimal", - "bitflags 2.3.3", + "bitflags 2.4.1", "byteorder", "chrono", "crc", @@ -3270,9 +3282,9 @@ dependencies = [ [[package]] name = "sqlx-sqlite" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4c21bf34c7cae5b283efb3ac1bcc7670df7561124dc2f8bdc0b59be40f79a2" +checksum = "d59dc83cf45d89c555a577694534fcd1b55c545a816c816ce51f20bbe56a4f3f" dependencies = [ "atoi", "chrono", @@ -3301,10 +3313,11 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stringprep" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" +checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" dependencies = [ + "finl_unicode", "unicode-bidi", "unicode-normalization", ] @@ -3334,7 +3347,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -3356,9 +3369,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.28" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -3400,15 +3413,14 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.6.0" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ - "autocfg", "cfg-if", - "fastrand", - "redox_syscall", - "rustix 0.37.22", + "fastrand 2.0.1", + "redox_syscall 0.3.5", + "rustix 0.38.20", "windows-sys", ] @@ -3437,7 +3449,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -3449,7 +3461,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", "test-case-core", ] @@ -3470,7 +3482,7 @@ checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -3485,11 +3497,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.22" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ + "deranged", "itoa", + "powerfmt", "serde", "time-core", "time-macros", @@ -3497,15 +3511,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.9" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] @@ -3539,7 +3553,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.3", + "socket2 0.5.5", "tokio-macros", "windows-sys", ] @@ -3552,7 +3566,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -3578,9 +3592,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" dependencies = [ "bytes", "futures-core", @@ -3621,7 +3635,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.1", "bytes", "futures-core", "futures-util", @@ -3665,7 +3679,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -3739,7 +3753,7 @@ checksum = "29a3151c41d0b13e3d011f98adc24434560ef06673a155a6c7f66b9879eecce2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -3750,14 +3764,14 @@ checksum = "982ee4197351b5c9782847ef5ec1fdcaf50503fb19d68f9771adae314e72b492" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "types" @@ -3792,9 +3806,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.10" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -3825,24 +3839,24 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "ureq" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b11c96ac7ee530603dcdf68ed1557050f374ce55a5a07193ebf8cbc9f8927e9" +checksum = "f5ccd538d4a604753ebc2f17cd9946e89b77bf87f6a8e2309667c6f2e87855e3" dependencies = [ - "base64 0.21.2", + "base64", "log", "once_cell", "rustls", - "rustls-webpki 0.100.1", + "rustls-webpki", "url", - "webpki-roots 0.23.1", + "webpki-roots 0.25.2", ] [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -3882,9 +3896,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "value-bag" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d92ccd67fb88503048c01b59152a04effd0782d035a83a6d256ce6085f08f4a3" +checksum = "4a72e1902dde2bd6441347de2b70b7f5d59bf157c6c62f0c44572607a1d55bbe" [[package]] name = "vcpkg" @@ -3909,9 +3923,9 @@ dependencies = [ [[package]] name = "waker-fn" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" [[package]] name = "want" @@ -3949,7 +3963,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", "wasm-bindgen-shared", ] @@ -3983,7 +3997,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4004,22 +4018,13 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki-roots" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" -dependencies = [ - "rustls-webpki 0.100.1", -] - [[package]] name = "webpki-roots" version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b291546d5d9d1eab74f069c77749f2cb8504a12caa20f0f2de93ddbf6f411888" dependencies = [ - "rustls-webpki 0.101.2", + "rustls-webpki", ] [[package]] @@ -4057,10 +4062,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows" -version = "0.48.0" +name = "windows-core" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" dependencies = [ "windows-targets", ] @@ -4076,9 +4081,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -4091,45 +4096,45 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winreg" diff --git a/server/domain/src/repository.rs b/server/domain/src/repository.rs index 403c82ba..ed9444ea 100644 --- a/server/domain/src/repository.rs +++ b/server/domain/src/repository.rs @@ -1,7 +1,10 @@ pub mod form_repository; +pub mod user_repository; pub trait Repositories: Send + Sync { type ConcreteFormRepository: form_repository::FormRepository; + type ConcreteUserRepository: user_repository::UserRepository; fn form_repository(&self) -> &Self::ConcreteFormRepository; + fn user_repository(&self) -> &Self::ConcreteUserRepository; } diff --git a/server/domain/src/repository/form_repository.rs b/server/domain/src/repository/form_repository.rs index a8db2cc7..2b8ed54f 100644 --- a/server/domain/src/repository/form_repository.rs +++ b/server/domain/src/repository/form_repository.rs @@ -2,16 +2,23 @@ use async_trait::async_trait; use errors::Error; use mockall::automock; -use crate::form::models::{ - Form, FormDescription, FormId, FormQuestionUpdateSchema, FormTitle, FormUpdateTargets, - OffsetAndLimit, PostedAnswers, +use crate::{ + form::models::{ + Form, FormDescription, FormId, FormQuestionUpdateSchema, FormTitle, FormUpdateTargets, + OffsetAndLimit, PostedAnswers, + }, + user::models::User, }; #[automock] #[async_trait] pub trait FormRepository: Send + Sync + 'static { - async fn create(&self, title: FormTitle, description: FormDescription) - -> Result; + async fn create( + &self, + title: FormTitle, + description: FormDescription, + user: User, + ) -> Result; async fn list(&self, offset_and_limit: OffsetAndLimit) -> Result, Error>; async fn get(&self, id: FormId) -> Result; async fn delete(&self, id: FormId) -> Result; diff --git a/server/domain/src/repository/user_repository.rs b/server/domain/src/repository/user_repository.rs new file mode 100644 index 00000000..f5b9553e --- /dev/null +++ b/server/domain/src/repository/user_repository.rs @@ -0,0 +1,11 @@ +use async_trait::async_trait; +use errors::Error; +use mockall::automock; + +use crate::user::models::User; + +#[automock] +#[async_trait] +pub trait UserRepository: Send + Sync + 'static { + async fn upsert_user(&self, user: &User) -> Result<(), Error>; +} diff --git a/server/domain/src/user/models.rs b/server/domain/src/user/models.rs index 2cc3246f..bee62767 100644 --- a/server/domain/src/user/models.rs +++ b/server/domain/src/user/models.rs @@ -1,8 +1,8 @@ use serde::{Deserialize, Serialize}; use uuid::Uuid; -#[derive(Serialize, Deserialize, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] pub struct User { pub name: String, - pub uuid: Uuid, + pub id: Uuid, } diff --git a/server/entrypoint/src/main.rs b/server/entrypoint/src/main.rs index ef08f8b5..16713018 100644 --- a/server/entrypoint/src/main.rs +++ b/server/entrypoint/src/main.rs @@ -78,7 +78,10 @@ async fn main() -> anyhow::Result<()> { .with_state(shared_repository.to_owned()) .route("/health", get(health_check)) .layer(layer) - .route_layer(middleware::from_fn(auth)) + .route_layer(middleware::from_fn_with_state( + shared_repository.to_owned(), + auth, + )) .layer( CorsLayer::new() .allow_methods([Method::GET, Method::POST, Method::DELETE, Method::PATCH]) diff --git a/server/infra/entities/src/answers.rs b/server/infra/entities/src/answers.rs index f5f12c37..da5890da 100644 --- a/server/infra/entities/src/answers.rs +++ b/server/infra/entities/src/answers.rs @@ -8,8 +8,7 @@ pub struct Model { #[sea_orm(primary_key)] pub id: i32, pub form_id: i32, - #[sea_orm(column_type = "Binary(BlobSize::Blob(Some(16)))")] - pub user: Vec, + pub user: i32, pub title: String, pub time_stamp: DateTimeUtc, } @@ -26,6 +25,14 @@ pub enum Relation { FormMetaData, #[sea_orm(has_many = "super::real_answers::Entity")] RealAnswers, + #[sea_orm( + belongs_to = "super::users::Entity", + from = "Column::User", + to = "super::users::Column::Id", + on_update = "NoAction", + on_delete = "NoAction" + )] + Users, } impl Related for Entity { @@ -40,4 +47,10 @@ impl Related for Entity { } } +impl Related for Entity { + fn to() -> RelationDef { + Relation::Users.def() + } +} + impl ActiveModelBehavior for ActiveModel {} diff --git a/server/infra/entities/src/form_meta_data.rs b/server/infra/entities/src/form_meta_data.rs index c9d7157f..7e7bb281 100644 --- a/server/infra/entities/src/form_meta_data.rs +++ b/server/infra/entities/src/form_meta_data.rs @@ -10,7 +10,9 @@ pub struct Model { pub title: String, pub description: Option, pub created_at: DateTimeUtc, + pub created_by: i32, pub updated_at: DateTimeUtc, + pub updated_by: i32, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] @@ -25,6 +27,22 @@ pub enum Relation { FormWebhooks, #[sea_orm(has_many = "super::response_period::Entity")] ResponsePeriod, + #[sea_orm( + belongs_to = "super::users::Entity", + from = "Column::CreatedBy", + to = "super::users::Column::Id", + on_update = "NoAction", + on_delete = "NoAction" + )] + Users2, + #[sea_orm( + belongs_to = "super::users::Entity", + from = "Column::UpdatedBy", + to = "super::users::Column::Id", + on_update = "NoAction", + on_delete = "NoAction" + )] + Users1, } impl Related for Entity { diff --git a/server/infra/entities/src/mod.rs b/server/infra/entities/src/mod.rs index b024134e..5ea0f3b4 100644 --- a/server/infra/entities/src/mod.rs +++ b/server/infra/entities/src/mod.rs @@ -11,3 +11,4 @@ pub mod form_webhooks; pub mod real_answers; pub mod response_period; pub mod sea_orm_active_enums; +pub mod users; diff --git a/server/infra/entities/src/prelude.rs b/server/infra/entities/src/prelude.rs index 4c7f10a1..da7a825c 100644 --- a/server/infra/entities/src/prelude.rs +++ b/server/infra/entities/src/prelude.rs @@ -5,4 +5,5 @@ pub use super::{ form_choices::Entity as FormChoices, form_meta_data::Entity as FormMetaData, form_questions::Entity as FormQuestions, form_webhooks::Entity as FormWebhooks, real_answers::Entity as RealAnswers, response_period::Entity as ResponsePeriod, + users::Entity as Users, }; diff --git a/server/infra/entities/src/users.rs b/server/infra/entities/src/users.rs new file mode 100644 index 00000000..e9220b41 --- /dev/null +++ b/server/infra/entities/src/users.rs @@ -0,0 +1,27 @@ +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1 + +use sea_orm::entity::prelude::*; + +#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] +#[sea_orm(table_name = "users")] +pub struct Model { + #[sea_orm(primary_key)] + pub id: i32, + #[sea_orm(column_type = "Binary(BlobSize::Blob(Some(16)))")] + pub uuid: Vec, + pub name: String, +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] +pub enum Relation { + #[sea_orm(has_many = "super::answers::Entity")] + Answers, +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Answers.def() + } +} + +impl ActiveModelBehavior for ActiveModel {} diff --git a/server/infra/resource/src/database.rs b/server/infra/resource/src/database.rs index 0c4d4434..ea9b5937 100644 --- a/server/infra/resource/src/database.rs +++ b/server/infra/resource/src/database.rs @@ -2,3 +2,4 @@ pub mod components; pub mod config; pub mod connection; pub mod form; +pub mod user; diff --git a/server/infra/resource/src/database/components.rs b/server/infra/resource/src/database/components.rs index 443e4b97..0454aae0 100644 --- a/server/infra/resource/src/database/components.rs +++ b/server/infra/resource/src/database/components.rs @@ -1,7 +1,10 @@ use async_trait::async_trait; -use domain::form::models::{ - FormDescription, FormId, FormQuestionUpdateSchema, FormTitle, FormUpdateTargets, - OffsetAndLimit, PostedAnswers, +use domain::{ + form::models::{ + FormDescription, FormId, FormQuestionUpdateSchema, FormTitle, FormUpdateTargets, + OffsetAndLimit, PostedAnswers, + }, + user::models::User, }; use errors::infra::InfraError; use mockall::automock; @@ -11,10 +14,12 @@ use crate::dto::{FormDto, PostedAnswersDto}; #[async_trait] pub trait DatabaseComponents: Send + Sync { type ConcreteFormDatabase: FormDatabase; + type ConcreteUserDatabase: UserDatabase; type TransactionAcrossComponents: Send + Sync; async fn begin_transaction(&self) -> anyhow::Result; fn form(&self) -> &Self::ConcreteFormDatabase; + fn user(&self) -> &Self::ConcreteUserDatabase; } #[automock] @@ -24,6 +29,7 @@ pub trait FormDatabase: Send + Sync { &self, title: FormTitle, description: FormDescription, + user: User, ) -> Result; async fn list(&self, offset_and_limit: OffsetAndLimit) -> Result, InfraError>; async fn get(&self, form_id: FormId) -> Result; @@ -38,3 +44,9 @@ pub trait FormDatabase: Send + Sync { async fn create_questions(&self, questions: FormQuestionUpdateSchema) -> Result<(), InfraError>; } + +#[automock] +#[async_trait] +pub trait UserDatabase: Send + Sync { + async fn upsert_user(&self, user: &User) -> Result<(), InfraError>; +} diff --git a/server/infra/resource/src/database/connection.rs b/server/infra/resource/src/database/connection.rs index 6e47b1cc..06e38dd9 100644 --- a/server/infra/resource/src/database/connection.rs +++ b/server/infra/resource/src/database/connection.rs @@ -42,6 +42,7 @@ impl ConnectionPool { #[async_trait] impl DatabaseComponents for ConnectionPool { type ConcreteFormDatabase = Self; + type ConcreteUserDatabase = Self; type TransactionAcrossComponents = DatabaseTransaction; async fn begin_transaction(&self) -> anyhow::Result { @@ -51,4 +52,8 @@ impl DatabaseComponents for ConnectionPool { fn form(&self) -> &Self::ConcreteFormDatabase { self } + + fn user(&self) -> &Self::ConcreteUserDatabase { + self + } } diff --git a/server/infra/resource/src/database/form.rs b/server/infra/resource/src/database/form.rs index e2db47e4..4ccd769a 100644 --- a/server/infra/resource/src/database/form.rs +++ b/server/infra/resource/src/database/form.rs @@ -1,16 +1,15 @@ use async_trait::async_trait; -use chrono::Utc; -use domain::form::models::{ - Answer, DefaultAnswerTitle, FormDescription, FormId, FormQuestionUpdateSchema, FormTitle, - FormUpdateTargets, OffsetAndLimit, PostedAnswers, +use domain::{ + form::models::{ + DefaultAnswerTitle, FormDescription, FormId, FormQuestionUpdateSchema, FormTitle, + FormUpdateTargets, OffsetAndLimit, PostedAnswers, + }, + user::models::User, }; use entities::{ - answers, default_answer_titles, form_choices, form_meta_data, form_questions, form_webhooks, - prelude::{ - Answers, DefaultAnswerTitles, FormChoices, FormMetaData, FormQuestions, FormWebhooks, - RealAnswers, - }, - real_answers, response_period, + default_answer_titles, form_choices, form_meta_data, form_questions, form_webhooks, + prelude::{DefaultAnswerTitles, FormChoices, FormMetaData, FormQuestions, FormWebhooks}, + response_period, sea_orm_active_enums::QuestionType, }; use errors::infra::{InfraError, InfraError::FormNotFound}; @@ -19,11 +18,11 @@ use itertools::Itertools; use num_traits::cast::FromPrimitive; use regex::Regex; use sea_orm::{ - prelude::Uuid, sea_query::{Expr, SimpleExpr}, ActiveEnum, ActiveModelTrait, ActiveValue, ActiveValue::Set, - ColumnTrait, EntityTrait, ModelTrait, QueryFilter, QueryOrder, QuerySelect, + ColumnTrait, ConnectionTrait, DatabaseBackend, DbErr, EntityTrait, ModelTrait, QueryFilter, + QueryOrder, QuerySelect, Statement, }; use crate::{ @@ -38,17 +37,22 @@ impl FormDatabase for ConnectionPool { &self, title: FormTitle, description: FormDescription, + user: User, ) -> Result { - let form_id = form_meta_data::ActiveModel { - id: ActiveValue::NotSet, - title: Set(title.title().to_owned()), - description: Set(description.to_owned()), - created_at: Default::default(), - updated_at: Default::default(), - } - .insert(&self.pool) - .await? - .id; + let form_id = self + .pool + .execute(Statement::from_sql_and_values( + DatabaseBackend::MySql, + "INSERT INTO form_meta_data (title, description, created_by, updated_by) + SELECT ?, ?, users.id, users.id FROM users WHERE uuid = UUID_TO_BIN(?)", + [ + title.title().to_owned().into(), + description.to_owned().into(), + user.id.to_string().into(), + ], + )) + .await? + .last_insert_id() as i32; Ok(form_id.into()) } @@ -405,78 +409,97 @@ impl FormDatabase for ConnectionPool { }, ); - let id = answers::ActiveModel { - id: Default::default(), - form_id: Set(answer.form_id.to_owned()), - user: Set(answer.uuid.to_owned().as_ref().to_vec()), - title: Set(embed_title), - time_stamp: Set(Utc::now()), - } - .insert(&self.pool) - .await? - .id; + let id = self + .pool + .execute(Statement::from_sql_and_values( + DatabaseBackend::MySql, + "INSERT INTO answers (form_id, user, title) VALUES (?, (SELECT id FROM users \ + WHERE uuid = UUID_TO_BIN(?)), ?)", + [ + answer.form_id.to_owned().into(), + answer.uuid.to_string().into(), + embed_title.into(), + ], + )) + .await? + .last_insert_id(); - let real_answer_models = answer + let params = answer .answers .into_iter() - .map( - |Answer { - question_id, - answer, - .. - }| real_answers::ActiveModel { - id: Default::default(), - answer_id: Set(id), - question_id: Set(question_id.into()), - answer: Set(answer), - }, - ) + .map(|answer| { + vec![ + id.to_string(), + answer.question_id.to_string(), + answer.answer, + ] + }) .collect_vec(); - RealAnswers::insert_many(real_answer_models) - .exec(&self.pool) + self.pool + .execute(Statement::from_sql_and_values( + DatabaseBackend::MySql, + format!( + "INSERT INTO real_answers (answer_id, question_id, answer) VALUES {}", + vec!["(?, ?, ?)"; params.len()].iter().join(", ") + ), + params + .iter() + .flatten() + .map(|value| value.into()) + .collect_vec(), + )) .await?; Ok(()) } async fn get_all_answers(&self) -> Result, InfraError> { - stream::iter( - Answers::find() - .order_by_desc(answers::Column::TimeStamp) - .all(&self.pool) - .await?, - ) - .then(|answer| async move { - let answers = RealAnswers::find() - .filter(Expr::col(real_answers::Column::AnswerId).eq(answer.id)) - .all(&self.pool) - .await? - .into_iter() - .map( - |real_answers::Model { - question_id, - answer, - .. - }| AnswerDto { - question_id, - answer, - }, - ) - .collect_vec(); + let answers = self + .pool + .query_all(Statement::from_string( + DatabaseBackend::MySql, + "SELECT form_id, answers.id AS answer_id, title, uuid, time_stamp FROM answers + INNER JOIN users ON answers.user = users.id + ORDER BY answers.time_stamp", + )) + .await?; + + let real_answers = self + .pool + .query_all(Statement::from_string( + DatabaseBackend::MySql, + "SELECT answer_id, question_id, answer FROM real_answers", + )) + .await?; - Ok(PostedAnswersDto { - uuid: Uuid::from_slice(answer.user.as_slice())?, - timestamp: answer.time_stamp, - form_id: answer.form_id, - title: Some(answer.title), - answers, + answers + .iter() + .map(|rs| { + let answer_id: i32 = rs.try_get("", "answer_id")?; + let answers = real_answers + .iter() + .filter(|rs| { + rs.try_get::("", "answer_id") + .is_ok_and(|id| id == answer_id) + }) + .map(|rs| { + Ok::(AnswerDto { + question_id: rs.try_get("", "question_id")?, + answer: rs.try_get("", "answer")?, + }) + }) + .collect::, _>>()?; + + Ok(PostedAnswersDto { + uuid: rs.try_get("", "uuid")?, + timestamp: rs.try_get("", "time_stamp")?, + form_id: rs.try_get("", "form_id")?, + title: rs.try_get("", "title")?, + answers, + }) }) - }) - .collect::>>() - .await - .into_iter() - .collect::, _>>() + .collect::, _>>() } async fn create_questions( diff --git a/server/infra/resource/src/database/user.rs b/server/infra/resource/src/database/user.rs new file mode 100644 index 00000000..15d53c1e --- /dev/null +++ b/server/infra/resource/src/database/user.rs @@ -0,0 +1,23 @@ +use async_trait::async_trait; +use domain::user::models::User; +use errors::infra::InfraError; +use sea_orm::{ConnectionTrait, DatabaseBackend, Statement}; + +use crate::database::{components::UserDatabase, connection::ConnectionPool}; + +#[async_trait] +impl UserDatabase for ConnectionPool { + async fn upsert_user(&self, user: &User) -> Result<(), InfraError> { + self.pool + .execute(Statement::from_sql_and_values( + DatabaseBackend::MySql, + "INSERT INTO users (uuid, name) VALUES (UUID_TO_BIN(?), ?) + ON DUPLICATE KEY UPDATE + name = VALUES(name)", + [user.id.to_string().into(), user.name.to_owned().into()], + )) + .await?; + + Ok(()) + } +} diff --git a/server/infra/resource/src/repository.rs b/server/infra/resource/src/repository.rs index 060349f3..6030b26e 100644 --- a/server/infra/resource/src/repository.rs +++ b/server/infra/resource/src/repository.rs @@ -1,4 +1,5 @@ pub mod form_repository_impl; +mod user_repository_impl; use std::sync::Arc; @@ -27,8 +28,13 @@ impl Repository { impl Repositories for SharedRepository { type ConcreteFormRepository = Repository; + type ConcreteUserRepository = Repository; fn form_repository(&self) -> &Self::ConcreteFormRepository { &self.0 } + + fn user_repository(&self) -> &Self::ConcreteUserRepository { + &self.0 + } } diff --git a/server/infra/resource/src/repository/form_repository_impl.rs b/server/infra/resource/src/repository/form_repository_impl.rs index 8f5aa1cb..00f82f2c 100644 --- a/server/infra/resource/src/repository/form_repository_impl.rs +++ b/server/infra/resource/src/repository/form_repository_impl.rs @@ -5,6 +5,7 @@ use domain::{ OffsetAndLimit, PostedAnswers, }, repository::form_repository::FormRepository, + user::models::User, }; use errors::Error; use futures::{stream, stream::StreamExt}; @@ -22,8 +23,9 @@ impl FormRepository for Repository &self, title: FormTitle, description: FormDescription, + user: User, ) -> Result { - let form_id = self.client.form().create(title, description).await?; + let form_id = self.client.form().create(title, description, user).await?; let form = self.client.form().get(form_id.to_owned().into()).await?; form_outgoing::create(form.try_into()?).await?; diff --git a/server/infra/resource/src/repository/user_repository_impl.rs b/server/infra/resource/src/repository/user_repository_impl.rs new file mode 100644 index 00000000..375b24bb --- /dev/null +++ b/server/infra/resource/src/repository/user_repository_impl.rs @@ -0,0 +1,19 @@ +use async_trait::async_trait; +use domain::{repository::user_repository::UserRepository, user::models::User}; +use errors::Error; + +use crate::{ + database::components::{DatabaseComponents, UserDatabase}, + repository::Repository, +}; + +#[async_trait] +impl UserRepository for Repository { + async fn upsert_user(&self, user: &User) -> Result<(), Error> { + self.client + .user() + .upsert_user(user) + .await + .map_err(Into::into) + } +} diff --git a/server/migration/src/lib.rs b/server/migration/src/lib.rs index af739585..58d9a5af 100644 --- a/server/migration/src/lib.rs +++ b/server/migration/src/lib.rs @@ -7,6 +7,7 @@ mod m20230614_083950_crate_form_response_period_table; mod m20230622_053919_create_form_webhook; mod m20230811_062425_create_answer_tables; mod m20230908_140907_create_default_answer_titles; +mod m20231008_135425_create_user_table; pub struct Migrator; @@ -14,6 +15,7 @@ pub struct Migrator; impl MigratorTrait for Migrator { fn migrations() -> Vec> { vec![ + Box::new(m20231008_135425_create_user_table::Migration), Box::new(m20220101_000001_create_table::Migration), Box::new(m20221211_211233_form_questions::Migration), Box::new(m20230219_143118_create_form_choices::Migration), diff --git a/server/migration/src/m20220101_000001_create_table.rs b/server/migration/src/m20220101_000001_create_table.rs index a0e297e7..7a324d3c 100644 --- a/server/migration/src/m20220101_000001_create_table.rs +++ b/server/migration/src/m20220101_000001_create_table.rs @@ -1,5 +1,7 @@ use sea_orm_migration::prelude::*; +use crate::m20231008_135425_create_user_table::UsersTable; + #[derive(DeriveMigrationName)] pub struct Migration; @@ -26,12 +28,40 @@ impl MigrationTrait for Migration { .not_null() .extra("DEFAULT CURRENT_TIMESTAMP".to_string()), ) + .col( + ColumnDef::new(FormMetaDataTable::CreatedBy) + .integer() + .not_null(), + ) + .foreign_key( + ForeignKey::create() + .name("fk-created-user-id") + .from( + FormMetaDataTable::FormMetaData, + FormMetaDataTable::CreatedBy, + ) + .to(UsersTable::Users, UsersTable::Id), + ) .col( ColumnDef::new(FormMetaDataTable::UpdatedAt) .timestamp() .not_null() .extra("DEFAULT CURRENT_TIMESTAMP".to_string()), ) + .col( + ColumnDef::new(FormMetaDataTable::UpdatedBy) + .integer() + .not_null(), + ) + .foreign_key( + ForeignKey::create() + .name("fk-updated-user-id") + .from( + FormMetaDataTable::FormMetaData, + FormMetaDataTable::UpdatedBy, + ) + .to(UsersTable::Users, UsersTable::Id), + ) .to_owned(), ) .await @@ -55,5 +85,7 @@ pub enum FormMetaDataTable { Title, Description, CreatedAt, + CreatedBy, UpdatedAt, + UpdatedBy, } diff --git a/server/migration/src/m20230811_062425_create_answer_tables.rs b/server/migration/src/m20230811_062425_create_answer_tables.rs index e74c548c..fe819897 100644 --- a/server/migration/src/m20230811_062425_create_answer_tables.rs +++ b/server/migration/src/m20230811_062425_create_answer_tables.rs @@ -3,6 +3,7 @@ use sea_orm_migration::prelude::*; use crate::{ m20220101_000001_create_table::FormMetaDataTable, m20221211_211233_form_questions::FormQuestionsTable, + m20231008_135425_create_user_table::UsersTable, }; #[derive(DeriveMigrationName)] @@ -30,7 +31,13 @@ impl MigrationTrait for Migration { .from(AnswersTable::Answers, AnswersTable::FormId) .to(FormMetaDataTable::FormMetaData, FormMetaDataTable::Id), ) - .col(ColumnDef::new(AnswersTable::User).uuid().not_null()) + .col(ColumnDef::new(AnswersTable::User).integer().not_null()) + .foreign_key( + ForeignKey::create() + .name("fk-answer-user-id") + .from(AnswersTable::Answers, AnswersTable::User) + .to(UsersTable::Users, UsersTable::Id), + ) .col( ColumnDef::new(AnswersTable::Title) .string() diff --git a/server/migration/src/m20231008_135425_create_user_table.rs b/server/migration/src/m20231008_135425_create_user_table.rs new file mode 100644 index 00000000..26915cf3 --- /dev/null +++ b/server/migration/src/m20231008_135425_create_user_table.rs @@ -0,0 +1,46 @@ +use sea_orm_migration::prelude::*; + +#[derive(DeriveMigrationName)] +pub struct Migration; + +#[async_trait::async_trait] +impl MigrationTrait for Migration { + async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { + manager + .create_table( + Table::create() + .table(UsersTable::Users) + .if_not_exists() + .col( + ColumnDef::new(UsersTable::Id) + .integer() + .not_null() + .auto_increment() + .primary_key(), + ) + .col( + ColumnDef::new(UsersTable::Uuid) + .uuid() + .unique_key() + .not_null(), + ) + .col(ColumnDef::new(UsersTable::Name).string().not_null()) + .to_owned(), + ) + .await + } + + async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { + manager + .drop_table(Table::drop().table(UsersTable::Users).to_owned()) + .await + } +} + +#[derive(DeriveIden)] +pub enum UsersTable { + Users, + Id, + Uuid, + Name, +} diff --git a/server/presentation/Cargo.toml b/server/presentation/Cargo.toml index 2c47f794..99b1e1f8 100644 --- a/server/presentation/Cargo.toml +++ b/server/presentation/Cargo.toml @@ -9,7 +9,9 @@ common = { path = "../common" } domain = { path = "../domain" } errors = { path = "../errors" } resource = { path = "../infra/resource" } +serde = { workspace = true } serde_json = { workspace = true } tracing = { workspace = true } usecase = { path = "../usecase" } uuid = { workspace = true } +reqwest = { workspace = true } diff --git a/server/presentation/src/auth.rs b/server/presentation/src/auth.rs index fd8db49c..00d253a6 100644 --- a/server/presentation/src/auth.rs +++ b/server/presentation/src/auth.rs @@ -1,29 +1,68 @@ use axum::{ - extract::TypedHeader, + extract::{State, TypedHeader}, headers::authorization::{Authorization, Bearer}, - http::{Request, StatusCode}, + http::{HeaderValue, Request, StatusCode}, middleware::Next, response::Response, }; use common::config::ENV; -use domain::user::models::User; +use domain::{ + repository::{user_repository::UserRepository, Repositories}, + user::models::User, +}; +use reqwest::header::{ACCEPT, CONTENT_TYPE}; +use resource::repository::RealInfrastructureRepository; +use usecase::user::UserUseCase; use uuid::uuid; pub async fn auth( + State(repository): State, TypedHeader(auth): TypedHeader>, mut request: Request, next: Next, ) -> Result { - //todo: フロントエンド側から何が返ってくるかがわかったらユーザー認証を実装する - if ENV.name == "local" && auth.token() == "debug_user" { - let user = User { + let token = auth.token(); + + let user = if ENV.name == "local" && token == "debug_user" { + User { name: "test_user".to_string(), - uuid: uuid!("478911be-3356-46c1-936e-fb14b71bf282"), - }; - request.extensions_mut().insert(user); - let response = next.run(request).await; - Ok(response) + id: uuid!("478911be-3356-46c1-936e-fb14b71bf282"), + } } else { - Err(StatusCode::UNAUTHORIZED) + let client = reqwest::Client::new(); + + let response = client + .get("https://api.minecraftservices.com/minecraft/profile") + .bearer_auth(token) + .header(CONTENT_TYPE, HeaderValue::from_static("application/json")) + .header(ACCEPT, HeaderValue::from_static("application/json")) + .send() + .await + .map_err(|_| StatusCode::UNAUTHORIZED)?; + + serde_json::from_str::( + response + .text() + .await + .map_err(|_| StatusCode::UNAUTHORIZED)? + .as_str(), + ) + .map_err(|_| StatusCode::UNAUTHORIZED)? + }; + + let user_use_case = UserUseCase { + repository: repository.user_repository(), + }; + + match user_use_case.repository.upsert_user(&user).await { + Ok(_) => { + request.extensions_mut().insert(user); + let response = next.run(request).await; + Ok(response) + } + Err(err) => { + tracing::error!("{}", err); + Err(StatusCode::INTERNAL_SERVER_ERROR) + } } } diff --git a/server/presentation/src/form_handler.rs b/server/presentation/src/form_handler.rs index f058db93..5b8f0359 100644 --- a/server/presentation/src/form_handler.rs +++ b/server/presentation/src/form_handler.rs @@ -2,13 +2,14 @@ use axum::{ extract::{Path, Query, State}, http::StatusCode, response::IntoResponse, - Json, + Extension, Json, }; use domain::{ form::models::{ Form, FormId, FormQuestionUpdateSchema, FormUpdateTargets, OffsetAndLimit, PostedAnswers, }, repository::Repositories, + user::models::User, }; use errors::{infra::InfraError, Error}; use resource::repository::RealInfrastructureRepository; @@ -16,6 +17,7 @@ use serde_json::json; use usecase::form::FormUseCase; pub async fn create_form_handler( + Extension(user): Extension, State(repository): State, Json(form): Json
, ) -> impl IntoResponse { @@ -24,7 +26,7 @@ pub async fn create_form_handler( }; match form_use_case - .create_form(form.title, form.description) + .create_form(form.title, form.description, user) .await { Ok(id) => (StatusCode::CREATED, Json(json!({ "id": id }))).into_response(), diff --git a/server/usecase/src/form.rs b/server/usecase/src/form.rs index bd03d29b..cb9fee59 100644 --- a/server/usecase/src/form.rs +++ b/server/usecase/src/form.rs @@ -4,6 +4,7 @@ use domain::{ OffsetAndLimit, PostedAnswers, }, repository::form_repository::FormRepository, + user::models::User, }; use errors::Error; @@ -16,8 +17,9 @@ impl FormUseCase<'_, R> { &self, title: FormTitle, description: FormDescription, + user: User, ) -> Result { - self.repository.create(title, description).await + self.repository.create(title, description, user).await } pub async fn form_list(&self, offset_and_limit: OffsetAndLimit) -> Result, Error> { diff --git a/server/usecase/src/lib.rs b/server/usecase/src/lib.rs index 5a8189bc..43d78c4c 100644 --- a/server/usecase/src/lib.rs +++ b/server/usecase/src/lib.rs @@ -1 +1,2 @@ pub mod form; +pub mod user; diff --git a/server/usecase/src/user.rs b/server/usecase/src/user.rs new file mode 100644 index 00000000..a9677c01 --- /dev/null +++ b/server/usecase/src/user.rs @@ -0,0 +1,12 @@ +use domain::{repository::user_repository::UserRepository, user::models::User}; +use errors::Error; + +pub struct UserUseCase<'a, UserRepo: UserRepository> { + pub repository: &'a UserRepo, +} + +impl UserUseCase<'_, R> { + pub async fn upsert_user(&self, user: &User) -> Result<(), Error> { + self.repository.upsert_user(user).await + } +}