diff --git a/.cargo/config.toml b/.cargo/config.toml index c62c036..5f65c35 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -3,5 +3,5 @@ linker = "clang" rustflags = [ "-C", "link-arg=-fuse-ld=mold", ] -[build] -rustc-wrapper = "/usr/bin/sccache" +#[build] +#rustc-wrapper = "" diff --git a/.gitignore b/.gitignore index fe78e04..2a3c64d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -/target +target bazzar.toml /tmp /uploads diff --git a/Cargo.lock b/Cargo.lock index 6be40d0..65b2550 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -103,7 +103,7 @@ dependencies = [ "percent-encoding", "pin-project-lite 0.2.9", "rand 0.8.5", - "sha1 0.10.5", + "sha1", "smallvec", "tracing", "zstd", @@ -296,6 +296,12 @@ dependencies = [ "alloc-no-stdlib", ] +[[package]] +name = "ambient-authority" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec8ad6edb4840b78c5c3d88de606b22252d552b55f3a4699fbb10fc070ec3049" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -379,7 +385,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi 0.3.9", ] @@ -399,27 +405,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "backtrace" -version = "0.3.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" -dependencies = [ - "addr2line", - "cc", - "cfg-if 1.0.0", - "libc", - "miniz_oxide 0.5.4", - "object", - "rustc-demangle", -] - -[[package]] -name = "base-x" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" - [[package]] name = "base64" version = "0.13.1" @@ -621,6 +606,71 @@ dependencies = [ "bytes 1.3.0", ] +[[package]] +name = "cap-fs-ext" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b0e103ce36d217d568903ad27b14ec2238ecb5d65bad2e756a8f3c0d651506e" +dependencies = [ + "cap-primitives", + "cap-std", + "io-lifetimes 0.7.5", + "windows-sys 0.36.1", +] + +[[package]] +name = "cap-primitives" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af3f336aa91cce16033ed3c94ac91d98956c49b420e6d6cd0dd7d0e386a57085" +dependencies = [ + "ambient-authority", + "fs-set-times", + "io-extras", + "io-lifetimes 0.7.5", + "ipnet", + "maybe-owned", + "rustix 0.35.13", + "winapi-util", + "windows-sys 0.36.1", + "winx", +] + +[[package]] +name = "cap-rand" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d14b9606aa9550d34651bc481443203bc014237bdb992d201d2afa62d2ec6dea" +dependencies = [ + "ambient-authority", + "rand 0.8.5", +] + +[[package]] +name = "cap-std" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9d6e70b626eceac9d6fc790fe2d72cc3f2f7bc3c35f467690c54a526b0f56db" +dependencies = [ + "cap-primitives", + "io-extras", + "io-lifetimes 0.7.5", + "ipnet", + "rustix 0.35.13", +] + +[[package]] +name = "cap-time-ext" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3a0524f7c4cff2ea547ae2b652bf7a348fd3e48f76556dc928d8b45ab2f1d50" +dependencies = [ + "cap-primitives", + "once_cell", + "rustix 0.35.13", + "winx", +] + [[package]] name = "cart_manager" version = "0.1.0" @@ -751,7 +801,6 @@ dependencies = [ "serde_json", "thiserror", "toml", - "tracing", ] [[package]] @@ -778,12 +827,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "const_fn" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935" - [[package]] name = "convert_case" version = "0.4.0" @@ -823,16 +866,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] -name = "corosensei" -version = "0.1.3" +name = "cpp_demangle" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9847f90f32a50b0dcbd68bc23ff242798b13080b97b0569f6ed96a45ce4cf2cd" +checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" dependencies = [ - "autocfg 1.1.0", "cfg-if 1.0.0", - "libc", - "scopeguard", - "windows-sys 0.33.0", ] [[package]] @@ -846,22 +885,25 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.86.1" +version = "0.90.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "529ffacce2249ac60edba2941672dfedf3d96558b415d0d8083cd007456e0f55" +checksum = "b62c772976416112fa4484cbd688cb6fb35fd430005c1c586224fc014018abad" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.86.1" +version = "0.90.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427d105f617efc8cb55f8d036a7fded2e227892d8780b4985e5551f8d27c4a92" +checksum = "9b40ed2dd13c2ac7e24f88a3090c68ad3414eb1d066a95f8f1f7b3b819cb4e46" dependencies = [ + "arrayvec", + "bumpalo", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", + "cranelift-egraph", "cranelift-entity", "cranelift-isle", "gimli", @@ -873,30 +915,47 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.86.1" +version = "0.90.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "551674bed85b838d45358e3eab4f0ffaa6790c70dc08184204b9a54b41cdb7d1" +checksum = "bb927a8f1c27c34ee3759b6b0ffa528d2330405d5cc4511f0cab33fe2279f4b5" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.86.1" +version = "0.90.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b3a63ae57498c3eb495360944a33571754241e15e47e3bcae6082f40fec5866" +checksum = "43dfa417b884a9ab488d95fd6b93b25e959321fe7bfd7a0a960ba5d7fb7ab927" + +[[package]] +name = "cranelift-egraph" +version = "0.90.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a66b39785efd8513d2cca967ede56d6cc57c8d7986a595c7c47d0c78de8dce" +dependencies = [ + "cranelift-entity", + "fxhash", + "hashbrown 0.12.3", + "indexmap", + "log", + "smallvec", +] [[package]] name = "cranelift-entity" -version = "0.86.1" +version = "0.90.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11aa8aa624c72cc1c94ea3d0739fa61248260b5b14d3646f51593a88d67f3e6e" +checksum = "0637ffde963cb5d759bc4d454cfa364b6509e6c74cdaa21298add0ed9276f346" +dependencies = [ + "serde", +] [[package]] name = "cranelift-frontend" -version = "0.86.1" +version = "0.90.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "544ee8f4d1c9559c9aa6d46e7aaeac4a13856d620561094f35527356c7d21bd0" +checksum = "fb72b8342685e850cb037350418f62cc4fc55d6c2eb9c7ca01b82f9f1a6f3d56" dependencies = [ "cranelift-codegen", "log", @@ -906,9 +965,36 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.86.1" +version = "0.90.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed16b14363d929b8c37e3c557d0a7396791b383ecc302141643c054343170aad" +checksum = "850579cb9e4b448f7c301f1e6e6cbad99abe3f1f1d878a4994cb66e33c6db8cd" + +[[package]] +name = "cranelift-native" +version = "0.90.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d0a279e5bcba3e0466c734d8d8eb6bfc1ad29e95c37f3e4955b492b5616335e" +dependencies = [ + "cranelift-codegen", + "libc", + "target-lexicon", +] + +[[package]] +name = "cranelift-wasm" +version = "0.90.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6b8c5e7ffb754093fb89ec4bd4f9dbb9f1c955427299e334917d284745835c2" +dependencies = [ + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "itertools 0.10.5", + "log", + "smallvec", + "wasmparser", + "wasmtime-types", +] [[package]] name = "crc" @@ -934,6 +1020,20 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "crossbeam" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2801af0d36612ae591caa9568261fddce32ce6e08a7275ea334a06a4ad021a2c" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + [[package]] name = "crossbeam-channel" version = "0.5.6" @@ -1047,18 +1147,8 @@ version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", -] - -[[package]] -name = "darling" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" -dependencies = [ - "darling_core 0.14.2", - "darling_macro 0.14.2", + "darling_core", + "darling_macro", ] [[package]] @@ -1075,37 +1165,13 @@ dependencies = [ "syn", ] -[[package]] -name = "darling_core" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "darling_macro" version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ - "darling_core 0.13.4", - "quote", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" -dependencies = [ - "darling_core 0.14.2", + "darling_core", "quote", "syn", ] @@ -1158,17 +1224,6 @@ dependencies = [ "version_check 0.1.5", ] -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "derive_more" version = "0.99.17" @@ -1193,6 +1248,16 @@ dependencies = [ "subtle", ] +[[package]] +name = "directories-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" +dependencies = [ + "cfg-if 1.0.0", + "dirs-sys-next", +] + [[package]] name = "dirs" version = "3.0.2" @@ -1223,10 +1288,15 @@ dependencies = [ ] [[package]] -name = "discard" -version = "1.0.4" +name = "dirs-sys-next" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi 0.3.9", +] [[package]] name = "displaydoc" @@ -1257,7 +1327,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5bf5ff6f74150b0bbb6e6057718a903b3d8f3fc7096c9190fc162ca99d3b2273" dependencies = [ - "darling 0.13.4", + "darling", "quote", "syn", ] @@ -1331,26 +1401,6 @@ dependencies = [ "cfg-if 1.0.0", ] -[[package]] -name = "enum-iterator" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eeac5c5edb79e4e39fe8439ef35207780a11f69c52cbe424ce3dfad4cb78de6" -dependencies = [ - "enum-iterator-derive", -] - -[[package]] -name = "enum-iterator-derive" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "enum-ordinalize" version = "3.1.12" @@ -1365,27 +1415,6 @@ dependencies = [ "syn", ] -[[package]] -name = "enumset" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19be8061a06ab6f3a6cf21106c873578bf01bd42ad15e0311a9c76161cb1c753" -dependencies = [ - "enumset_derive", -] - -[[package]] -name = "enumset_derive" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03e7b551eba279bf0fa88b83a46330168c1560a52a94f5126f892f0b364ab3e0" -dependencies = [ - "darling 0.14.2", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "env_logger" version = "0.7.1" @@ -1399,6 +1428,40 @@ dependencies = [ "termcolor", ] +[[package]] +name = "env_logger" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +dependencies = [ + "atty", + "humantime 2.1.0", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi 0.3.9", +] + +[[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 = "event-listener" version = "2.5.3" @@ -1495,6 +1558,16 @@ dependencies = [ "tasque", ] +[[package]] +name = "file-per-thread-logger" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21e16290574b39ee41c71aeb90ae960c504ebaf1e2a1c87bd52aa56ed6e1a02f" +dependencies = [ + "env_logger 0.9.3", + "log", +] + [[package]] name = "filetime" version = "0.2.18" @@ -1514,7 +1587,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" dependencies = [ "crc32fast", - "miniz_oxide 0.6.2", + "miniz_oxide", ] [[package]] @@ -1604,6 +1677,17 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs-set-times" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a267b6a9304912e018610d53fe07115d8b530b160e85db4d2d3a59f3ddde1aec" +dependencies = [ + "io-lifetimes 0.7.5", + "rustix 0.35.13", + "windows-sys 0.36.1", +] + [[package]] name = "fs_extra" version = "1.2.0" @@ -1768,15 +1852,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "generational-arena" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d3b771574f62d0548cee0ad9057857e9fc25d7a3335f140c84f6acd0bf601" -dependencies = [ - "cfg-if 0.1.10", -] - [[package]] name = "generic-array" version = "0.14.6" @@ -2024,6 +2099,15 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + [[package]] name = "hex" version = "0.4.3" @@ -2235,12 +2319,6 @@ dependencies = [ "cxx-build", ] -[[package]] -name = "id-arena" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" - [[package]] name = "ident_case" version = "1.0.1" @@ -2338,6 +2416,36 @@ dependencies = [ "unic-langid", ] +[[package]] +name = "io-extras" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5d8c2ab5becd8720e30fd25f8fa5500d8dc3fceadd8378f05859bd7b46fc49" +dependencies = [ + "io-lifetimes 0.7.5", + "windows-sys 0.36.1", +] + +[[package]] +name = "io-lifetimes" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074" +dependencies = [ + "libc", + "windows-sys 0.42.0", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c" +dependencies = [ + "libc", + "windows-sys 0.42.0", +] + [[package]] name = "iovec" version = "0.1.4" @@ -2359,6 +2467,18 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f84f1612606f3753f205a4e9a2efd6fe5b4c573a6269b2cc6c3003d44a0d127" +[[package]] +name = "is-terminal" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d508111813f9af3afd2f92758f77e4ed2cc9371b642112c6a48d22eb73105c5" +dependencies = [ + "hermit-abi 0.2.6", + "io-lifetimes 0.7.5", + "rustix 0.35.13", + "windows-sys 0.36.1", +] + [[package]] name = "itertools" version = "0.9.0" @@ -2389,6 +2509,26 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" +[[package]] +name = "ittapi" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8c4f6ff06169ce7048dac5150b1501c7e3716a929721aeb06b87e51a43e42f4" +dependencies = [ + "anyhow", + "ittapi-sys", + "log", +] + +[[package]] +name = "ittapi-sys" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87e078cce01485f418bae3beb34dd604aaedf2065502853c7da17fbce8e64eda" +dependencies = [ + "cc", +] + [[package]] name = "jobserver" version = "0.1.25" @@ -2526,6 +2666,18 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" +[[package]] +name = "linux-raw-sys" +version = "0.0.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" + +[[package]] +name = "linux-raw-sys" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f9f08d8963a6c613f4b1a78f4f4a4dbfadf8e6545b2d72861731e4858b8b47f" + [[package]] name = "llvmenv" version = "0.3.2" @@ -2642,6 +2794,12 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +[[package]] +name = "maybe-owned" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4facc753ae494aeb6e3c22f839b158aebd4f9270f55cd3c79906c45476c47ab4" + [[package]] name = "md-5" version = "0.10.5" @@ -2658,12 +2816,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] -name = "memmap2" -version = "0.5.8" +name = "memfd" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b182332558b18d807c4ce1ca8ca983b34c3ee32765e47b3f0f69b90355cc1dc" +checksum = "b20a59d985586e4a5aef64564ac77299f8586d8be6cf9106a5a40207e8908efb" dependencies = [ - "libc", + "rustix 0.36.5", ] [[package]] @@ -2706,15 +2864,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "miniz_oxide" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" -dependencies = [ - "adler", -] - [[package]] name = "miniz_oxide" version = "0.6.2" @@ -2795,17 +2944,10 @@ dependencies = [ "sqlx", "sqlx-core", "thiserror", - "tracing", "uuid 1.2.2", "validator", ] -[[package]] -name = "more-asserts" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" - [[package]] name = "nanorand" version = "0.7.0" @@ -2925,7 +3067,7 @@ version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", ] @@ -2941,6 +3083,9 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" dependencies = [ + "crc32fast", + "hashbrown 0.12.3", + "indexmap", "memchr", ] @@ -2993,15 +3138,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "openssl-src" -version = "111.24.0+1.1.1s" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3498f259dab01178c6228c6b00dcef0ed2a2d5e20d648c017861227773ea4abd" -dependencies = [ - "cc", -] - [[package]] name = "openssl-sys" version = "0.9.78" @@ -3011,7 +3147,6 @@ dependencies = [ "autocfg 1.1.0", "cc", "libc", - "openssl-src", "pkg-config", "vcpkg", ] @@ -3229,13 +3364,19 @@ name = "payment_adapter" version = "0.1.0" dependencies = [ "config", + "futures 0.3.25", "model", + "serde", + "thiserror", + "tracing", + "uuid 1.2.2", ] [[package]] name = "payment_manager" version = "0.1.0" dependencies = [ + "bincode", "channels", "chrono", "config", @@ -3244,8 +3385,6 @@ dependencies = [ "gumdrop", "llvmenv", "model", - "openssl-src", - "openssl-sys", "opentelemetry 0.17.0", "opentelemetry-jaeger", "payment_adapter", @@ -3261,8 +3400,10 @@ dependencies = [ "tracing-opentelemetry", "tracing-subscriber", "uuid 1.2.2", - "wasmer", - "wasmer-wasi", + "wapc", + "wapc-codec", + "wapc-pool", + "wasmtime-provider", ] [[package]] @@ -3312,7 +3453,7 @@ checksum = "fec8605d59fc2ae0c6c1aefc0c7c7a9769732017c0ce07f7a9cfffa7b4404f20" dependencies = [ "once_cell", "pest", - "sha1 0.10.5", + "sha1", ] [[package]] @@ -3377,7 +3518,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "926d36b9553851b8b0005f1275891b392ee4d2d833852c417ed025477350fb9d" dependencies = [ - "env_logger", + "env_logger 0.7.1", "log", ] @@ -3414,12 +3555,6 @@ dependencies = [ "version_check 0.9.4", ] -[[package]] -name = "proc-macro-hack" -version = "0.5.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" - [[package]] name = "proc-macro2" version = "1.0.47" @@ -3454,6 +3589,15 @@ dependencies = [ "trackable 0.2.24", ] +[[package]] +name = "psm" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +dependencies = [ + "cc", +] + [[package]] name = "ptr_meta" version = "0.1.4" @@ -3474,17 +3618,6 @@ dependencies = [ "syn", ] -[[package]] -name = "pulldown-cmark" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8" -dependencies = [ - "bitflags", - "memchr", - "unicase", -] - [[package]] name = "quick-error" version = "1.2.3" @@ -3713,9 +3846,9 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.3.2" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d43a209257d978ef079f3d446331d0f1794f5e0fc19b306a199983857833a779" +checksum = "91b2eab54204ea0117fe9a060537e0b07a4e72f7c7d182361ecc346cab2240e5" dependencies = [ "fxhash", "log", @@ -3749,18 +3882,6 @@ version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" -[[package]] -name = "region" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" -dependencies = [ - "bitflags", - "libc", - "mach", - "winapi 0.3.9", -] - [[package]] name = "remove_dir_all" version = "0.5.3" @@ -3910,7 +4031,6 @@ checksum = "cec2b3485b07d96ddfd3134767b8a447b45ea4eb91448d0a35180ec0ffd5ed15" dependencies = [ "bytecheck", "hashbrown 0.12.3", - "indexmap", "ptr_meta", "rend", "rkyv_derive", @@ -3928,6 +4048,28 @@ dependencies = [ "syn", ] +[[package]] +name = "rmp" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44519172358fd6d58656c86ab8e7fbc9e1490c3e8f14d35ed78ca0dd07403c9f" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5b13be192e0220b8afb7222aa5813cb62cc269ebb5cac346ca6487681d2913e" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + [[package]] name = "rumqttc" version = "0.18.0" @@ -4004,6 +4146,36 @@ dependencies = [ "semver 1.0.14", ] +[[package]] +name = "rustix" +version = "0.35.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "727a1a6d65f786ec22df8a81ca3121107f235970dc1705ed681d3e6e8b9cd5f9" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes 0.7.5", + "itoa 1.0.4", + "libc", + "linux-raw-sys 0.0.46", + "once_cell", + "windows-sys 0.42.0", +] + +[[package]] +name = "rustix" +version = "0.36.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3807b5d10909833d3e9acd1eb5fb988f79376ff10fce42937de71a449c4c588" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes 1.0.3", + "libc", + "linux-raw-sys 0.1.3", + "windows-sys 0.42.0", +] + [[package]] name = "rustls" version = "0.20.7" @@ -4062,6 +4234,19 @@ dependencies = [ "rust_decimal_macros", ] +[[package]] +name = "rusty_pool" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33a01b7876355018cbcc41204d38ff70227950dd3cd6fe3f4f52a10474b1a2de" +dependencies = [ + "crossbeam-channel", + "futures 0.3.25", + "futures-channel", + "futures-executor", + "num_cpus", +] + [[package]] name = "ryu" version = "1.0.11" @@ -4249,9 +4434,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.148" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e53f64bb4ba0191d6d0676e1b141ca55047d83b74f5607e6d8eb88126c52c2dc" +checksum = "256b9932320c590e707b94576e3cc1f7c9024d0ee6612dfbcf1cb106cbe8e055" dependencies = [ "serde_derive", ] @@ -4269,9 +4454,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.148" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55492425aa53521babf6137309e7d34c20bbfbbfcfe2c7f3a047fd1f6b92c0c" +checksum = "b4eae9b04cbffdfd550eb462ed33bc6a1b68c935127d008b27444d08380f94e4" dependencies = [ "proc-macro2", "quote", @@ -4301,15 +4486,6 @@ dependencies = [ "serde", ] -[[package]] -name = "sha1" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" -dependencies = [ - "sha1_smol", -] - [[package]] name = "sha1" version = "0.10.5" @@ -4540,7 +4716,7 @@ dependencies = [ "rustls-pemfile 1.0.1", "serde", "serde_json", - "sha1 0.10.5", + "sha1", "sha2", "smallvec", "sqlformat", @@ -4592,70 +4768,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" -[[package]] -name = "standback" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff" -dependencies = [ - "version_check 0.9.4", -] - [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "stdweb" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" -dependencies = [ - "discard", - "rustc_version 0.2.3", - "stdweb-derive", - "stdweb-internal-macros", - "stdweb-internal-runtime", - "wasm-bindgen", -] - -[[package]] -name = "stdweb-derive" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" -dependencies = [ - "proc-macro2", - "quote", - "serde", - "serde_derive", - "syn", -] - -[[package]] -name = "stdweb-internal-macros" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" -dependencies = [ - "base-x", - "proc-macro2", - "quote", - "serde", - "serde_derive", - "serde_json", - "sha1 0.6.1", - "syn", -] - -[[package]] -name = "stdweb-internal-runtime" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" - [[package]] name = "stock_manager" version = "0.1.0" @@ -4772,6 +4890,22 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "system-interface" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92adbaf536f5aff6986e1e62ba36cee72b1718c5153eee08b9e728ddde3f6029" +dependencies = [ + "atty", + "bitflags", + "cap-fs-ext", + "cap-std", + "io-lifetimes 0.7.5", + "rustix 0.35.13", + "windows-sys 0.36.1", + "winx", +] + [[package]] name = "tar" version = "0.4.38" @@ -4942,21 +5076,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "time" -version = "0.2.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4752a97f8eebd6854ff91f1c1824cd6160626ac4bd44287f7f4ea2035a02a242" -dependencies = [ - "const_fn", - "libc", - "standback", - "stdweb", - "time-macros 0.1.1", - "version_check 0.9.4", - "winapi 0.3.9", -] - [[package]] name = "time" version = "0.3.17" @@ -4966,7 +5085,7 @@ dependencies = [ "itoa 1.0.4", "serde", "time-core", - "time-macros 0.2.6", + "time-macros", ] [[package]] @@ -4975,16 +5094,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" -[[package]] -name = "time-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1" -dependencies = [ - "proc-macro-hack", - "time-macros-impl", -] - [[package]] name = "time-macros" version = "0.2.6" @@ -4994,19 +5103,6 @@ dependencies = [ "time-core", ] -[[package]] -name = "time-macros-impl" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd3c141a1b43194f3f56a1411225df8646c55781d5f26db825b3d98507eb482f" -dependencies = [ - "proc-macro-hack", - "proc-macro2", - "quote", - "standback", - "syn", -] - [[package]] name = "tinystr" version = "0.7.0" @@ -5448,12 +5544,6 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - [[package]] name = "unicode_categories" version = "0.1.1" @@ -5555,6 +5645,41 @@ dependencies = [ "try-lock", ] +[[package]] +name = "wapc" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "924d892db9de6ecf605ad99b15ea85eaecd9ff8ac32a829d4d9b61987b716eb9" +dependencies = [ + "log", + "parking_lot 0.11.2", + "thiserror", +] + +[[package]] +name = "wapc-codec" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "547c5bc15ef114be946d56ce368ff990d91b22603ac09cc0c0d476213289fcd2" +dependencies = [ + "rmp-serde", + "serde", +] + +[[package]] +name = "wapc-pool" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26899b966cf72ac7cc45845c3913a2cb8a3d70323ff45dcbe4e3c226a2b3e152" +dependencies = [ + "crossbeam", + "log", + "rusty_pool", + "thiserror", + "tokio 1.22.0", + "wapc", +] + [[package]] name = "wasi" version = "0.10.0+wasi-snapshot-preview1" @@ -5567,6 +5692,49 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi-cap-std-sync" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecbeebb8985a5423f36f976b2f4a0b3c6ce38d7d9a7247e1ce07aa2880e4f29b" +dependencies = [ + "anyhow", + "async-trait", + "cap-fs-ext", + "cap-rand", + "cap-std", + "cap-time-ext", + "fs-set-times", + "io-extras", + "io-lifetimes 0.7.5", + "is-terminal", + "once_cell", + "rustix 0.35.13", + "system-interface", + "tracing", + "wasi-common", + "windows-sys 0.36.1", +] + +[[package]] +name = "wasi-common" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81e2171f3783fe6600ee24ff6c58ca1b329c55e458cc1622ecc1fd0427648607" +dependencies = [ + "anyhow", + "bitflags", + "cap-rand", + "cap-std", + "io-extras", + "rustix 0.35.13", + "thiserror", + "tracing", + "wasmtime", + "wiggle", + "windows-sys 0.36.1", +] + [[package]] name = "wasm-bindgen" version = "0.2.83" @@ -5654,281 +5822,252 @@ dependencies = [ ] [[package]] -name = "wasmer" -version = "3.0.2" +name = "wasmparser" +version = "0.93.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4927f95d9f17b9a3b123c99ca9d9d45952a7df1b97826545212d9517e1c54ec3" +checksum = "c5a4460aa3e271fa180b6a5d003e728f3963fb30e3ba0fa7c9634caa06049328" dependencies = [ - "bytes 1.3.0", + "indexmap", +] + +[[package]] +name = "wasmtime" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d18265705b1c49218776577d9f301d79ab06888c7f4a32e2ed24e68a55738ce7" +dependencies = [ + "anyhow", + "async-trait", + "bincode", "cfg-if 1.0.0", "indexmap", - "js-sys", - "more-asserts", + "libc", + "log", + "object", + "once_cell", + "paste", + "psm", + "rayon", "serde", - "serde-wasm-bindgen", "target-lexicon", - "thiserror", - "wasm-bindgen", - "wasmer-compiler", - "wasmer-compiler-cranelift", - "wasmer-derive", - "wasmer-types", - "wasmer-vm", - "wat", - "winapi 0.3.9", -] - -[[package]] -name = "wasmer-compiler" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50749ff89787ebce029e83b77cfb1585c1eb67ff7cb34aaa7ba64ebeb2b474f2" -dependencies = [ - "backtrace", - "cfg-if 1.0.0", - "enum-iterator", - "enumset", - "lazy_static", - "leb128", - "memmap2", - "more-asserts", - "region", - "rustc-demangle", - "smallvec", - "thiserror", - "wasmer-types", - "wasmer-vm", "wasmparser", - "winapi 0.3.9", + "wasmtime-cache", + "wasmtime-cranelift", + "wasmtime-environ", + "wasmtime-fiber", + "wasmtime-jit", + "wasmtime-runtime", + "wat", + "windows-sys 0.36.1", ] [[package]] -name = "wasmer-compiler-cranelift" -version = "3.0.2" +name = "wasmtime-asm-macros" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "009219b2cb6e5e7f398249d16293940a21f16536f3831ce1a140e503ccab76e5" +checksum = "a201583f6c79b96e74dcce748fa44fb2958f474ef13c93f880ea4d3bed31ae4f" dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "wasmtime-cache" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f37efc6945b08fcb634cffafc438dd299bac55a27c836954656c634d3e63c31" +dependencies = [ + "anyhow", + "base64", + "bincode", + "directories-next", + "file-per-thread-logger", + "log", + "rustix 0.35.13", + "serde", + "sha2", + "toml", + "windows-sys 0.36.1", + "zstd", +] + +[[package]] +name = "wasmtime-cranelift" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe208297e045ea0ee6702be88772ea40f918d55fbd4163981a4699aff034b634" +dependencies = [ + "anyhow", "cranelift-codegen", "cranelift-entity", "cranelift-frontend", + "cranelift-native", + "cranelift-wasm", "gimli", - "more-asserts", - "rayon", - "smallvec", + "log", + "object", "target-lexicon", - "tracing", - "wasmer-compiler", - "wasmer-types", + "thiserror", + "wasmparser", + "wasmtime-environ", ] [[package]] -name = "wasmer-derive" -version = "3.0.2" +name = "wasmtime-environ" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d19406a021b637c2d46d202a96f15d7d27b2762af7aeeb2ebcb5896b329ab313" +checksum = "754b97f7441ac780a7fa738db5b9c23c1b70ef4abccd8ad205ada5669d196ba2" dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "wasmer-types" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bfa18d5568dec7df1bc92023bee9adcb135a2d59288e080788add89705262b4" -dependencies = [ - "enum-iterator", - "enumset", + "anyhow", + "cranelift-entity", + "gimli", "indexmap", - "more-asserts", - "rkyv", + "log", + "object", + "serde", "target-lexicon", "thiserror", + "wasmparser", + "wasmtime-types", ] [[package]] -name = "wasmer-vbus" -version = "3.0.2" +name = "wasmtime-fiber" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c49a4f8e2ff517eb63a9e04329e16f79a6f1281d438c788229bb046076622346" +checksum = "e5f54abc960b4a055ba16b942cbbd1da641e0ad44cc97a7608f3d43c069b120e" dependencies = [ - "thiserror", - "wasmer-vfs", -] - -[[package]] -name = "wasmer-vfs" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03215f8640183464fb824a6a64fb467db8e189ef22f5ffe744533c073ce7b425" -dependencies = [ - "libc", - "thiserror", - "tracing", -] - -[[package]] -name = "wasmer-vm" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2ab5dbf2886cf842f1edfde10d8cbeb687fe2f27a5f7b23b5058bed1696441" -dependencies = [ - "backtrace", "cc", "cfg-if 1.0.0", - "corosensei", - "enum-iterator", - "indexmap", - "lazy_static", - "libc", - "mach", - "memoffset 0.6.5", - "more-asserts", - "region", - "scopeguard", - "thiserror", - "wasmer-types", - "winapi 0.3.9", + "rustix 0.35.13", + "wasmtime-asm-macros", + "windows-sys 0.36.1", ] [[package]] -name = "wasmer-vnet" -version = "3.0.2" +name = "wasmtime-jit" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "988238083832d04de32e9c06d1ba548f9e45558d50a70ec45dae7ee1741a6f0c" +checksum = "32800cb6e29faabab7056593f70a4c00c65c75c365aaf05406933f2169d0c22f" dependencies = [ - "bytes 1.3.0", - "thiserror", - "wasmer-vfs", -] - -[[package]] -name = "wasmer-wasi" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd64af37eaa01ff9c14df0da7d5b22cbd9b013ceffb5afd02136d0d6b78b0bcd" -dependencies = [ - "bytes 1.3.0", + "addr2line", + "anyhow", + "bincode", "cfg-if 1.0.0", - "derivative", - "generational-arena", - "getrandom", - "libc", + "cpp_demangle", + "gimli", + "ittapi", + "log", + "object", + "rustc-demangle", + "serde", + "target-lexicon", "thiserror", - "tracing", - "wasm-bindgen", - "wasmer", - "wasmer-vbus", - "wasmer-vfs", - "wasmer-vnet", - "wasmer-wasi-local-networking", - "wasmer-wasi-types", - "winapi 0.3.9", + "wasmtime-environ", + "wasmtime-jit-debug", + "wasmtime-jit-icache-coherence", + "wasmtime-runtime", + "windows-sys 0.36.1", ] [[package]] -name = "wasmer-wasi-local-networking" -version = "3.0.2" +name = "wasmtime-jit-debug" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db3cf40684789eec48efc28ede87bd284e43a298a3080653f3f78e2f5df7f28" +checksum = "fe057012a0ba6cee3685af1e923d6e0a6cb9baf15fb3ffa4be3d7f712c7dec42" dependencies = [ - "bytes 1.3.0", - "tracing", - "wasmer-vfs", - "wasmer-vnet", + "object", + "once_cell", + "rustix 0.35.13", ] [[package]] -name = "wasmer-wasi-types" -version = "3.0.2" +name = "wasmtime-jit-icache-coherence" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6299be55d7fb5e998b3e765d4918ae6741b87c8645788a5ed246895aecc4d2ce" +checksum = "e6bbabb309c06cc238ee91b1455b748c45f0bdcab0dda2c2db85b0a1e69fcb66" dependencies = [ - "byteorder", - "time 0.2.27", - "wasmer", - "wasmer-derive", - "wasmer-types", - "wasmer-wit-bindgen-gen-core", - "wasmer-wit-bindgen-gen-rust-wasm", - "wasmer-wit-bindgen-rust", - "wasmer-wit-parser", + "cfg-if 1.0.0", + "libc", + "windows-sys 0.36.1", ] [[package]] -name = "wasmer-wit-bindgen-gen-core" -version = "0.1.1" +name = "wasmtime-provider" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff8aa5be5ae5d61f5e151dc2c0e603093fe28395d2083b65ef7a3547844054fe" +checksum = "ac199721b8f4ae37677715b7a75567689144c97362199196ea105af708c81f57" dependencies = [ "anyhow", - "wasmer-wit-parser", + "cfg-if 1.0.0", + "log", + "parking_lot 0.11.2", + "thiserror", + "wapc", + "wasi-cap-std-sync", + "wasi-common", + "wasmtime", + "wasmtime-wasi", ] [[package]] -name = "wasmer-wit-bindgen-gen-rust" -version = "0.1.1" +name = "wasmtime-runtime" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "438bce7c4589842bf100cc9b312443a9b5fc6440e58ab0b8c114e460219c3c3b" -dependencies = [ - "heck 0.3.3", - "wasmer-wit-bindgen-gen-core", -] - -[[package]] -name = "wasmer-wit-bindgen-gen-rust-wasm" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "505f5168cfee591840e13e158a5c5e2f95d6df1df710839021564f36bee7bafc" -dependencies = [ - "heck 0.3.3", - "wasmer-wit-bindgen-gen-core", - "wasmer-wit-bindgen-gen-rust", -] - -[[package]] -name = "wasmer-wit-bindgen-rust" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "968747f1271f74aab9b70d9c5d4921db9bd13b4ec3ba5506506e6e7dc58c918c" -dependencies = [ - "async-trait", - "bitflags", - "wasmer-wit-bindgen-rust-impl", -] - -[[package]] -name = "wasmer-wit-bindgen-rust-impl" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd26fe00d08bd2119870b017d13413dfbd51e7750b6634d649fc7a7bbc057b85" -dependencies = [ - "proc-macro2", - "syn", - "wasmer-wit-bindgen-gen-core", - "wasmer-wit-bindgen-gen-rust-wasm", -] - -[[package]] -name = "wasmer-wit-parser" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46c9a15086be8a2eb3790613902b9d3a9a687833b17cd021de263a20378585a" +checksum = "09a23b6e138e89594c0189162e524a29e217aec8f9a4e1959a34f74c64e8d17d" dependencies = [ "anyhow", - "id-arena", - "pulldown-cmark", - "unicode-normalization", - "unicode-xid", + "cc", + "cfg-if 1.0.0", + "indexmap", + "libc", + "log", + "mach", + "memfd", + "memoffset 0.6.5", + "paste", + "rand 0.8.5", + "rustix 0.35.13", + "thiserror", + "wasmtime-asm-macros", + "wasmtime-environ", + "wasmtime-fiber", + "wasmtime-jit-debug", + "windows-sys 0.36.1", ] [[package]] -name = "wasmparser" -version = "0.83.0" +name = "wasmtime-types" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" +checksum = "68ec7615fde8c79737f1345d81f0b18da83b3db929a87b4604f27c932246d1e2" +dependencies = [ + "cranelift-entity", + "serde", + "thiserror", + "wasmparser", +] + +[[package]] +name = "wasmtime-wasi" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca539adf155dca1407aa3656e5661bf2364b1f3ebabc7f0a8bd62629d876acfa" +dependencies = [ + "anyhow", + "wasi-cap-std-sync", + "wasi-common", + "wasmtime", + "wiggle", +] + +[[package]] +name = "wast" +version = "35.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ef140f1b49946586078353a453a1d28ba90adfc54dde75710bc1931de204d68" +dependencies = [ + "leb128", +] [[package]] name = "wast" @@ -5948,7 +6087,7 @@ version = "1.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "584aaf7a1ecf4d383bbe1a25eeab0cbb8ff96acc6796707ff65cde48f4632f15" dependencies = [ - "wast", + "wast 50.0.0", ] [[package]] @@ -6032,6 +6171,48 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wiggle" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2da09ca5b8bb9278a2123e8c36342166b9aaa55a0dbab18b231f46d6f6ab85bc" +dependencies = [ + "anyhow", + "async-trait", + "bitflags", + "thiserror", + "tracing", + "wasmtime", + "wiggle-macro", +] + +[[package]] +name = "wiggle-generate" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5796f53b429df7d44cfdaae8f6d9cd981d82aec3516561352ca9c5e73ee185" +dependencies = [ + "anyhow", + "heck 0.4.0", + "proc-macro2", + "quote", + "shellexpand", + "syn", + "witx", +] + +[[package]] +name = "wiggle-macro" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b830eb7203d48942fb8bc8bb105f76e7d09c33a082d638e990e02143bb2facd" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wiggle-generate", +] + [[package]] name = "winapi" version = "0.2.8" @@ -6075,19 +6256,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43dbb096663629518eb1dfa72d80243ca5a6aca764cae62a2df70af760a9be75" -dependencies = [ - "windows_aarch64_msvc 0.33.0", - "windows_i686_gnu 0.33.0", - "windows_i686_msvc 0.33.0", - "windows_x86_64_gnu 0.33.0", - "windows_x86_64_msvc 0.33.0", -] - [[package]] name = "windows-sys" version = "0.36.1" @@ -6122,12 +6290,6 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" -[[package]] -name = "windows_aarch64_msvc" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd761fd3eb9ab8cc1ed81e56e567f02dd82c4c837e48ac3b2181b9ffc5060807" - [[package]] name = "windows_aarch64_msvc" version = "0.36.1" @@ -6140,12 +6302,6 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" -[[package]] -name = "windows_i686_gnu" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab0cf703a96bab2dc0c02c0fa748491294bf9b7feb27e1f4f96340f208ada0e" - [[package]] name = "windows_i686_gnu" version = "0.36.1" @@ -6158,12 +6314,6 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" -[[package]] -name = "windows_i686_msvc" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfdbe89cc9ad7ce618ba34abc34bbb6c36d99e96cae2245b7943cd75ee773d0" - [[package]] name = "windows_i686_msvc" version = "0.36.1" @@ -6176,12 +6326,6 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" -[[package]] -name = "windows_x86_64_gnu" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4dd9b0c0e9ece7bb22e84d70d01b71c6d6248b81a3c60d11869451b4cb24784" - [[package]] name = "windows_x86_64_gnu" version = "0.36.1" @@ -6200,12 +6344,6 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" -[[package]] -name = "windows_x86_64_msvc" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1e4aa646495048ec7f3ffddc411e1d829c026a2ec62b39da15c1055e406eaa" - [[package]] name = "windows_x86_64_msvc" version = "0.36.1" @@ -6236,6 +6374,29 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "winx" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7b01e010390eb263a4518c8cebf86cb67469d1511c00b749a47b64c39e8054d" +dependencies = [ + "bitflags", + "io-lifetimes 0.7.5", + "windows-sys 0.36.1", +] + +[[package]] +name = "witx" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e366f27a5cabcddb2706a78296a40b8fcc451e1a6aba2fc1d94b4a01bdaaef4b" +dependencies = [ + "anyhow", + "log", + "thiserror", + "wast 35.0.2", +] + [[package]] name = "ws2_32-sys" version = "0.2.1" diff --git a/Cargo.toml b/Cargo.toml index 8fa45b5..40ea4ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,6 +19,7 @@ members = [ "crates/fs_manager", "crates/lang_provider", "crates/payment_adapter", +# "crates/payment_adapter_pay_u", # artifacts # "crates/db-seed", # "crates/api", diff --git a/crates/config/Cargo.toml b/crates/config/Cargo.toml index e0d438d..d04c8f2 100644 --- a/crates/config/Cargo.toml +++ b/crates/config/Cargo.toml @@ -16,4 +16,3 @@ serde = { version = "1.0", features = ["derive"] } serde_json = { version = "1.0", features = [] } thiserror = { version = "1.0" } toml = { version = "0.5", features = [] } -tracing = { version = "0.1.34" } diff --git a/crates/config/src/lib.rs b/crates/config/src/lib.rs index f59ac48..a1d679a 100644 --- a/crates/config/src/lib.rs +++ b/crates/config/src/lib.rs @@ -776,8 +776,7 @@ pub fn load(config_path: &str, opts: &impl UpdateConfig) -> SharedAppConfig { std::process::exit(1); } Err(e) => { - tracing::error!("{e:?}"); - panic!("Config file was not found at path {config_path:?}") + panic!("Config file was not found at path {config_path:?}. {}", e) } } } diff --git a/crates/model/Cargo.toml b/crates/model/Cargo.toml index 7987189..709747a 100644 --- a/crates/model/Cargo.toml +++ b/crates/model/Cargo.toml @@ -28,6 +28,6 @@ serde = { version = "1.0.137" } sqlx = { version = "0.6.2", features = ["migrate", "runtime-actix-rustls", "all-types", "postgres"], optional = true } sqlx-core = { version = "0.6.2", features = [], optional = true } thiserror = { version = "1.0.31" } -tracing = { version = "0.1.34" } uuid = { version = "1.2.1", features = ["serde"] } validator = { version = "0.16.0" } +#tracing = { version = "0.1.34" } diff --git a/crates/model/src/encrypt.rs b/crates/model/src/encrypt.rs index cec51a8..05e3b08 100644 --- a/crates/model/src/encrypt.rs +++ b/crates/model/src/encrypt.rs @@ -9,7 +9,7 @@ pub trait Encrypt { impl Encrypt for crate::Password { fn encrypt(&self, salt: &SaltString) -> password_hash::Result { - tracing::debug!("Hashing password {:?}", self); + // tracing::debug!("Hashing password {:?}", self); Ok( Argon2::new(Algorithm::Argon2id, Version::V0x13, Params::default()) .hash_password(self.as_bytes(), &salt)? @@ -18,7 +18,7 @@ impl Encrypt for crate::Password { } fn validate(&self, pass_hash: &crate::PassHash) -> password_hash::Result<()> { - tracing::debug!("Validating password {:?} {:?}", self, pass_hash); + // tracing::debug!("Validating password {:?} {:?}", self, pass_hash); Argon2::default().verify_password( self.as_bytes(), diff --git a/crates/payment_adapter/Cargo.toml b/crates/payment_adapter/Cargo.toml index 703987e..6005a8d 100644 --- a/crates/payment_adapter/Cargo.toml +++ b/crates/payment_adapter/Cargo.toml @@ -6,3 +6,8 @@ edition = "2021" [dependencies] config = { path = "../config", default-features = false, features = [] } model = { path = "../model" } +serde = { version = "1.0.149", features = ['derive'] } +uuid = { version = "1.2.2", features = ['v4'] } +futures = { version = "0.3.25" } +tracing = { version = "0.1.37" } +thiserror = { version = "1.0.37" } diff --git a/crates/payment_adapter/src/lib.rs b/crates/payment_adapter/src/lib.rs index 801b3a6..440743a 100644 --- a/crates/payment_adapter/src/lib.rs +++ b/crates/payment_adapter/src/lib.rs @@ -1,18 +1,24 @@ -use std::collections::HashMap; - pub use config::PaymentProviderConfig; pub use model::*; +pub use uuid; pub const CONFIG_POS: u32 = 3; -#[derive(Debug)] +#[derive(Debug, Clone, Copy, thiserror::Error, serde::Serialize, serde::Deserialize)] +#[repr(C)] +pub enum Error { + #[error("Malformed create payment message")] + MalformedCreatePayment, +} + +#[derive(Debug, Clone, Copy, serde::Serialize, serde::Deserialize)] #[repr(C)] pub enum Status { Success = 0, Failure = 1, } -#[derive(Debug)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] #[repr(C)] pub struct Buyer { /// Required customer e-mail @@ -27,17 +33,25 @@ pub struct Buyer { pub language: String, } -#[derive(Debug)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] #[repr(C)] pub struct Product { - pub id: ProductId, + pub id: i32, pub name: String, - pub unit_price: Price, - pub quantity_unit: QuantityUnit, - pub quantity: Quantity, + pub unit_price: i32, + pub quantity_unit: String, + pub quantity: i32, } -#[derive(Debug)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] +#[repr(C)] +pub struct Item { + pub product_id: i32, + pub quantity: i32, + pub quantity_unit: String, +} + +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] #[repr(C)] pub struct CreatePayment { // pub client: PayUClient, @@ -46,16 +60,46 @@ pub struct CreatePayment { pub currency: String, pub description: String, pub cart_products: Vec, - pub items: HashMap, + pub items: Vec, pub order_ext_id: String, pub notify_uri: String, pub continue_uri: String, } -pub trait PaymentAdapter { - fn name() -> &'static str; - - fn init(&mut self, config: PaymentProviderConfig); - - fn create_payment(&self, msg: CreatePayment) -> Status; -} +// #[tarpc::service] +// pub trait PaymentAdapter { +// async fn create_payment(msg: CreatePayment) -> Status; +// } +// +// pub async fn start_server(name: &str, port: u16, build: +// Build) where +// Server: Serve + Send + 'static + Clone, +// Build: Fn() -> Server, +// >::Fut: Send, +// >::Resp: serde::Serialize + Send + 'static, +// Req: Send + 'static, +// Req: for<'l> serde::Deserialize<'l>, +// { +// let server_addr = (IpAddr::V4(Ipv4Addr::LOCALHOST), port); +// +// let mut listener = tarpc::serde_transport::tcp::listen(&server_addr, +// Bincode::default) .await +// .unwrap(); +// tracing::info!("Starting {} rpc at {}", name, listener.local_addr()); +// listener.config_mut().max_frame_length(usize::MAX); +// listener +// // Ignore accept errors. +// .filter_map(|r| futures::future::ready(r.ok())) +// .map(server::BaseChannel::with_defaults) +// // Limit channels to 8 per IP. +// .max_channels_per_key(8, |t| t.transport().peer_addr().unwrap().ip()) +// .max_concurrent_requests_per_channel(20) +// // serve is generated by the service attribute. It takes as input any +// type implementing // the generated World trait. +// .map(|channel| channel.execute(build())) +// // Max 10 channels. +// .buffer_unordered(10) +// .for_each(|_| async {}) +// .await; +// tracing::info!("RPC channel closed"); +// } diff --git a/crates/payment_adapter_pay_u/Cargo.lock b/crates/payment_adapter_pay_u/Cargo.lock new file mode 100644 index 0000000..b5dd90c --- /dev/null +++ b/crates/payment_adapter_pay_u/Cargo.lock @@ -0,0 +1,1597 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aho-corasick" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +dependencies = [ + "memchr", +] + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "argon2" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db4ce4441f99dbd377ca8a8f57b698c44d0d6e712d8329b5040da5a64aa1ce73" +dependencies = [ + "base64ct", + "blake2", + "password-hash", + "rayon", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64ct" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b645a089122eccb6111b4f81cbc1a49f5900ac4666bb93ac027feaecf15607bf" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "blake2" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b12e5fd123190ce1c2e559308a94c9bacad77907d4c6005d9e58fe1a0689e55e" +dependencies = [ + "digest", +] + +[[package]] +name = "block-buffer" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" + +[[package]] +name = "cc" +version = "1.0.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-integer", + "num-traits", + "serde", + "time", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "config" +version = "0.1.0" +dependencies = [ + "parking_lot 0.12.1", + "password-hash", + "serde", + "serde_json", + "thiserror", + "toml", +] + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "crossbeam-channel" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cxx" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdf07d07d6531bfcdbe9b8b739b104610c6508dcc4d63b410585faf338241daf" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2eb5b96ecdc99f72657332953d4d9c50135af1bac34277801cc3937906ebd39" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac040a39517fd1674e0f32177648334b0f4074625b5588a64519804ba0553b12" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1362b0ddcfc4eb0a1f57b68bd77dd99f0e826958a96abd0ae9bd092e114ffed6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn", +] + +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "either" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" + +[[package]] +name = "encoding_rs" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" + +[[package]] +name = "futures-executor" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" + +[[package]] +name = "futures-macro" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" + +[[package]] +name = "futures-task" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" + +[[package]] +name = "futures-util" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "h2_wasi" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "756e9dfbaf90887b69ea8113ef9d04a9fec0ec4ac17b84a95006381f6f7966f9" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio-util_wasi", + "tokio_wasi", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "hyper_wasi" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b903a973bd98c326103ea94336a9ffe44c57c71517d6be7639438021053dc6e" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2_wasi", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "tokio_wasi", + "tower-service", + "tracing", + "want", + "wasmedge_wasi_socket", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ipnet" +version = "2.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f88c5561171189e69df9d98bcf18fd5f9558300f7ea7b801eb8a0fd748bd8745" + +[[package]] +name = "itoa" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" + +[[package]] +name = "js-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.138" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" + +[[package]] +name = "link-cplusplus" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" +dependencies = [ + "cc", +] + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "matches" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + +[[package]] +name = "mio_wasi" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e260e68b7a4187e52caf00a035aaf7166391c2c2529123fe8229d4d8f86e15a2" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasmedge_wasi_socket", + "windows-sys 0.36.1", +] + +[[package]] +name = "model" +version = "0.1.0" +dependencies = [ + "argon2", + "chrono", + "derive_more", + "password-hash", + "rand_core", + "serde", + "thiserror", + "uuid", + "validator", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.5", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.5", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys 0.42.0", +] + +[[package]] +name = "password-hash" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +dependencies = [ + "base64ct", + "rand_core", + "subtle", +] + +[[package]] +name = "paste" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" + +[[package]] +name = "pay_u" +version = "0.1.9" +dependencies = [ + "chrono", + "derive_more", + "log", + "reqwest_wasi", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "payment_adapter" +version = "0.1.0" +dependencies = [ + "config", + "futures", + "model", + "serde", + "thiserror", + "tracing", + "uuid", +] + +[[package]] +name = "payment_adapter_pay_u" +version = "0.1.0" +dependencies = [ + "bincode", + "pay_u", + "payment_adapter", + "tokio", + "wapc-codec", + "wapc-guest", +] + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "proc-macro2" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e060280438193c554f654141c9ea9417886713b7acd75974c85b18a69a88e0b" +dependencies = [ + "crossbeam-deque", + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cac410af5d00ab6884528b4ab69d1e8e146e8d471201800fa1b4524126de6ad3" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" + +[[package]] +name = "reqwest_wasi" +version = "0.11.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c1c0524070b75dc4a924bdaac56d5c874205497fb3132f09f3270e4efb188d" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2_wasi", + "http", + "http-body", + "hyper_wasi", + "ipnet", + "js-sys", + "lazy_static", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "tokio_wasi", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "rmp" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44519172358fd6d58656c86ab8e7fbc9e1490c3e8f14d35ed78ca0dd07403c9f" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5b13be192e0220b8afb7222aa5813cb62cc269ebb5cac346ca6487681d2913e" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "ryu" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "scratch" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" + +[[package]] +name = "semver" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" + +[[package]] +name = "serde" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "256b9932320c590e707b94576e3cc1f7c9024d0ee6612dfbcf1cb106cbe8e055" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4eae9b04cbffdfd550eb462ed33bc6a1b68c935127d008b27444d08380f94e4" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "socket2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46" +dependencies = [ + "autocfg", + "pin-project-lite", + "windows-sys 0.42.0", +] + +[[package]] +name = "tokio-util_wasi" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4e7e921c33dc681c0b01aa4c5aa1bf619f46a7040a1565ddb1f84bc4666c1bd" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio_wasi", + "tracing", +] + +[[package]] +name = "tokio_wasi" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68e9a04f238fa1676caa7c897bf1dbe7a82269b675aca14176a028af7a2167d2" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio_wasi", + "num_cpus", + "pin-project-lite", + "socket2", + "wasmedge_wasi_socket", + "winapi", +] + +[[package]] +name = "toml" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +dependencies = [ + "serde", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" + +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + +[[package]] +name = "unicode-bidi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + +[[package]] +name = "unicode-ident" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna 0.3.0", + "percent-encoding", +] + +[[package]] +name = "uuid" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "422ee0de9031b5b948b97a8fc04e3aa35230001a722ddd27943e0be31564ce4c" +dependencies = [ + "getrandom", + "serde", +] + +[[package]] +name = "validator" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32ad5bf234c7d3ad1042e5252b7eddb2c4669ee23f32c7dd0e9b7705f07ef591" +dependencies = [ + "idna 0.2.3", + "lazy_static", + "regex", + "serde", + "serde_derive", + "serde_json", + "url", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + +[[package]] +name = "wapc-codec" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "547c5bc15ef114be946d56ce368ff990d91b22603ac09cc0c0d476213289fcd2" +dependencies = [ + "rmp-serde", + "serde", +] + +[[package]] +name = "wapc-guest" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d55cfd1e7647db9da8b283424bb2b24aa9c470dbe18991d0126f83aa085851" +dependencies = [ + "once_cell", + "parking_lot 0.11.2", +] + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" + +[[package]] +name = "wasmedge_wasi_socket" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fc4e93009d7e2c2e3d29b65d1f56ef606466673e85fe417808beca50cb608bf" +dependencies = [ + "libc", +] + +[[package]] +name = "web-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] diff --git a/crates/payment_adapter_pay_u/Cargo.toml b/crates/payment_adapter_pay_u/Cargo.toml index dee9def..4aaba58 100644 --- a/crates/payment_adapter_pay_u/Cargo.toml +++ b/crates/payment_adapter_pay_u/Cargo.toml @@ -9,9 +9,7 @@ crate-type = ['cdylib'] [dependencies] pay_u = { path = "../../vendor/pay_u" } payment_adapter = { path = "../payment_adapter" } -#wasmer-wasi = { version = "3.0.2" } -wasmer = { version = "3.0.2", default-features = false, features = ['js', 'std', 'wasmer-compiler-llvm', 'enable-serde'] } -#wasm-bindgen = { version = "0.2.83", features = [] } -#js-sys = { version = "0.3.60", features = [] } -#web-sys = { version = "0.3.60", features = [] } -wee_alloc = { version = "0.4.5" } +bincode = { version = "1.3.3" } +wapc-codec = { version = "1.0.0" } +wapc-guest = { version = "1.0.0" } +tokio = { version="1.21.1", features=["rt","sync","time"] } diff --git a/crates/payment_adapter_pay_u/src/lib.rs b/crates/payment_adapter_pay_u/src/lib.rs index 153e06f..84ae6c0 100644 --- a/crates/payment_adapter_pay_u/src/lib.rs +++ b/crates/payment_adapter_pay_u/src/lib.rs @@ -1,20 +1,78 @@ -use std::os::wasi::prelude::*; +use std::sync::{Arc, Mutex}; -use payment_adapter::{CreatePayment, Status}; -// use wasm_bindgen::prelude::*; +use pay_u::{ClientId, ClientSecret, MerchantPosId}; +use payment_adapter::{CreatePayment, PaymentProviderConfig, Status}; +use wapc_codec::messagepack::*; +use wapc_guest as wapc; -#[global_allocator] -static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; - -// #[wasm_bindgen] -#[no_mangle] -pub extern "C" fn name() -> String { - "pay_u".into() +struct PayU { + client: Arc>, } -// #[wasm_bindgen] -#[no_mangle] -pub extern "C" fn create_payment(msg: *const CreatePayment) -> i32 { - eprintln!("{:?}", msg); - Status::Failure as i32 +static mut CLIENT: Option = None; +static mut RUNTIME: Option = None; + +impl PayU { + fn mount() { + wapc::register_function("init", Self::init); + wapc::register_function("create_payment", Self::create_payment); + } + + fn init(msg: &[u8]) -> wapc::CallResult { + let runtime = tokio::runtime::Builder::new_current_thread() + .enable_all() + .enable_time() + .build() + .unwrap(); + unsafe { + RUNTIME = Some(runtime); + } + + let config: PaymentProviderConfig = match deserialize(msg) { + Ok(c) => c, + _ => return Err(Box::new(payment_adapter::Error::MalformedCreatePayment)), + }; + let res_client = Arc::new(Mutex::new({ + pay_u::Client::new( + ClientId::new(config.client_id.unwrap()), + ClientSecret::new(config.client_secret.unwrap()), + MerchantPosId::new(config.merchant_id.unwrap().parse().unwrap()), + ) + })); + + let c = res_client.clone(); + unsafe { RUNTIME.as_ref().unwrap() }.block_on(async { + c.lock().unwrap().authorize().await.unwrap_or_else(|e| { + // tracing::error!("{e}"); + dbg!(e); + std::process::exit(1); + }); + }); + + unsafe { + CLIENT = Some(Self { client: res_client }); + } + + Ok(vec![]) + } + + fn create_payment(msg: &[u8]) -> wapc::CallResult { + let client = unsafe { CLIENT.as_ref().unwrap() }; + let c: CreatePayment = match deserialize(msg) { + Ok(c) => c, + _ => return Err(Box::new(payment_adapter::Error::MalformedCreatePayment)), + }; + wapc::console_log(&format!( + "IN_WASM: Received request for `ping` operation with payload : {:?}", + c + )); + eprintln!("{:?}", c); + // let _res = wapc::host_call("binding", "sample:namespace", "pong", msg)?; + Ok(serialize(Status::Success).unwrap()) + } +} + +#[no_mangle] +pub fn wapc_init() { + PayU::mount(); } diff --git a/crates/payment_manager/Cargo.toml b/crates/payment_manager/Cargo.toml index 3880623..9be79c7 100644 --- a/crates/payment_manager/Cargo.toml +++ b/crates/payment_manager/Cargo.toml @@ -15,8 +15,6 @@ db-utils = { path = "../db-utils" } gumdrop = { version = "0.8.1", features = [] } llvmenv = { version = "0.3.2" } model = { path = "../model", features = ["db"] } -openssl-src = { version = "111" } -openssl-sys = { version = "0.9", features = ['openssl-src'] } opentelemetry = { version = "0.17.0" } opentelemetry-jaeger = { version = "0.17.0" } payment_adapter = { path = "../payment_adapter" } @@ -30,9 +28,12 @@ tokio = { version = "1.21.2", features = ['full'] } tracing = { version = "0.1.6" } tracing-opentelemetry = { version = "0.17.4" } tracing-subscriber = { version = "0.3.16", features = ["env-filter"] } -uuid = { version = "1.2.1", features = ["serde"] } -wasmer = { version = "3", default-features = false, features = ['sys-default', 'wasmer-compiler-cranelift'] } -wasmer-wasi = { version = "3.0.2", default-features = false, features = ['host-fs', 'host-vnet'] } +uuid = { version = "1.2.1", features = ["serde", "v4"] } +bincode = { version = "1.3.3" } +wapc = { version = "1.0.0", features = [] } +wapc-codec = { version = "1.0.0" } +wapc-pool = { version = "1.0.0" } +wasmtime-provider = { version = "1.3.2", features = [] } [dev-dependencies] fake = { version = "2.5.0" } diff --git a/crates/payment_manager/src/main.rs b/crates/payment_manager/src/main.rs index 63ab942..1114ecc 100644 --- a/crates/payment_manager/src/main.rs +++ b/crates/payment_manager/src/main.rs @@ -2,6 +2,7 @@ use std::fs::read_dir; use std::path::PathBuf; use config::{AppConfig, UpdateConfig}; +use wapc_pool::HostPoolBuilder; // use payment_adapter::{CreatePayment, PaymentAdapter, Status}; // mod actions; @@ -30,18 +31,7 @@ async fn main() { let opts: Opts = gumdrop::parse_args_default_or_exit(); let config = config::default_load(&opts); - let payment_config = { config.lock().payment().clone() }; - - use wasmer::{Instance, Module, Store, Value}; - let imports = wasmer::imports! { - // "" => { "name" => name, "create_payment" => create_payment, } - }; - let mut store = wasmer::Store::default(); - // store.add_fuel(u64::MAX).unwrap(); - // store.data_mut().table().insert_at( - // payment_adapter::CONFIG_POS, - // Box::new(payment_config.clone()), - // ); + let _payment_config = config.lock().payment().clone(); { let adapters_path = config.lock().payment().adapters_path.clone(); @@ -57,16 +47,24 @@ async fn main() { if file.extension().and_then(|s| s.to_str()) != Some("wasm") { continue; } - // let module = wasmtime::Module::from_file(&engine, file).unwrap(); - // let instance = linker.instantiate(&mut store, &module).unwrap(); - // // let config = wasmtime::ExternRef::new(payment_config.clone()); - // - // let f = instance - // .get_typed_func::, i32, _>(&mut store, - // "create_payment") .unwrap(); - let module = wasmer::Module::from_file(&store, file).unwrap(); - let instance = Instance::new(&mut store, &module, &imports).unwrap(); + let module = std::fs::read(&file).unwrap(); + let engine = wasmtime_provider::WasmtimeEngineProviderBuilder::new() + .module_bytes(&module) + .build() + .unwrap(); + + let pool = HostPoolBuilder::new() + .name("pool") + .factory(move || { + wapc::WapcHost::new( + Box::new(engine.clone()), + Some(Box::new(move |_a, _b, _c, _d, _e| Ok(vec![]))), + ) + .unwrap() + }) + .max_threads(5) + .build(); { let msg = payment_adapter::CreatePayment { @@ -87,26 +85,18 @@ async fn main() { continue_uri: "continue_uri".to_string(), }; - let create_payment = instance.exports.get_function("create_payment").unwrap(); - let ext = wasmer::ExternRef::new(&mut store, msg); - let result = create_payment.call(&mut store, &[Value::ExternRef(Some(ext))]); + let call_result = pool + .call( + "create_payment", + wapc_codec::messagepack::serialize(msg).unwrap(), + ) + .await + .unwrap(); + let result: payment_adapter::Status = + wapc_codec::messagepack::deserialize(&call_result).unwrap(); + eprintln!("create payment res {:?}", result) } - // let fnc = - // match instance.get_typed_func::<(), dyn PaymentAdapter, - // _>(&mut store, "adapter") { Err(e) => { - // tracing::error!("{}", e); - // continue; - // } - // Ok(fnc) => fnc, - // }; - // let adapter = match fnc.call(&mut store, ()) { - // Err(e) => { - // tracing::error!("{}", e); - // continue; - // } - // Ok(adapter) => adapter, - // }; } } diff --git a/scripts/build-adapters b/scripts/build-adapters new file mode 100755 index 0000000..44e32e4 --- /dev/null +++ b/scripts/build-adapters @@ -0,0 +1,12 @@ +#!/usr/bin/env zsh + +target=wasm32-wasi +#target=wasm32-unknown-unknown + +mkdir -p adapters +for d in $(ls crates | grep payment_adapter_); do +# echo $d + echo "cargo build --target ${target} -p ${d} --manifest-path ./crates/${d}/Cargo.toml" + cargo build --target-dir ./target --target ${target} -p ${d} --manifest-path ./crates/$d/Cargo.toml + cp ./target/${target}/debug/${d}.wasm ./adapters/ +done