From 0bff51882440eefbd9bce877875ba108d6be239c Mon Sep 17 00:00:00 2001 From: Nathaniel Cook Date: Tue, 25 Apr 2023 14:51:50 -0600 Subject: [PATCH] feat(event): Add event (commit) libraries for creating events for ceramic Add event functionality (see https://developers.ceramic.network/protocol/streams/event-log/#events) which is similar to commit functionality currently found in ceramic. --- .gitignore | 1 + Cargo.lock | 2832 ++++++++++++++++++++----- Cargo.toml | 29 +- core/Cargo.toml | 32 + core/src/bytes.rs | 76 + core/src/jwk.rs | 187 ++ core/src/jws.rs | 90 + core/src/lib.rs | 221 ++ core/src/stream_id.rs | 210 ++ event/Cargo.toml | 31 + event/src/args.rs | 182 ++ event/src/deterministic_init_event.rs | 25 + event/src/event.rs | 140 ++ event/src/lib.rs | 13 + kubo-rpc/Cargo.toml | 9 +- kubo-rpc/src/http/mod.rs | 8 +- 16 files changed, 3506 insertions(+), 580 deletions(-) create mode 100644 core/Cargo.toml create mode 100644 core/src/bytes.rs create mode 100644 core/src/jwk.rs create mode 100644 core/src/jws.rs create mode 100644 core/src/lib.rs create mode 100644 core/src/stream_id.rs create mode 100644 event/Cargo.toml create mode 100644 event/src/args.rs create mode 100644 event/src/deterministic_init_event.rs create mode 100644 event/src/event.rs create mode 100644 event/src/lib.rs diff --git a/.gitignore b/.gitignore index 56ce72803..71b6a9434 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target */target +.idea diff --git a/Cargo.lock b/Cargo.lock index 43105a47d..12bc46242 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,7 +8,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57a7559404a7f3573127aab53c08ce37a6c6a315c374a31070f3c91cd1b4a7fe" dependencies = [ - "bitflags 1.3.2", + "bitflags", "bytes", "futures-core", "futures-sink", @@ -31,7 +31,7 @@ dependencies = [ "actix-utils", "ahash 0.8.3", "base64 0.21.0", - "bitflags 1.3.2", + "bitflags", "brotli", "bytes", "bytestring", @@ -65,7 +65,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "465a6172cf69b960917811022d8f29bc0b7fa1398bc4f78b3c466673db1213b6" dependencies = [ "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -198,7 +198,7 @@ dependencies = [ "serde_urlencoded", "smallvec", "socket2", - "time", + "time 0.3.20", "url", ] @@ -211,7 +211,7 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -235,7 +235,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" dependencies = [ - "generic-array", + "generic-array 0.14.7", ] [[package]] @@ -244,18 +244,18 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" dependencies = [ - "generic-array", + "generic-array 0.14.7", "rand_core 0.6.4", ] [[package]] name = "aead" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c192eb8f11fc081b0fe4259ba5af04217d4e0faddd02417310a927911abd7c8" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" dependencies = [ "crypto-common", - "generic-array", + "generic-array 0.14.7", ] [[package]] @@ -278,7 +278,7 @@ dependencies = [ "cfg-if", "cipher 0.3.0", "cpufeatures", - "opaque-debug", + "opaque-debug 0.3.0", ] [[package]] @@ -312,7 +312,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82e1366e0c69c9f927b1fa5ce2c7bf9eafc8f9268c0b9800729e8b267612447c" dependencies = [ - "aead 0.5.1", + "aead 0.5.2", "aes 0.8.2", "cipher 0.4.4", "ctr 0.9.2", @@ -327,7 +327,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" dependencies = [ "cipher 0.2.5", - "opaque-debug", + "opaque-debug 0.3.0", ] [[package]] @@ -337,7 +337,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" dependencies = [ "cipher 0.2.5", - "opaque-debug", + "opaque-debug 0.3.0", ] [[package]] @@ -346,7 +346,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.8", + "getrandom 0.2.9", "once_cell", "version_check", ] @@ -358,16 +358,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ "cfg-if", - "getrandom 0.2.8", + "getrandom 0.2.9", "once_cell", "version_check", ] [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" dependencies = [ "memchr", ] @@ -396,11 +396,60 @@ dependencies = [ "libc", ] +[[package]] +name = "anstream" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" + +[[package]] +name = "anstyle-parse" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + [[package]] name = "anyhow" -version = "1.0.69" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" +checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" dependencies = [ "backtrace", ] @@ -413,9 +462,15 @@ checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" [[package]] name = "arrayref" -version = "0.3.6" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "arrayvec" @@ -436,7 +491,7 @@ dependencies = [ "num-traits", "rusticata-macros", "thiserror", - "time", + "time 0.3.20", ] [[package]] @@ -452,7 +507,7 @@ dependencies = [ "num-traits", "rusticata-macros", "thiserror", - "time", + "time 0.3.20", ] [[package]] @@ -463,7 +518,7 @@ checksum = "db8b7511298d5b7784b40b092d9e9dcd3a627a5707e4b5e507931ab0d44eeebf" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "synstructure", ] @@ -475,7 +530,7 @@ checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "synstructure", ] @@ -487,14 +542,24 @@ checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "asn1_der" -version = "0.7.5" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "155a5a185e42c6b77ac7b88a15143d930a9e9727a5b7b77eed417404ab15c247" + +[[package]] +name = "async-attributes" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22d1f4b888c298a027c99dc9048015fac177587de20fc30232a057dfbe24a21" +checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" +dependencies = [ + "quote", + "syn 1.0.109", +] [[package]] name = "async-broadcast" @@ -518,24 +583,53 @@ dependencies = [ "futures-core", ] +[[package]] +name = "async-executor" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" +dependencies = [ + "async-lock", + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "slab", +] + +[[package]] +name = "async-global-executor" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1b6f5d7df27bd294849f8eec66ecfc63d11814df7a4f5d74168a2394467b776" +dependencies = [ + "async-channel", + "async-executor", + "async-io", + "async-lock", + "blocking", + "futures-lite", + "once_cell", +] + [[package]] name = "async-io" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c374dda1ed3e7d8f0d9ba58715f924862c63eae6849c92d3a18e7fbde9e2794" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ "async-lock", "autocfg", + "cfg-if", "concurrent-queue", "futures-lite", - "libc", "log", "parking", "polling", + "rustix", "slab", "socket2", "waker-fn", - "windows-sys 0.42.0", ] [[package]] @@ -547,11 +641,38 @@ dependencies = [ "event-listener", ] +[[package]] +name = "async-std" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" +dependencies = [ + "async-attributes", + "async-channel", + "async-global-executor", + "async-io", + "async-lock", + "crossbeam-utils", + "futures-channel", + "futures-core", + "futures-io", + "futures-lite", + "gloo-timers", + "kv-log-macro", + "log", + "memchr", + "once_cell", + "pin-project-lite 0.2.9", + "pin-utils", + "slab", + "wasm-bindgen-futures", +] + [[package]] name = "async-stream" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad445822218ce64be7a341abfb0b1ea43b5c23aa83902542a4542e78309d8e5e" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" dependencies = [ "async-stream-impl", "futures-core", @@ -560,24 +681,30 @@ dependencies = [ [[package]] name = "async-stream-impl" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4655ae1a7b0cdf149156f780c5bf3f1352bc53cbd9e0a361a7ef7b22947e965" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] +[[package]] +name = "async-task" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" + [[package]] name = "async-trait" -version = "0.1.66" +version = "0.1.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84f9ebcc6c1f5b8cb160f6990096a5c127f423fcb6e1ccc46c370cbdfb75dfc" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] @@ -595,9 +722,9 @@ dependencies = [ [[package]] name = "atomic-waker" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "debc29dde2e69f9e47506b525f639ed42300fc014a3e007832592448fa8e4599" +checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" [[package]] name = "atty" @@ -618,13 +745,13 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "axum" -version = "0.6.7" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fb79c228270dcf2426e74864cabc94babb5dbab01a4314e702d2f16540e1591" +checksum = "f8175979259124331c1d7bf6586ee7e0da434155e4b2d48ec2c8386281d8df39" dependencies = [ "async-trait", "axum-core", - "bitflags 1.3.2", + "bitflags", "bytes", "futures-util", "http", @@ -640,16 +767,15 @@ dependencies = [ "serde", "sync_wrapper", "tower", - "tower-http", "tower-layer", "tower-service", ] [[package]] name = "axum-core" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2f958c80c248b34b9a877a643811be8dbca03ca5ba827f2b63baf3a81e5fc4e" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" dependencies = [ "async-trait", "bytes", @@ -672,7 +798,7 @@ dependencies = [ "cc", "cfg-if", "libc", - "miniz_oxide", + "miniz_oxide 0.6.2", "object", "rustc-demangle", ] @@ -689,6 +815,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +[[package]] +name = "base64" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" + [[package]] name = "base64" version = "0.13.1" @@ -716,6 +848,12 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +[[package]] +name = "bech32" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9ff0bbfd639f15c74af777d81383cf53efb7c93613f6cab67c6c11e05bbf8b" + [[package]] name = "bincode" version = "1.3.3" @@ -731,7 +869,7 @@ version = "0.64.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4" dependencies = [ - "bitflags 1.3.2", + "bitflags", "cexpr", "clang-sys", "lazy_static", @@ -742,7 +880,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn", + "syn 1.0.109", ] [[package]] @@ -752,10 +890,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "bitflags" -version = "2.2.1" +name = "bitvec" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24a6904aef64d73cf10ab17ebace7befb918b82164785cb89907993be7f83813" +checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] [[package]] name = "blake2" @@ -766,6 +910,17 @@ dependencies = [ "digest 0.10.6", ] +[[package]] +name = "blake2b_simd" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "constant_time_eq 0.1.5", +] + [[package]] name = "blake2b_simd" version = "1.0.1" @@ -773,8 +928,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" dependencies = [ "arrayref", - "arrayvec", - "constant_time_eq", + "arrayvec 0.7.2", + "constant_time_eq 0.2.5", ] [[package]] @@ -784,8 +939,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6637f448b9e61dfadbdcbae9a885fadee1f3eaffb1f8d3c1965d3ade8bdfd44f" dependencies = [ "arrayref", - "arrayvec", - "constant_time_eq", + "arrayvec 0.7.2", + "constant_time_eq 0.2.5", ] [[package]] @@ -795,10 +950,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ae2468a89544a466886840aa467a25b766499f4f04bf7d9fcd10ecee9fccef" dependencies = [ "arrayref", - "arrayvec", + "arrayvec 0.7.2", "cc", "cfg-if", - "constant_time_eq", + "constant_time_eq 0.2.5", +] + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding 0.1.5", + "byte-tools", + "byteorder", + "generic-array 0.12.4", ] [[package]] @@ -807,7 +974,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "generic-array", + "generic-array 0.14.7", ] [[package]] @@ -816,7 +983,7 @@ version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array", + "generic-array 0.14.7", ] [[package]] @@ -825,16 +992,40 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57a0e8073e8baa88212fb5823574c02ebccb395136ba9a164ab89379ec6072f0" dependencies = [ - "block-padding", + "block-padding 0.2.1", "cipher 0.2.5", ] +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +dependencies = [ + "byte-tools", +] + [[package]] name = "block-padding" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" +[[package]] +name = "blocking" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" +dependencies = [ + "async-channel", + "async-lock", + "async-task", + "atomic-waker", + "fastrand", + "futures-lite", + "log", +] + [[package]] name = "brotli" version = "3.3.4" @@ -861,12 +1052,21 @@ name = "bs58" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +dependencies = [ + "sha2 0.9.9", +] [[package]] name = "bumpalo" -version = "3.12.0" +version = "3.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8" + +[[package]] +name = "byte-tools" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "bytecheck" @@ -887,7 +1087,7 @@ checksum = "e31225543cb46f81a7e224762764f4a6a0f097b1db0b175f69e8065efaa42de5" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -925,6 +1125,35 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "cacaos" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92680fcbb8e24eaa4640c6deca0042db02da17c8b92fde62a0c517bcb6769d7d" +dependencies = [ + "async-trait", + "hex", + "http", + "iri-string", + "libipld 0.14.0", + "serde", + "serde_with 2.3.3", + "siwe", + "thiserror", + "time 0.3.20", + "url", +] + +[[package]] +name = "cached" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af4dfac631a8e77b2f327f7852bb6172771f5279c4512efe79fad6067b37be3d" +dependencies = [ + "hashbrown 0.11.2", + "once_cell", +] + [[package]] name = "cbor4ii" version = "0.2.14" @@ -954,6 +1183,53 @@ dependencies = [ "subtle", ] +[[package]] +name = "ceramic-core" +version = "0.1.0" +dependencies = [ + "anyhow", + "base64 0.21.0", + "cid 0.9.0", + "did-method-key", + "did-pkh", + "hex", + "int-enum", + "multibase 0.9.1", + "once_cell", + "regex", + "serde", + "serde_ipld_dagcbor", + "serde_json", + "ssi", + "test-log", + "tokio", + "tracing", + "tracing-subscriber", + "unsigned-varint", +] + +[[package]] +name = "ceramic-event" +version = "0.1.0" +dependencies = [ + "anyhow", + "ceramic-core", + "expect-test", + "libipld 0.15.0", + "multibase 0.9.1", + "multihash 0.17.0", + "once_cell", + "rand 0.8.5", + "serde", + "serde_ipld_dagcbor", + "serde_json", + "ssi", + "test-log", + "tokio", + "tracing", + "tracing-subscriber", +] + [[package]] name = "ceramic-kubo-rpc" version = "0.1.0" @@ -977,7 +1253,7 @@ dependencies = [ "iroh-rpc-types", "iroh-store", "itertools", - "libipld", + "libipld 0.15.0", "libp2p", "libp2p-tls", "mime", @@ -1000,7 +1276,7 @@ dependencies = [ "actix-web", "anyhow", "ceramic-kubo-rpc", - "clap 4.1.11", + "clap 4.2.7", "expect-test", "futures", "futures-util", @@ -1011,7 +1287,7 @@ dependencies = [ "iroh-rpc-client", "iroh-rpc-types", "iroh-store", - "libipld", + "libipld 0.15.0", "libp2p", "multiaddr", "names", @@ -1069,14 +1345,17 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.23" +version = "0.4.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" +checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" dependencies = [ "iana-time-zone", + "js-sys", "num-integer", "num-traits", "serde", + "time 0.1.45", + "wasm-bindgen", "winapi", ] @@ -1087,7 +1366,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6ed9c8b2d17acb8110c46f1da5bf4a696d745e1474a16db0cd2b49cd0249bf2" dependencies = [ "core2", - "multibase", + "multibase 0.9.1", "multihash 0.16.3", "serde", "serde_bytes", @@ -1101,7 +1380,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9b68e3193982cd54187d71afdb2a271ad4cf8af157858e9cb911b91321de143" dependencies = [ "core2", - "multibase", + "multibase 0.9.1", "multihash 0.17.0", "serde", "serde_bytes", @@ -1114,7 +1393,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" dependencies = [ - "generic-array", + "generic-array 0.14.7", ] [[package]] @@ -1123,7 +1402,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" dependencies = [ - "generic-array", + "generic-array 0.14.7", ] [[package]] @@ -1138,9 +1417,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ed9a53e5d4d9c573ae844bfac6872b159cb1d1585a83b29e7a64b7eef7332a" +checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" dependencies = [ "glob", "libc", @@ -1149,60 +1428,68 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.23" +version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" dependencies = [ "atty", - "bitflags 1.3.2", - "clap_derive 3.2.18", + "bitflags", + "clap_derive 3.2.25", "clap_lex 0.2.4", "indexmap", "once_cell", - "strsim", + "strsim 0.10.0", "termcolor", "textwrap", ] [[package]] name = "clap" -version = "4.1.11" +version = "4.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42dfd32784433290c51d92c438bb72ea5063797fc3cc9a21a8c4346bebbb2098" +checksum = "34d21f9bf1b425d2968943631ec91202fe5e837264063503708b83013f8fc938" dependencies = [ - "bitflags 2.2.1", - "clap_derive 4.1.9", - "clap_lex 0.3.2", - "is-terminal", + "clap_builder", + "clap_derive 4.2.0", "once_cell", - "strsim", - "termcolor", +] + +[[package]] +name = "clap_builder" +version = "4.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "914c8c79fb560f238ef6429439a30023c862f7a28e688c58f7203f12b29970bd" +dependencies = [ + "anstream", + "anstyle", + "bitflags", + "clap_lex 0.4.1", + "strsim 0.10.0", ] [[package]] name = "clap_derive" -version = "3.2.18" +version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" +checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" dependencies = [ "heck", "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "clap_derive" -version = "4.1.9" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fddf67631444a3a3e3e5ac51c36a5e01335302de677bd78759eaa90ab1f46644" +checksum = "3f9644cd56d6b87dbe899ef8b053e331c0637664e9e21a33dfcdc36093f5c5c4" dependencies = [ "heck", - "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] @@ -1216,11 +1503,17 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.3.2" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" + +[[package]] +name = "clear_on_drop" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350b9cf31731f9957399229e9b2adc51eeabdfbe9d71d9a0552275fd12710d09" +checksum = "38508a63f4979f0048febc9966fadbd48e5dab31fd0ec6a3f151bbf4a74f7423" dependencies = [ - "os_str_bytes", + "cc", ] [[package]] @@ -1233,6 +1526,18 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "combination" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "337cdbf3f1a0e643b4a7d1a2ffa39d22342fb6ee25739b5cfb997c28b3586422" + [[package]] name = "common-multipart-rfc7578" version = "0.6.0" @@ -1251,9 +1556,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c278839b831783b70278b14df4d45e1beb1aad306c07bb796637de9a0e323e8e" +checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" dependencies = [ "crossbeam-utils", ] @@ -1277,6 +1582,12 @@ dependencies = [ "yaml-rust", ] +[[package]] +name = "const-oid" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" + [[package]] name = "const-oid" version = "0.9.2" @@ -1285,24 +1596,36 @@ checksum = "520fbf3c07483f94e3e3ca9d0cfd913d7718ef2483d2cfd91c0d9e91474ab913" [[package]] name = "constant_time_eq" -version = "0.2.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3ad85c1f65dc7b37604eb0e89748faf0b9653065f2a8ef69f96a687ec1e9279" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] -name = "convert_case" -version = "0.4.0" +name = "constant_time_eq" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +checksum = "13418e745008f7349ec7e449155f419a61b92b58a99cc3616942b926825ec76b" [[package]] -name = "cookie" -version = "0.16.2" +name = "contextual" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05ca71f324d19e85a2e976be04b5ecbb193253794a75adfe2e5044c8bef03f6a" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "cookie" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" dependencies = [ "percent-encoding", - "time", + "time 0.3.20", "version_check", ] @@ -1318,9 +1641,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "core2" @@ -1333,9 +1656,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" dependencies = [ "libc", ] @@ -1366,9 +1689,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2b3e8478797446514c91ef04bafcb59faba183e621ad488df88983cc14128c" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ "cfg-if", "crossbeam-utils", @@ -1423,13 +1746,23 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-bigint" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" +dependencies = [ + "generic-array 0.14.7", + "subtle", +] + [[package]] name = "crypto-bigint" version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" dependencies = [ - "generic-array", + "generic-array 0.14.7", "rand_core 0.6.4", "subtle", "zeroize", @@ -1441,7 +1774,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array", + "generic-array 0.14.7", "rand_core 0.6.4", "typenum", ] @@ -1452,7 +1785,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" dependencies = [ - "generic-array", + "generic-array 0.14.7", "subtle", ] @@ -1463,7 +1796,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" dependencies = [ "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1509,9 +1842,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.0.0-rc.0" +version = "4.0.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da00a7a9a4eb92a0a0f8e75660926d48f0d0f3c537e455c457bcdaa1e16b1ac" +checksum = "8d4ba9852b42210c7538b75484f9daa0655e9a3ac04f693747bb0f02cf3cfe16" dependencies = [ "cfg-if", "fiat-crypto", @@ -1523,9 +1856,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.92" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a140f260e6f3f79013b8bfc65e7ce630c9ab4388c6a89c71e07226f49487b72" +checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93" dependencies = [ "cc", "cxxbridge-flags", @@ -1535,9 +1868,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.92" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da6383f459341ea689374bf0a42979739dc421874f112ff26f829b8040b8e613" +checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b" dependencies = [ "cc", "codespan-reporting", @@ -1545,24 +1878,24 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn", + "syn 2.0.15", ] [[package]] name = "cxxbridge-flags" -version = "1.0.92" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90201c1a650e95ccff1c8c0bb5a343213bdd317c6e600a93075bca2eff54ec97" +checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb" [[package]] name = "cxxbridge-macro" -version = "1.0.92" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b75aed41bb2e6367cae39e6326ef817a851db13c13e4f3263714ca3cfb8de56" +checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] @@ -1573,21 +1906,79 @@ checksum = "66d43879cac9c48b2f934bc49947cb1a1f82b05e83175cf2eba1ced8496322f0" dependencies = [ "anyhow", "base64-url", - "libipld", + "libipld 0.15.0", "serde", "serde_derive", "serde_ipld_dagcbor", "thiserror", ] +[[package]] +name = "darling" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" +dependencies = [ + "darling_core 0.10.2", + "darling_macro 0.10.2", +] + +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core 0.13.4", + "darling_macro 0.13.4", +] + [[package]] name = "darling" version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.14.4", + "darling_macro 0.14.4", +] + +[[package]] +name = "darling" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c99d16b88c92aef47e58dadd53e87b4bd234c29934947a6cec8b466300f99b" +dependencies = [ + "darling_core 0.20.0", + "darling_macro 0.20.0", +] + +[[package]] +name = "darling_core" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.9.3", + "syn 1.0.109", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.10.0", + "syn 1.0.109", ] [[package]] @@ -1600,8 +1991,44 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim", - "syn", + "strsim 0.10.0", + "syn 1.0.109", +] + +[[package]] +name = "darling_core" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ea05d2fcb27b53f7a98faddaf5f2914760330ab7703adfc9df13332b42189f9" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.10.0", + "syn 2.0.15", +] + +[[package]] +name = "darling_macro" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" +dependencies = [ + "darling_core 0.10.2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core 0.13.4", + "quote", + "syn 1.0.109", ] [[package]] @@ -1610,9 +2037,20 @@ version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" dependencies = [ - "darling_core", + "darling_core 0.14.4", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bfb82b62b1b8a2a9808fb4caf844ede819a76cfc23b2827d7f94eefb49551eb" +dependencies = [ + "darling_core 0.20.0", "quote", - "syn", + "syn 2.0.15", ] [[package]] @@ -1622,7 +2060,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" dependencies = [ "cfg-if", - "hashbrown", + "hashbrown 0.12.3", "lock_api", "once_cell", "parking_lot_core 0.9.7", @@ -1651,7 +2089,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038db" dependencies = [ "data-encoding", - "syn", + "syn 1.0.109", ] [[package]] @@ -1664,14 +2102,31 @@ dependencies = [ "tokio", ] +[[package]] +name = "decoded-char" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5440d1dc8ea7cae44cda3c64568db29bfa2434aba51ae66a50c00488841a65a3" + +[[package]] +name = "der" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" +dependencies = [ + "const-oid 0.7.1", + "crypto-bigint 0.3.2", + "pem-rfc7468 0.3.1", +] + [[package]] name = "der" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" dependencies = [ - "const-oid", - "pem-rfc7468", + "const-oid 0.9.2", + "pem-rfc7468 0.6.0", "zeroize", ] @@ -1711,7 +2166,20 @@ checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2658621297f2cf68762a6f7dc0bb7e1ff2cfd6583daef8ee0fed6f7ec468ec0" +dependencies = [ + "darling 0.10.2", + "derive_builder_core 0.9.0", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -1723,16 +2191,28 @@ dependencies = [ "derive_builder_macro", ] +[[package]] +name = "derive_builder_core" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2791ea3e372c8495c0bc2033991d76b512cd799d07491fbd6890124db9458bef" +dependencies = [ + "darling 0.10.2", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "derive_builder_core" version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" dependencies = [ - "darling", + "darling 0.14.4", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1741,8 +2221,8 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" dependencies = [ - "derive_builder_core", - "syn", + "derive_builder_core 0.11.2", + "syn 1.0.109", ] [[package]] @@ -1755,7 +2235,45 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "did-method-key" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "543b322ff52ab4892f4fd30ceb8fa1007aca4e3c5e89ad55793036846f0cc74e" +dependencies = [ + "async-trait", + "k256", + "multibase 0.8.0", + "p256", + "serde_json", + "simple_asn1", + "ssi-crypto", + "ssi-dids", + "ssi-jwk", + "thiserror", +] + +[[package]] +name = "did-pkh" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "074c4ae82880d60a25048cd3bf2e8aaaa881922d7c73fbb9ec29fc67fa0d33e4" +dependencies = [ + "async-trait", + "bech32", + "bs58", + "chrono", + "iref", + "serde", + "serde_json", + "ssi-caips", + "ssi-crypto", + "ssi-dids", + "ssi-jwk", + "static-iref", ] [[package]] @@ -1764,13 +2282,22 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array 0.12.4", +] + [[package]] name = "digest" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array", + "generic-array 0.14.7", ] [[package]] @@ -1780,7 +2307,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" dependencies = [ "block-buffer 0.10.4", - "const-oid", + "const-oid 0.9.2", "crypto-common", "subtle", ] @@ -1814,7 +2341,7 @@ checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1841,7 +2368,7 @@ version = "0.14.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" dependencies = [ - "der", + "der 0.6.1", "elliptic-curve", "rfc6979", "signature", @@ -1883,15 +2410,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" dependencies = [ "base16ct", - "crypto-bigint", - "der", + "crypto-bigint 0.4.9", + "der 0.6.1", "digest 0.10.6", "ff", - "generic-array", + "generic-array 0.14.7", "group", "hkdf", - "pem-rfc7468", - "pkcs8", + "pem-rfc7468 0.6.0", + "pkcs8 0.9.0", "rand_core 0.6.4", "sec1", "subtle", @@ -1916,18 +2443,18 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "errno" -version = "0.2.8" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" dependencies = [ "errno-dragonfly", "libc", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -1956,6 +2483,12 @@ dependencies = [ "once_cell", ] +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + [[package]] name = "fastrand" version = "1.9.0" @@ -1977,9 +2510,18 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.1.19" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ace6ec7cc19c8ed33a32eaa9ea692d7faea05006b5356b9e2b668ec4bc3955" +checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" + +[[package]] +name = "fixed-hash" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" +dependencies = [ + "static_assertions", +] [[package]] name = "fixedbitset" @@ -1989,13 +2531,13 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" dependencies = [ "crc32fast", "libz-sys", - "miniz_oxide", + "miniz_oxide 0.7.1", ] [[package]] @@ -2008,7 +2550,7 @@ dependencies = [ "futures-sink", "nanorand", "pin-project", - "spin 0.9.5", + "spin 0.9.8", ] [[package]] @@ -2026,11 +2568,17 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "funty" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" + [[package]] name = "futures" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" dependencies = [ "futures-channel", "futures-core", @@ -2043,9 +2591,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", "futures-sink", @@ -2053,15 +2601,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] name = "futures-executor" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" dependencies = [ "futures-core", "futures-task", @@ -2071,15 +2619,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-lite" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ "fastrand", "futures-core", @@ -2092,13 +2640,13 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] @@ -2114,15 +2662,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-timer" @@ -2132,9 +2680,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-channel", "futures-core", @@ -2150,9 +2698,18 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + +[[package]] +name = "generic-array" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -2171,9 +2728,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" dependencies = [ "cfg-if", "js-sys", @@ -2188,7 +2745,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" dependencies = [ - "opaque-debug", + "opaque-debug 0.3.0", "polyval 0.5.3", ] @@ -2198,7 +2755,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" dependencies = [ - "opaque-debug", + "opaque-debug 0.3.0", "polyval 0.6.0", ] @@ -2227,7 +2784,7 @@ dependencies = [ "proc-macro-hack", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2236,6 +2793,30 @@ 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 = "grdf" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9bbea22c05df8419a2bac76dcf144ef312c06de1db6f5d1304b1ce578890b00" +dependencies = [ + "derivative", + "hashbrown 0.13.2", + "iref", + "rdf-types", +] + [[package]] name = "group" version = "0.12.1" @@ -2249,9 +2830,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.16" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be7b54589b581f624f566bf5d8eb2bab1db736c51528720b6bd36b96b55924d" +checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21" dependencies = [ "bytes", "fnv", @@ -2266,6 +2847,12 @@ dependencies = [ "tracing", ] +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" + [[package]] name = "hashbrown" version = "0.12.3" @@ -2275,6 +2862,15 @@ dependencies = [ "ahash 0.7.6", ] +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.3", +] + [[package]] name = "heck" version = "0.4.1" @@ -2387,12 +2983,6 @@ dependencies = [ "pin-project-lite 0.2.9", ] -[[package]] -name = "http-range-header" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" - [[package]] name = "httparse" version = "1.8.0" @@ -2416,9 +3006,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.25" +version = "0.14.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" +checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" dependencies = [ "bytes", "futures-channel", @@ -2465,16 +3055,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.53" +version = "0.1.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "winapi", + "windows 0.48.0", ] [[package]] @@ -2526,9 +3116,9 @@ dependencies = [ [[package]] name = "if-watch" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba7abdbb86e485125dad06c2691e1e393bf3b08c7b743b43aa162a00fd39062e" +checksum = "a9465340214b296cd17a0009acdb890d6160010b8adf8f78a00d0d7ab270f79f" dependencies = [ "async-io", "core-foundation", @@ -2540,17 +3130,17 @@ dependencies = [ "rtnetlink", "system-configuration", "tokio", - "windows", + "windows 0.34.0", ] [[package]] name = "indexmap" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", "serde", ] @@ -2560,7 +3150,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" dependencies = [ - "generic-array", + "generic-array 0.14.7", ] [[package]] @@ -2572,6 +3162,27 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "int-enum" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff87d3cc4b79b4559e3c75068d64247284aceb6a038bd4bb38387f3f164476d" +dependencies = [ + "int-enum-impl", +] + +[[package]] +name = "int-enum-impl" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df1f2f068675add1a3fc77f5f5ab2e29290c841ee34d151abc007bce902e5d34" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "interceptor" version = "0.8.2" @@ -2593,12 +3204,13 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "1.0.6" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfa919a82ea574332e2de6e74b4c36e74d41982b335080fa59d4ef31be20fdf3" +checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" dependencies = [ + "hermit-abi 0.3.1", "libc", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -2615,22 +3227,44 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" +checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" [[package]] -name = "iroh-bitswap" -version = "0.2.0" -source = "git+https://github.com/nathanielc/beetle?branch=expose-api-client#28f1ea735123e62b8ea2430dad66157010fbb763" +name = "iref" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72758dab8e7c250a8643189063072ab0abf48e27eb453e0a38bbd2d7770ee8ec" dependencies = [ - "ahash 0.8.3", - "anyhow", - "async-broadcast", - "async-channel", - "async-stream", - "async-trait", - "asynchronous-codec", + "hashbrown 0.13.2", + "pct-str", + "serde", + "smallvec", +] + +[[package]] +name = "iri-string" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d0586ad318a04c73acdbad33f67969519b5452c80770c4c72059a686da48a7e" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "iroh-bitswap" +version = "0.2.0" +source = "git+https://github.com/nathanielc/beetle?branch=expose-api-client#28f1ea735123e62b8ea2430dad66157010fbb763" +dependencies = [ + "ahash 0.8.3", + "anyhow", + "async-broadcast", + "async-channel", + "async-stream", + "async-trait", + "asynchronous-codec", "bytes", "cid 0.9.0", "deadqueue", @@ -2692,7 +3326,7 @@ dependencies = [ "asynchronous-codec", "bytes", "cid 0.9.0", - "clap 4.1.11", + "clap 4.2.7", "config", "futures", "futures-util", @@ -2756,7 +3390,7 @@ dependencies = [ "quic-rpc", "serde", "serde-error", - "serde_with", + "serde_with 2.3.3", "tokio", ] @@ -2772,7 +3406,7 @@ dependencies = [ "bytecheck", "bytes", "cid 0.9.0", - "clap 4.1.11", + "clap 4.2.7", "config", "ctrlc", "futures", @@ -2816,14 +3450,14 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.4" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b6b32576413a8e69b90e952e4a026476040d81017b80445deda5f2d3921857" +checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" dependencies = [ "hermit-abi 0.3.1", "io-lifetimes", "rustix", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -2859,6 +3493,166 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "json-ld" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e445d0986fc6a6e8bbe8b2c4ba0c847b7bebd201046cc37df645d632eb4202a" +dependencies = [ + "contextual", + "futures", + "json-ld-compaction", + "json-ld-context-processing", + "json-ld-core", + "json-ld-expansion", + "json-ld-syntax", + "json-syntax", + "locspan", + "rdf-types", + "thiserror", +] + +[[package]] +name = "json-ld-compaction" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd69243e6b268c66c9cdd6f1aab73bd0d4f6df617d53e8d77238b676a9ab01c3" +dependencies = [ + "contextual", + "derivative", + "futures", + "iref", + "json-ld-context-processing", + "json-ld-core", + "json-ld-expansion", + "json-ld-syntax", + "json-syntax", + "langtag", + "locspan", + "mown", + "rdf-types", + "thiserror", +] + +[[package]] +name = "json-ld-context-processing" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6162a8b000517178a4a23f546fa7fef31a0cac466393ef922a351d8e6041fb8f" +dependencies = [ + "contextual", + "futures", + "iref", + "json-ld-core", + "json-ld-syntax", + "locspan", + "mown", + "rdf-types", + "thiserror", +] + +[[package]] +name = "json-ld-core" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f103ff1c30bf42b3b7d09c69cbe12869e5ad42497638c5199d83de6fd7d7b13e" +dependencies = [ + "contextual", + "derivative", + "futures", + "hashbrown 0.13.2", + "iref", + "json-ld-syntax", + "json-syntax", + "langtag", + "locspan", + "locspan-derive", + "log", + "mime", + "mown", + "once_cell", + "permutohedron", + "pretty_dtoa", + "rdf-types", + "ryu-js", + "smallvec", + "static-iref", + "thiserror", +] + +[[package]] +name = "json-ld-expansion" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ec3b334e7ae66e64a139ac34f38d3559dd82e7a0deed8891d1897a933a006cc" +dependencies = [ + "contextual", + "derivative", + "futures", + "iref", + "json-ld-context-processing", + "json-ld-core", + "json-ld-syntax", + "json-syntax", + "langtag", + "locspan", + "mown", + "rdf-types", + "thiserror", +] + +[[package]] +name = "json-ld-syntax" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fe7e17ed956850ff813815c960dcf3ab80604d72a2590ddebf8112509fb3722" +dependencies = [ + "contextual", + "decoded-char", + "derivative", + "hashbrown 0.13.2", + "indexmap", + "iref", + "json-syntax", + "langtag", + "locspan", + "locspan-derive", + "rdf-types", + "smallvec", + "thiserror", +] + +[[package]] +name = "json-number" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c724484d970b5aabe46934b9571980e255fd50a9ef1b13f23ed2b5c2a19bbb69" +dependencies = [ + "lexical", + "ryu-js", + "serde", + "smallvec", +] + +[[package]] +name = "json-syntax" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e3473c7c1719795449173b4d4d89c653598df3ddbc2f32b73bd9ceab8cc2dfb" +dependencies = [ + "contextual", + "decoded-char", + "hashbrown 0.12.3", + "indexmap", + "json-number", + "locspan", + "locspan-derive", + "ryu-js", + "serde", + "smallstr", + "smallvec", +] + [[package]] name = "json5" version = "0.4.1" @@ -2870,6 +3664,19 @@ dependencies = [ "serde", ] +[[package]] +name = "k256" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2 0.10.6", + "sha3", +] + [[package]] name = "keccak" version = "0.1.3" @@ -2879,6 +3686,16 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "keccak-hash" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae0386ec98c26dd721aaa3412bf3a817156ff3ee7cb6959503f8d1095f4ccc51" +dependencies = [ + "primitive-types", + "tiny-keccak", +] + [[package]] name = "keyed_priority_queue" version = "0.4.1" @@ -2888,6 +3705,21 @@ dependencies = [ "indexmap", ] +[[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 = "langtag" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d78b08c3742c6e025dac6db28d42a961411470194bc4ec2ef22ba16bbc38da03" + [[package]] name = "language-tags" version = "0.3.2" @@ -2909,11 +3741,104 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +[[package]] +name = "lexical" +version = "6.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7aefb36fd43fef7003334742cbf77b243fcd36418a1d1bdd480d613a67968f6" +dependencies = [ + "lexical-core", +] + +[[package]] +name = "lexical-core" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cde5de06e8d4c2faabc400238f9ae1c74d5412d03a7bd067645ccbc47070e46" +dependencies = [ + "lexical-parse-float", + "lexical-parse-integer", + "lexical-util", + "lexical-write-float", + "lexical-write-integer", +] + +[[package]] +name = "lexical-parse-float" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683b3a5ebd0130b8fb52ba0bdc718cc56815b6a097e28ae5a6997d0ad17dc05f" +dependencies = [ + "lexical-parse-integer", + "lexical-util", + "static_assertions", +] + +[[package]] +name = "lexical-parse-integer" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d0994485ed0c312f6d965766754ea177d07f9c00c9b82a5ee62ed5b47945ee9" +dependencies = [ + "lexical-util", + "static_assertions", +] + +[[package]] +name = "lexical-util" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5255b9ff16ff898710eb9eb63cb39248ea8a5bb036bea8085b1a767ff6c4e3fc" +dependencies = [ + "static_assertions", +] + +[[package]] +name = "lexical-write-float" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accabaa1c4581f05a3923d1b4cfd124c329352288b7b9da09e766b0668116862" +dependencies = [ + "lexical-util", + "lexical-write-integer", + "static_assertions", +] + +[[package]] +name = "lexical-write-integer" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1b6f3d1f4422866b68192d62f77bc5c700bee84f3069f2469d7bc8c77852446" +dependencies = [ + "lexical-util", + "static_assertions", +] + [[package]] name = "libc" -version = "0.2.140" +version = "0.2.142" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" + +[[package]] +name = "libipld" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" +checksum = "ac9c3aa309c260aa2f174bac968901eddc546e9d85950c28eae6a7bec402f926" +dependencies = [ + "async-trait", + "cached", + "fnv", + "libipld-cbor 0.14.0", + "libipld-cbor-derive 0.14.0", + "libipld-core 0.14.0", + "libipld-json 0.14.0", + "libipld-macro 0.14.0", + "log", + "multihash 0.16.3", + "parking_lot 0.12.1", + "thiserror", +] [[package]] name = "libipld" @@ -2922,17 +3847,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a20e38e0ad9a2fd600476691fa0780421931a198279985e398a3a0851903e1b2" dependencies = [ "fnv", - "libipld-cbor", - "libipld-cbor-derive", - "libipld-core", - "libipld-json", - "libipld-macro", + "libipld-cbor 0.15.0", + "libipld-cbor-derive 0.15.0", + "libipld-core 0.15.0", + "libipld-json 0.15.0", + "libipld-macro 0.15.0", "libipld-pb", "log", "multihash 0.17.0", "thiserror", ] +[[package]] +name = "libipld-cbor" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dd1ab68c9d26f20c7d0dfea6eecbae8c00359875210001b33ca27d4a02f3d09" +dependencies = [ + "byteorder", + "libipld-core 0.14.0", + "thiserror", +] + [[package]] name = "libipld-cbor" version = "0.15.0" @@ -2940,10 +3876,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b75370e27e0745910a9991c83f365cdae58027acf0502aa7987ac538a8a4744" dependencies = [ "byteorder", - "libipld-core", + "libipld-core 0.15.0", "thiserror", ] +[[package]] +name = "libipld-cbor-derive" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69ec2f49393a1347a2d95ebcb248ff75d0d47235919b678036c010a8cd927375" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + [[package]] name = "libipld-cbor-derive" version = "0.15.0" @@ -2953,10 +3902,25 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "synstructure", ] +[[package]] +name = "libipld-core" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d44790246ec6b7314cba745992c23d479d018073e66d49ae40ae1b64e5dd8eb5" +dependencies = [ + "anyhow", + "cid 0.8.6", + "core2", + "multibase 0.9.1", + "multihash 0.16.3", + "serde", + "thiserror", +] + [[package]] name = "libipld-core" version = "0.15.0" @@ -2966,31 +3930,52 @@ dependencies = [ "anyhow", "cid 0.9.0", "core2", - "multibase", + "multibase 0.9.1", "multihash 0.17.0", "serde", "thiserror", ] +[[package]] +name = "libipld-json" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18aa481a87f084d98473dd9ece253a9569c762b75f6bbba8217d54e48c9d63b3" +dependencies = [ + "libipld-core 0.14.0", + "multihash 0.16.3", + "serde", + "serde_json", +] + [[package]] name = "libipld-json" version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc549d7c70f9a401031fcb6d3bf7eccfe91bcad938f7485f71ee8ba9f79c1e79" dependencies = [ - "libipld-core", + "libipld-core 0.15.0", "multihash 0.17.0", "serde", "serde_json", ] +[[package]] +name = "libipld-macro" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852c011562ae5059b67c3a917f9f5945af5a68df8e39ede4444fff33274d25e2" +dependencies = [ + "libipld-core 0.14.0", +] + [[package]] name = "libipld-macro" version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4c7ccd89e54f2796cf3f99aabeea7a7751d418df504926544f28348d3c890c7" dependencies = [ - "libipld-core", + "libipld-core 0.15.0", ] [[package]] @@ -2999,7 +3984,7 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd84ee8b7e283c81b28ecf46e07c31a524a2cd35ec4e87833733a18218c17ccb" dependencies = [ - "libipld-core", + "libipld-core 0.15.0", "prost", "thiserror", ] @@ -3035,7 +4020,7 @@ dependencies = [ "bytes", "futures", "futures-timer", - "getrandom 0.2.8", + "getrandom 0.2.9", "instant", "libp2p-autonat", "libp2p-core", @@ -3212,7 +4197,7 @@ version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2766dcd2be8c87d5e1f35487deb22d765f49c6ae1251b3633efe3b25698bd3d2" dependencies = [ - "arrayvec", + "arrayvec 0.7.2", "asynchronous-codec", "bytes", "either", @@ -3424,7 +4409,7 @@ checksum = "9d527d5827582abd44a6d80c07ff8b50b4ee238a8979e05998474179e79dc400" dependencies = [ "heck", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -3542,9 +4527,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" +checksum = "56ee889ecc9568871456d42f603d6a0ce59ff328d291063a45cbdf0036baf6db" dependencies = [ "cc", "pkg-config", @@ -3568,9 +4553,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.1.4" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +checksum = "b64f40e5e03e0d54f03845c8197d0291253cdbedfb1cb46b13c2c117554a9f4c" [[package]] name = "local-channel" @@ -3600,6 +4585,28 @@ dependencies = [ "scopeguard", ] +[[package]] +name = "locspan" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685e26b5a3e4266c351baf3c00793a097e40f4293270ac508b3f4cbc41e72e54" +dependencies = [ + "contextual", + "hashbrown 0.13.2", +] + +[[package]] +name = "locspan-derive" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88991223b049a3d29ca1f60c05639581336a0f3ee4bf8a659dddecc11c4961a" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "log" version = "0.4.17" @@ -3607,6 +4614,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ "cfg-if", + "value-bag", ] [[package]] @@ -3615,7 +4623,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" dependencies = [ - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -3689,9 +4697,9 @@ dependencies = [ [[package]] name = "mime" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" @@ -3719,9 +4727,18 @@ dependencies = [ ] [[package]] -name = "mio" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" dependencies = [ "libc", @@ -3730,6 +4747,12 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "mown" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7627d8bbeb17edbf1c3f74b21488e4af680040da89713b4217d0010e9cbd97e" + [[package]] name = "multiaddr" version = "0.16.0" @@ -3739,7 +4762,7 @@ dependencies = [ "arrayref", "byteorder", "data-encoding", - "multibase", + "multibase 0.9.1", "multihash 0.16.3", "percent-encoding", "serde", @@ -3748,6 +4771,17 @@ dependencies = [ "url", ] +[[package]] +name = "multibase" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b78c60039650ff12e140ae867ef5299a58e19dded4d334c849dc7177083667e2" +dependencies = [ + "base-x", + "data-encoding", + "data-encoding-macro", +] + [[package]] name = "multibase" version = "0.9.1" @@ -3765,12 +4799,16 @@ version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c346cf9999c631f002d8f977c4eaeaa0e6386f16007202308d0b3757522c2cc" dependencies = [ + "blake2b_simd 1.0.1", + "blake2s_simd", + "blake3", "core2", "digest 0.10.6", "multihash-derive", "serde", "serde-big-array", "sha2 0.10.6", + "sha3", "unsigned-varint", ] @@ -3780,7 +4818,7 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" dependencies = [ - "blake2b_simd", + "blake2b_simd 1.0.1", "blake2s_simd", "blake3", "core2", @@ -3795,15 +4833,15 @@ dependencies = [ [[package]] name = "multihash-derive" -version = "0.8.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6d4752e6230d8ef7adf7bd5d8c4b1f6561c1014c5ba9a37445ccefe18aa1db" +checksum = "fc076939022111618a5026d3be019fd8b366e76314538ff9a1b59ffbcbf98bcd" dependencies = [ "proc-macro-crate", "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "synstructure", ] @@ -3833,7 +4871,7 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7bddcd3bf5144b6392de80e04c347cd7fab2508f6df16a85fc496ecd5cec39bc" dependencies = [ - "clap 3.2.23", + "clap 3.2.25", "rand 0.8.5", ] @@ -3843,7 +4881,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" dependencies = [ - "getrandom 0.2.8", + "getrandom 0.2.9", ] [[package]] @@ -3865,7 +4903,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9ea4302b9759a7a88242299225ea3688e63c85ea136371bb6cf94fd674efaab" dependencies = [ "anyhow", - "bitflags 1.3.2", + "bitflags", "byteorder", "libc", "netlink-packet-core", @@ -3918,7 +4956,7 @@ version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ - "bitflags 1.3.2", + "bitflags", "cfg-if", "libc", "memoffset 0.6.5", @@ -3930,7 +4968,7 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" dependencies = [ - "bitflags 1.3.2", + "bitflags", "cfg-if", "libc", "static_assertions", @@ -3954,9 +4992,9 @@ dependencies = [ [[package]] name = "ntapi" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc51db7b362b205941f71232e56c625156eb9a929f8cf74a428fd5bc094a4afc" +checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" dependencies = [ "winapi", ] @@ -4058,7 +5096,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -4094,6 +5132,12 @@ version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + [[package]] name = "opaque-debug" version = "0.3.0" @@ -4187,14 +5231,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccd746e37177e1711c20dd619a1620f34f5c8b569c53590a72dedd5344d8924a" dependencies = [ "dlv-list", - "hashbrown", + "hashbrown 0.12.3", ] [[package]] name = "os_str_bytes" -version = "6.4.1" +version = "6.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" +checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" [[package]] name = "output_vt100" @@ -4245,9 +5289,9 @@ dependencies = [ [[package]] name = "parking" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" +checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" [[package]] name = "parking_lot" @@ -4279,7 +5323,7 @@ dependencies = [ "cfg-if", "instant", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec", "winapi", ] @@ -4292,7 +5336,7 @@ checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec", "windows-sys 0.45.0", ] @@ -4309,6 +5353,15 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" +[[package]] +name = "pct-str" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77d207ec8d182c2fef45f028b9b9507770df19e89b3e14827ccd95d4a23f6003" +dependencies = [ + "utf8-decode", +] + [[package]] name = "peeking_take_while" version = "0.1.2" @@ -4324,6 +5377,15 @@ dependencies = [ "base64 0.13.1", ] +[[package]] +name = "pem-rfc7468" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01de5d978f34aa4b2296576379fcc416034702fd94117c56ffd8a1a767cefb30" +dependencies = [ + "base64ct", +] + [[package]] name = "pem-rfc7468" version = "0.6.0" @@ -4339,11 +5401,17 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +[[package]] +name = "permutohedron" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b687ff7b5da449d39e418ad391e5e08da53ec334903ddbb921db208908fc372c" + [[package]] name = "pest" -version = "2.5.6" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cbd939b234e95d72bc393d51788aec68aeeb5d51e748ca08ff3aad58cb722f7" +checksum = "e68e84bfb01f0507134eac1e9b410a12ba379d064eab48c50ba4ce329a527b70" dependencies = [ "thiserror", "ucd-trie", @@ -4351,9 +5419,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.5.6" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a81186863f3d0a27340815be8f2078dd8050b14cd71913db9fbda795e5f707d7" +checksum = "6b79d4c71c865a25a4322296122e3924d30bc8ee0834c8bfc8b95f7f054afbfb" dependencies = [ "pest", "pest_generator", @@ -4361,22 +5429,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.5.6" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75a1ef20bf3193c15ac345acb32e26b3dc3223aff4d77ae4fc5359567683796b" +checksum = "6c435bf1076437b851ebc8edc3a18442796b30f1728ffea6262d59bbe28b077e" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] name = "pest_meta" -version = "2.5.6" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e3b284b1f13a20dc5ebc90aff59a51b8d7137c221131b52a7260c08cbc1cc80" +checksum = "745a452f8eb71e39ffd8ee32b3c5f51d03845f99786fa9b68db6ff509c505411" dependencies = [ "once_cell", "pest", @@ -4410,7 +5478,7 @@ checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -4431,15 +5499,37 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs1" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a78f66c04ccc83dd4486fd46c33896f4e17b24a7a3a6400dedc48ed0ddd72320" +dependencies = [ + "der 0.5.1", + "pkcs8 0.8.0", + "zeroize", +] + [[package]] name = "pkcs1" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eff33bdbdfc54cc98a2eca766ebdec3e1b8fb7387523d5c9c9a2891da856f719" dependencies = [ - "der", - "pkcs8", - "spki", + "der 0.6.1", + "pkcs8 0.9.0", + "spki 0.6.0", + "zeroize", +] + +[[package]] +name = "pkcs8" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" +dependencies = [ + "der 0.5.1", + "spki 0.5.4", "zeroize", ] @@ -4449,8 +5539,8 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" dependencies = [ - "der", - "spki", + "der 0.6.1", + "spki 0.6.0", ] [[package]] @@ -4467,18 +5557,18 @@ checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" [[package]] name = "polling" -version = "2.6.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e1f879b2998099c2d69ab9605d145d5b661195627eccc680002c4918a7fb6fa" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" dependencies = [ "autocfg", - "bitflags 1.3.2", + "bitflags", "cfg-if", "concurrent-queue", "libc", "log", "pin-project-lite 0.2.9", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -4488,7 +5578,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" dependencies = [ "cpufeatures", - "opaque-debug", + "opaque-debug 0.3.0", "universal-hash 0.4.1", ] @@ -4500,7 +5590,7 @@ checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" dependencies = [ "cfg-if", "cpufeatures", - "opaque-debug", + "opaque-debug 0.3.0", "universal-hash 0.4.1", ] @@ -4512,7 +5602,7 @@ checksum = "7ef234e08c11dfcb2e56f79fd70f6f2eb7f025c0ce2333e82f4f0518ecad30c6" dependencies = [ "cfg-if", "cpufeatures", - "opaque-debug", + "opaque-debug 0.3.0", "universal-hash 0.5.0", ] @@ -4534,24 +5624,43 @@ dependencies = [ "yansi", ] +[[package]] +name = "pretty_dtoa" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a239bcdfda2c685fda1add3b4695c06225f50075e3cfb5b954e91545587edff2" +dependencies = [ + "ryu_floating_decimal", +] + [[package]] name = "prettyplease" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebcd279d20a4a0a2404a33056388e950504d891c855c7975b9a8fef75f3bf04" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" dependencies = [ "proc-macro2", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "primitive-types" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06345ee39fbccfb06ab45f3a1a5798d9dafa04cb8921a76d227040003a234b0e" +dependencies = [ + "fixed-hash", + "uint", ] [[package]] name = "proc-macro-crate" -version = "1.1.3" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ - "thiserror", - "toml", + "once_cell", + "toml_edit", ] [[package]] @@ -4563,7 +5672,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -4586,9 +5695,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.51" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" dependencies = [ "unicode-ident", ] @@ -4613,14 +5722,14 @@ checksum = "66a455fbcb954c1a7decf3c586e860fd7889cddf4b8e164be736dbac95a953cd" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "prost" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48e50df39172a3e7eb17e14642445da64996989bc212b583015435d39a58537" +checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ "bytes", "prost-derive", @@ -4628,9 +5737,9 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c828f93f5ca4826f97fedcbd3f9a536c16b12cff3dbbb4a007f932bbad95b12" +checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" dependencies = [ "bytes", "heck", @@ -4643,7 +5752,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn", + "syn 1.0.109", "tempfile", "which", ] @@ -4663,22 +5772,22 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea9b0f8cbe5e15a8a042d030bd96668db28ecb567ec37d691971ff5731d2b1b" +checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "prost-types" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "379119666929a1afd7a043aa6cf96fa67a6dce9af60c88095a4686dbce4c9c88" +checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" dependencies = [ "prost", ] @@ -4700,7 +5809,7 @@ checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -4739,9 +5848,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ef4ced82a24bb281af338b9e8f94429b6eca01b4e66d899f40031f074e74c9" +checksum = "67c10f662eee9c94ddd7135043e544f3c82fa839a1e7b865911331961b53186c" dependencies = [ "bytes", "rand 0.8.5", @@ -4757,13 +5866,19 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.23" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" dependencies = [ "proc-macro2", ] +[[package]] +name = "radium" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" + [[package]] name = "rand" version = "0.7.3" @@ -4823,7 +5938,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.8", + "getrandom 0.2.9", ] [[package]] @@ -4865,7 +5980,7 @@ checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" dependencies = [ "pem", "ring", - "time", + "time 0.3.20", "x509-parser 0.13.2", "yasna", ] @@ -4878,17 +5993,39 @@ checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" dependencies = [ "pem", "ring", - "time", + "time 0.3.20", "yasna", ] +[[package]] +name = "rdf-types" +version = "0.12.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63d95f82a1f30f2d62e77b775ef4863f67ffafef1fc2c95ebfb55f3750be55df" +dependencies = [ + "contextual", + "iref", + "langtag", + "locspan", + "locspan-derive", +] + [[package]] name = "redox_syscall" version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags 1.3.2", + "bitflags", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", ] [[package]] @@ -4897,20 +6034,20 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.8", - "redox_syscall", + "getrandom 0.2.9", + "redox_syscall 0.2.16", "thiserror", ] [[package]] name = "regex" -version = "1.7.1" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.7.1", ] [[package]] @@ -4919,14 +6056,20 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "regex-syntax", + "regex-syntax 0.6.29", ] [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" [[package]] name = "rend" @@ -4939,9 +6082,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.14" +version = "0.11.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9" +checksum = "13293b639a097af28fc8a90f22add145a9c954e49d77da06263d58cf44d5fb91" dependencies = [ "base64 0.21.0", "bytes", @@ -4992,7 +6135,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" dependencies = [ - "crypto-bigint", + "crypto-bigint 0.4.9", "hmac 0.12.1", "zeroize", ] @@ -5012,14 +6155,25 @@ dependencies = [ "winapi", ] +[[package]] +name = "ripemd160" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eca4ecc81b7f313189bf73ce724400a07da2a6dac19588b03c8bd76a2dcc251" +dependencies = [ + "block-buffer 0.9.0", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + [[package]] name = "rkyv" -version = "0.7.40" +version = "0.7.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c30f1d45d9aa61cbc8cd1eb87705470892289bb2d01943e7803b873a57404dc3" +checksum = "21499ed91807f07ae081880aabb2ccc0235e9d88011867d984525e9a4c3cfa3e" dependencies = [ "bytecheck", - "hashbrown", + "hashbrown 0.12.3", "ptr_meta", "rend", "rkyv_derive", @@ -5028,13 +6182,13 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.7.40" +version = "0.7.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff26ed6c7c4dfc2aa9480b86a60e3c7233543a270a680e10758a507c5a4ce476" +checksum = "ac1c672430eb41556291981f45ca900a0239ad007242d1cb4b4167af842db666" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -5063,10 +6217,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88073939a61e5b7680558e6be56b419e208420c2adb92be54921fa6b72283f1a" dependencies = [ "base64 0.13.1", - "bitflags 1.3.2", + "bitflags", "serde", ] +[[package]] +name = "rsa" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cf22754c49613d2b3b119f0e5d46e34a2c628a937e3024b8762de4e7d8c710b" +dependencies = [ + "byteorder", + "digest 0.10.6", + "num-bigint-dig", + "num-integer", + "num-iter", + "num-traits", + "pkcs1 0.3.3", + "pkcs8 0.8.0", + "rand_core 0.6.4", + "smallvec", + "subtle", + "zeroize", +] + [[package]] name = "rsa" version = "0.7.2" @@ -5079,8 +6253,8 @@ dependencies = [ "num-integer", "num-iter", "num-traits", - "pkcs1", - "pkcs8", + "pkcs1 0.4.1", + "pkcs8 0.9.0", "rand_core 0.6.4", "signature", "smallvec", @@ -5140,9 +6314,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustc-hash" @@ -5170,16 +6344,16 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.9" +version = "0.37.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd5c6ff11fecd55b40746d1995a02f2eb375bf8c00d192d521ee09f42bef37bc" +checksum = "8bbfc1d1c7c40c01715f47d71444744a81669ca84e8b63e25a55e169b1f86433" dependencies = [ - "bitflags 1.3.2", + "bitflags", "errno", "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -5239,6 +6413,18 @@ version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +[[package]] +name = "ryu-js" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6518fc26bced4d53678a22d6e423e9d8716377def84545fe328236e3af070e7f" + +[[package]] +name = "ryu_floating_decimal" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "700de91d5fd6091442d00fdd9ee790af6d4f0f480562b0f5a1e8f59e90aafe73" + [[package]] name = "scopeguard" version = "1.1.0" @@ -5296,24 +6482,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" dependencies = [ "base16ct", - "der", - "generic-array", - "pkcs8", + "der 0.6.1", + "generic-array 0.14.7", + "pkcs8 0.9.0", "subtle", "zeroize", ] [[package]] name = "semver" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" [[package]] name = "serde" -version = "1.0.154" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cdd151213925e7f1ab45a9bbfb129316bd00799784b174b7cc7bcd16961c49e" +checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" dependencies = [ "serde_derive", ] @@ -5347,13 +6533,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.154" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc80d722935453bcafdc2c9a73cd6fac4dc1938f0346035d84bf99fa9e33217" +checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] @@ -5368,6 +6554,17 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_jcs" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cacecf649bc1a7c5f0e299cc813977c6a78116abda2b93b1ee01735b71ead9a8" +dependencies = [ + "ryu-js", + "serde", + "serde_json", +] + [[package]] name = "serde_json" version = "1.0.96" @@ -5381,13 +6578,13 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395627de918015623b32e7669714206363a7fc00382bf477e72c1f7533e8eafc" +checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] @@ -5404,9 +6601,20 @@ dependencies = [ [[package]] name = "serde_with" -version = "2.3.0" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" +dependencies = [ + "base64 0.13.1", + "serde", + "serde_with_macros 1.5.2", +] + +[[package]] +name = "serde_with" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ea48c9627169d206b35905699f513f513c303ab9d964a59b44fdcf66c1d1ab7" +checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" dependencies = [ "base64 0.13.1", "chrono", @@ -5414,20 +6622,32 @@ dependencies = [ "indexmap", "serde", "serde_json", - "serde_with_macros", - "time", + "serde_with_macros 2.3.3", + "time 0.3.20", ] [[package]] name = "serde_with_macros" -version = "2.3.0" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e6b7e52858f9f06c25e1c566bbb4ab428200cb3b30053ea09dc50837de7538b" +checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" dependencies = [ - "darling", + "darling 0.13.4", "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "serde_with_macros" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" +dependencies = [ + "darling 0.20.0", + "proc-macro2", + "quote", + "syn 2.0.15", ] [[package]] @@ -5440,7 +6660,7 @@ dependencies = [ "cfg-if", "cpufeatures", "digest 0.9.0", - "opaque-debug", + "opaque-debug 0.3.0", ] [[package]] @@ -5454,6 +6674,18 @@ dependencies = [ "digest 0.10.6", ] +[[package]] +name = "sha2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +dependencies = [ + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug 0.2.3", +] + [[package]] name = "sha2" version = "0.9.9" @@ -5464,7 +6696,7 @@ dependencies = [ "cfg-if", "cpufeatures", "digest 0.9.0", - "opaque-debug", + "opaque-debug 0.3.0", ] [[package]] @@ -5480,9 +6712,9 @@ dependencies = [ [[package]] name = "sha3" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9" +checksum = "54c2bb1a323307527314a36bfb73f24febb08ce2b8a554bf4ffd6f51ad15198c" dependencies = [ "digest 0.10.6", "keccak", @@ -5528,6 +6760,48 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" +[[package]] +name = "simple_asn1" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eb4ea60fb301dc81dfc113df680571045d375ab7345d171c5dc7d7e13107a80" +dependencies = [ + "chrono", + "num-bigint", + "num-traits", + "thiserror", +] + +[[package]] +name = "siwe" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec4cc2eafb2354c1aeaeac5f53b7726ca4ea5ad16314a0b5ebacb6676f599c2b" +dependencies = [ + "hex", + "http", + "iri-string", + "k256", + "rand 0.8.5", + "sha3", + "thiserror", + "time 0.3.20", +] + +[[package]] +name = "siwe-recap" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afe6254970fe99274b440ba4c5e9891550939e7a3c10274029b2e8a9ab2d5c8b" +dependencies = [ + "base64 0.12.3", + "iri-string", + "serde", + "serde_json", + "siwe", + "thiserror", +] + [[package]] name = "slab" version = "0.4.8" @@ -5538,106 +6812,448 @@ dependencies = [ ] [[package]] -name = "smallvec" -version = "1.10.0" +name = "smallstr" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63b1aefdf380735ff8ded0b15f31aab05daf1f70216c01c02a12926badd1df9d" +dependencies = [ + "smallvec", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "snow" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ccba027ba85743e09d15c03296797cad56395089b832b48b5a5217880f57733" +dependencies = [ + "aes-gcm 0.9.4", + "blake2", + "chacha20poly1305", + "curve25519-dalek 4.0.0-rc.1", + "rand_core 0.6.4", + "ring", + "rustc_version", + "sha2 0.10.6", + "subtle", +] + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "soketto" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" +dependencies = [ + "base64 0.13.1", + "bytes", + "flate2", + "futures", + "httparse", + "log", + "rand 0.8.5", + "sha-1", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spki" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +dependencies = [ + "base64ct", + "der 0.5.1", +] + +[[package]] +name = "spki" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +dependencies = [ + "base64ct", + "der 0.6.1", +] + +[[package]] +name = "ssh-encoding" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19cfdc32e0199062113edf41f344fbf784b8205a94600233c84eb838f45191e1" +dependencies = [ + "base64ct", + "pem-rfc7468 0.6.0", + "sha2 0.10.6", +] + +[[package]] +name = "ssh-key" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "288d8f5562af5a3be4bda308dd374b2c807b940ac370b5efa1c99311da91d9a1" +dependencies = [ + "ed25519-dalek", + "p256", + "p384", + "rand_core 0.6.4", + "rsa 0.7.2", + "sec1", + "sha2 0.10.6", + "signature", + "ssh-encoding", + "zeroize", +] + +[[package]] +name = "sshkeys" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c926cb006a77964474a13a86aa0135ea82c9fd43e6793a1151cc54143db6637c" +dependencies = [ + "base64 0.12.3", + "byteorder", + "sha2 0.8.2", +] + +[[package]] +name = "ssi" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a74add6dcfc3599495a73e953a7126ea19e9a0fc81860f5d593cabf1322cdf9" +dependencies = [ + "ssi-caips", + "ssi-core", + "ssi-crypto", + "ssi-dids", + "ssi-json-ld", + "ssi-jwk", + "ssi-jws", + "ssi-jwt", + "ssi-ldp", + "ssi-ssh", + "ssi-tzkey", + "ssi-ucan", + "ssi-vc", + "ssi-zcap-ld", +] + +[[package]] +name = "ssi-caips" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da2c479690955bebece0279a5b1ab9d7d584402caed9f56ecec346d0bc63661f" +dependencies = [ + "bs58", + "ssi-jwk", + "thiserror", +] + +[[package]] +name = "ssi-contexts" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "286de2217e2ab66948fa8d69874ced77938d54ac2d2658444dc1d82ee502b882" + +[[package]] +name = "ssi-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e43f42016b80dc3e5eae8f7d2b22db3debbfe97b38e4fa449433497b3513048" +dependencies = [ + "async-trait", + "serde", + "thiserror", +] + +[[package]] +name = "ssi-crypto" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f41a12b15af9dce950a24a3295a2540be3b8500467621e31a97ddbe7618a5c8" +dependencies = [ + "bs58", + "digest 0.9.0", + "k256", + "keccak-hash", + "ripemd160", + "sha2 0.10.6", + "thiserror", + "zeroize", +] + +[[package]] +name = "ssi-dids" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62e3c375b0fb2129c691e65e776c9105290ade34b56f39755f4f9c40ba98e41c" +dependencies = [ + "anyhow", + "async-trait", + "bs58", + "chrono", + "derive_builder 0.9.0", + "hex", + "iref", + "multibase 0.8.0", + "serde", + "serde_json", + "serde_urlencoded", + "ssi-caips", + "ssi-core", + "ssi-json-ld", + "ssi-jwk", + "static-iref", + "thiserror", +] + +[[package]] +name = "ssi-json-ld" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b90b3723421b79dcefdbe65ee92d6f7a9d74b6d42de57afeca7d8286424faa14" +dependencies = [ + "async-std", + "combination", + "futures", + "grdf", + "iref", + "json-ld", + "json-syntax", + "lazy_static", + "locspan", + "rdf-types", + "ssi-contexts", + "ssi-crypto", + "static-iref", + "thiserror", +] + +[[package]] +name = "ssi-jwk" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "fbaa04abdfe9de454fe34c0c49a4920a1c595c4ef12d357d17ce94a8a8da0910" +dependencies = [ + "base64 0.12.3", + "blake2b_simd 0.5.11", + "bs58", + "ed25519-dalek", + "getrandom 0.2.9", + "k256", + "lazy_static", + "num-bigint", + "p256", + "rand 0.7.3", + "rand 0.8.5", + "rsa 0.6.1", + "serde", + "simple_asn1", + "ssi-crypto", + "thiserror", + "zeroize", +] [[package]] -name = "snow" -version = "0.9.1" +name = "ssi-jws" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12ba5f4d4ff12bdb6a169ed51b7c48c0e0ac4b0b4b31012b2571e97d78d3201d" +checksum = "df9e36ec8624a4f81f21b0e407f1c2209c2cd89c0ff3c27b928999682b2e8912" dependencies = [ - "aes-gcm 0.9.4", + "base64 0.12.3", "blake2", - "chacha20poly1305", - "curve25519-dalek 4.0.0-rc.0", - "rand_core 0.6.4", - "ring", - "rustc_version", + "clear_on_drop", + "ed25519-dalek", + "k256", + "p256", + "rand 0.8.5", + "rsa 0.6.1", + "serde", + "serde_json", "sha2 0.10.6", - "subtle", + "ssi-crypto", + "ssi-jwk", + "thiserror", ] [[package]] -name = "socket2" -version = "0.4.9" +name = "ssi-jwt" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "46522391b37f4b749911bb29b3960a7e2e0b9936c7debf52035f431480b40123" dependencies = [ - "libc", - "winapi", + "chrono", + "serde", + "serde_json", + "serde_with 2.3.3", + "ssi-jwk", + "ssi-jws", + "thiserror", ] [[package]] -name = "soketto" -version = "0.7.1" +name = "ssi-ldp" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" +checksum = "de930bb18e3ed3c1f7b0a2b2b4fdba2887dffff34bb5f44b9967a983fea2d60c" dependencies = [ - "base64 0.13.1", - "bytes", - "flate2", - "futures", - "httparse", - "log", - "rand 0.8.5", - "sha-1", + "async-trait", + "bs58", + "chrono", + "grdf", + "hex", + "iref", + "json-syntax", + "k256", + "keccak-hash", + "lazy_static", + "locspan", + "multibase 0.8.0", + "p256", + "rdf-types", + "serde", + "serde_jcs", + "serde_json", + "ssi-caips", + "ssi-contexts", + "ssi-core", + "ssi-crypto", + "ssi-dids", + "ssi-json-ld", + "ssi-jwk", + "ssi-jws", + "ssi-tzkey", + "static-iref", + "thiserror", ] [[package]] -name = "spin" -version = "0.5.2" +name = "ssi-ssh" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "22967c7882e2457a2813badebf613a1b6ea3240f77ccac5c7c03858806d56618" +dependencies = [ + "sshkeys", + "ssi-jwk", + "thiserror", +] [[package]] -name = "spin" -version = "0.9.5" +name = "ssi-tzkey" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dccf47db1b41fa1573ed27ccf5e08e3ca771cb994f776668c5ebda893b248fc" +checksum = "c1b57d919e20d214253a9a8dbc5f3b08ff555364934d99a09c828becab27a823" dependencies = [ - "lock_api", + "bs58", + "ed25519-dalek", + "ssi-jwk", + "ssi-jws", + "thiserror", ] [[package]] -name = "spki" -version = "0.6.0" +name = "ssi-ucan" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +checksum = "0982f62c7860922026a9d9edc6c604de79693ee4c5c6bd65be11e2ff66b1df09" dependencies = [ - "base64ct", - "der", + "base64 0.12.3", + "chrono", + "libipld 0.14.0", + "serde", + "serde_json", + "serde_with 1.14.0", + "ssi-caips", + "ssi-core", + "ssi-dids", + "ssi-jwk", + "ssi-jws", + "ssi-jwt", + "thiserror", ] [[package]] -name = "ssh-encoding" -version = "0.1.0" +name = "ssi-vc" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19cfdc32e0199062113edf41f344fbf784b8205a94600233c84eb838f45191e1" +checksum = "fd7a9a9dc254d976962fea4501ed40097b8a7c23c15f076a7f46fa97ed886bc7" dependencies = [ - "base64ct", - "pem-rfc7468", - "sha2 0.10.6", + "async-trait", + "base64 0.12.3", + "bitvec", + "cacaos", + "chrono", + "flate2", + "iref", + "libipld 0.14.0", + "multihash 0.16.3", + "reqwest", + "serde", + "serde_json", + "siwe-recap", + "ssi-core", + "ssi-dids", + "ssi-json-ld", + "ssi-jwk", + "ssi-jws", + "ssi-jwt", + "ssi-ldp", + "thiserror", ] [[package]] -name = "ssh-key" -version = "0.5.1" +name = "ssi-zcap-ld" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "288d8f5562af5a3be4bda308dd374b2c807b940ac370b5efa1c99311da91d9a1" +checksum = "7c6b6a1e8e36842c9f69209f3ea0da7e979da126d352734a94a5eae2ed01ede1" dependencies = [ - "ed25519-dalek", - "p256", - "p384", - "rand_core 0.6.4", - "rsa", - "sec1", - "sha2 0.10.6", - "signature", - "ssh-encoding", - "zeroize", + "async-trait", + "iref", + "serde", + "serde_json", + "ssi-core", + "ssi-dids", + "ssi-json-ld", + "ssi-jwk", + "ssi-ldp", + "thiserror", +] + +[[package]] +name = "static-iref" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9786d4b8e9e5423fe85c57a826d7e0f0774746149a2ccd21e2104ff74b71ce7" +dependencies = [ + "iref", ] [[package]] @@ -5646,6 +7262,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strsim" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" + [[package]] name = "strsim" version = "0.10.0" @@ -5697,6 +7319,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "sync_wrapper" version = "0.1.2" @@ -5711,7 +7344,7 @@ checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "unicode-xid", ] @@ -5736,7 +7369,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d75182f12f490e953596550b65ee31bda7c8e043d9386174b353bda50838c3fd" dependencies = [ - "bitflags 1.3.2", + "bitflags", "core-foundation", "system-configuration-sys", ] @@ -5751,17 +7384,23 @@ dependencies = [ "libc", ] +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + [[package]] name = "tempfile" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" +checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", + "redox_syscall 0.3.5", "rustix", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -5773,6 +7412,17 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "test-log" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38f0c854faeb68a048f0f2dc410c5ddae3bf83854ef0e4977d58306a5edef50e" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "textwrap" version = "0.16.0" @@ -5781,22 +7431,22 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.39" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5ab016db510546d856297882807df8da66a16fb8c4101cb8b30054b0d5b2d9c" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.39" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5420d42e90af0c38c3290abcca25b9b3bdf379fc9f55c528f53a269d9c9a267e" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] @@ -5809,6 +7459,17 @@ dependencies = [ "once_cell", ] +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + [[package]] name = "time" version = "0.3.20" @@ -5836,6 +7497,15 @@ dependencies = [ "time-core", ] +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + [[package]] name = "tinytemplate" version = "1.2.1" @@ -5863,14 +7533,13 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.26.0" +version = "1.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" +checksum = "c3c786bf8134e5a3a166db9b29ab8f48134739014a3eca7bc6bfa95d673b136f" dependencies = [ "autocfg", "bytes", "libc", - "memchr", "mio", "num_cpus", "parking_lot 0.12.1", @@ -5878,7 +7547,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -5902,13 +7571,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.8.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] @@ -5924,9 +7593,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.12" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", "pin-project-lite 0.2.9", @@ -5935,9 +7604,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ "bytes", "futures-core", @@ -5957,6 +7626,23 @@ dependencies = [ "serde", ] +[[package]] +name = "toml_datetime" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" + +[[package]] +name = "toml_edit" +version = "0.19.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + [[package]] name = "tonic" version = "0.8.3" @@ -5999,7 +7685,7 @@ dependencies = [ "proc-macro2", "prost-build", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -6022,25 +7708,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "tower-http" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" -dependencies = [ - "bitflags 1.3.2", - "bytes", - "futures-core", - "futures-util", - "http", - "http-body", - "http-range-header", - "pin-project-lite 0.2.9", - "tower", - "tower-layer", - "tower-service", -] - [[package]] name = "tower-layer" version = "0.3.2" @@ -6068,9 +7735,9 @@ dependencies = [ [[package]] name = "tracing-actix-web" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4082e4d81173e0b7ad3cfb71e9eaef0dd0cbb7b139fdb56394f488a3b0760b23" +checksum = "e2def0ffabc0116481e14e82cf705fef814f5178171d445b6790137ff8a85a73" dependencies = [ "actix-web", "pin-project", @@ -6080,13 +7747,13 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] @@ -6136,9 +7803,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" +checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" dependencies = [ "matchers", "nu-ansi-term", @@ -6258,9 +7925,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.11" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524b68aca1d05e03fdf03fcdce2c6c94b6daf6d16861ddaa7e4f2b6638a9052c" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" @@ -6291,9 +7958,9 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "unimock" -version = "0.4.9" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d287bcbde515749baa159c8aff96aefb16808ba43669f1639ae3228e5350f9f" +checksum = "aa46b37ccb0341a256f583def2628c2d00158c37dac5f4ede95f4fa0dcf01ce6" dependencies = [ "once_cell", "pretty_assertions", @@ -6302,13 +7969,13 @@ dependencies = [ [[package]] name = "unimock_macros" -version = "0.4.9" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64677cf333b99077788547ec64d5f6aebb323e4d7ce76efb7f19bf6a7fb36165" +checksum = "c574c9b375e8e4d35027aee2959c7b4b384ca9d94e3d9a7fa50640b8b0d4ff16" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] @@ -6317,7 +7984,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" dependencies = [ - "generic-array", + "generic-array 0.14.7", "subtle", ] @@ -6360,13 +8027,25 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "utf8-decode" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca61eb27fa339aa08826a29f03e87b99b4d8f0fc2255306fd266bb1b6a9de498" + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "uuid" -version = "1.3.0" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1674845326ee10d37ca60470760d4288a6f80f304007d92e5c53bab78c9cfd79" +checksum = "4dad5567ad0cf5b760e5665964bec1b47dfd077ba8a2544b513f3556d3d239a2" dependencies = [ - "getrandom 0.2.8", + "getrandom 0.2.9", ] [[package]] @@ -6375,6 +8054,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +[[package]] +name = "value-bag" +version = "1.0.0-alpha.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55" +dependencies = [ + "ctor", + "version_check", +] + [[package]] name = "vcpkg" version = "0.2.15" @@ -6424,6 +8113,12 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -6451,7 +8146,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-shared", ] @@ -6485,7 +8180,7 @@ checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6576,7 +8271,7 @@ dependencies = [ "sha2 0.10.6", "stun", "thiserror", - "time", + "time 0.3.20", "tokio", "turn", "url", @@ -6598,7 +8293,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ef36a4d12baa6e842582fe9ec16a57184ba35e1a09308307b67d43ec8883100" dependencies = [ "bytes", - "derive_builder", + "derive_builder 0.11.2", "log", "thiserror", "tokio", @@ -6686,18 +8381,15 @@ dependencies = [ [[package]] name = "webrtc-media" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2a3c157a040324e5049bcbd644ffc9079e6738fa2cfab2bcff64e5cc4c00d7" +checksum = "f72e1650a8ae006017d1a5280efb49e2610c19ccc3c0905b03b648aee9554991" dependencies = [ "byteorder", "bytes", - "derive_builder", - "displaydoc", "rand 0.8.5", "rtp", "thiserror", - "webrtc-util", ] [[package]] @@ -6748,7 +8440,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f1db1727772c05cf7a2cfece52c3aca8045ca1e176cd517d323489aa3c6d87" dependencies = [ "async-trait", - "bitflags 1.3.2", + "bitflags", "bytes", "cc", "ipnet", @@ -6824,18 +8516,12 @@ dependencies = [ ] [[package]] -name = "windows-sys" -version = "0.42.0" +name = "windows" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows_aarch64_gnullvm 0.42.1", - "windows_aarch64_msvc 0.42.1", - "windows_i686_gnu 0.42.1", - "windows_i686_msvc 0.42.1", - "windows_x86_64_gnu 0.42.1", - "windows_x86_64_gnullvm 0.42.1", - "windows_x86_64_msvc 0.42.1", + "windows-targets 0.48.0", ] [[package]] @@ -6844,7 +8530,7 @@ version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows-targets 0.42.1", + "windows-targets 0.42.2", ] [[package]] @@ -6858,17 +8544,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ - "windows_aarch64_gnullvm 0.42.1", - "windows_aarch64_msvc 0.42.1", - "windows_i686_gnu 0.42.1", - "windows_i686_msvc 0.42.1", - "windows_x86_64_gnu 0.42.1", - "windows_x86_64_gnullvm 0.42.1", - "windows_x86_64_msvc 0.42.1", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", ] [[package]] @@ -6888,9 +8574,9 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" @@ -6906,9 +8592,9 @@ checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" @@ -6924,9 +8610,9 @@ checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" [[package]] name = "windows_i686_gnu" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" @@ -6942,9 +8628,9 @@ checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" [[package]] name = "windows_i686_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" @@ -6960,9 +8646,9 @@ checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" @@ -6972,9 +8658,9 @@ checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" @@ -6990,9 +8676,9 @@ checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" @@ -7000,6 +8686,15 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +[[package]] +name = "winnow" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.10.1" @@ -7009,6 +8704,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "wyz" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" + [[package]] name = "x25519-dalek" version = "1.1.1" @@ -7047,7 +8748,7 @@ dependencies = [ "ring", "rusticata-macros", "thiserror", - "time", + "time 0.3.20", ] [[package]] @@ -7065,7 +8766,7 @@ dependencies = [ "oid-registry 0.6.1", "rusticata-macros", "thiserror", - "time", + "time 0.3.20", ] [[package]] @@ -7099,32 +8800,31 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "yasna" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aed2e7a52e3744ab4d0c05c20aa065258e84c49fd4226f5191b2ed29712710b4" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" dependencies = [ - "time", + "time 0.3.20", ] [[package]] name = "zeroize" -version = "1.5.7" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" dependencies = [ "zeroize_derive", ] [[package]] name = "zeroize_derive" -version = "1.3.3" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn", - "synstructure", + "syn 2.0.15", ] [[package]] @@ -7138,9 +8838,9 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "6.0.4+zstd.1.5.4" +version = "6.0.5+zstd.1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7afb4b54b8910cf5447638cb54bf4e8a65cbedd783af98b98c62ffe91f185543" +checksum = "d56d9e60b4b1758206c238a10165fbcae3ca37b01744e394c463463f6529d23b" dependencies = [ "libc", "zstd-sys", @@ -7148,9 +8848,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.7+zstd.1.5.4" +version = "2.0.8+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94509c3ba2fe55294d752b79842c530ccfab760192521df74a081a78d2b3c7f5" +checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" dependencies = [ "cc", "libc", diff --git a/Cargo.toml b/Cargo.toml index cd0be9623..a7382eeb3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = ["kubo-rpc", "one"] +members = ["core", "event", "kubo-rpc", "one"] [workspace.dependencies] anyhow = "1" @@ -7,10 +7,13 @@ async-stream = "0.3" async-trait = "0.1" bytes = "1.1" ceramic-one = { path = "./one" } -cid = "0.9" +cid = { version = "0.9", features = ["serde-codec"] } dag-jose = "0.1" futures = "0.3" futures-util = "0.3" +hex = "0.4.3" +iroh-api = { git = "https://github.com/nathanielc/beetle", branch = "expose-api-client" } +iroh-embed = { git = "https://github.com/nathanielc/beetle", branch = "expose-api-client" } iroh-metrics = { git = "https://github.com/nathanielc/beetle", branch = "expose-api-client" } iroh-p2p = { git = "https://github.com/nathanielc/beetle", branch = "expose-api-client" } iroh-rpc-client = { git = "https://github.com/nathanielc/beetle", branch = "expose-api-client" } @@ -18,15 +21,26 @@ iroh-rpc-types = { git = "https://github.com/nathanielc/beetle", branch = "expos iroh-store = { git = "https://github.com/nathanielc/beetle", branch = "expose-api-client" } libipld = "0.15" # use same version as Iroh libp2p = { version = "0.50", default-features = false } # use same version as Iroh +libp2p-tls = { version = "=0.1.0-alpha", default-features = false } # use explicit version of dep to avoid conflict multiaddr = "0.16" # use same version as Iroh +multibase = "0.9" +multihash = "0.17" +once_cell = "1.17.1" opentelemetry = "0.18" opentelemetry-otlp = "0.11" -tokio = { version = "1", features = ["full"] } +serde = { version = "1.0", features = ["derive"] } +serde_ipld_dagcbor = "0.3.0" +serde_json = "1.0" +ssi = { version = "0.6", features = ["ed25519"] } +test-log = { version = "0.2", default-features = false, features = ["trace"] } +tokio = { version = "1", default-features = false, features = ["rt"] } tracing = "0.1" tracing-opentelemetry = "0.18" -tracing-subscriber = "0.3" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } unimock = "0.4" -libp2p-tls = { version = "=0.1.0-alpha", default-features = false } # use explicit version of dep to avoid conflict +unsigned-varint = "0.7" +expect-test = "1" + # Uncomment these lines to use a local copy of beetle @@ -43,6 +57,9 @@ libp2p-tls = { version = "=0.1.0-alpha", default-features = false } [workspace.package] version = "0.1.0" edition = "2021" -authors = ["Nathaniel Cook "] +authors = [ + "Nathaniel Cook ", + "Danny Browning ", +] license = "MIT OR Apache-2.0" repository = "https://github.com/3box/rust-ceramic" diff --git a/core/Cargo.toml b/core/Cargo.toml new file mode 100644 index 000000000..b1b89b6e9 --- /dev/null +++ b/core/Cargo.toml @@ -0,0 +1,32 @@ +[package] +name = "ceramic-core" +version = "0.1.0" +edition.workspace = true +authors.workspace = true +license.workspace = true +repository.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +anyhow.workspace = true +base64 = "0.21.0" +cid.workspace = true +did-method-key = "0.2.1" +did-pkh = "0.2.1" +hex.workspace = true +int-enum = "0.5.0" +multibase.workspace = true +once_cell.workspace = true +regex = "1.7.1" +serde.workspace = true +serde_json.workspace = true +serde_ipld_dagcbor.workspace = true +ssi.workspace = true +unsigned-varint.workspace = true + +[dev-dependencies] +tokio = { workspace = true, features = ["macros", "rt"] } +tracing.workspace = true +tracing-subscriber.workspace = true +test-log.workspace = true diff --git a/core/src/bytes.rs b/core/src/bytes.rs new file mode 100644 index 000000000..168b04d04 --- /dev/null +++ b/core/src/bytes.rs @@ -0,0 +1,76 @@ +use serde::de::Error; +use serde::{ + de::{self, Visitor}, + Deserialize, Serialize, +}; + +/// Sequence of byte values. +#[derive(PartialEq, Default, Debug)] +pub struct Bytes(Vec); + +impl Bytes { + /// Returns the inner slice held by this `Bytes`. + pub fn as_slice(&self) -> &[u8] { + &self.0 + } +} + +impl From<&[u8]> for Bytes { + fn from(value: &[u8]) -> Self { + Self(value.to_vec()) + } +} + +impl From> for Bytes { + fn from(value: Vec) -> Self { + Self(value) + } +} + +impl AsRef<[u8]> for Bytes { + fn as_ref(&self) -> &[u8] { + &self.0 + } +} + +impl Serialize for Bytes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_bytes(&self.0) + } +} + +impl<'de> Deserialize<'de> for Bytes { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + deserializer.deserialize_byte_buf(BytesVisitor) + } +} + +struct BytesVisitor; + +impl<'de> Visitor<'de> for BytesVisitor { + type Value = Bytes; + + fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { + formatter.write_str("a sequence of bytes") + } + + fn visit_byte_buf(self, v: Vec) -> Result + where + E: de::Error, + { + Ok(Bytes(v)) + } + + fn visit_borrowed_bytes(self, v: &'de [u8]) -> Result + where + E: Error, + { + Ok(Bytes(v.to_vec())) + } +} diff --git a/core/src/jwk.rs b/core/src/jwk.rs new file mode 100644 index 000000000..ef233c7c2 --- /dev/null +++ b/core/src/jwk.rs @@ -0,0 +1,187 @@ +use crate::DidDocument; +use cid::multibase; +use once_cell::sync::Lazy; +use ssi::did::{Resource, VerificationMethod}; +use ssi::did_resolve::{dereference, Content, DIDResolver, DereferencingInputMetadata}; +use ssi::jwk::{Base64urlUInt, OctetParams, Params, JWK}; +use std::ops::Deref; + +static DID_TYPE_REGEX: Lazy = + Lazy::new(|| regex::Regex::new(r#"did:(?P[^:]+):(?P[A-Za-z0-9:]+)"#).unwrap()); + +/// Newtype around JWK to make it easier to construct from a DID and provide a private key +#[derive(Debug)] +pub struct Jwk(JWK); + +const DID_KEY: &str = "key"; +const DID_PKH: &str = "pkh"; + +impl Jwk { + /// Create a new JWK from a DID + pub async fn new(did: &DidDocument) -> anyhow::Result { + let cap = DID_TYPE_REGEX.captures(&did.id); + let mut jwk = if let Some(cap) = cap { + match &cap["T"] { + DID_KEY => { + if let Some(jwk) = did_as_jwk(&did_method_key::DIDKey, &did.id).await? { + jwk + } else { + pk_as_jwk(&cap["K"])? + } + } + DID_PKH => { + if let Some(jwk) = did_as_jwk(&did_pkh::DIDPKH, &did.id).await? { + jwk + } else { + anyhow::bail!("Failed to get jwk for {}", did.id) + } + } + _ => { + unimplemented!() + } + } + } else { + anyhow::bail!("Invalid DID") + }; + jwk.key_id = Some(did.id.clone()); + Ok(Self(jwk)) + } + + /// Add a private key to the JWK + pub fn with_private_key(self, pk: &str) -> anyhow::Result { + let pk = hex::decode(pk)?; + let params = match self.0.params.clone() { + Params::OKP(mut op) => { + op.private_key = Some(Base64urlUInt(pk)); + Params::OKP(op) + } + Params::EC(mut ec) => { + ec.ecc_private_key = Some(Base64urlUInt(pk)); + Params::EC(ec) + } + _ => anyhow::bail!("Unsupported JWK Params"), + }; + let mut jwk = JWK::from(params); + jwk.key_id = self.key_id.clone(); + Ok(Self(jwk)) + } +} + +impl From for Jwk { + fn from(value: JWK) -> Self { + Self(value) + } +} + +impl Deref for Jwk { + type Target = JWK; + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +async fn did_as_jwk(resolver: &dyn DIDResolver, id: &str) -> anyhow::Result> { + let (res, object, _) = dereference(resolver, id, &DereferencingInputMetadata::default()).await; + if res.error.is_none() { + match object { + Content::Object(Resource::VerificationMethod(vm)) => { + let jwk = vm.get_jwk()?; + return Ok(Some(jwk)); + } + Content::DIDDocument(doc) => { + if let Some(vms) = &doc.verification_method { + for vm in vms { + if let VerificationMethod::Map(vm) = vm { + if let Ok(jwk) = vm.get_jwk() { + return Ok(Some(jwk)); + } + } + } + } + } + _ => {} + } + } + Ok(None) +} + +fn pk_as_jwk(public_key: &str) -> anyhow::Result { + let (_, data) = multibase::decode(public_key)?; + let curve = match data[0..2] { + [0xed, 0x01] => "Ed25519", + [0xe7, 0x01] => "SECP256K1", + _ => anyhow::bail!("Unknown encoding prefix"), + }; + let mut jwk = JWK::from(Params::OKP(OctetParams { + curve: curve.to_string(), + public_key: Base64urlUInt(data[2..].to_vec()), + private_key: None, + })); + jwk.key_id = Some(public_key.to_string()); + Ok(jwk) +} + +#[cfg(test)] +mod tests { + use super::*; + use ssi::did::DIDMethod; + use ssi::did::VerificationMethod; + use test_log::test; + + #[test(tokio::test)] + async fn should_convert_did_key_generated_without_vm() { + let jwk = JWK::generate_ed25519().unwrap(); + let did = did_method_key::DIDKey + .generate(&ssi::did::Source::Key(&jwk)) + .unwrap(); + let did = DidDocument::new(&did); + let other_jwk = Jwk::new(&did).await.unwrap(); + if let (Params::OKP(did), Params::OKP(orig)) = (&other_jwk.params, jwk.params) { + assert_eq!(did.public_key, orig.public_key) + } + } + + #[test(tokio::test)] + async fn should_convert_did_key_generated_with_vm() { + let jwk = ssi::jwk::JWK::generate_ed25519().unwrap(); + let did = did_method_key::DIDKey + .generate(&ssi::did::Source::Key(&jwk)) + .unwrap(); + let pko = ssi::did::VerificationMethodMap { + public_key_jwk: Some(jwk.clone()), + ..Default::default() + }; + let did = ssi::did::DocumentBuilder::default() + .id(did) + .verification_method(vec![VerificationMethod::Map(pko)]) + .build() + .unwrap(); + let other_jwk = Jwk::new(&did).await.unwrap(); + if let (Params::OKP(did), Params::OKP(orig)) = (&other_jwk.params, jwk.params) { + assert_eq!(did.public_key, orig.public_key) + } else { + panic!("Was not OKP"); + } + } + + #[test(tokio::test)] + async fn should_convert_did_key_with_vm() { + let did = DidDocument::new("did:key:zQ3shokFTS3brHcDQrn82RUDfCZESWL1ZdCEJwekUDPQiYBme#zQ3shokFTS3brHcDQrn82RUDfCZESWL1ZdCEJwekUDPQiYBme"); + let jwk = Jwk::new(&did).await.unwrap(); + tracing::debug!("JWK={:?}", jwk); + if let Params::EC(params) = &jwk.params { + let crv = params.curve.clone().unwrap_or_default(); + tracing::debug!("EC={}", crv); + } else { + panic!("Was not EC"); + } + } + + #[test(tokio::test)] + async fn should_fail_to_convert_did_pkh_with_vm() { + let did = DidDocument::new("did:pkh:eip155:1:0xb9c5714089478a327f09197987f16f9e5d936e8a"); + if Jwk::new(&did).await.is_ok() { + panic!("Should not get JWK from document"); + } + } +} diff --git a/core/src/jws.rs b/core/src/jws.rs new file mode 100644 index 000000000..326757644 --- /dev/null +++ b/core/src/jws.rs @@ -0,0 +1,90 @@ +use crate::{Base64String, Base64UrlString, DidDocument, Jwk, MultiBase32String}; +use cid::Cid; +use serde::{Deserialize, Serialize}; +use ssi::jwk::Algorithm; + +/// The fields associated with the signature used to sign a JWS +#[derive(Serialize, Deserialize)] +pub struct JwsSignature { + pub protected: Option, + pub signature: Base64UrlString, +} + +/// A JWS object +#[derive(Serialize, Deserialize)] +pub struct Jws { + /// Link to CID that contains encoded data + pub link: MultiBase32String, + /// CID of the encoded data + pub payload: Base64UrlString, + /// The signatures of the JWS + pub signatures: Vec, +} + +impl Jws { + /// Creates a new JWS object + pub fn new(jwk: &Jwk, signer: &DidDocument, cid: &Cid) -> anyhow::Result { + let alg = Algorithm::EdDSA; + let header = ssi::jws::Header { + algorithm: alg, + type_: Some("JWT".to_string()), + key_id: Some(signer.id.clone()), + ..Default::default() + }; + let cid_str = Base64UrlString::from_cid(cid); + // creates compact signature of protected.signature + let header_str = Base64String::from(serde_json::to_vec(&header)?); + let signing_input = format!("{}.{}", header_str.as_ref(), cid_str.as_ref()); + let signed = ssi::jws::sign_bytes_b64(header.algorithm, signing_input.as_bytes(), jwk)?; + let link = MultiBase32String::try_from(cid)?; + Ok(Self { + payload: cid_str, + link, + signatures: vec![JwsSignature { + protected: Some(header_str), + signature: Base64UrlString::from(signed), + }], + }) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::{DagCborEncoded, DidDocument}; + use cid::multihash::{Code, MultihashDigest}; + use ssi::did::DIDMethod; + use ssi::did::Source; + use ssi::jwk::Params; + + #[tokio::test] + async fn should_produce_verifiable_signatures() { + let key = ssi::jwk::JWK::generate_ed25519().unwrap(); + let private_key = if let Params::OKP(params) = &key.params { + let pk = params.private_key.as_ref().unwrap(); + hex::encode(pk.0.as_slice()) + } else { + panic!("Invalid key generated"); + }; + let did = did_method_key::DIDKey.generate(&Source::Key(&key)).unwrap(); + let did = DidDocument::new(&did); + let jwk = Jwk::new(&did).await.unwrap(); + let jwk = jwk.with_private_key(&private_key).unwrap(); + let data = "some data"; + let linked_block = DagCborEncoded::new(&data).unwrap(); + let cid = Cid::new_v1(0x71, Code::Sha2_256.digest(linked_block.as_ref())); + let jws = Jws::new(&jwk, &did, &cid).unwrap(); + let compact = format!( + "{}.{}.{}", + jws.signatures[0].protected.as_ref().unwrap().as_ref(), + jws.payload.as_ref(), + jws.signatures[0].signature.as_ref(), + ); + let jwk = Jwk::new(&did).await.unwrap(); + let (_, payload) = ssi::jws::decode_verify(&compact, &jwk).unwrap(); + assert_eq!( + Base64UrlString::from(payload).as_ref(), + Base64UrlString::from_cid(&cid).as_ref() + ); + } +} diff --git a/core/src/lib.rs b/core/src/lib.rs new file mode 100644 index 000000000..68b7884d8 --- /dev/null +++ b/core/src/lib.rs @@ -0,0 +1,221 @@ +//! # Ceramic Core +//! Core functionality for ceramic, including the StreamId, Cid, and Jws types. +#![deny(warnings)] +#![deny(missing_docs)] +mod bytes; +mod jwk; +mod jws; +mod stream_id; + +pub use bytes::Bytes; +pub use jwk::Jwk; +pub use jws::Jws; +pub use stream_id::{StreamId, StreamIdType}; + +pub use cid::Cid; +pub use ssi; +pub use ssi::did::Document as DidDocument; + +use base64::Engine; +use multibase::Base; +use serde::{Deserialize, Serialize}; +use std::fmt::Formatter; + +macro_rules! impl_multi_base { + ($typname:ident, $base:expr) => { + /// A string that is encoded with a multibase prefix + #[derive(Debug, Deserialize, Serialize)] + #[serde(transparent)] + pub struct $typname(String); + + impl std::convert::TryFrom<&cid::Cid> for $typname { + type Error = anyhow::Error; + + fn try_from(v: &cid::Cid) -> Result { + let s = v.to_string_of_base($base)?; + Ok(Self(s)) + } + } + + impl std::convert::TryFrom<&StreamId> for $typname { + type Error = anyhow::Error; + + fn try_from(v: &StreamId) -> Result { + let v = v.to_vec()?; + Ok(Self::from(v)) + } + } + + impl AsRef for $typname { + fn as_ref(&self) -> &str { + &self.0 + } + } + + impl From<&[u8]> for $typname { + fn from(value: &[u8]) -> Self { + Self(multibase::encode($base, value)) + } + } + + impl From> for $typname { + fn from(value: Vec) -> Self { + Self::from(value.as_slice()) + } + } + }; +} + +impl_multi_base!(MultiBase32String, multibase::Base::Base32Lower); +impl_multi_base!(MultiBase36String, multibase::Base::Base36Lower); +impl_multi_base!(MultiBase58BtcString, multibase::Base::Base58Btc); +impl_multi_base!(MultiBase64String, multibase::Base::Base64); +impl_multi_base!(MultiBase64UrlString, multibase::Base::Base64Url); + +/// Newtype to encapsulate a value that is DagCbor encoded +#[derive(Debug, Deserialize, Serialize)] +#[serde(transparent)] +pub struct DagCborEncoded(Vec); + +impl AsRef<[u8]> for DagCborEncoded { + fn as_ref(&self) -> &[u8] { + self.0.as_ref() + } +} + +impl DagCborEncoded { + /// Create a new DagCborEncoded from a value that can be serialized to DagCbor + pub fn new(value: &T) -> anyhow::Result { + let res = serde_ipld_dagcbor::to_vec(value)?; + Ok(Self(res)) + } +} + +impl std::fmt::Display for DagCborEncoded { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + let s = multibase::encode(Base::Base64, &self.0); + write!(f, "{}", s) + } +} + +/// A string that is encoded with base64 +#[derive(Debug, Deserialize, Serialize)] +#[serde(transparent)] +pub struct Base64String(String); + +impl Base64String { + /// Create a new Base64String from a cid + pub fn from_cid(cid: &cid::Cid) -> Self { + Self::from(cid.to_bytes().as_slice()) + } + /// Convert the Base64String to a Vec + pub fn to_vec(&self) -> anyhow::Result> { + let v = base64::engine::general_purpose::STANDARD_NO_PAD.decode(&self.0)?; + Ok(v) + } +} + +impl AsRef for Base64String { + fn as_ref(&self) -> &str { + &self.0 + } +} + +impl From> for Base64String { + fn from(value: Vec) -> Self { + Self::from(value.as_slice()) + } +} + +impl From<&[u8]> for Base64String { + fn from(value: &[u8]) -> Self { + let s = base64::engine::general_purpose::STANDARD_NO_PAD.encode(value); + Self(s) + } +} + +impl From for Base64String { + fn from(value: String) -> Self { + Self(value) + } +} + +/// A string that is encoded with base64url +#[derive(Debug, Deserialize, Serialize)] +#[serde(transparent)] +pub struct Base64UrlString(String); + +impl Base64UrlString { + /// Create a new Base64UrlString from a cid + pub fn from_cid(cid: &cid::Cid) -> Self { + Self::from(cid.to_bytes().as_slice()) + } + /// Convert the Base64UrlString to a Vec + pub fn to_vec(&self) -> anyhow::Result> { + let v = base64::engine::general_purpose::URL_SAFE_NO_PAD.decode(&self.0)?; + Ok(v) + } +} + +impl AsRef for Base64UrlString { + fn as_ref(&self) -> &str { + &self.0 + } +} + +impl From> for Base64UrlString { + fn from(value: Vec) -> Self { + Self::from(value.as_slice()) + } +} + +impl From<&[u8]> for Base64UrlString { + fn from(value: &[u8]) -> Self { + let s = base64::engine::general_purpose::URL_SAFE_NO_PAD.encode(value); + Self(s) + } +} + +impl From for Base64UrlString { + fn from(value: String) -> Self { + Self(value) + } +} + +// Version 0.10 of the cid crate has an encoded_len method. +// However we are on version 0.9 because of iroh dependencies. +// +// To make upgrading easier this trait implements the behavior +// however inefficiently. +// +// Once we upgrade to 0.10 of cid we can simply delete this code. +trait EncodedLen { + fn encoded_len(&self) -> usize; +} + +impl EncodedLen for Cid { + fn encoded_len(&self) -> usize { + self.to_bytes().len() + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn should_roundtrip_base64string() { + let data = vec![0, 1, 2, 3]; + let s = Base64String::from(data.as_slice()); + let other_data = s.to_vec().unwrap(); + assert_eq!(other_data, data); + } + + #[test] + fn should_roundtrip_base64urlstring() { + let data = vec![0, 1, 2, 3]; + let s = Base64UrlString::from(data.as_slice()); + let other_data = s.to_vec().unwrap(); + assert_eq!(other_data, data); + } +} diff --git a/core/src/stream_id.rs b/core/src/stream_id.rs new file mode 100644 index 000000000..168354f72 --- /dev/null +++ b/core/src/stream_id.rs @@ -0,0 +1,210 @@ +use crate::Bytes; +use cid::multibase::{self, Base}; +pub use cid::Cid; +use std::fmt::Formatter; +use std::io::Write; + +use int_enum::IntEnum; +use serde::{Deserialize, Deserializer, Serialize}; +use unsigned_varint::{decode, encode}; + +/// Types of possible stream id's +#[repr(u64)] +#[derive(Copy, Clone, Debug, Eq, IntEnum, PartialEq)] +pub enum StreamIdType { + /// A model stream id + Model = 2, + /// A document stream id + Document = 3, + /// Unloadable. This is also used for the parent stream id of all models + Unloadable = 4, +} + +impl Serialize for StreamIdType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_u64(self.int_value()) + } +} + +/// A stream id, which is a cid with a type +#[derive(Debug, Eq, PartialEq)] +pub struct StreamId { + /// The type of the stream + pub r#type: StreamIdType, + /// Cid of the stream + pub cid: Cid, +} + +const STREAMID_CODEC: u64 = 206; + +impl StreamId { + /// Create a new stream id for a model type + pub fn model(id: Cid) -> Self { + Self { + r#type: StreamIdType::Model, + cid: id, + } + } + + /// Whether this stream id is a model type + pub fn is_model(&self) -> bool { + self.r#type == StreamIdType::Model + } + + /// Create a new stream for a document type + pub fn document(id: Cid) -> Self { + Self { + r#type: StreamIdType::Document, + cid: id, + } + } + + /// Whether this stream id is a document type + pub fn is_document(&self) -> bool { + self.r#type == StreamIdType::Document + } + + // TODO re-add this logic once we can use cid@0.10 + //fn len(&self) -> usize { + // U64_LEN + // + U64_LEN + // + self.cid.encoded_len() + // + self.commit.as_ref().map(|v| v.encoded_len()).unwrap_or(0) + //} + + /// Write the stream id to a writer + pub fn write(&self, mut writer: W) -> anyhow::Result<()> { + let mut buf = encode::u64_buffer(); + let v = encode::u64(STREAMID_CODEC, &mut buf); + writer.write_all(v)?; + let v = encode::u64(self.r#type.int_value(), &mut buf); + writer.write_all(v)?; + self.cid.write_bytes(&mut writer)?; + Ok(()) + } + + /// Convert the stream id to a vector + pub fn to_vec(&self) -> anyhow::Result> { + // Use self.len() here when we have cid@0.10 + let buf = Vec::new(); + let mut writer = std::io::BufWriter::new(buf); + self.write(&mut writer)?; + Ok(writer.into_inner()?) + } +} + +impl TryInto for StreamId { + type Error = anyhow::Error; + + fn try_into(self) -> Result { + (&self).try_into() + } +} + +impl TryInto for &StreamId { + type Error = anyhow::Error; + + fn try_into(self) -> Result { + Ok(Bytes::from(self.to_vec()?)) + } +} + +impl std::str::FromStr for StreamId { + type Err = anyhow::Error; + + fn from_str(s: &str) -> Result { + let (_, id) = multibase::decode(s)?; + Self::try_from(id.as_slice()) + } +} + +impl std::fmt::Display for StreamId { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + if let Ok(b) = self.to_vec() { + let s = multibase::encode(Base::Base36Lower, b); + write!(f, "{}", s) + } else { + Err(std::fmt::Error::default()) + } + } +} + +impl TryFrom<&[u8]> for StreamId { + type Error = anyhow::Error; + + fn try_from(value: &[u8]) -> Result { + let (value, rest) = decode::u64(value)?; + if value == STREAMID_CODEC { + let (tpe, rest) = decode::u64(rest)?; + let tpe = StreamIdType::from_int(tpe)?; + let cid = Cid::read_bytes(std::io::BufReader::new(rest))?; + Ok(StreamId { r#type: tpe, cid }) + } else { + anyhow::bail!("Invalid StreamId, does not include StreamId Codec"); + } + } +} + +impl Serialize for StreamId { + fn serialize(&self, serializer: S) -> Result + where + S: serde::ser::Serializer, + { + serializer.serialize_str(&self.to_string()) + } +} + +impl<'de> Deserialize<'de> for StreamId { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_str(StreamIdVisitor) + } +} + +struct StreamIdVisitor; + +impl<'de> serde::de::Visitor<'de> for StreamIdVisitor { + type Value = StreamId; + + fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { + formatter.write_str("a multi base string") + } + + fn visit_str(self, v: &str) -> Result + where + E: serde::de::Error, + { + match multibase::decode(v) { + Ok((_, v)) => StreamId::try_from(v.as_slice()) + .map_err(|e| serde::de::Error::custom(format!("{:?}", e))), + Err(e) => Err(serde::de::Error::custom(format!("{:?}", e))), + } + } + + fn visit_string(self, v: String) -> Result + where + E: serde::de::Error, + { + self.visit_str(&v) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use std::str::FromStr; + + #[test] + fn can_serialize_and_deserialize_correctly() { + let orig = "kjzl6kcym7w8y7nzgytqayf6aro12zt0mm01n6ydjomyvvklcspx9kr6gpbwd09"; + let stream = StreamId::from_str(orig).unwrap(); + assert_eq!(stream.r#type, StreamIdType::Document); + let s = stream.to_string(); + assert_eq!(&s, orig); + } +} diff --git a/event/Cargo.toml b/event/Cargo.toml new file mode 100644 index 000000000..90bedb2d2 --- /dev/null +++ b/event/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "ceramic-event" +version = "0.1.0" +edition.workspace = true +authors.workspace = true +license.workspace = true +repository.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +anyhow.workspace = true +ceramic-core = { path = "../core" } +multibase.workspace = true +multihash.workspace = true +once_cell.workspace = true +rand = "0.8.5" +serde.workspace = true +ssi.workspace = true +#ssi-jwk = { version = "0.1.0", features = ["ed25519"] } +#ssi-jwt = "0.1.0" + +[dev-dependencies] +serde_ipld_dagcbor.workspace = true +serde_json.workspace = true +tokio = { workspace = true, features = ["fs", "macros", "rt"] } +tracing.workspace = true +tracing-subscriber.workspace = true +test-log.workspace = true +libipld.workspace = true +expect-test.workspace = true diff --git a/event/src/args.rs b/event/src/args.rs new file mode 100644 index 000000000..97b0d2f48 --- /dev/null +++ b/event/src/args.rs @@ -0,0 +1,182 @@ +use crate::deterministic_init_event::DeterministicInitEvent; +use crate::event::Event; +use crate::{DidDocument, StreamId}; + +use anyhow::Result; +use ceramic_core::{Bytes, Cid, Jwk}; +use once_cell::sync::Lazy; +use rand::Fill; +use serde::Serialize; +use std::str::FromStr; + +const SEP: &str = "model"; + +/// All models have this parent StreamId, while all documents have the parent stream id of the model +/// they use +pub static PARENT_STREAM_ID: Lazy = + Lazy::new(|| StreamId::from_str("kh4q0ozorrgaq2mezktnrmdwleo1d").unwrap()); + +/// Arguments for creating an event +pub struct EventArgs<'a> { + signer: &'a DidDocument, + controllers: Vec<&'a DidDocument>, + parent: &'a StreamId, + sep: &'a str, +} + +impl<'a> EventArgs<'a> { + /// Create a new event args object from a DID document + pub fn new(signer: &'a DidDocument) -> Self { + Self { + signer, + controllers: vec![signer], + parent: &PARENT_STREAM_ID, + sep: SEP, + } + } + + /// Create a new event args object from a DID document and a parent stream id + pub fn new_with_parent(signer: &'a DidDocument, parent: &'a StreamId) -> Self { + Self { + signer, + controllers: vec![signer], + parent, + sep: SEP, + } + } + + /// Parent stream id + pub fn parent(&self) -> &StreamId { + self.parent + } + + /// Create an init event from these arguments + pub fn init(&self) -> Result { + let evt = UnsignedEvent::<()>::init(self)?; + let evt = DeterministicInitEvent::new(&evt)?; + Ok(evt) + } + + /// Create an init event from these arguments with data + pub async fn init_with_data(&self, data: &T, private_key: &str) -> Result { + let jwk = Jwk::new(self.signer).await?; + let jwk = jwk.with_private_key(private_key)?; + let evt = UnsignedEvent::init_with_data(self, data)?; + let evt = Event::new(&evt, self.signer, &jwk).await?; + Ok(evt) + } + + /// Create an update event from these arguments + pub async fn update( + &self, + data: &T, + private_key: &str, + prev: &Cid, + ) -> Result { + let jwk = Jwk::new(self.signer).await?; + let jwk = jwk.with_private_key(private_key)?; + let evt = UnsignedEvent::update(self, data, prev)?; + let evt = Event::new(&evt, self.signer, &jwk).await?; + Ok(evt) + } + + /// Controllers for this event + pub fn controllers(&self) -> impl Iterator { + self.controllers.iter() + } +} + +#[derive(Serialize)] +struct UnsignedEventHeader<'a> { + controllers: Vec<&'a str>, + #[serde(rename = "model")] + parent: Bytes, + sep: &'a str, + #[serde(skip_serializing_if = "Option::is_none")] + unique: Option>, +} + +/// An unsigned event, which can be used to create a events +#[derive(Serialize)] +pub struct UnsignedEvent<'a, T: Serialize> { + #[serde(skip_serializing_if = "Option::is_none")] + data: Option<&'a T>, + #[serde(skip_serializing_if = "Option::is_none")] + header: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + prev: Option<&'a Cid>, + #[serde(skip_serializing_if = "Option::is_none")] + id: Option<&'a Cid>, +} + +impl<'a, T: Serialize> UnsignedEvent<'a, T> { + /// Initialize a new unsigned event from event arguments + pub fn init(args: &'a EventArgs) -> Result { + create_unsigned_event(args, CreateArgs::Init) + } + + /// Initialize a new unsigned event from event arguments with data + pub fn init_with_data(args: &'a EventArgs, data: &'a T) -> Result { + let mut rng = rand::thread_rng(); + let mut unique = [0u32; 12]; + unique.try_fill(&mut rng)?; + create_unsigned_event( + args, + CreateArgs::InitWithData { + data, + unique: unique.to_vec(), + }, + ) + } + + /// Create an update unsigned event from event arguments + pub fn update(args: &'a EventArgs, data: &'a T, prev: &'a Cid) -> Result { + create_unsigned_event(args, CreateArgs::Update { data, prev }) + } +} + +enum CreateArgs<'a, T: Serialize> { + Init, + InitWithData { data: &'a T, unique: Vec }, + Update { data: &'a T, prev: &'a Cid }, +} + +fn create_unsigned_event<'a, T: Serialize>( + event_args: &'a EventArgs<'a>, + create_args: CreateArgs<'a, T>, +) -> Result> { + let controllers: Vec<&str> = event_args + .controllers + .iter() + .map(|d| d.id.as_ref()) + .collect(); + let (header, data, prev) = match create_args { + CreateArgs::Init => ( + Some(UnsignedEventHeader { + controllers, + parent: event_args.parent.try_into()?, + sep: event_args.sep, + unique: None, + }), + None, + None, + ), + CreateArgs::InitWithData { data, unique } => ( + Some(UnsignedEventHeader { + controllers, + parent: event_args.parent.try_into()?, + sep: event_args.sep, + unique: Some(unique), + }), + Some(data), + None, + ), + CreateArgs::Update { data, prev } => (None, Some(data), Some(prev)), + }; + Ok(UnsignedEvent { + data, + header, + prev, + id: prev, + }) +} diff --git a/event/src/deterministic_init_event.rs b/event/src/deterministic_init_event.rs new file mode 100644 index 000000000..77ca9545b --- /dev/null +++ b/event/src/deterministic_init_event.rs @@ -0,0 +1,25 @@ +use crate::args::UnsignedEvent; +use anyhow::Result; +use ceramic_core::DagCborEncoded; +use serde::Serialize; +use std::fmt::Formatter; + +/// A deterministic init event, where it will always hash the same way +pub struct DeterministicInitEvent { + /// The encoded event + pub encoded: DagCborEncoded, +} + +impl DeterministicInitEvent { + /// Create a deterministic init event from an unsigned event + pub fn new(evt: &UnsignedEvent<'_, T>) -> Result { + let data = DagCborEncoded::new(&evt)?; + Ok(Self { encoded: data }) + } +} + +impl std::fmt::Display for DeterministicInitEvent { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.encoded) + } +} diff --git a/event/src/event.rs b/event/src/event.rs new file mode 100644 index 000000000..4ad029c0c --- /dev/null +++ b/event/src/event.rs @@ -0,0 +1,140 @@ +use crate::args::UnsignedEvent; +use crate::DidDocument; +use anyhow::Result; +use ceramic_core::{Cid, DagCborEncoded, Jwk, Jws}; +use multihash::{Code, MultihashDigest}; +use serde::Serialize; + +// https://github.com/multiformats/multicodec/blob/master/table.csv +const DAG_CBOR_CODEC: u64 = 0x71; + +/// A ceramic event +pub struct Event { + /// Cid of the data for the event + pub cid: Cid, + /// The data for the event to be encoded in the block + pub linked_block: DagCborEncoded, + /// JWS signature of the event + pub jws: Jws, +} + +impl Event { + /// Create a new event from an unsigned event, signer, and jwk + pub async fn new<'a, T: Serialize>( + unsigned: &'a UnsignedEvent<'a, T>, + signer: &'a DidDocument, + jwk: &'a Jwk, + ) -> Result { + // encode our event with dag cbor, hashing that to create cid + let linked_block = DagCborEncoded::new(&unsigned)?; + let cid = Cid::new_v1(DAG_CBOR_CODEC, Code::Sha2_256.digest(linked_block.as_ref())); + let jws = Jws::new(jwk, signer, &cid)?; + Ok(Self { + cid, + linked_block, + jws, + }) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + use crate::{DidDocument, EventArgs, StreamId}; + + use expect_test::expect; + use libipld::{cbor::DagCborCodec, json::DagJsonCodec, prelude::Codec, Ipld}; + use std::str::FromStr; + use test_log::test; + + fn to_pretty_json(json_data: &[u8]) -> String { + let json: serde_json::Value = match serde_json::from_slice(json_data) { + Ok(r) => r, + Err(_) => { + panic!( + "input data should be valid json: {:?}", + String::from_utf8(json_data.to_vec()) + ) + } + }; + serde_json::to_string_pretty(&json).unwrap() + } + + #[test] + fn should_roundtrip_json_data() { + let did_str = "some_did"; + let data = serde_json::json!({ + "creator": did_str, + "radius": 1, + "red": 2, + "green": 3, + "blue": 4, + }); + let encoded = DagCborEncoded::new(&data).unwrap(); + let decoded: serde_json::Value = serde_ipld_dagcbor::from_slice(encoded.as_ref()).unwrap(); + assert_eq!(decoded, data); + } + + #[test] + fn should_dag_json_init_event() { + let did = DidDocument::new("did:key:blah"); + let model = + StreamId::from_str("kjzl6kcym7w8y6of44g27v981fuutovbrnlw2ifbf8n26j2t4g5mmm6zc43nx1u") + .unwrap(); + let args = EventArgs::new_with_parent(&did, &model); + let evt = args.init().unwrap(); + let data: Ipld = DagCborCodec.decode(evt.encoded.as_ref()).unwrap(); + let encoded = DagJsonCodec.encode(&data).unwrap(); + expect![[r#" + { + "header": { + "controllers": [ + "did:key:blah" + ], + "model": { + "/": { + "bytes": "zgEDAYUBEiBICac5WcThoeb40H49X/XNgN0enh/EJNtBhIMsTp36Eg" + } + }, + "sep": "model" + } + }"#]] + .assert_eq(&to_pretty_json(&encoded)); + } + + #[tokio::test] + async fn should_create_event() { + let mid = + StreamId::from_str("kjzl6kcym7w8y7nzgytqayf6aro12zt0mm01n6ydjomyvvklcspx9kr6gpbwd09") + .unwrap(); + let did = DidDocument::new("did:key:z6MkeqMVHDo67GE1CDMDXGvFK2eG98Ta2c2WB18m7SVXDb6f"); + let did_str = &did.id; + let data = serde_json::json!({ + "creator": did_str, + "radius": 1, + "red": 2, + "green": 3, + "blue": 4, + }); + let args = EventArgs::new_with_parent(&did, &mid); + let evt = args + .init_with_data( + &data, + "3224d39677c03d4c3d83d6ede051db0f2c1df16f422ed509731dd6592a906d9c", + ) + .await + .unwrap(); + + let protected = evt.jws.signatures[0].protected.as_ref().unwrap(); + let protected = protected.to_vec().unwrap(); + let protected: serde_json::Value = serde_json::from_slice(protected.as_ref()).unwrap(); + assert!(protected.as_object().unwrap().contains_key("kid")); + + let post_data: Ipld = DagCborCodec.decode(evt.linked_block.as_ref()).unwrap(); + let encoded = DagJsonCodec.encode(&post_data).unwrap(); + let post_data: serde_json::Value = serde_json::from_slice(&encoded).unwrap(); + let post_data = post_data.as_object().unwrap().get("data").unwrap(); + assert_eq!(post_data, &data); + } +} diff --git a/event/src/lib.rs b/event/src/lib.rs new file mode 100644 index 000000000..a0f87a102 --- /dev/null +++ b/event/src/lib.rs @@ -0,0 +1,13 @@ +//! # Ceramic Event +//! Implementation of ceramic event protocol, with appropriate compatibilility with js-ceramic +#![deny(warnings)] +#![deny(missing_docs)] +mod args; +mod deterministic_init_event; +mod event; + +pub use args::EventArgs; +pub use deterministic_init_event::DeterministicInitEvent; +pub use event::Event; + +pub use ceramic_core::*; diff --git a/kubo-rpc/Cargo.toml b/kubo-rpc/Cargo.toml index be1717ffa..46c9f0f97 100644 --- a/kubo-rpc/Cargo.toml +++ b/kubo-rpc/Cargo.toml @@ -31,7 +31,7 @@ bytes.workspace = true cid.workspace = true dag-jose.workspace = true futures-util.workspace = true -hex = "0.4" +hex.workspace = true iroh-metrics.workspace = true iroh-p2p.workspace = true iroh-rpc-client.workspace = true @@ -43,8 +43,8 @@ libp2p-tls.workspace = true libp2p.workspace = true mime = { version = "0.3.16", optional = true } multiaddr.workspace = true -serde = { version = "1", features = ["derive"], optional = true } -serde_json = { version = "1", optional = true } +serde = { workspace = true, optional = true } +serde_json = { workspace = true, optional = true } thiserror = "1" tokio.workspace = true tracing-actix-web = { version = "0.7", optional = true } @@ -53,5 +53,4 @@ tracing.workspace = true unimock.workspace = true [dev-dependencies] -expect-test = "1" -hex = "0.4" +expect-test.workspace = true diff --git a/kubo-rpc/src/http/mod.rs b/kubo-rpc/src/http/mod.rs index 3071f36cc..7b022e03d 100644 --- a/kubo-rpc/src/http/mod.rs +++ b/kubo-rpc/src/http/mod.rs @@ -138,13 +138,15 @@ mod tests { ::Error: std::fmt::Debug, { let body_bytes = body::to_bytes(body).await.unwrap(); - let body_json: serde_json::Value = serde_json::from_slice(body_bytes.as_ref()) - .unwrap_or_else(|_| { + let body_json: serde_json::Value = match serde_json::from_slice(body_bytes.as_ref()) { + Ok(v) => v, + Err(_) => { panic!( "response body should be valid json: {:?}", String::from_utf8(body_bytes.as_ref().to_vec()) ) - }); + } + }; let pretty_json = serde_json::to_string_pretty(&body_json).unwrap(); expect.assert_eq(&pretty_json); }