From dd1381cf3e470499f9558da1ad9bfd93e94714e0 Mon Sep 17 00:00:00 2001 From: Filip Bozic <70634661+fbozic@users.noreply.github.com> Date: Wed, 19 Jun 2024 12:33:27 +0200 Subject: [PATCH] chore(identity): remove unused code and dependecies --- Cargo.lock | 1002 ++-------------------- Cargo.toml | 2 +- crates/identity/Cargo.toml | 6 +- crates/identity/src/auth.rs | 36 +- crates/identity/src/dht.rs | 42 - crates/identity/src/identity_provider.rs | 71 -- crates/identity/src/lib.rs | 6 +- crates/identity/src/main.rs | 80 -- crates/identity/src/types.rs | 85 -- crates/identity/src/vc.rs | 64 -- crates/identity/src/vp.rs | 29 - crates/server/src/middleware/auth.rs | 5 +- 12 files changed, 57 insertions(+), 1371 deletions(-) delete mode 100644 crates/identity/src/dht.rs delete mode 100644 crates/identity/src/identity_provider.rs delete mode 100644 crates/identity/src/main.rs delete mode 100644 crates/identity/src/types.rs delete mode 100644 crates/identity/src/vc.rs delete mode 100644 crates/identity/src/vp.rs diff --git a/Cargo.lock b/Cargo.lock index 37943e934..ae3980dfd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -287,12 +287,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "asn1_der" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "155a5a185e42c6b77ac7b88a15143d930a9e9727a5b7b77eed417404ab15c247" - [[package]] name = "assert-json-diff" version = "2.0.2" @@ -309,216 +303,34 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - -[[package]] -name = "async-channel" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" -dependencies = [ - "concurrent-queue", - "event-listener 5.2.0", - "event-listener-strategy 0.5.1", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-executor" -version = "1.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10b3e585719c2358d2660232671ca8ca4ddb4be4ce8a1842d6c2dc8685303316" -dependencies = [ - "async-lock 3.3.0", - "async-task", - "concurrent-queue", - "fastrand 2.0.2", - "futures-lite 2.3.0", - "slab", -] - -[[package]] -name = "async-fs" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "blocking", - "futures-lite 1.13.0", -] - -[[package]] -name = "async-global-executor" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" -dependencies = [ - "async-channel 2.2.0", - "async-executor", - "async-io 2.3.2", - "async-lock 3.3.0", - "blocking", - "futures-lite 2.3.0", - "once_cell", -] - -[[package]] -name = "async-io" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "cfg-if 1.0.0", - "concurrent-queue", - "futures-lite 1.13.0", - "log", - "parking", - "polling 2.8.0", - "rustix 0.37.27", - "slab", - "socket2 0.4.10", - "waker-fn", -] - [[package]] name = "async-io" version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" dependencies = [ - "async-lock 3.3.0", + "async-lock", "cfg-if 1.0.0", "concurrent-queue", "futures-io", - "futures-lite 2.3.0", + "futures-lite", "parking", - "polling 3.6.0", - "rustix 0.38.32", + "polling", + "rustix", "slab", "tracing", "windows-sys 0.52.0", ] -[[package]] -name = "async-lock" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" -dependencies = [ - "event-listener 2.5.3", -] - [[package]] name = "async-lock" version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ - "event-listener 4.0.3", - "event-listener-strategy 0.4.0", - "pin-project-lite", -] - -[[package]] -name = "async-net" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0434b1ed18ce1cf5769b8ac540e33f01fa9471058b5e89da9e06f3c882a8c12f" -dependencies = [ - "async-io 1.13.0", - "blocking", - "futures-lite 1.13.0", -] - -[[package]] -name = "async-process" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" -dependencies = [ - "async-io 1.13.0", - "async-lock 2.8.0", - "async-signal", - "blocking", - "cfg-if 1.0.0", - "event-listener 3.1.0", - "futures-lite 1.13.0", - "rustix 0.38.32", - "windows-sys 0.48.0", -] - -[[package]] -name = "async-signal" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" -dependencies = [ - "async-io 2.3.2", - "async-lock 2.8.0", - "atomic-waker", - "cfg-if 1.0.0", - "futures-core", - "futures-io", - "rustix 0.38.32", - "signal-hook-registry", - "slab", - "windows-sys 0.48.0", -] - -[[package]] -name = "async-std" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" -dependencies = [ - "async-channel 1.9.0", - "async-global-executor", - "async-io 1.13.0", - "async-lock 2.8.0", - "async-process", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite 1.13.0", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "once_cell", + "event-listener", + "event-listener-strategy", "pin-project-lite", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] - -[[package]] -name = "async-std-resolver" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0ed2b6671c13d2c28756c5a64e04759c1e0b5d3d7ac031f521c3561e21fbcb" -dependencies = [ - "async-std", - "async-trait", - "futures-io", - "futures-util", - "hickory-resolver", - "pin-utils", - "socket2 0.5.6", ] [[package]] @@ -543,12 +355,6 @@ dependencies = [ "syn 2.0.66", ] -[[package]] -name = "async-task" -version = "4.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" - [[package]] name = "async-trait" version = "0.1.79" @@ -586,12 +392,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "attohttpc" version = "0.24.1" @@ -699,12 +499,6 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" -[[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" @@ -835,22 +629,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "blocking" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" -dependencies = [ - "async-channel 2.2.0", - "async-lock 3.3.0", - "async-task", - "fastrand 2.0.2", - "futures-io", - "futures-lite 2.3.0", - "piper", - "tracing", -] - [[package]] name = "borsh" version = "0.9.3" @@ -1049,7 +827,7 @@ dependencies = [ "semver", "serde", "serde_json", - "sha2 0.10.8", + "sha2", "tracing", ] @@ -1061,10 +839,6 @@ dependencies = [ "eyre", "hex", "libp2p", - "multibase", - "serde", - "serde_json", - "sha2 0.10.8", "web3", ] @@ -1143,7 +917,7 @@ dependencies = [ "semver", "serde", "serde_json", - "sha2 0.10.8", + "sha2", ] [[package]] @@ -1214,7 +988,7 @@ dependencies = [ "semver", "serde", "serde_json", - "sha2 0.10.8", + "sha2", "thiserror", "tokio", "tower", @@ -1276,7 +1050,7 @@ dependencies = [ "rustc_version", "schemars", "serde_json", - "sha2 0.10.8", + "sha2", "symbolic-debuginfo", "zstd", ] @@ -1303,15 +1077,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "cbor4ii" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b4c883b9cc4757b061600d39001d4d0232bece4a3174696cf8f58a14db107d" -dependencies = [ - "serde", -] - [[package]] name = "cc" version = "1.0.90" @@ -1767,18 +1532,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" -[[package]] -name = "crypto-bigint" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" -dependencies = [ - "generic-array", - "rand_core 0.6.4", - "subtle", - "zeroize", -] - [[package]] name = "crypto-common" version = "0.1.6" @@ -1809,17 +1562,6 @@ dependencies = [ "cipher 0.4.4", ] -[[package]] -name = "cuckoofilter" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b810a8449931679f64cd7eef1bbd0fa315801b6d5d9cdc1ace2804d6529eee18" -dependencies = [ - "byteorder", - "fnv", - "rand 0.7.3", -] - [[package]] name = "curve25519-dalek" version = "4.1.2" @@ -1939,7 +1681,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", - "pem-rfc7468", "zeroize", ] @@ -2018,7 +1759,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", - "const-oid", "crypto-common", "subtle", ] @@ -2100,20 +1840,6 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53aff6fdc1b181225acdcb5b14c47106726fd8e486707315b1b138baed68ee31" -[[package]] -name = "ecdsa" -version = "0.16.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" -dependencies = [ - "der", - "digest 0.10.7", - "elliptic-curve", - "rfc6979", - "signature", - "spki", -] - [[package]] name = "ed25519" version = "2.2.3" @@ -2134,7 +1860,7 @@ dependencies = [ "ed25519", "rand_core 0.6.4", "serde", - "sha2 0.10.8", + "sha2", "subtle", "zeroize", ] @@ -2155,26 +1881,6 @@ dependencies = [ "xml-rs", ] -[[package]] -name = "elliptic-curve" -version = "0.13.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" -dependencies = [ - "base16ct", - "crypto-bigint", - "digest 0.10.7", - "ff", - "generic-array", - "group", - "pem-rfc7468", - "pkcs8", - "rand_core 0.6.4", - "sec1", - "subtle", - "zeroize", -] - [[package]] name = "encoding_rs" version = "0.8.33" @@ -2330,23 +2036,6 @@ dependencies = [ "uint", ] -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "event-listener" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - [[package]] name = "event-listener" version = "4.0.3" @@ -2358,34 +2047,13 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "event-listener" -version = "5.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b5fb89194fa3cad959b833185b3063ba881dbfc7030680b314250779fb4cc91" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - [[package]] name = "event-listener-strategy" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" dependencies = [ - "event-listener 4.0.3", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332f51cb23d20b0de8458b86580878211da09bcd4503cb579c225b3d124cabb3" -dependencies = [ - "event-listener 5.2.0", + "event-listener", "pin-project-lite", ] @@ -2405,31 +2073,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - [[package]] name = "fastrand" version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" -[[package]] -name = "ff" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" -dependencies = [ - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "fiat-crypto" version = "0.2.7" @@ -2596,31 +2245,13 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - [[package]] name = "futures-lite" version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ - "fastrand 2.0.2", "futures-core", - "futures-io", - "parking", "pin-project-lite", ] @@ -2673,10 +2304,6 @@ name = "futures-timer" version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" -dependencies = [ - "gloo-timers", - "send_wrapper 0.4.0", -] [[package]] name = "futures-util" @@ -2713,7 +2340,6 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", - "zeroize", ] [[package]] @@ -2734,10 +2360,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if 1.0.0", - "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", - "wasm-bindgen", ] [[package]] @@ -2773,18 +2397,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" -[[package]] -name = "gloo-timers" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - [[package]] name = "goblin" version = "0.5.4" @@ -2796,17 +2408,6 @@ dependencies = [ "scroll 0.11.0", ] -[[package]] -name = "group" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" -dependencies = [ - "ff", - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "h2" version = "0.3.26" @@ -2965,7 +2566,7 @@ dependencies = [ "ipnet", "once_cell", "rand 0.8.5", - "socket2 0.5.6", + "socket2", "thiserror", "tinyvec", "tokio", @@ -3000,17 +2601,7 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ - "hmac 0.12.1", -] - -[[package]] -name = "hmac" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" -dependencies = [ - "crypto-mac", - "digest 0.9.0", + "hmac", ] [[package]] @@ -3022,17 +2613,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "hmac-drbg" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" -dependencies = [ - "digest 0.9.0", - "generic-array", - "hmac 0.8.1", -] - [[package]] name = "home" version = "0.5.9" @@ -3150,7 +2730,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.6", + "socket2", "tokio", "tower-service", "tracing", @@ -3232,7 +2812,7 @@ dependencies = [ "http-body 1.0.0", "hyper 1.2.0", "pin-project-lite", - "socket2 0.5.6", + "socket2", "tokio", "tower", "tower-service", @@ -3304,7 +2884,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" dependencies = [ - "async-io 2.3.2", + "async-io", "core-foundation", "fnv", "futures", @@ -3312,7 +2892,6 @@ dependencies = [ "ipnet", "log", "rtnetlink", - "smol", "system-configuration", "tokio", "windows", @@ -3425,20 +3004,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if 1.0.0", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.9", - "libc", - "windows-sys 0.48.0", ] [[package]] @@ -3447,7 +3012,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.6", + "socket2", "widestring", "windows-sys 0.48.0", "winreg", @@ -3558,15 +3123,6 @@ dependencies = [ "cpufeatures", ] -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - [[package]] name = "kv-store" version = "0.1.0" @@ -3644,35 +3200,25 @@ dependencies = [ "getrandom 0.2.15", "instant", "libp2p-allow-block-list", - "libp2p-autonat", "libp2p-connection-limits", "libp2p-core", "libp2p-dcutr", "libp2p-dns", - "libp2p-floodsub", "libp2p-gossipsub", "libp2p-identify", "libp2p-identity", "libp2p-kad", "libp2p-mdns", - "libp2p-memory-connection-limits", "libp2p-metrics", "libp2p-noise", "libp2p-ping", - "libp2p-plaintext", - "libp2p-pnet", "libp2p-quic", "libp2p-relay", "libp2p-rendezvous", - "libp2p-request-response", "libp2p-swarm", "libp2p-tcp", "libp2p-tls", - "libp2p-uds", "libp2p-upnp", - "libp2p-websocket", - "libp2p-websocket-websys", - "libp2p-webtransport-websys", "libp2p-yamux", "multiaddr", "pin-project", @@ -3692,27 +3238,6 @@ dependencies = [ "void", ] -[[package]] -name = "libp2p-autonat" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95151726170e41b591735bf95c42b888fe4aa14f65216a9fbf0edcc04510586" -dependencies = [ - "async-trait", - "asynchronous-codec 0.6.2", - "futures", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-identity", - "libp2p-request-response", - "libp2p-swarm", - "quick-protobuf", - "quick-protobuf-codec 0.2.0", - "rand 0.8.5", - "tracing", -] - [[package]] name = "libp2p-connection-limits" version = "0.3.1" @@ -3783,7 +3308,6 @@ version = "0.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d17cbcf7160ff35c3e8e560de4a068fe9d6cb777ea72840e48eb76ff9576c4b6" dependencies = [ - "async-std-resolver", "async-trait", "futures", "hickory-resolver", @@ -3794,28 +3318,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "libp2p-floodsub" -version = "0.44.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd9bc67af5415858262de3b37eb777159f10c0c349ff3214842faf8179ee087" -dependencies = [ - "asynchronous-codec 0.6.2", - "bytes", - "cuckoofilter", - "fnv", - "futures", - "libp2p-core", - "libp2p-identity", - "libp2p-swarm", - "quick-protobuf", - "quick-protobuf-codec 0.2.0", - "rand 0.8.5", - "smallvec", - "thiserror", - "tracing", -] - [[package]] name = "libp2p-gossipsub" version = "0.46.1" @@ -3842,7 +3344,7 @@ dependencies = [ "rand 0.8.5", "regex", "serde", - "sha2 0.10.8", + "sha2", "smallvec", "tracing", "void", @@ -3877,22 +3379,16 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "999ec70441b2fb35355076726a6bc466c932e9bdc66f6a11c6c0aa17c7ab9be0" dependencies = [ - "asn1_der", "bs58 0.5.1", "ed25519-dalek", "hkdf", - "libsecp256k1", "multihash", - "p256", "quick-protobuf", "rand 0.8.5", - "ring 0.17.8", - "sec1", "serde", - "sha2 0.10.8", + "sha2", "thiserror", "tracing", - "void", "zeroize", ] @@ -3918,7 +3414,7 @@ dependencies = [ "quick-protobuf-codec 0.3.1", "rand 0.8.5", "serde", - "sha2 0.10.8", + "sha2", "smallvec", "thiserror", "tracing", @@ -3932,8 +3428,6 @@ version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49007d9a339b3e1d7eeebc4d67c05dbf23d300b7d091193ec2d3f26802d7faf2" dependencies = [ - "async-io 2.3.2", - "async-std", "data-encoding", "futures", "hickory-proto", @@ -3943,27 +3437,12 @@ dependencies = [ "libp2p-swarm", "rand 0.8.5", "smallvec", - "socket2 0.5.6", + "socket2", "tokio", "tracing", "void", ] -[[package]] -name = "libp2p-memory-connection-limits" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63ec429a224821a9915f31613743566846c6d20078af9736975a60bea4a9293" -dependencies = [ - "libp2p-core", - "libp2p-identity", - "libp2p-swarm", - "memory-stats", - "sysinfo", - "tracing", - "void", -] - [[package]] name = "libp2p-metrics" version = "0.14.1" @@ -4002,7 +3481,7 @@ dependencies = [ "once_cell", "quick-protobuf", "rand 0.8.5", - "sha2 0.10.8", + "sha2", "snow", "static_assertions", "thiserror", @@ -4019,44 +3498,14 @@ checksum = "76b94ee41bd8c294194fe608851e45eb98de26fe79bc7913838cbffbfe8c7ce2" dependencies = [ "either", "futures", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-identity", - "libp2p-swarm", - "rand 0.8.5", - "tracing", - "void", -] - -[[package]] -name = "libp2p-plaintext" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67330af40b67217e746d42551913cfb7ad04c74fa300fb329660a56318590b3f" -dependencies = [ - "asynchronous-codec 0.6.2", - "bytes", - "futures", - "libp2p-core", - "libp2p-identity", - "quick-protobuf", - "quick-protobuf-codec 0.2.0", - "tracing", -] - -[[package]] -name = "libp2p-pnet" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af2dcb82113064b0baf0a3b92d30ad61211ff66fff02f2973b569b77b2d1811a" -dependencies = [ - "futures", - "pin-project", + "futures-timer", + "instant", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", "rand 0.8.5", - "salsa20", - "sha3", "tracing", + "void", ] [[package]] @@ -4065,7 +3514,6 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0375cdfee57b47b313ef1f0fdb625b78aed770d33a40cf1c294a371ff5e6666" dependencies = [ - "async-std", "bytes", "futures", "futures-timer", @@ -4078,7 +3526,7 @@ dependencies = [ "rand 0.8.5", "ring 0.16.20", "rustls 0.21.11", - "socket2 0.5.6", + "socket2", "thiserror", "tokio", "tracing", @@ -4140,7 +3588,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e12823250fe0c45bdddea6eefa2be9a609aff1283ff4e1d8a294fdbb89572f6f" dependencies = [ "async-trait", - "cbor4ii", "futures", "futures-bounded", "futures-timer", @@ -4149,8 +3596,6 @@ dependencies = [ "libp2p-identity", "libp2p-swarm", "rand 0.8.5", - "serde", - "serde_json", "smallvec", "tracing", "void", @@ -4177,12 +3622,10 @@ version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80cae6cb75f89dbca53862f9ebe0b9f463aa7b302762fcfaafb9e51dcc9b0f7e" dependencies = [ - "async-std", "either", "fnv", "futures", "futures-timer", - "getrandom 0.2.15", "instant", "libp2p-core", "libp2p-identity", @@ -4195,7 +3638,6 @@ dependencies = [ "tokio", "tracing", "void", - "wasm-bindgen-futures", ] [[package]] @@ -4216,14 +3658,13 @@ version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b2460fc2748919adff99ecbc1aab296e4579e41f374fb164149bd2c9e529d4c" dependencies = [ - "async-io 1.13.0", "futures", "futures-timer", "if-watch", "libc", "libp2p-core", "libp2p-identity", - "socket2 0.5.6", + "socket2", "tokio", "tracing", ] @@ -4247,17 +3688,6 @@ dependencies = [ "yasna", ] -[[package]] -name = "libp2p-uds" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee6531e4844f618678c70ce52fe5cc6971442edc343fc5c774333a28f039d83f" -dependencies = [ - "futures", - "libp2p-core", - "tracing", -] - [[package]] name = "libp2p-upnp" version = "0.2.1" @@ -4274,65 +3704,6 @@ dependencies = [ "void", ] -[[package]] -name = "libp2p-websocket" -version = "0.43.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4846d51afd08180e164291c3754ba30dd4fbac6fac65571be56403c16431a5e" -dependencies = [ - "either", - "futures", - "futures-rustls", - "libp2p-core", - "libp2p-identity", - "parking_lot", - "pin-project-lite", - "rw-stream-sink", - "soketto", - "tracing", - "url", - "webpki-roots 0.25.4", -] - -[[package]] -name = "libp2p-websocket-websys" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "550e578dcc9cd572be9dd564831d1f5efe8e6661953768b1d56c1d462855bf6f" -dependencies = [ - "bytes", - "futures", - "js-sys", - "libp2p-core", - "parking_lot", - "send_wrapper 0.6.0", - "thiserror", - "tracing", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "libp2p-webtransport-websys" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "840b63681e3bedbdb3df3e4f2dd48e9a20d2c6714264829ab90c6fce8549d627" -dependencies = [ - "futures", - "js-sys", - "libp2p-core", - "libp2p-identity", - "libp2p-noise", - "multiaddr", - "multihash", - "send_wrapper 0.6.0", - "thiserror", - "tracing", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - [[package]] name = "libp2p-yamux" version = "0.45.1" @@ -4374,54 +3745,6 @@ dependencies = [ "zstd-sys", ] -[[package]] -name = "libsecp256k1" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" -dependencies = [ - "arrayref", - "base64 0.13.1", - "digest 0.9.0", - "hmac-drbg", - "libsecp256k1-core", - "libsecp256k1-gen-ecmult", - "libsecp256k1-gen-genmult", - "rand 0.8.5", - "serde", - "sha2 0.9.9", - "typenum", -] - -[[package]] -name = "libsecp256k1-core" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" -dependencies = [ - "crunchy", - "digest 0.9.0", - "subtle", -] - -[[package]] -name = "libsecp256k1-gen-ecmult" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" -dependencies = [ - "libsecp256k1-core", -] - -[[package]] -name = "libsecp256k1-gen-genmult" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" -dependencies = [ - "libsecp256k1-core", -] - [[package]] name = "libz-sys" version = "1.1.16" @@ -4439,12 +3762,6 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - [[package]] name = "linux-raw-sys" version = "0.4.13" @@ -4467,9 +3784,6 @@ name = "log" version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" -dependencies = [ - "value-bag", -] [[package]] name = "lru" @@ -4589,16 +3903,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "memory-stats" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34f79cf9964c5c9545493acda1263f1912f8d2c56c8a2ffee2606cb960acaacc" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "memory_units" version = "0.4.0" @@ -4772,7 +4076,7 @@ dependencies = [ "once_cell", "serde", "serde_json", - "sha2 0.10.8", + "sha2", "smart-default", "tracing", ] @@ -4977,7 +4281,7 @@ dependencies = [ "serde", "serde_repr", "serde_with", - "sha2 0.10.8", + "sha2", "strum 0.24.1", "thiserror", ] @@ -5105,7 +4409,7 @@ dependencies = [ "serde", "serde_repr", "serde_with", - "sha2 0.10.8", + "sha2", "sha3", "strum 0.24.1", "thiserror", @@ -5139,7 +4443,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "sha2 0.10.8", + "sha2", "tempfile", "thiserror", "tokio", @@ -5207,7 +4511,6 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" dependencies = [ - "async-io 1.13.0", "bytes", "futures", "libc", @@ -5261,15 +4564,6 @@ dependencies = [ "nom", ] -[[package]] -name = "ntapi" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" -dependencies = [ - "winapi", -] - [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -5527,18 +4821,6 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" -[[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 0.10.8", -] - [[package]] name = "package-manager" version = "0.1.0" @@ -5548,7 +4830,7 @@ dependencies = [ "near-workspaces", "semver", "serde_json", - "sha2 0.10.8", + "sha2", "tokio", ] @@ -5631,9 +4913,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ "digest 0.10.7", - "hmac 0.12.1", + "hmac", "password-hash", - "sha2 0.10.8", + "sha2", ] [[package]] @@ -5657,15 +4939,6 @@ dependencies = [ "serde", ] -[[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.1" @@ -5723,17 +4996,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "piper" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" -dependencies = [ - "atomic-waker", - "fastrand 2.0.2", - "futures-io", -] - [[package]] name = "pkcs8" version = "0.10.2" @@ -5762,22 +5024,6 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" -[[package]] -name = "polling" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if 1.0.0", - "concurrent-queue", - "libc", - "log", - "pin-project-lite", - "windows-sys 0.48.0", -] - [[package]] name = "polling" version = "3.6.0" @@ -5788,7 +5034,7 @@ dependencies = [ "concurrent-queue", "hermit-abi 0.3.9", "pin-project-lite", - "rustix 0.38.32", + "rustix", "tracing", "windows-sys 0.52.0", ] @@ -5850,15 +5096,6 @@ dependencies = [ "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.10.1" @@ -6119,8 +5356,6 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" dependencies = [ - "async-io 1.13.0", - "async-std", "bytes", "futures-io", "pin-project-lite", @@ -6158,7 +5393,7 @@ checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" dependencies = [ "bytes", "libc", - "socket2 0.5.6", + "socket2", "tracing", "windows-sys 0.48.0", ] @@ -6479,16 +5714,6 @@ dependencies = [ "quick-error", ] -[[package]] -name = "rfc6979" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" -dependencies = [ - "hmac 0.12.1", - "subtle", -] - [[package]] name = "ring" version = "0.16.20" @@ -6595,7 +5820,6 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" dependencies = [ - "async-global-executor", "futures", "log", "netlink-packet-route", @@ -6641,20 +5865,6 @@ dependencies = [ "nom", ] -[[package]] -name = "rustix" -version = "0.37.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - [[package]] name = "rustix" version = "0.38.32" @@ -6664,7 +5874,7 @@ dependencies = [ "bitflags 2.5.0", "errno", "libc", - "linux-raw-sys 0.4.13", + "linux-raw-sys", "windows-sys 0.52.0", ] @@ -6753,15 +5963,6 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" -[[package]] -name = "salsa20" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" -dependencies = [ - "cipher 0.4.4", -] - [[package]] name = "schannel" version = "0.1.23" @@ -6843,20 +6044,6 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" -[[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 = "secp256k1" version = "0.27.0" @@ -6914,21 +6101,6 @@ dependencies = [ "serde", ] -[[package]] -name = "send_wrapper" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" - -[[package]] -name = "send_wrapper" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" -dependencies = [ - "futures-core", -] - [[package]] name = "serde" version = "1.0.197" @@ -7091,19 +6263,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", -] - [[package]] name = "sha2" version = "0.10.8" @@ -7165,7 +6324,6 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "digest 0.10.7", "rand_core 0.6.4", ] @@ -7213,23 +6371,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "smol" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13f2b548cd8447f8de0fdf1c592929f70f4fc7039a05e47404b0d096ec6987a1" -dependencies = [ - "async-channel 1.9.0", - "async-executor", - "async-fs", - "async-io 1.13.0", - "async-lock 2.8.0", - "async-net", - "async-process", - "blocking", - "futures-lite 1.13.0", -] - [[package]] name = "snow" version = "0.9.6" @@ -7243,20 +6384,10 @@ dependencies = [ "rand_core 0.6.4", "ring 0.17.8", "rustc_version", - "sha2 0.10.8", + "sha2", "subtle", ] -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "socket2" version = "0.5.6" @@ -7489,21 +6620,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "sysinfo" -version = "0.29.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd727fc423c2060f6c92d9534cef765c65a6ed3f428a03d7def74a8c4348e666" -dependencies = [ - "cfg-if 1.0.0", - "core-foundation-sys", - "libc", - "ntapi", - "once_cell", - "rayon", - "winapi", -] - [[package]] name = "system-configuration" version = "0.5.1" @@ -7555,8 +6671,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if 1.0.0", - "fastrand 2.0.2", - "rustix 0.38.32", + "fastrand", + "rustix", "windows-sys 0.52.0", ] @@ -7674,7 +6790,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.6", + "socket2", "tokio-macros", "windows-sys 0.48.0", ] @@ -8310,7 +7426,7 @@ dependencies = [ "rustls-pki-types", "rustls-webpki 0.102.2", "url", - "webpki-roots 0.26.1", + "webpki-roots", ] [[package]] @@ -8355,12 +7471,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" -[[package]] -name = "value-bag" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74797339c3b98616c009c7c3eb53a0ce41e85c8ec66bd3db96ed132d20cfdee8" - [[package]] name = "vcpkg" version = "0.2.15" @@ -8379,12 +7489,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" -[[package]] -name = "waker-fn" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" - [[package]] name = "want" version = "0.3.1" @@ -8708,12 +7812,6 @@ dependencies = [ "url", ] -[[package]] -name = "webpki-roots" -version = "0.25.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" - [[package]] name = "webpki-roots" version = "0.26.1" @@ -8744,7 +7842,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.32", + "rustix", ] [[package]] @@ -9060,8 +8158,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", - "linux-raw-sys 0.4.13", - "rustix 0.38.32", + "linux-raw-sys", + "rustix", ] [[package]] @@ -9203,7 +8301,7 @@ dependencies = [ "crc32fast", "crossbeam-utils", "flate2", - "hmac 0.12.1", + "hmac", "pbkdf2", "sha1", "time", diff --git a/Cargo.toml b/Cargo.toml index 8363d5483..2120d82dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,7 @@ hex = "0.4.3" libp2p = "0.53.2" libp2p-stream = "0.1.0-alpha.1" multiaddr = "0.18.1" -multibase = "0.9.1" +# multibase = "0.9.1" near-jsonrpc-client = "0.8.0" near-jsonrpc-primitives = "0.20.0" near-primitives = "0.20.0" diff --git a/crates/identity/Cargo.toml b/crates/identity/Cargo.toml index ba18de8f0..a862db7dc 100644 --- a/crates/identity/Cargo.toml +++ b/crates/identity/Cargo.toml @@ -12,9 +12,5 @@ license.workspace = true bs58.workspace = true eyre.workspace = true hex.workspace = true -libp2p = { workspace = true, features = ["full"] } -serde_json.workspace = true -sha2.workspace = true -multibase.workspace = true -serde.workspace = true +libp2p = { workspace = true } web3.workspace = true diff --git a/crates/identity/src/auth.rs b/crates/identity/src/auth.rs index 9416e221e..55ae98391 100644 --- a/crates/identity/src/auth.rs +++ b/crates/identity/src/auth.rs @@ -1,10 +1,6 @@ -use libp2p::identity::{Keypair, PublicKey}; +use libp2p::identity::PublicKey; use web3::signing::{keccak256, recover}; -pub fn verify_peer_auth(keypair: &Keypair, msg: &[u8], signature: &[u8]) -> bool { - keypair.public().verify(msg, signature) -} - pub fn verify_near_public_key( public_key: &str, msg: &[u8], @@ -50,7 +46,7 @@ pub fn verify_eth_signature(account: &str, message: &str, signature: &str) -> ey } } -pub fn eth_message(message: &str) -> [u8; 32] { +fn eth_message(message: &str) -> [u8; 32] { keccak256( format!( "{}{}{}", @@ -81,32 +77,4 @@ mod tests { let pubkey = format!("{:02X?}", pubkey); assert_eq!(account, pubkey) } - - #[test] - fn valid_headers() { - let keypair = get_peer_keypair().unwrap(); - let msg = "blabla"; - println!("challenge header= {:?}", bs58::encode(msg).into_string()); - - let signature = keypair.sign(msg.as_bytes()).unwrap(); - let signature_header = bs58::encode(&signature).into_string(); - println!("signature header = {:?}", signature_header); - - assert_eq!( - verify_peer_auth(&keypair, msg.as_bytes(), signature.as_slice()), - true - ); - } - - pub fn get_peer_keypair() -> Result { - let private_key = "23jhTekjBHR2wvqeGe5kHwJAzoYbhRoqN1YHL9jSsSeqDFwdTJevSnYQ2hcWsBPjGeVMFaTPAX3bPkc2yzyGJQ6AMfCEo"; - - let private_key = bs58::decode(private_key) - .into_vec() - .map_err(|_| "Invalid PrivKey base 58".to_string())?; - - let keypair = Keypair::from_protobuf_encoding(&private_key) - .map_err(|_| "Decoding PrivKey failed.".to_string())?; - Ok(keypair) - } } diff --git a/crates/identity/src/dht.rs b/crates/identity/src/dht.rs deleted file mode 100644 index 9e369872b..000000000 --- a/crates/identity/src/dht.rs +++ /dev/null @@ -1,42 +0,0 @@ -use std::io; - -use libp2p::kad::store::{MemoryStore, RecordStore}; - -use crate::types::DidDocument; - -pub struct Dht<'a> { - kad: &'a mut MemoryStore, -} - -impl<'a> Dht<'a> { - pub fn new(kad: &'a mut MemoryStore) -> Self { - Dht { kad } - } - - /// Write did in dht - pub fn write_record(&mut self, did_document: DidDocument) -> Result<(), io::Error> { - let key_id = did_document.id.as_bytes().to_owned(); - let key = libp2p::kad::RecordKey::from(key_id); - let value = serde_json::to_vec(&did_document)?; - let record = libp2p::kad::Record::new(key, value); - self.kad - .put(record) - .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?; - Ok(()) - } - - /// read did document per did id from dht - pub fn read_record(&self, did: String) -> Result, io::Error> { - let key_id: Vec = did.into(); - let key = libp2p::kad::RecordKey::from(key_id); - - if let Some(result) = self.kad.get(&key) { - let data = std::str::from_utf8(&result.value) - .map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?; - let did_document: DidDocument = serde_json::from_str(data)?; - Ok(Some(did_document)) - } else { - Ok(None) - } - } -} diff --git a/crates/identity/src/identity_provider.rs b/crates/identity/src/identity_provider.rs deleted file mode 100644 index bb445e2e0..000000000 --- a/crates/identity/src/identity_provider.rs +++ /dev/null @@ -1,71 +0,0 @@ -use std::io; - -use libp2p::identity::PublicKey; -use libp2p::kad::store::MemoryStore; -use multibase::{encode, Base}; - -use crate::dht::Dht; -use crate::types::{AlgorithmType, DidDocument, VerificationMethod}; - -#[derive(Debug)] -pub struct Authentication { - pub algorithm: AlgorithmType, - pub controller: Option, - pub public_key: PublicKey, -} - -const DID_CALI_IDENTIFIER: &str = "did:cali:"; - -/// Create decentralized identity document based on provided public key -/// { -/// "id": "did:cali:12D3KooWLU42rBMLrzAyFg8CdpHiPcwJcVsKv9Wx9DtiT4QjPGGV", -/// "verificationMethod": [ -/// { -/// "id": "did:cali:12D3KooWLU42rBMLrzAyFg8CdpHiPcwJcVsKv9Wx9DtiT4QjPGGV", -/// "type": "Ed25519", -/// "publicKeyMultibase": "zCovLVG4fQcqT8sDqj76uQuXtQU2LqABAf6X8vnDW36zAidisFK22Z5Ecm28apKb9Kg6ofRo", -/// "controller": "did:cali:12D3KooWLU42rBMLrzAyFg8CdpHiPcwJcVsKv9Wx9DtiT4QjPGGV" -/// } -/// ] -/// } -pub fn create_identity( - store: &mut MemoryStore, - authentication: Authentication, -) -> Result { - let public_key_id = authentication.public_key.to_peer_id(); - let multibase_encoded = encode(Base::Base58Btc, public_key_id.as_ref().to_bytes()); - - let did = format!("{}{}", DID_CALI_IDENTIFIER, public_key_id); - - let verification_method: VerificationMethod = VerificationMethod { - id: format!("{}#key1", did), - algorithm_type: authentication.algorithm.to_string(), - public_key_multibase: multibase_encoded, - controller: authentication.controller.unwrap_or_else(|| did.clone()), - }; - - let did_document: DidDocument = DidDocument { - id: did, - verification_method: vec![verification_method], - }; - Dht::new(store).write_record(did_document.clone())?; - - return Ok(did_document); -} - -pub fn get_identifier( - store: &mut MemoryStore, - did: String, -) -> Result, io::Error> { - return Dht::new(store).read_record(did); -} - -#[allow(dead_code)] -pub async fn update_identifier() { - unimplemented!(); -} - -#[allow(dead_code)] -pub async fn delete_identifier() { - unimplemented!(); -} diff --git a/crates/identity/src/lib.rs b/crates/identity/src/lib.rs index 75d46b9c6..6cfda0be7 100644 --- a/crates/identity/src/lib.rs +++ b/crates/identity/src/lib.rs @@ -1,6 +1,2 @@ pub mod auth; -pub mod dht; -pub mod identity_provider; -pub mod types; -pub mod vc; -pub mod vp; +// pub mod types; diff --git a/crates/identity/src/main.rs b/crates/identity/src/main.rs deleted file mode 100644 index b93e21b96..000000000 --- a/crates/identity/src/main.rs +++ /dev/null @@ -1,80 +0,0 @@ -mod auth; - -use std::borrow::BorrowMut; -use std::error::Error; - -use calimero_identity::identity_provider::{create_identity, get_identifier, Authentication}; -use calimero_identity::types::{AlgorithmType, WalletType}; -use calimero_identity::vc::create_wallet_verifiable_credentials; -use calimero_identity::vp::{create_verifiable_presentation, validate_verifiable_presentation}; -use libp2p::identity::Keypair; -use libp2p::kad::store::MemoryStore; - -fn main() -> Result<(), Box> { - //generate keypair in any way - let peer_keypair = Keypair::generate_ed25519(); - let peer_public_key = peer_keypair.public(); - - let authentication: Authentication = Authentication { - algorithm: AlgorithmType::Ed25519, - controller: None, - public_key: peer_public_key.clone(), - }; - - let peer_id = peer_public_key.to_peer_id(); - let mut store = MemoryStore::new(peer_id); - - println!("Generate identity"); - let identity = create_identity(store.borrow_mut(), authentication); - let did_document = match identity { - Ok(value) => { - let formatted_identity = serde_json::to_string_pretty(&value).unwrap(); - println!("Stored did document: {}", formatted_identity); - value - } - Err(err) => { - println!("Error while reading record {}", err); - return Err(Box::new(err)); - } - }; - - println!("Fetch identity"); - let identity = get_identifier(store.borrow_mut(), did_document.id.clone()); - match identity { - Ok(value) => { - let formatted_identity = serde_json::to_string_pretty(&value).unwrap(); - println!("Fetched did document {}", formatted_identity) - } - Err(err) => { - println!("Error while reading record {}", err) - } - } - - println!("Create verifiable credential"); - let wallet_keypair = Keypair::generate_ed25519(); - let message = peer_id.to_string(); - let proof = wallet_keypair.sign(&message.as_bytes())?; - let verifiable_credential = create_wallet_verifiable_credentials( - peer_id.to_string(), - WalletType::NEAR, - "cali.near".to_string(), - wallet_keypair.public().encode_protobuf(), - proof, - )?; - println!("Verifiable credential: {:?}", verifiable_credential); - - println!("Create verifiable presentation"); - let application_challenge = "alpha bravo sigma"; - let verifiable_presentation = create_verifiable_presentation( - application_challenge.to_string(), - verifiable_credential, - &peer_keypair, - )?; - - println!("Verifiable presentation: {:?}", verifiable_presentation); - let verifiable_presentation_result = - validate_verifiable_presentation(&peer_keypair.public(), &verifiable_presentation); - println!("Validate verifiable presentation: {verifiable_presentation_result}"); - - Ok(()) -} diff --git a/crates/identity/src/types.rs b/crates/identity/src/types.rs deleted file mode 100644 index a7adc5259..000000000 --- a/crates/identity/src/types.rs +++ /dev/null @@ -1,85 +0,0 @@ -use std::fmt; - -use serde::{Deserialize, Serialize}; - -#[derive(Debug, Serialize, Deserialize)] -pub struct SerializedPublicKey(Vec); - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct VerificationMethod { - pub id: String, - #[serde(rename = "type")] - pub algorithm_type: String, - #[serde(rename = "publicKeyMultibase")] - pub public_key_multibase: String, - pub controller: String, -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct DidDocument { - pub id: String, - pub verification_method: Vec, -} - -impl DidDocument { - pub fn new(id: String, verification_method: Vec) -> Self { - Self { - id, - verification_method, - } - } -} - -#[derive(Debug, Serialize, Clone, Deserialize)] -pub enum AlgorithmType { - Ed25519, -} - -impl fmt::Display for AlgorithmType { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - AlgorithmType::Ed25519 => write!(f, "Ed25519"), - } - } -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub enum WalletType { - ETH, - NEAR, -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub enum VerifiableCredentialType { - Wallet(WalletVerifiableCredential), -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(rename = "camelCase")] -pub struct WalletVerifiableCredential { - #[serde(rename = "wallet")] - pub wallet_type: WalletType, - pub address: String, - pub public_key: Vec, - pub peer_id: String, -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(rename = "camelCase")] -pub struct VerifiableCredential { - pub id: String, - pub issuer: String, - #[serde(rename = "type")] - pub algorithm_type: AlgorithmType, - pub credential_subject: VerifiableCredentialType, - pub proof: Vec, -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct VerifiablePresentation { - pub challenge: String, - pub verifiable_credential: VerifiableCredential, - pub signature: Vec, -} diff --git a/crates/identity/src/vc.rs b/crates/identity/src/vc.rs deleted file mode 100644 index ef48d31df..000000000 --- a/crates/identity/src/vc.rs +++ /dev/null @@ -1,64 +0,0 @@ -use std::io; - -use libp2p::identity::PublicKey; -use types::WalletType; - -use crate::types::{ - self, AlgorithmType, VerifiableCredential, VerifiableCredentialType, WalletVerifiableCredential, -}; - -pub fn create_wallet_verifiable_credentials( - peer_id: String, - wallet_type: WalletType, - address: String, - public_key: Vec, - proof: Vec, -) -> Result { - let wallet_verifiable_credential = WalletVerifiableCredential { - wallet_type, - address, - public_key, - peer_id: peer_id.clone(), - }; - create_verifiable_credentials( - peer_id, - VerifiableCredentialType::Wallet(wallet_verifiable_credential), - proof, - ) -} - -pub fn create_verifiable_credentials( - peer_id: String, - credential_subject: VerifiableCredentialType, - proof: Vec, -) -> Result { - //check for proof - let verified_proof = match &credential_subject { - VerifiableCredentialType::Wallet(wallet) => { - let pubkey_result = PublicKey::try_decode_protobuf(&wallet.public_key); - match pubkey_result { - Ok(pub_k) => pub_k.verify(&wallet.peer_id.as_bytes(), &proof), - Err(err) => { - print!("Error while decoding proof {err}"); - false - } - } - } - }; - if !verified_proof { - return Err(io::Error::new( - io::ErrorKind::InvalidData, - "Invalid proof for public key", - )); - } - - let verifiable_credentials = VerifiableCredential { - id: peer_id.clone(), //TBD - issuer: peer_id, - credential_subject, - proof, - algorithm_type: AlgorithmType::Ed25519, - }; - - Ok(verifiable_credentials) -} diff --git a/crates/identity/src/vp.rs b/crates/identity/src/vp.rs deleted file mode 100644 index aed618327..000000000 --- a/crates/identity/src/vp.rs +++ /dev/null @@ -1,29 +0,0 @@ -use libp2p::identity::{Keypair, PublicKey, SigningError}; - -use crate::types::{VerifiableCredential, VerifiablePresentation}; - -pub fn create_verifiable_presentation( - challenge: String, - verifiable_credential: VerifiableCredential, - key_pair: &Keypair, -) -> Result { - //sign challenge with node private key - let signature = key_pair.sign(challenge.as_bytes())?; - let vp = VerifiablePresentation { - challenge, - verifiable_credential, - signature, - }; - - Ok(vp) -} - -pub fn validate_verifiable_presentation( - public_key: &PublicKey, - verifiable_presentation: &VerifiablePresentation, -) -> bool { - public_key.verify( - verifiable_presentation.challenge.as_bytes(), - &verifiable_presentation.signature, - ) -} diff --git a/crates/server/src/middleware/auth.rs b/crates/server/src/middleware/auth.rs index 498bdcca1..afb167a20 100644 --- a/crates/server/src/middleware/auth.rs +++ b/crates/server/src/middleware/auth.rs @@ -13,9 +13,8 @@ use libp2p::futures::future::BoxFuture; use tower::{Layer, Service}; use tracing::debug; -use crate::admin::service::{parse_api_error, ApiError}; use crate::admin::storage::client_keys::exists_client_key; -use crate::admin::storage::root_key::{exists_root_keys, get_root_keys}; +use crate::admin::storage::root_key::exists_root_keys; #[derive(Clone)] pub struct AuthSignatureLayer { @@ -158,7 +157,7 @@ fn get_auth_headers(headers: &HeaderMap) -> Result