diff --git a/Cargo.lock b/Cargo.lock index d34bed2..f411048 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,11 +2,46 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "account-sdk" +version = "0.1.0" +source = "git+https://github.com/cartridge-gg/controller?rev=53a3457#53a3457402b319319f93f833f1dcf151aef6a1cb" +dependencies = [ + "anyhow", + "async-trait", + "base64 0.21.7", + "cainome", + "cairo-lang-starknet", + "coset", + "ecdsa", + "futures", + "js-sys", + "lazy_static", + "p256", + "primitive-types", + "rand_core", + "serde", + "serde_json", + "sha2", + "starknet", + "starknet-crypto 0.6.2", + "thiserror", + "tokio", + "toml", + "u256-literal", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-bindgen-test", + "wasm-webauthn", + "web-sys", +] + [[package]] name = "addr2line" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -235,13 +270,13 @@ checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -252,14 +287,14 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "axum" @@ -312,9 +347,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", @@ -325,6 +360,12 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "base64" version = "0.13.1" @@ -333,9 +374,15 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.3" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64ct" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bigdecimal" @@ -381,9 +428,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "bitvec" @@ -408,9 +455,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byte-slice-cast" @@ -420,17 +467,80 @@ checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +dependencies = [ + "serde", +] + +[[package]] +name = "cainome" +version = "0.2.3" +source = "git+https://github.com/piniom/cainome?rev=beb1f1f5#beb1f1f57e0296b390d8afe549bb5870f41b02e9" dependencies = [ + "anyhow", + "async-trait", + "cainome-cairo-serde", + "cainome-parser", + "cainome-rs", + "camino", + "clap", + "clap_complete", + "convert_case 0.6.0", "serde", + "serde_json", + "starknet", + "thiserror", + "tracing", + "tracing-subscriber", + "url", +] + +[[package]] +name = "cainome-cairo-serde" +version = "0.1.0" +source = "git+https://github.com/piniom/cainome?rev=beb1f1f5#beb1f1f57e0296b390d8afe549bb5870f41b02e9" +dependencies = [ + "starknet", + "thiserror", +] + +[[package]] +name = "cainome-parser" +version = "0.1.0" +source = "git+https://github.com/piniom/cainome?rev=beb1f1f5#beb1f1f57e0296b390d8afe549bb5870f41b02e9" +dependencies = [ + "convert_case 0.6.0", + "quote", + "serde_json", + "starknet", + "syn 2.0.66", + "thiserror", +] + +[[package]] +name = "cainome-rs" +version = "0.1.0" +source = "git+https://github.com/piniom/cainome?rev=beb1f1f5#beb1f1f57e0296b390d8afe549bb5870f41b02e9" +dependencies = [ + "anyhow", + "cainome-cairo-serde", + "cainome-parser", + "camino", + "prettyplease", + "proc-macro2", + "quote", + "serde_json", + "starknet", + "syn 2.0.66", + "thiserror", ] [[package]] @@ -617,7 +727,7 @@ checksum = "0c90d812ec983c5a8e3173aca3fc55036b9739201c89f30271ee14a4c1189379" dependencies = [ "cairo-lang-debug", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -899,14 +1009,20 @@ dependencies = [ ] [[package]] -name = "cc" -version = "1.0.82" +name = "camino" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" +checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" dependencies = [ - "libc", + "serde", ] +[[package]] +name = "cc" +version = "1.0.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" + [[package]] name = "cesu8" version = "1.1.0" @@ -937,7 +1053,34 @@ dependencies = [ "num-traits 0.2.19", "serde", "wasm-bindgen", - "windows-targets 0.52.0", + "windows-targets 0.52.5", +] + +[[package]] +name = "ciborium" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" + +[[package]] +name = "ciborium-ll" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" +dependencies = [ + "ciborium-io", + "half", ] [[package]] @@ -969,7 +1112,16 @@ dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim", + "strsim 0.11.1", +] + +[[package]] +name = "clap_complete" +version = "4.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2020fa13af48afc65a9a87335bda648309ab3d154cd03c7ff95b378c7ed39c4" +dependencies = [ + "clap", ] [[package]] @@ -981,7 +1133,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -1021,14 +1173,24 @@ dependencies = [ [[package]] name = "combine" -version = "4.6.6" +version = "4.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" dependencies = [ "bytes", "memchr", ] +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + [[package]] name = "const-fnv1a-hash" version = "1.1.0" @@ -1048,6 +1210,12 @@ dependencies = [ "serde", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "const_format" version = "0.2.32" @@ -1085,9 +1253,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -1095,9 +1263,19 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "coset" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "ff8aad850c1f86daa47e812913051eb5a26c4d9fb4242a89178bf99b946e4e3c" +dependencies = [ + "ciborium", + "ciborium-io", +] [[package]] name = "cpufeatures" @@ -1155,6 +1333,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", + "rand_core", "subtle", "zeroize", ] @@ -1188,14 +1367,38 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core 0.14.4", + "darling_macro 0.14.4", +] + [[package]] name = "darling" version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.20.9", + "darling_macro 0.20.9", +] + +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.10.0", + "syn 1.0.109", ] [[package]] @@ -1208,8 +1411,19 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim", - "syn 2.0.48", + "strsim 0.11.1", + "syn 2.0.66", +] + +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core 0.14.4", + "quote", + "syn 1.0.109", ] [[package]] @@ -1218,9 +1432,20 @@ version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ - "darling_core", + "darling_core 0.20.9", "quote", - "syn 2.0.48", + "syn 2.0.66", +] + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", ] [[package]] @@ -1244,6 +1469,37 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_builder" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +dependencies = [ + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" +dependencies = [ + "derive_builder_core", + "syn 1.0.109", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -1264,6 +1520,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", + "const-oid", "crypto-common", "subtle", ] @@ -1310,17 +1567,62 @@ dependencies = [ "winapi", ] +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "dyn-clone" version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", + "spki", +] + [[package]] name = "either" -version = "1.9.0" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "pem-rfc7468", + "pkcs8", + "rand_core", + "sec1", + "subtle", + "zeroize", +] [[package]] name = "ena" @@ -1333,9 +1635,9 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -1361,9 +1663,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -1424,6 +1726,16 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed-hash" version = "0.8.0" @@ -1460,9 +1772,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -1473,53 +1785,90 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", + "futures-sink", ] [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ + "futures-channel", "futures-core", + "futures-io", "futures-macro", + "futures-sink", "futures-task", + "memchr", "pin-project-lite", "pin-utils", "slab", @@ -1544,7 +1893,7 @@ checksum = "553630feadf7b76442b0849fd25fdf89b860d933623aec9693fed19af0400c78" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -1555,13 +1904,14 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", @@ -1572,9 +1922,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "good_lp" @@ -1644,11 +1994,22 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + [[package]] name = "h2" -version = "0.3.21" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", @@ -1656,13 +2017,23 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.3", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", "tracing", ] +[[package]] +name = "half" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +dependencies = [ + "cfg-if", + "crunchy", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -1733,18 +2104,18 @@ dependencies = [ [[package]] name = "home" -version = "0.5.5" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "http" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -1753,9 +2124,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -1770,9 +2141,9 @@ checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "d0e7a4dd27b9476dc40cb050d3632d3bba3a70ddbff012285f7f8559a1e7e545" [[package]] name = "httpdate" @@ -1788,9 +2159,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" dependencies = [ "bytes", "futures-channel", @@ -1803,7 +2174,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.9", + "socket2", "tokio", "tower-service", "tracing", @@ -1812,9 +2183,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http", @@ -1847,6 +2218,124 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "id-arena" version = "2.2.1" @@ -1861,12 +2350,14 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.4.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "icu_normalizer", + "icu_properties", + "smallvec", + "utf8_iter", ] [[package]] @@ -1961,9 +2452,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" @@ -2002,9 +2493,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jni" @@ -2014,7 +2505,7 @@ checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" dependencies = [ "cesu8", "cfg-if", - "combine 4.6.6", + "combine 4.6.7", "jni-sys", "log", "thiserror", @@ -2030,9 +2521,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -2044,7 +2535,7 @@ source = "git+https://github.com/dojoengine/dojo?tag=v0.7.0-alpha.3#855da3112c87 dependencies = [ "alloy-primitives", "anyhow", - "base64 0.21.3", + "base64 0.21.7", "cairo-lang-sierra", "cairo-lang-starknet", "cairo-lang-starknet-classes", @@ -2111,14 +2602,14 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" dependencies = [ - "spin", + "spin 0.5.2", ] [[package]] name = "libc" -version = "0.2.153" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libm" @@ -2136,11 +2627,27 @@ dependencies = [ "libc", ] +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.5.0", + "libc", +] + [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" [[package]] name = "lock_api" @@ -2154,9 +2661,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "lru" @@ -2176,11 +2683,20 @@ dependencies = [ "libc", ] +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + [[package]] name = "matchit" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed1202b2a6f884ae56f04cff409ab315c5ce26b5e58d7412e484f01fd52f52ef" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" [[package]] name = "matrixmultiply" @@ -2230,18 +2746,18 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", @@ -2279,7 +2795,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", "cfg-if", "cfg_aliases", "libc", @@ -2295,6 +2811,16 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num-bigint" version = "0.4.5" @@ -2399,18 +2925,18 @@ dependencies = [ [[package]] name = "object" -version = "0.31.1" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oorandom" @@ -2424,6 +2950,24 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + [[package]] name = "parity-scale-codec" version = "3.6.12" @@ -2495,7 +3039,7 @@ dependencies = [ "libc", "redox_syscall 0.5.1", "smallvec", - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -2519,11 +3063,20 @@ dependencies = [ "digest", ] +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "petgraph" @@ -2552,29 +3105,29 @@ checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "pin-project-lite" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -2582,6 +3135,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -2600,6 +3163,25 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" +[[package]] +name = "prettyplease" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +dependencies = [ + "proc-macro2", + "syn 2.0.66", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + [[package]] name = "primitive-types" version = "0.12.2" @@ -2624,9 +3206,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" dependencies = [ "unicode-ident", ] @@ -2637,7 +3219,7 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", "num-traits 0.2.19", "rand", "rand_chacha", @@ -2647,9 +3229,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -2746,41 +3328,39 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", ] [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", - "redox_syscall 0.2.16", + "libredox", "thiserror", ] [[package]] name = "regex" -version = "1.9.4" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.7", - "regex-syntax 0.7.5", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] name = "regex-automata" -version = "0.3.7" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.7.5", + "regex-syntax 0.6.29", ] [[package]] @@ -2796,9 +3376,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" @@ -2814,11 +3394,11 @@ checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" [[package]] name = "reqwest" -version = "0.11.20" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ - "base64 0.21.3", + "base64 0.21.7", "bytes", "encoding_rs", "futures-core", @@ -2840,6 +3420,8 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", + "system-configuration", "tokio", "tokio-rustls", "tower-service", @@ -2863,17 +3445,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.16.20" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", + "getrandom", "libc", - "once_cell", - "spin", + "spin 0.9.8", "untrusted", - "web-sys", - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -2918,9 +3500,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -2945,11 +3527,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", @@ -2958,9 +3540,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.7" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring", @@ -2970,18 +3552,18 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.3", + "base64 0.21.7", ] [[package]] name = "rustls-webpki" -version = "0.101.6" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ "ring", "untrusted", @@ -2989,15 +3571,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "salsa" @@ -3068,9 +3650,15 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.48", + "syn 2.0.66", ] +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + [[package]] name = "scopeguard" version = "1.2.0" @@ -3091,14 +3679,28 @@ dependencies = [ [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ "ring", "untrusted", ] +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "1.0.23" @@ -3107,22 +3709,42 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.196" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] +[[package]] +name = "serde-wasm-bindgen" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3b143e2833c57ab9ad3ea280d21fd34e285a42837aeb0ee301f4f41890fa00e" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_bytes" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +dependencies = [ + "serde", +] + [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -3133,14 +3755,14 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "serde_json" -version = "1.0.105" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -3160,9 +3782,9 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.14" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" dependencies = [ "itoa", "serde", @@ -3211,10 +3833,10 @@ version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" dependencies = [ - "darling", + "darling 0.20.9", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -3238,6 +3860,15 @@ dependencies = [ "keccak", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + [[package]] name = "shellexpand" version = "3.1.0" @@ -3256,6 +3887,16 @@ dependencies = [ "libc", ] +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + [[package]] name = "siphasher" version = "0.3.11" @@ -3275,15 +3916,17 @@ dependencies = [ name = "slot" version = "0.7.5" dependencies = [ + "account-sdk", "anyhow", "axum", - "base64 0.21.3", + "base64 0.21.7", "chrono", "clap", "ctrlc", "dirs", "env_logger", "graphql_client", + "hyper", "katana-primitives", "log", "rand", @@ -3296,6 +3939,7 @@ dependencies = [ "thiserror", "tokio", "tower-http", + "tower-layer", "tracing", "url", "urlencoding", @@ -3319,29 +3963,35 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.9" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "winapi", + "windows-sys 0.52.0", ] [[package]] -name = "socket2" -version = "0.5.5" +name = "spin" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" -dependencies = [ - "libc", - "windows-sys 0.48.0", -] +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "spin" -version = "0.5.2" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] [[package]] name = "sprs" @@ -3354,6 +4004,12 @@ dependencies = [ "num-traits 0.1.43", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "starknet" version = "0.10.0" @@ -3405,7 +4061,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ed286d637e34fb8ae1cd2f9615120ec8ff38d1cffd311ed7fdd497cdd2bd01f" dependencies = [ - "base64 0.21.3", + "base64 0.21.7", "flate2", "hex", "serde", @@ -3465,7 +4121,7 @@ checksum = "bbc159a1934c7be9761c237333a57febe060ace2bc9e3b337a59a37af206d19f" dependencies = [ "starknet-curve 0.4.2", "starknet-ff", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -3508,7 +4164,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95d549d3078bdbe775d0deaa8ddb57a19942989ce7c1f2dfd60beeb322bb4945" dependencies = [ "starknet-core", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -3586,6 +4242,12 @@ dependencies = [ "precomputed-hash", ] +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strsim" version = "0.11.1" @@ -3627,7 +4289,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -3649,9 +4311,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -3664,6 +4326,38 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tap" version = "1.0.1" @@ -3704,22 +4398,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -3742,6 +4436,16 @@ dependencies = [ "thiserror-impl-no-std", ] +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + [[package]] name = "time" version = "0.3.36" @@ -3783,25 +4487,20 @@ dependencies = [ ] [[package]] -name = "tinyvec" -version = "1.6.0" +name = "tinystr" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" dependencies = [ - "tinyvec_macros", + "displaydoc", + "zerovec", ] -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - [[package]] name = "tokio" -version = "1.36.0" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", "bytes", @@ -3811,20 +4510,20 @@ dependencies = [ "parking_lot 0.12.3", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2", "tokio-macros", "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -3839,16 +4538,15 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] @@ -3918,7 +4616,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", "bytes", "futures-core", "futures-util", @@ -3928,6 +4626,7 @@ dependencies = [ "pin-project-lite", "tower-layer", "tower-service", + "tracing", ] [[package]] @@ -3944,11 +4643,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -3963,23 +4661,66 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "serde", + "serde_json", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", + "tracing-serde", ] [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" @@ -3987,6 +4728,16 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "u256-literal" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39a1ed842845c7cdbcf413a186dba1fb3cf8b13753c21e5572bf64aadec4778" +dependencies = [ + "primitive-types", + "syn 1.0.109", +] + [[package]] name = "uint" version = "0.9.5" @@ -4014,26 +4765,11 @@ dependencies = [ "thiserror", ] -[[package]] -name = "unicode-bidi" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" - [[package]] name = "unicode-ident" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" - -[[package]] -name = "unicode-normalization" -version = "0.1.22" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" -dependencies = [ - "tinyvec", -] +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-segmentation" @@ -4058,15 +4794,15 @@ dependencies = [ [[package]] name = "untrusted" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.4.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" dependencies = [ "form_urlencoded", "idna", @@ -4079,6 +4815,18 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -4140,34 +4888,36 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", + "serde", + "serde_json", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -4177,9 +4927,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4187,28 +4937,72 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + +[[package]] +name = "wasm-bindgen-test" +version = "0.3.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9bf62a58e0780af3e852044583deee40983e5886da43a271dd772379987667b" +dependencies = [ + "console_error_panic_hook", + "js-sys", + "scoped-tls", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-bindgen-test-macro", +] + +[[package]] +name = "wasm-bindgen-test-macro" +version = "0.3.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f89739351a2e03cb94beb799d47fb2cac01759b40ec441f7de39b00cbf7ef0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "wasm-webauthn" +version = "0.1.0" +source = "git+https://github.com/broody/wasm-webauthn?rev=972693fdeaa5dbcf7eee181c1e4aad5dfdb73a82#972693fdeaa5dbcf7eee181c1e4aad5dfdb73a82" +dependencies = [ + "ciborium", + "coset", + "derive_builder", + "js-sys", + "serde", + "serde-wasm-bindgen", + "serde_bytes", + "thiserror", + "tracing", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -4216,9 +5010,9 @@ dependencies = [ [[package]] name = "webbrowser" -version = "0.8.11" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2c79b77f525a2d670cb40619d7d9c673d09e0666f72c591ebd7861f84a87e57" +checksum = "db67ae75a9405634f5882791678772c94ff5f16a66535aae186e26aa0841fc8b" dependencies = [ "core-foundation", "home", @@ -4233,9 +5027,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.2" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "winapi" @@ -4255,11 +5049,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -4274,7 +5068,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -4292,7 +5086,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.2", + "windows-targets 0.48.5", ] [[package]] @@ -4301,7 +5095,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -4321,32 +5115,33 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1eeca1c172a285ee6c2c84c341ccea837e7c01b12fbb2d0fe3c9e550ce49ec8" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.2", - "windows_aarch64_msvc 0.48.2", - "windows_i686_gnu 0.48.2", - "windows_i686_msvc 0.48.2", - "windows_x86_64_gnu 0.48.2", - "windows_x86_64_gnullvm 0.48.2", - "windows_x86_64_msvc 0.48.2", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -4357,15 +5152,15 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b10d0c968ba7f6166195e13d593af609ec2e3d24f916f081690695cf5eaffb2f" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -4375,15 +5170,15 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "571d8d4e62f26d4932099a9efe89660e8bd5087775a2ab5cdd8b747b811f1058" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -4393,15 +5188,21 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2229ad223e178db5fbbc8bd8d3835e51e566b8474bfca58d2e6150c48bb723cd" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -4411,15 +5212,15 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "600956e2d840c194eedfc5d18f8242bc2e17c7775b6684488af3a9fff6fe3287" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -4429,15 +5230,15 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea99ff3f8b49fb7a8e0d305e5aec485bd068c2ba691b6e277d29eaeac945868a" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -4447,15 +5248,15 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1a05a1ece9a7a0d5a7ccf30ba2c33e3a61a30e042ffd247567d1de1d94120d" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -4465,15 +5266,15 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d419259aba16b663966e29e6d7c6ecfa0bb8425818bb96f6f1f3c3eb71a6e7b9" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" @@ -4503,6 +5304,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "wyz" version = "0.5.1" @@ -4527,6 +5340,30 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d422e8e38ec76e2f06ee439ccc765e9c6a9638b9e7c9f2e8255e4d41e8bd852" +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.34" @@ -4544,7 +5381,28 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", +] + +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "synstructure", ] [[package]] @@ -4564,5 +5422,27 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", +] + +[[package]] +name = "zerovec" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", ] diff --git a/Cargo.toml b/Cargo.toml index 24527c9..a355444 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,12 +4,13 @@ version = "0.7.5" edition = "2021" [dependencies] +account-sdk = { git = "https://github.com/cartridge-gg/controller", rev = "53a3457" } katana-primitives = { git = "https://github.com/dojoengine/dojo", tag = "v0.7.0-alpha.3" } anyhow = "1.0.75" axum = "0.6" base64 = "0.21.2" clap = { version = "4.2", features = ["derive"] } -chrono = "0.4.31" +chrono = "0.4.38" ctrlc = "3.4.1" dirs = "5" env_logger = "0.10" @@ -25,13 +26,15 @@ serde_json = "1" shellexpand = "3.1.0" thiserror = "1.0.32" tokio = { version = "1.18.2", features = ["full", "sync"] } -tower-http = "0.4" +tower-http = { version = "0.4", features = ["cors", "trace"] } tracing = "0.1.34" urlencoding = "2" webbrowser = "0.8" starknet = "0.10.0" url = "2.2.2" tempfile = "3.10.1" +hyper = "0.14.27" +tower-layer = "0.3.2" [[bin]] name = "slot" diff --git a/src/bin/command/auth/login.rs b/src/bin/command/auth/login.rs index 15f0e91..4ef4fe0 100644 --- a/src/bin/command/auth/login.rs +++ b/src/bin/command/auth/login.rs @@ -1,36 +1,147 @@ +use std::sync::Arc; + use anyhow::Result; +use axum::{ + extract::{Query, State}, + response::{IntoResponse, Redirect, Response}, + routing::get, + Router, +}; use clap::Args; -use slot::{browser::Browser, server::LocalServer}; -use tokio::runtime::Runtime; +use graphql_client::GraphQLQuery; +use hyper::StatusCode; +use log::error; +use serde::Deserialize; +use slot::{ + api::Client, + browser, constant, + credential::Credentials, + graphql::auth::{ + me::{ResponseData, Variables}, + Me, + }, + server::LocalServer, +}; +use tokio::sync::mpsc::Sender; #[derive(Debug, Args)] pub struct LoginArgs; impl LoginArgs { - pub fn run(&self) -> Result<()> { - let rt = Runtime::new()?; + pub async fn run(&self) -> Result<()> { + let server = Self::callback_server().expect("Failed to create a server"); + let port = server.local_addr()?.port(); + let callback_uri = format!("http://localhost:{port}/callback"); - let handler = std::thread::spawn(move || { - let server = LocalServer::new().expect("Failed to start a server"); - let addr = server.local_addr().unwrap(); + let url = format!("https://x.cartridge.gg/slot/auth?callback_uri={callback_uri}"); - let res = rt.block_on(async { tokio::join!(server.start(), Browser::open(&addr)) }); + browser::open(&url)?; + server.start().await?; - match res { - (Err(e), _) => { - eprintln!("Server error: {e}"); - } - (_, Err(e)) => { - eprintln!("Browser error: {e}"); - } - _ => { - // println!("Success"); + Ok(()) + } + + fn callback_server() -> Result { + let (tx, rx) = tokio::sync::mpsc::channel::<()>(1); + let shared_state = Arc::new(AppState::new(tx)); + + let router = Router::new() + .route("/callback", get(handler)) + .with_state(shared_state); + + Ok(LocalServer::new(router)?.with_shutdown_signal(rx)) + } +} + +#[derive(Debug, Deserialize)] +struct CallbackPayload { + code: Option, +} + +#[derive(Clone)] +struct AppState { + shutdown_tx: Sender<()>, +} + +impl AppState { + fn new(shutdown_tx: Sender<()>) -> Self { + Self { shutdown_tx } + } + + async fn shutdown(&self) -> Result<()> { + self.shutdown_tx.send(()).await?; + Ok(()) + } +} + +#[derive(Debug, thiserror::Error)] +enum CallbackError { + #[error(transparent)] + Io(#[from] std::io::Error), + + #[error("Api error: {0}")] + Api(#[from] slot::api::Error), + + #[error(transparent)] + Other(#[from] anyhow::Error), + + #[error(transparent)] + Credentials(#[from] slot::credential::Error), +} + +impl IntoResponse for CallbackError { + fn into_response(self) -> Response { + let status = StatusCode::INTERNAL_SERVER_ERROR; + let message = format!("Something went wrong: {self}"); + (status, message).into_response() + } +} + +async fn handler( + State(state): State>, + Query(payload): Query, +) -> Result { + // 1. Shutdown the server + state.shutdown().await?; + + // 2. Get access token using the authorization code + match payload.code { + Some(code) => { + let mut api = Client::new(); + + let token = api.oauth2(&code).await?; + api.set_token(token.clone()); + + // fetch the account information + let request_body = Me::build_query(Variables {}); + let res: graphql_client::Response = api.query(&request_body).await?; + + // display the errors if any, but still process bcs we have the token + if let Some(errors) = res.errors { + for err in errors { + eprintln!("Error: {}", err.message); } } - }); - handler.join().unwrap(); + let account_info = res.data.map(|data| data.me.expect("should exist")); - Ok(()) + // 3. Store the access token locally + Credentials::new(account_info, token).store()?; + + println!("You are now logged in!\n"); + + Ok(Redirect::permanent(&format!( + "{}/slot/auth/success", + constant::CARTRIDGE_KEYCHAIN_URL + ))) + } + None => { + error!("User denied consent. Try again."); + + Ok(Redirect::permanent(&format!( + "{}/slot/auth/failure", + constant::CARTRIDGE_KEYCHAIN_URL + ))) + } } } diff --git a/src/bin/command/auth/mod.rs b/src/bin/command/auth/mod.rs index c5f0e5f..a67e665 100644 --- a/src/bin/command/auth/mod.rs +++ b/src/bin/command/auth/mod.rs @@ -5,6 +5,7 @@ use self::{info::InfoArgs, login::LoginArgs}; mod info; mod login; +mod session; #[derive(Subcommand, Debug)] pub enum Auth { @@ -12,13 +13,17 @@ pub enum Auth { Login(LoginArgs), #[command(about = "Display info about the authenticated user.")] Info(InfoArgs), + // Mostly for testing purposes, will eventually turn it into a library call from `sozo`. + #[command(hide = true)] + CreateSession(session::CreateSession), } impl Auth { pub async fn run(&self) -> Result<()> { match &self { - Auth::Login(args) => args.run(), + Auth::Login(args) => args.run().await, Auth::Info(args) => args.run().await, + Auth::CreateSession(args) => args.run().await, } } } diff --git a/src/bin/command/auth/session.rs b/src/bin/command/auth/session.rs new file mode 100644 index 0000000..c5ebeac --- /dev/null +++ b/src/bin/command/auth/session.rs @@ -0,0 +1,49 @@ +use std::str::FromStr; + +use anyhow::{anyhow, ensure, Result}; +use clap::Parser; +use slot::session::{self, Policy}; +use starknet::core::types::FieldElement; +use starknet::providers::{jsonrpc::HttpTransport, JsonRpcClient, Provider}; +use url::Url; + +#[derive(Debug, Parser)] +pub struct CreateSession { + #[arg(long)] + #[arg(value_name = "URL")] + // #[arg(default_value = "http://localhost:5050")] + #[arg(help = "The RPC URL of the network you want to create a session for.")] + rpc_url: String, + + #[arg(help = "The session's policies.")] + #[arg(value_parser = parse_policy)] + #[arg(required = true)] + policies: Vec, +} + +impl CreateSession { + pub async fn run(&self) -> Result<()> { + let url = Url::parse(&self.rpc_url)?; + let chain_id = get_network_chain_id(url.clone()).await?; + let session = session::create(url, &self.policies).await?; + session::store(chain_id, &session)?; + Ok(()) + } +} + +fn parse_policy(value: &str) -> Result { + let mut parts = value.split(','); + + let target = parts.next().ok_or(anyhow!("missing target"))?.to_owned(); + let target = FieldElement::from_str(&target)?; + let method = parts.next().ok_or(anyhow!("missing method"))?.to_owned(); + + ensure!(parts.next().is_none(), " bruh"); + + Ok(Policy { target, method }) +} + +async fn get_network_chain_id(url: Url) -> Result { + let provider = JsonRpcClient::new(HttpTransport::new(url)); + Ok(provider.chain_id().await?) +} diff --git a/src/browser.rs b/src/browser.rs index 24f9ad4..5815b49 100644 --- a/src/browser.rs +++ b/src/browser.rs @@ -1,18 +1,9 @@ -use anyhow::Result; -use std::net::SocketAddr; -use urlencoding::encode; - -pub struct Browser; - -impl Browser { - pub async fn open(local_addr: &SocketAddr) -> Result<()> { - let callback_uri = format!("http://{local_addr}/callback").replace("[::1]", "localhost"); - let encoded_callback_uri = encode(&callback_uri); - let url = format!("https://x.cartridge.gg/slot/auth?callback_uri={encoded_callback_uri}"); - - println!("Your browser has been opened to visit: \n\n {url}\n"); - webbrowser::open(&url)?; - - Ok(()) - } +use anyhow::{Context, Result}; +use tracing::trace; + +pub fn open(url: &str) -> Result<()> { + trace!(%url, "Opening browser."); + webbrowser::open(url).context("Failed to open web browser")?; + println!("Your browser has been opened to visit: \n\n {url}\n"); + Ok(()) } diff --git a/src/credential.rs b/src/credential.rs index 426897c..210f4d1 100644 --- a/src/credential.rs +++ b/src/credential.rs @@ -4,7 +4,7 @@ use std::io::{self}; use std::path::{Path, PathBuf}; use crate::graphql::auth::me::MeMe; -use crate::utils::{self, SLOT_DIR}; +use crate::utils::{self}; const CREDENTIALS_FILE: &str = "credentials.json"; @@ -58,28 +58,29 @@ impl Credentials { /// the credentials file are invalid or missing. /// pub fn load() -> Result { - Self::load_at(get_file_path()) + Self::load_at(utils::config_dir()) } /// Store the credentials of an authenticated user. Returns the path to the stored credentials /// file. pub fn store(&self) -> Result { - let path = get_file_path(); - Self::store_at(self, &path)?; - Ok(path) + Self::store_at(utils::config_dir(), self) } - pub(crate) fn store_at>(credentials: &Self, path: P) -> Result<(), Error> { - let path = path.as_ref(); + pub(crate) fn store_at>( + config_dir: P, + credentials: &Self, + ) -> Result { + let path = get_file_path(config_dir); // create the dir paths if it doesn't yet exist fs::create_dir_all(path.parent().expect("qed; parent exist"))?; let content = serde_json::to_string_pretty(credentials)?; - fs::write(path, content)?; - Ok(()) + fs::write(&path, content)?; + Ok(path) } - pub(crate) fn load_at>(path: P) -> Result { - let path = path.as_ref(); + pub(crate) fn load_at>(config_dir: P) -> Result { + let path = get_file_path(config_dir); if !path.exists() { return Err(Error::Unauthorized); @@ -103,18 +104,16 @@ impl Credentials { } /// Get the path to the credentials file. -pub fn get_file_path() -> PathBuf { - let mut path = utils::config_dir(); - path.extend([SLOT_DIR, CREDENTIALS_FILE]); - path +pub fn get_file_path>(config_dir: P) -> PathBuf { + config_dir.as_ref().join(CREDENTIALS_FILE) } #[cfg(test)] mod tests { use super::LegacyCredentials; - use crate::credential::{AccessToken, Credentials}; + use crate::credential::{AccessToken, Credentials, CREDENTIALS_FILE}; + use crate::utils; use std::fs; - use tempfile::tempdir; #[test] fn loading_legacy_credentials() { @@ -123,34 +122,35 @@ mod tests { token_type: "mytokentype".to_string(), }; - let dir = tempdir().unwrap(); - let path = dir.path().join("cred.json"); - fs::write(&path, serde_json::to_vec(&cred).unwrap()).unwrap(); + let dir = utils::config_dir(); + let path = dir.join(CREDENTIALS_FILE); + fs::create_dir_all(&dir).expect("failed to create intermediary dirs"); + fs::write(path, serde_json::to_vec(&cred).unwrap()).unwrap(); - let err = Credentials::load_at(path).unwrap_err(); + let err = Credentials::load_at(dir).unwrap_err(); assert!(err.to_string().contains("Legacy credentials found")) } #[test] fn loading_non_existent_credentials() { - let dir = tempdir().unwrap(); - let path = dir.path().join("cred.json"); - - let err = Credentials::load_at(path).unwrap_err(); + let dir = utils::config_dir(); + let err = Credentials::load_at(dir).unwrap_err(); assert!(err.to_string().contains("No credentials found")) } #[test] fn credentials_rt() { + let config_dir = utils::config_dir(); + let access_token = AccessToken { token: "mytoken".to_string(), r#type: "Bearer".to_string(), }; let expected = Credentials::new(None, access_token); - let stored_path = Credentials::store(&expected).unwrap(); + let _ = Credentials::store_at(&config_dir, &expected).unwrap(); - let actual = Credentials::load_at(stored_path).unwrap(); + let actual = Credentials::load_at(config_dir).unwrap(); assert_eq!(expected, actual); } } diff --git a/src/lib.rs b/src/lib.rs index add1a8d..d0553de 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,4 +4,5 @@ pub mod constant; pub mod credential; pub mod graphql; pub mod server; +pub mod session; pub(crate) mod utils; diff --git a/src/server.rs b/src/server.rs index ea88590..29fbf24 100644 --- a/src/server.rs +++ b/src/server.rs @@ -1,158 +1,93 @@ -use anyhow::Result; -use axum::{ - extract::{Query, State}, - http::StatusCode, - response::{IntoResponse, Redirect, Response}, - routing::get, - Router, -}; -use graphql_client::GraphQLQuery; -use log::error; -use serde::Deserialize; -use std::{ - net::{SocketAddr, TcpListener}, - sync::Arc, -}; -use tokio::sync::mpsc::{Receiver, Sender}; - -use crate::{ - api::Client, - constant, - credential::Credentials, - graphql::auth::{ - me::{ResponseData, Variables}, - Me, - }, -}; +use std::io; +use std::net::{SocketAddr, TcpListener}; +use axum::Router; +use tokio::sync::mpsc::Receiver; +use tower_http::cors::CorsLayer; +use tower_http::trace::TraceLayer; + +/// A simple local server. +#[derive(Debug)] pub struct LocalServer { router: Router, - shutdown_rx: Receiver<()>, listener: TcpListener, + shutdown_rx: Option>, } -impl<'a> LocalServer { - pub fn new() -> Result { - let (tx, rx) = tokio::sync::mpsc::channel::<()>(1); +impl LocalServer { + pub fn new(router: Router) -> anyhow::Result { // Port number of 0 requests OS to find an available port. let listener = TcpListener::bind("localhost:0")?; - - let shared_state = Arc::new(AppState::new(tx)); - let router = Router::new() - .route("/callback", get(Self::callback)) - .with_state(shared_state); + // To view the logs emitted by the server, set `RUST_LOG=tower_http=trace` + let router = router.layer(TraceLayer::new_for_http()); Ok(Self { router, - shutdown_rx: rx, listener, + shutdown_rx: None, }) } - pub fn local_addr(&self) -> Result { - self.listener.local_addr() + /// Add a CORS layer to the server. + pub fn cors(mut self, cors: CorsLayer) -> Self { + self.router = self.router.layer(cors); + self } - pub async fn start(mut self) -> Result<()> { - axum::Server::from_tcp(self.listener)? - .serve(self.router.into_make_service()) - .with_graceful_shutdown(async { - let _ = &self.shutdown_rx.recv().await; - }) - .await?; + /// Shutdown the server when a signal is received from `receiver`. + pub fn with_shutdown_signal(mut self, receiver: Receiver<()>) -> Self { + self.shutdown_rx = Some(receiver); + self + } - Ok(()) + pub fn local_addr(&self) -> Result { + self.listener.local_addr() } - async fn callback( - State(state): State>, - Query(payload): Query, - ) -> Result { - // 1. Shutdown the server - state.shutdown().await?; - - // 2. Get access token using the authorization code - match payload.code { - Some(code) => { - let mut api = Client::new(); - - let token = api.oauth2(&code).await?; - api.set_token(token.clone()); - - // fetch the account information - let request_body = Me::build_query(Variables {}); - let res: graphql_client::Response = api.query(&request_body).await?; - - // display the errors if any, but still process bcs we have the token - if let Some(errors) = res.errors { - for err in errors { - eprintln!("Error: {}", err.message); - } - } - - let account_info = res.data.map(|data| data.me.expect("should exist")); - - // 3. Store the access token locally - Credentials::new(account_info, token).store()?; - - println!("You are now logged in!\n"); - - Ok(Redirect::permanent(&format!( - "{}/slot/auth/success", - constant::CARTRIDGE_KEYCHAIN_URL - ))) - } - None => { - error!("User denied consent. Try again."); - - Ok(Redirect::permanent(&format!( - "{}/slot/auth/failure", - constant::CARTRIDGE_KEYCHAIN_URL - ))) - } + pub async fn start(mut self) -> anyhow::Result<()> { + let addr = self.listener.local_addr()?; + tracing::info!(?addr, "Callback server started"); + + let server = axum::Server::from_tcp(self.listener)?.serve(self.router.into_make_service()); + if let Some(mut rx) = self.shutdown_rx.take() { + server + .with_graceful_shutdown(async { rx.recv().await.expect("channel closed") }) + .await?; + } else { + server.await?; } + + Ok(()) } } -#[derive(Deserialize)] -struct CallbackPayload { - code: Option, -} +#[cfg(test)] +mod tests { + use crate::server::LocalServer; + use axum::{routing::get, Router}; -#[derive(Clone)] -struct AppState { - shutdown_tx: Sender<()>, -} + #[tokio::test] + async fn test_server_graceful_shutdown() { + let (tx, rx) = tokio::sync::mpsc::channel(1); -impl AppState { - fn new(shutdown_tx: Sender<()>) -> Self { - Self { shutdown_tx } - } + let router = Router::new().route("/callback", get(|| async { "Hello, World!" })); + let server = LocalServer::new(router).unwrap().with_shutdown_signal(rx); + let port = server.local_addr().unwrap().port(); - async fn shutdown(&self) -> Result<()> { - self.shutdown_tx.send(()).await?; + let client = reqwest::Client::new(); + let url = format!("http://localhost:{port}/callback"); - Ok(()) - } -} + // start the local server + tokio::spawn(server.start()); -struct AppError(anyhow::Error); + // first request should succeed + assert!(client.get(&url).send().await.is_ok()); -impl IntoResponse for AppError { - fn into_response(self) -> Response { - ( - StatusCode::INTERNAL_SERVER_ERROR, - format!("Something went wrong: {}", self.0), - ) - .into_response() - } -} + // send shutdown signal + tx.send(()).await.unwrap(); -impl From for AppError -where - E: Into, -{ - fn from(err: E) -> Self { - Self(err.into()) + // sending request after sending the shutdown signal should fail as server + // should've been shutdown + assert!(client.get(url).send().await.is_err()) } } diff --git a/src/session.rs b/src/session.rs new file mode 100644 index 0000000..3080364 --- /dev/null +++ b/src/session.rs @@ -0,0 +1,404 @@ +use std::io; +use std::path::Path; +use std::{fs, path::PathBuf}; + +use anyhow::Context; +use axum::response::{IntoResponse, Response}; +use axum::{extract::State, routing::post, Json, Router}; +use hyper::StatusCode; +use serde::{Deserialize, Serialize}; +use starknet::core::types::FieldElement; +use thiserror::Error; +use tokio::sync::mpsc::{channel, Receiver, Sender}; +use tower_http::cors::CorsLayer; +use tracing::info; +use url::Url; + +use crate::credential::{self, Credentials}; +use crate::utils::{self}; +use crate::{browser, server::LocalServer}; + +const SESSION_CREATION_PAGE: &str = "https://x.cartridge.gg/slot/session"; +const SESSION_FILE_BASE_NAME: &str = "session.json"; + +/// A policy defines what action can be performed by the session key. +#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq)] +pub struct Policy { + /// The target contract address. + pub target: FieldElement, + /// The method name. + pub method: String, +} + +#[derive(Debug, Default, Serialize, Deserialize, PartialEq, Eq)] +#[serde(rename_all = "camelCase")] +pub struct SessionDetails { + /// The expiration date of the session. + // TODO(kariy): change this to u64 + pub expires_at: String, + /// The session's policies. + pub policies: Vec, + pub credentials: SessionCredentials, +} + +#[derive(Debug, Default, Serialize, Deserialize, PartialEq, Eq)] +#[serde(rename_all = "camelCase")] +pub struct SessionCredentials { + /// The signing key of the session. + pub private_key: FieldElement, + pub authorization: Vec, +} + +// TODO(kariy): unify the error types for the whole Slot crate. +#[derive(Debug, Error)] +pub enum Error { + #[error(transparent)] + IO(#[from] io::Error), + + #[error(transparent)] + Credentials(#[from] credential::Error), + + #[error(transparent)] + Serde(#[from] serde_json::Error), + + #[error(transparent)] + Other(#[from] anyhow::Error), +} + +/// Retrieves the session for the given chain id of the currently authenticated user. +/// Returns `None` if no session can be found for the chain id. +/// +/// # Errors +/// +/// This function will return an error if there is no authenticated user. +/// +pub fn get(chain: FieldElement) -> Result, Error> { + get_at(utils::config_dir(), chain) +} + +/// Stores the session on-disk. Returns the path to the file where the `session` has been written to. +/// +/// # Errors +/// +/// This function will return an error if there is no authenticated user. +/// +pub fn store(chain: FieldElement, session: &SessionDetails) -> Result { + store_at(utils::config_dir(), chain, session) +} + +/// Creates a new session token for the given set of parameters for the currently authenticated user. +/// Returns the newly created session token. +/// +/// # Arguments +/// +/// * `rpc_url` - The RPC URL of the chain network that you want to create a session for. +/// * `policies` - The policies that the session token will have. +/// +/// # Errors +/// +/// This function will return an error if there is no authenticated user. +/// +pub async fn create(rpc_url: U, policies: &[Policy]) -> Result +where + U: Into, +{ + let credentials = Credentials::load()?; + let username = credentials.account.expect("id must exist").id; + create_user_session(&username, rpc_url, policies).await +} + +/// Get the session token of the chain id `chain` for the currently authenticated user. It will +/// use `config_dir` as the root path to look for the session file. +fn get_at

(config_dir: P, chain: FieldElement) -> Result, Error> +where + P: AsRef, +{ + let credentials = Credentials::load_at(&config_dir)?; + let username = credentials.account.expect("id must exist").id; + + let user_path = get_user_relative_file_path(&username, chain); + let file_path = config_dir.as_ref().join(user_path); + + if file_path.exists() { + let contents = fs::read_to_string(file_path)?; + let session = serde_json::from_str(&contents)?; + Ok(Some(session)) + } else { + Ok(None) + } +} + +/// Stores the session token of the chain id `chain` for the currently authenticated user. It will +/// use `config_dir` as the root path to store the session file. +fn store_at

( + config_dir: P, + chain: FieldElement, + session: &SessionDetails, +) -> Result +where + P: AsRef, +{ + // TODO: maybe can store the authenticated user in a global variable so that + // we don't have to call load again if we already did it before. + let credentials = Credentials::load_at(&config_dir)?; + let username = credentials.account.expect("id must exist").id; + + let path = get_user_relative_file_path(&username, chain); + let file_path = config_dir.as_ref().join(path); + + // Create the parent directories if they don't yet exist. + if let Some(parent) = file_path.parent() { + if !parent.exists() { + fs::create_dir_all(parent)?; + } + } + + let contents = serde_json::to_string_pretty(session)?; + fs::write(&file_path, contents)?; + + Ok(file_path) +} + +// TODO(kariy): this function should probably be put in a more generic `controller` rust sdk. +/// Creates a new session token for the given user. This will open a browser to the Cartridge +/// Controller keychain page to prompt user to create a new session for the given policies and +/// network. Returns the newly created session token. +#[tracing::instrument(name = "create_session", level = "trace", skip(rpc_url), fields(policies = policies.len()))] +pub async fn create_user_session( + username: &str, + rpc_url: U, + policies: &[Policy], +) -> Result +where + U: Into, +{ + let rpc_url: Url = rpc_url.into(); + let mut rx = open_session_creation_page(username, rpc_url.as_str(), policies)?; + Ok(rx.recv().await.context("Failed to received the session.")?) +} + +/// Starts the session creation process by opening the browser to the Cartridge keychain to prompt +/// the user to approve the session creation. +fn open_session_creation_page( + username: &str, + rpc_url: &str, + policies: &[Policy], +) -> anyhow::Result> { + let params = prepare_query_params(username, rpc_url, policies)?; + let url = format!("{SESSION_CREATION_PAGE}?{params}"); + + let (tx, rx) = channel::(1); + let server = callback_server(tx)?; + + // get the callback server url + let port = server.local_addr()?.port(); + let mut url = Url::parse(&url)?; + + // append the callback uri to the query params + let callback_uri = format!("http://localhost:{port}/callback"); + url.query_pairs_mut() + .append_pair("callback_uri", &callback_uri); + + browser::open(url.as_str())?; + tokio::spawn(server.start()); + + Ok(rx) +} + +fn prepare_query_params( + username: &str, + rpc_url: &str, + policies: &[Policy], +) -> Result { + let policies = policies + .iter() + .map(serde_json::to_string) + .map(|p| Ok(urlencoding::encode(&p?).into_owned())) + .collect::, _>>()? + .join(","); + + Ok(format!( + "username={username}&rpc_url={rpc_url}&policies=[{policies}]", + )) +} + +#[derive(Debug, thiserror::Error)] +enum CallbackError { + #[error("Internal server error")] + Unexpected, +} + +impl IntoResponse for CallbackError { + fn into_response(self) -> Response { + match self { + Self::Unexpected => { + let status = StatusCode::INTERNAL_SERVER_ERROR; + (status, self.to_string()).into_response() + } + } + } +} + +/// Create the callback server that will receive the session token from the browser. +fn callback_server(result_sender: Sender) -> anyhow::Result { + type HandlerState = State<(Sender, Sender<()>)>; + + // Request handler for the /callback endpoint. + let handler = |state: HandlerState, json: Json| async move { + info!("Received session token from the browser."); + + let State((res_sender, shutdown_sender)) = state; + let Json(session) = json; + + // Parse the session token from the json payload. + res_sender + .send(session) + .await + .map_err(|_| CallbackError::Unexpected)?; + + // send shutdown signal to the server ONLY after succesfully receiving and processing + // the session token. + shutdown_sender + .send(()) + .await + .map_err(|_| CallbackError::Unexpected)?; + + Ok::<(), CallbackError>(()) + }; + + let (shutdown_tx, shutdown_rx) = tokio::sync::mpsc::channel(1); + + let router = Router::new() + .route("/callback", post(handler)) + .with_state((result_sender, shutdown_tx)); + + Ok(LocalServer::new(router)? + .cors(CorsLayer::permissive()) + .with_shutdown_signal(shutdown_rx)) +} + +fn get_user_relative_file_path(username: &str, chain_id: FieldElement) -> PathBuf { + let file_name = format!("{chain_id:#x}-{}", SESSION_FILE_BASE_NAME); + PathBuf::from(username).join(file_name) +} + +#[cfg(test)] +mod tests { + use super::{get, Error}; + use crate::credential::{AccessToken, Credentials, Error::Unauthorized}; + use crate::graphql::auth::me::{MeMe, MeMeCredentials}; + use crate::session::{get_at, get_user_relative_file_path, store_at, SessionDetails}; + use crate::utils; + use starknet::{core::types::FieldElement, macros::felt}; + use std::ffi::OsStr; + use std::path::{Component, Path}; + use tokio::sync::mpsc::channel; + + fn authenticate(config_dir: impl AsRef) -> &'static str { + static USERNAME: &str = "foo"; + + let token = AccessToken { + token: "mytoken".to_string(), + r#type: "Bearer".to_string(), + }; + + let me = MeMe { + name: None, + id: USERNAME.to_string(), + contract_address: None, + credentials: MeMeCredentials { webauthn: None }, + }; + + let cred = Credentials::new(Some(me), token); + let _ = Credentials::store_at(&config_dir, &cred).unwrap(); + + USERNAME + } + + #[test] + fn user_rel_path() { + let chain = felt!("0x999"); + let username = "foo"; + let file_name = "0x999-session.json"; + + let path = get_user_relative_file_path(username, chain); + let mut comps = path.components(); + + assert_eq!(comps.next(), Some(Component::Normal(OsStr::new(username)))); + assert_eq!(comps.next(), Some(Component::Normal(OsStr::new(file_name)))); + assert_eq!(comps.next(), None); + } + + #[test] + fn get_session_unauthenticated() { + let chain = FieldElement::ONE; + let err = get(chain).unwrap_err(); + let Error::Credentials(Unauthorized) = err else { + panic!("expected Unauthorized error, got {err:?}"); + }; + } + + #[test] + fn get_non_existant_session_authenticated() { + let config_dir = utils::config_dir(); + authenticate(&config_dir); + + let chain = felt!("0x999"); + let result = get_at(config_dir, chain).unwrap(); + assert!(result.is_none()) + } + + #[test] + fn get_existant_session_authenticated() { + let config_dir = utils::config_dir(); + let username = authenticate(&config_dir); + + let chain = felt!("0x999"); + let expected = SessionDetails::default(); + let path = store_at(&config_dir, chain, &expected).unwrap(); + + let user_path = get_user_relative_file_path(username, chain); + let actual = get_at(config_dir, chain).unwrap(); + + assert_eq!(Some(expected), actual); + assert!(path.ends_with(user_path)); + } + + #[test] + fn store_session_unauthenticated() { + let config_dir = utils::config_dir(); + + let chain = felt!("0x999"); + let session = SessionDetails::default(); + + let err = store_at(config_dir, chain, &session).unwrap_err(); + assert!(err.to_string().contains("No credentials found")) + } + + #[tokio::test] + async fn test_callback_server() { + let (tx, mut rx) = channel::(1); + let server = super::callback_server(tx).expect("failed to create server"); + + // get the callback url + let port = server.local_addr().unwrap().port(); + let url = format!("http://localhost:{port}/callback"); + + // start the callback server + tokio::spawn(server.start()); + + // call the callback url + let session = SessionDetails::default(); + let res = reqwest::Client::new() + .post(url) + .json(&session) + .send() + .await + .expect("failed to call callback url"); + + assert!(res.status().is_success()); + + let actual = rx.recv().await.expect("failed to receive session"); + assert_eq!(session, actual) + } +} diff --git a/src/utils.rs b/src/utils.rs index 0164cf9..5d460be 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,14 +1,36 @@ -use std::path::PathBuf; +use std::{fs, path::PathBuf}; /// The default directory name where the Slot-generated files (e.g credentials/session keys) are stored. -pub const SLOT_DIR: &str = "slot"; +const SLOT_DIR: &str = "slot"; /// Get the path to the config directory where the Slot-generated files (e.g credentials/session keys) are stored. +/// This function guarantees that the config directory exists. +/// /// If this function is called in a test environment, path to a temporary directory is returned instead. pub fn config_dir() -> PathBuf { - if cfg!(test) { + let path = if cfg!(test) { tempfile::tempdir().unwrap().into_path() } else { dirs::config_local_dir().expect("unsupported OS") } + .join(SLOT_DIR); + + if path.exists() { + path + } else { + fs::create_dir_all(&path).expect("failed to create config directory"); + path + } +} + +#[cfg(test)] +mod tests { + use crate::utils::SLOT_DIR; + + #[test] + fn config_dir_must_exist() { + let path = super::config_dir(); + assert!(path.exists()); + assert!(path.ends_with(SLOT_DIR)); + } }