diff --git a/Cargo.lock b/Cargo.lock index 9408240b..399bb770 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,17 +2,11 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" - [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -52,15 +46,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ "cfg-if", + "getrandom 0.2.10", "once_cell", "version_check", ] [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" dependencies = [ "memchr", ] @@ -146,7 +141,7 @@ dependencies = [ "async-lock", "async-task", "concurrent-queue", - "fastrand", + "fastrand 1.9.0", "futures-lite", "slab", ] @@ -182,35 +177,17 @@ dependencies = [ "polling", "rustix 0.37.23", "slab", - "socket2", + "socket2 0.4.9", "waker-fn", ] [[package]] name = "async-lock" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" -dependencies = [ - "event-listener", -] - -[[package]] -name = "async-process" -version = "1.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a9d28b1d97e08915212e2e45310d47854eafa69600756fc735fb788f75199c9" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ - "async-io", - "async-lock", - "autocfg", - "blocking", - "cfg-if", "event-listener", - "futures-lite", - "rustix 0.37.23", - "signal-hook", - "windows-sys 0.48.0", ] [[package]] @@ -224,7 +201,6 @@ dependencies = [ "async-global-executor", "async-io", "async-lock", - "async-process", "crossbeam-utils", "futures-channel", "futures-core", @@ -260,7 +236,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] @@ -271,20 +247,20 @@ checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" [[package]] name = "async-trait" -version = "0.1.71" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] name = "atoi" -version = "1.0.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7c57d12312ff59c811c0643f4d80830505833c9ffaebd193d819392b265be8e" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" dependencies = [ "num-traits", ] @@ -328,7 +304,7 @@ dependencies = [ "http", "hyper", "ring", - "time 0.3.23", + "time", "tokio", "tower", "tracing", @@ -384,7 +360,7 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "fastrand", + "fastrand 1.9.0", "http", "tokio-stream", "tower", @@ -492,7 +468,7 @@ dependencies = [ "percent-encoding", "regex", "ring", - "time 0.3.23", + "time", "tracing", ] @@ -540,7 +516,7 @@ dependencies = [ "aws-smithy-http-tower", "aws-smithy-types", "bytes", - "fastrand", + "fastrand 1.9.0", "http", "http-body", "hyper", @@ -628,7 +604,7 @@ dependencies = [ "itoa", "num-integer", "ryu", - "time 0.3.23", + "time", ] [[package]] @@ -658,9 +634,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -671,19 +647,6 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "bae" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b8de67cc41132507eeece2584804efcb15f85ba516e34c944b7667f480397a" -dependencies = [ - "heck 0.3.3", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "base-x" version = "0.2.11" @@ -716,9 +679,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "base64ct" @@ -732,6 +695,12 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf9ff0bbfd639f15c74af777d81383cf53efb7c93613f6cab67c6c11e05bbf8b" +[[package]] +name = "bech32" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" + [[package]] name = "bigdecimal" version = "0.3.1" @@ -763,9 +732,12 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +dependencies = [ + "serde", +] [[package]] name = "bitvec" @@ -813,31 +785,31 @@ dependencies = [ [[package]] name = "blake2b_simd" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" +checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq 0.2.6", + "constant_time_eq 0.3.0", ] [[package]] name = "blake2s_simd" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6637f448b9e61dfadbdcbae9a885fadee1f3eaffb1f8d3c1965d3ade8bdfd44f" +checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq 0.2.6", + "constant_time_eq 0.3.0", ] [[package]] name = "blake3" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "199c42ab6972d92c9f8995f086273d25c42fc0f7b2a1fcefba465c1352d25ba5" +checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" dependencies = [ "arrayref", "arrayvec 0.7.4", @@ -904,7 +876,7 @@ dependencies = [ "async-lock", "async-task", "atomic-waker", - "fastrand", + "fastrand 1.9.0", "futures-lite", "log", ] @@ -984,9 +956,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.6.0" +version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" +checksum = "4c2f7349907b712260e64b0afe2f84692af14a454be26187d9df565c7f69266a" dependencies = [ "memchr", "serde", @@ -1004,9 +976,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byte-tools" @@ -1044,9 +1016,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "bytes-utils" @@ -1058,6 +1030,32 @@ dependencies = [ "either", ] +[[package]] +name = "cacaos" +version = "0.5.0" +source = "git+https://github.com/spruceid/cacao-rs?branch=feat/cacao-v3#92661420efc40f9d2b1345e6366d848f238828bd" +dependencies = [ + "async-trait", + "hex", + "http", + "iri-string", + "libipld 0.16.0", + "multidid", + "serde", + "serde_json", + "siwe", + "siwe-recap 0.2.0", + "ssi-dids", + "ssi-jwk", + "ssi-jwt", + "ssi-ucan", + "thiserror", + "time", + "ucan-capabilities-object", + "url", + "varsig", +] + [[package]] name = "cacaos" version = "0.5.1" @@ -1068,12 +1066,12 @@ dependencies = [ "hex", "http", "iri-string", - "libipld", + "libipld 0.14.0", "serde", "serde_with 2.3.3", "siwe", "thiserror", - "time 0.3.23", + "time", "url", ] @@ -1117,9 +1115,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfb-mode" @@ -1138,18 +1139,17 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "serde", - "time 0.1.45", "wasm-bindgen", - "winapi", + "windows-targets 0.48.5", ] [[package]] @@ -1162,6 +1162,19 @@ dependencies = [ "multibase 0.9.1", "multihash 0.16.3", "serde", + "unsigned-varint", +] + +[[package]] +name = "cid" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd94671561e36e4e7de75f753f577edafb0e7c05d6e4547229fdf7938fbcd2c3" +dependencies = [ + "core2", + "multibase 0.9.1", + "multihash 0.18.1", + "serde", "serde_bytes", "unsigned-varint", ] @@ -1218,9 +1231,9 @@ checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" [[package]] name = "const-oid" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] name = "constant_time_eq" @@ -1228,12 +1241,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" -[[package]] -name = "constant_time_eq" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" - [[package]] name = "constant_time_eq" version = "0.3.0" @@ -1253,7 +1260,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7efb37c3e1ccb1ff97164ad95ac1606e8ccd35b3fa0a7d99a304c7f4a428cc24" dependencies = [ "percent-encoding", - "time 0.3.23", + "time", "version_check", ] @@ -1291,6 +1298,21 @@ dependencies = [ "libc", ] +[[package]] +name = "crc" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" + [[package]] name = "crc24" version = "0.1.6" @@ -1299,9 +1321,9 @@ checksum = "fd121741cf3eb82c08dd3023eb55bf2665e5f60ec20f89760cf836ae4562e6a0" [[package]] name = "crc32c" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dfea2db42e9927a3845fb268a10a72faed6d416065f77873f05e411457c363e" +checksum = "d8f48d60e5b4d2c53d5c2b1d8a58c849a70ae5e5509b08a48d047e3b65714a74" dependencies = [ "rustc_version", ] @@ -1374,9 +1396,9 @@ dependencies = [ [[package]] name = "crypto-bigint" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" +checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", @@ -1418,9 +1440,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.0.0-rc.3" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436ace70fc06e06f7f689d2624dc4e2f0ea666efb5aa704215f7249ae6e047a7" +checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" dependencies = [ "cfg-if", "cpufeatures", @@ -1441,7 +1463,7 @@ checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] @@ -1537,7 +1559,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] @@ -1581,7 +1603,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core 0.20.3", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] @@ -1633,21 +1655,30 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" dependencies = [ - "const-oid 0.9.4", + "const-oid 0.9.5", "zeroize", ] [[package]] name = "der" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7ed52955ce76b1554f509074bb357d3fb8ac9b51288a65a3fd480d1dfba946" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ - "const-oid 0.9.4", + "const-oid 0.9.5", "pem-rfc7468 0.7.0", "zeroize", ] +[[package]] +name = "deranged" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +dependencies = [ + "serde", +] + [[package]] name = "derivative" version = "2.2.0" @@ -1750,18 +1781,17 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35b50dba0afdca80b187392b24f2499a88c336d5a8493e4b4ccfb608708be56a" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.0", "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] name = "did-ethr" version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d22b1adcd156bf1041f87f80cd027bf6f82a34849bada30d59b869e831df19d" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "async-trait", "chrono", @@ -1777,8 +1807,7 @@ dependencies = [ [[package]] name = "did-method-key" version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "543b322ff52ab4892f4fd30ceb8fa1007aca4e3c5e89ad55793036846f0cc74e" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "async-trait", "multibase 0.8.0", @@ -1793,8 +1822,7 @@ dependencies = [ [[package]] name = "did-onion" version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8e1ba10a5415931c5d436a6343bbd72673a42284a16d4acd501fbfb9d882db5" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "async-trait", "http", @@ -1807,11 +1835,10 @@ dependencies = [ [[package]] name = "did-pkh" version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "074c4ae82880d60a25048cd3bf2e8aaaa881922d7c73fbb9ec29fc67fa0d33e4" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "async-trait", - "bech32", + "bech32 0.8.1", "bs58 0.4.0", "chrono", "iref", @@ -1827,8 +1854,7 @@ dependencies = [ [[package]] name = "did-tz" version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "562670fedf756b20c047dcf4ef88d020c5c86c2115f954fb3aef072952015ba4" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "anyhow", "async-trait", @@ -1848,8 +1874,7 @@ dependencies = [ [[package]] name = "did-web" version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e239187ee5cf6b778c75252ad22bb8289508dcaf05a7c718222a3093460ca0d2" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "async-trait", "http", @@ -1861,8 +1886,7 @@ dependencies = [ [[package]] name = "did-webkey" version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88fb811ef9b08a872eac80c1d1bcb0cabf4cd6a205d75971d8864f06ea2a9c2a" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "anyhow", "async-trait", @@ -1903,31 +1927,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", - "const-oid 0.9.4", + "const-oid 0.9.5", "crypto-common", "subtle", ] -[[package]] -name = "dirs" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - [[package]] name = "dotenvy" version = "0.15.7" @@ -1948,11 +1952,11 @@ dependencies = [ [[package]] name = "ecdsa" -version = "0.16.7" +version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0997c976637b606099b9985693efa3581e84e41f5c11ba5255f88711058ad428" +checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" dependencies = [ - "der 0.7.7", + "der 0.7.8", "digest 0.10.7", "elliptic-curve 0.13.5", "rfc6979 0.4.0", @@ -1971,9 +1975,9 @@ dependencies = [ [[package]] name = "ed25519" -version = "2.2.1" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb04eee5d9d907f29e80ee6b0e78f7e2c82342c63e3580d8c4f69d9d5aad963" +checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" dependencies = [ "pkcs8 0.10.2", "signature 2.1.0", @@ -1995,12 +1999,13 @@ dependencies = [ [[package]] name = "ed25519-dalek" -version = "2.0.0-rc.3" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa8e9049d5d72bfc12acbc05914731b5322f79b5e2f195e9f2d705fca22ab4c" +checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" dependencies = [ - "curve25519-dalek 4.0.0-rc.3", - "ed25519 2.2.1", + "curve25519-dalek 4.1.1", + "ed25519 2.2.2", + "rand_core 0.6.4", "serde", "sha2 0.10.7", "zeroize", @@ -2008,9 +2013,12 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +dependencies = [ + "serde", +] [[package]] name = "elliptic-curve" @@ -2039,7 +2047,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" dependencies = [ "base16ct 0.2.0", - "crypto-bigint 0.5.2", + "crypto-bigint 0.5.3", "digest 0.10.7", "ff 0.13.0", "generic-array 0.14.7", @@ -2055,9 +2063,9 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] @@ -2070,9 +2078,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" dependencies = [ "errno-dragonfly", "libc", @@ -2089,6 +2097,17 @@ dependencies = [ "libc", ] +[[package]] +name = "etcetera" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" +dependencies = [ + "cfg-if", + "home", + "windows-sys 0.48.0", +] + [[package]] name = "event-listener" version = "2.5.3" @@ -2110,6 +2129,12 @@ dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + [[package]] name = "ff" version = "0.12.1" @@ -2132,9 +2157,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.1.20" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" +checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d" [[package]] name = "figment" @@ -2145,11 +2170,17 @@ dependencies = [ "atomic", "pear", "serde", - "toml 0.7.6", + "toml 0.7.8", "uncased", "version_check", ] +[[package]] +name = "finl_unicode" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" + [[package]] name = "fixed-hash" version = "0.7.0" @@ -2161,9 +2192,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" dependencies = [ "crc32fast", "miniz_oxide", @@ -2268,13 +2299,13 @@ dependencies = [ [[package]] name = "futures-intrusive" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a604f7a68fbf8103337523b1fadc8ade7361ee3f112f7c680ad179651616aed5" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" dependencies = [ "futures-core", "lock_api", - "parking_lot 0.11.2", + "parking_lot", ] [[package]] @@ -2289,7 +2320,7 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ - "fastrand", + "fastrand 1.9.0", "futures-core", "futures-io", "memchr", @@ -2306,18 +2337,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", -] - -[[package]] -name = "futures-rustls" -version = "0.22.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" -dependencies = [ - "futures-io", - "rustls 0.20.8", - "webpki 0.22.0", + "syn 2.0.37", ] [[package]] @@ -2417,9 +2437,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "glob" @@ -2475,9 +2495,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.20" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -2528,21 +2548,20 @@ dependencies = [ [[package]] name = "hashlink" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "312f66718a2d7789ffef4f4b7b213138ed9f1eb3aa1d0d82fc99f88fb3ffd26f" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ "hashbrown 0.14.0", ] [[package]] name = "headers" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" +checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" dependencies = [ - "base64 0.13.1", - "bitflags 1.3.2", + "base64 0.21.4", "bytes", "headers-core", "http", @@ -2560,15 +2579,6 @@ dependencies = [ "http", ] -[[package]] -name = "heck" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "heck" version = "0.4.1" @@ -2580,9 +2590,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hex" @@ -2608,6 +2618,15 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "home" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +dependencies = [ + "windows-sys 0.48.0", +] + [[package]] name = "http" version = "0.2.9" @@ -2638,9 +2657,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" @@ -2659,7 +2678,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -2680,7 +2699,7 @@ dependencies = [ "rustls-native-certs", "tokio", "tokio-rustls 0.22.0", - "webpki 0.21.4", + "webpki", ] [[package]] @@ -2692,7 +2711,7 @@ dependencies = [ "futures-util", "http", "hyper", - "rustls 0.21.5", + "rustls 0.21.7", "tokio", "tokio-rustls 0.24.1", ] @@ -2779,6 +2798,17 @@ dependencies = [ "hashbrown 0.14.0", ] +[[package]] +name = "inherent" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce243b1bfa62ffc028f1cc3b6034ec63d649f3031bc8a4fbbb004e1ac17d1f68" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.37", +] + [[package]] name = "inlinable_string" version = "0.1.15" @@ -2855,15 +2885,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi", - "rustix 0.38.4", + "rustix 0.38.14", "windows-sys 0.48.0", ] [[package]] name = "itertools" -version = "0.10.5" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" dependencies = [ "either", ] @@ -3014,9 +3044,9 @@ dependencies = [ [[package]] name = "json-number" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c724484d970b5aabe46934b9571980e255fd50a9ef1b13f23ed2b5c2a19bbb69" +checksum = "280f53da10842ffc42737ac8a6f2c14ced71f950de1cdb6765264a2eb1100cc5" dependencies = [ "lexical", "ryu-js", @@ -3037,9 +3067,9 @@ dependencies = [ [[package]] name = "json-syntax" -version = "0.9.4" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9043ed89d8285e64843df5e12696d5d14f1efc0642bdde62852239917fa7e1f" +checksum = "9f2f4557e0fe320cc102bdebf9fa9471b8513e13bb34b5fc23d7e270c5f9b1cc" dependencies = [ "contextual", "decoded-char", @@ -3138,7 +3168,7 @@ dependencies = [ "serde_json", "ssi", "thiserror", - "time 0.3.23", + "time", ] [[package]] @@ -3147,7 +3177,7 @@ version = "0.2.0" dependencies = [ "async-trait", "base64 0.13.1", - "cacaos", + "cacaos 0.5.0", "did-ethr", "did-method-key", "did-onion", @@ -3157,15 +3187,15 @@ dependencies = [ "did-webkey", "iri-string", "lazy_static", - "libipld", + "libipld 0.16.0", "serde", + "serde_ipld_dagcbor", "serde_json", "serde_with 1.14.0", - "siwe-recap", + "siwe-recap 0.2.0", "ssi", "thiserror", "tokio", - "uuid", ] [[package]] @@ -3178,12 +3208,14 @@ dependencies = [ "iri-string", "kepler-lib", "serde", + "serde_ipld_dagcbor", "serde_json", "serde_with 1.14.0", "thiserror", - "time 0.3.23", + "time", "tokio", "tracing", + "uuid", ] [[package]] @@ -3198,7 +3230,7 @@ dependencies = [ "serde", "serde_json", "serde_with 1.14.0", - "time 0.3.23", + "time", "wasm-bindgen", "wasm-bindgen-futures", ] @@ -3302,9 +3334,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.147" +version = "0.2.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" [[package]] name = "libipld" @@ -3315,14 +3347,30 @@ dependencies = [ "async-trait", "cached", "fnv", - "libipld-cbor", - "libipld-cbor-derive", - "libipld-core", - "libipld-json", - "libipld-macro", + "libipld-cbor 0.14.0", + "libipld-cbor-derive 0.14.0", + "libipld-core 0.14.0", + "libipld-macro 0.14.0", "log", "multihash 0.16.3", - "parking_lot 0.12.1", + "parking_lot", + "thiserror", +] + +[[package]] +name = "libipld" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1ccd6b8ffb3afee7081fcaec00e1b099fd1c7ccf35ba5729d88538fcc3b4599" +dependencies = [ + "fnv", + "libipld-cbor 0.16.0", + "libipld-cbor-derive 0.16.0", + "libipld-core 0.16.0", + "libipld-json", + "libipld-macro 0.16.0", + "log", + "multihash 0.18.1", "thiserror", ] @@ -3333,7 +3381,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8dd1ab68c9d26f20c7d0dfea6eecbae8c00359875210001b33ca27d4a02f3d09" dependencies = [ "byteorder", - "libipld-core", + "libipld-core 0.14.0", + "thiserror", +] + +[[package]] +name = "libipld-cbor" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77d98c9d1747aa5eef1cf099cd648c3fd2d235249f5fed07522aaebc348e423b" +dependencies = [ + "byteorder", + "libipld-core 0.16.0", "thiserror", ] @@ -3350,6 +3409,19 @@ dependencies = [ "synstructure", ] +[[package]] +name = "libipld-cbor-derive" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5ba3a729b72973e456a1812b0afe2e176a376c1836cc1528e9fc98ae8cb838" +dependencies = [ + "proc-macro-crate 1.1.3", + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + [[package]] name = "libipld-core" version = "0.14.0" @@ -3357,22 +3429,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d44790246ec6b7314cba745992c23d479d018073e66d49ae40ae1b64e5dd8eb5" dependencies = [ "anyhow", - "cid", + "cid 0.8.6", "core2", "multibase 0.9.1", "multihash 0.16.3", + "thiserror", +] + +[[package]] +name = "libipld-core" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5acd707e8d8b092e967b2af978ed84709eaded82b75effe6cb6f6cc797ef8158" +dependencies = [ + "anyhow", + "cid 0.10.1", + "core2", + "multibase 0.9.1", + "multihash 0.18.1", "serde", "thiserror", ] [[package]] name = "libipld-json" -version = "0.14.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18aa481a87f084d98473dd9ece253a9569c762b75f6bbba8217d54e48c9d63b3" +checksum = "25856def940047b07b25c33d4e66d248597049ab0202085215dc4dca0487731c" dependencies = [ - "libipld-core", - "multihash 0.16.3", + "libipld-core 0.16.0", + "multihash 0.18.1", "serde", "serde_json", ] @@ -3383,7 +3469,16 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "852c011562ae5059b67c3a917f9f5945af5a68df8e39ede4444fff33274d25e2" dependencies = [ - "libipld-core", + "libipld-core 0.14.0", +] + +[[package]] +name = "libipld-macro" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71171c54214f866ae6722f3027f81dff0931e600e5a61e6b1b6a49ca0b5ed4ae" +dependencies = [ + "libipld-core 0.16.0", ] [[package]] @@ -3394,9 +3489,9 @@ checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" [[package]] name = "libp2p" -version = "0.52.1" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38039ba2df4f3255842050845daef4a004cc1f26da03dbc645535088b51910ef" +checksum = "32d07d1502a027366d55afe187621c2d7895dc111a3df13b35fed698049681d7" dependencies = [ "bytes", "futures", @@ -3426,9 +3521,9 @@ dependencies = [ [[package]] name = "libp2p-connection-limits" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d45dd90e8f0e1fa59e85ff5316dd4d1ac41a9a507e79cda1b0e9b7be43ad1a56" +checksum = "2f5107ad45cb20b2f6c3628c7b6014b996fcb13a88053f4569c872c6e30abf58" dependencies = [ "libp2p-core", "libp2p-identity", @@ -3450,10 +3545,10 @@ dependencies = [ "libp2p-identity", "log", "multiaddr", - "multihash 0.19.0", + "multihash 0.19.1", "multistream-select", "once_cell", - "parking_lot 0.12.1", + "parking_lot", "pin-project", "quick-protobuf", "rand 0.8.5", @@ -3466,14 +3561,14 @@ dependencies = [ [[package]] name = "libp2p-identity" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2874d9c6575f1d7a151022af5c42bb0ffdcdfbafe0a6fd039de870b384835a2" +checksum = "686e73aff5e23efbb99bc85340ea6fd8686986aa7b283a881ba182cfca535ca9" dependencies = [ "bs58 0.5.0", - "ed25519-dalek 1.0.1", + "ed25519-dalek 2.0.0", "log", - "multihash 0.19.0", + "multihash 0.19.1", "quick-protobuf", "rand 0.8.5", "sha2 0.10.7", @@ -3483,9 +3578,9 @@ dependencies = [ [[package]] name = "libp2p-swarm" -version = "0.43.1" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de15b2097fc3bde063df8c202803538ff467fedb18f01c13bc5da55913d246c" +checksum = "28016944851bd73526d3c146aabf0fa9bbe27c558f080f9e5447da3a1772c01a" dependencies = [ "either", "fnv", @@ -3504,9 +3599,9 @@ dependencies = [ [[package]] name = "libsqlite3-sys" -version = "0.24.2" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "898745e570c7d0453cc1fbc4a701eb6c662ed54e8fec8b7d14be137ebeeb9d14" +checksum = "afc22eff61b133b115c6e8c74e818c628d6d5e7a502afea6f64dee076dd94326" dependencies = [ "cc", "pkg-config", @@ -3527,9 +3622,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.3" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" +checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" [[package]] name = "lock_api" @@ -3543,9 +3638,9 @@ dependencies = [ [[package]] name = "locspan" -version = "0.7.13" +version = "0.7.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685e26b5a3e4266c351baf3c00793a097e40f4293270ac508b3f4cbc41e72e54" +checksum = "6eb541fabac50f90782ec4fafa7b0b3961adc0d1862c7c7a863dc94ed5541d73" dependencies = [ "contextual", "hashbrown 0.13.2", @@ -3565,9 +3660,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" dependencies = [ "value-bag", ] @@ -3607,9 +3702,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] name = "mime" @@ -3680,7 +3775,7 @@ dependencies = [ "data-encoding", "libp2p-identity", "multibase 0.9.1", - "multihash 0.19.0", + "multihash 0.19.1", "percent-encoding", "serde", "static_assertions", @@ -3710,13 +3805,40 @@ dependencies = [ "data-encoding-macro", ] +[[package]] +name = "multidid" +version = "0.1.0" +source = "git+https://github.com/spruceid/cacao-rs?branch=feat/cacao-v3#92661420efc40f9d2b1345e6366d848f238828bd" +dependencies = [ + "bech32 0.9.1", + "bs58 0.5.0", + "hex", + "iri-string", + "serde", + "sha3", + "thiserror", + "unsigned-varint", +] + [[package]] name = "multihash" version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c346cf9999c631f002d8f977c4eaeaa0e6386f16007202308d0b3757522c2cc" dependencies = [ - "blake2b_simd 1.0.1", + "blake3", + "core2", + "multihash-derive", + "unsigned-varint", +] + +[[package]] +name = "multihash" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfd8a792c1694c6da4f68db0a9d707c72bd260994da179e6030a5dcee00bb815" +dependencies = [ + "blake2b_simd 1.0.2", "blake2s_simd", "blake3", "core2", @@ -3731,9 +3853,9 @@ dependencies = [ [[package]] name = "multihash" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd59dcc2bbe70baabeac52cd22ae52c55eefe6c38ff11a9439f16a350a939f2" +checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" dependencies = [ "core2", "unsigned-varint", @@ -3807,9 +3929,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", @@ -3845,6 +3967,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "num-derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e6a0fd4f737c707bd9086cc16c925f294943eb62eb71499e9fd4cf71f8b9f4e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.37", +] + [[package]] name = "num-integer" version = "0.1.45" @@ -3868,9 +4001,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", "libm", @@ -3886,11 +4019,31 @@ dependencies = [ "libc", ] +[[package]] +name = "nutype" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "060a7fdadbae85c7063375e8fb9dd88c9ac336a22d1f0eb2fefd53dbf98edcb5" +dependencies = [ + "nutype_macros", +] + +[[package]] +name = "nutype_macros" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a0d2e869a6039d8b1d10f8a478f76538958808fbf95dae367875ee9635430b9" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "object" -version = "0.31.1" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -3915,11 +4068,11 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.55" +version = "0.10.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" +checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "cfg-if", "foreign-types", "libc", @@ -3936,7 +4089,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] @@ -3947,18 +4100,18 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "111.26.0+1.1.1u" +version = "300.1.5+3.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efc62c9f12b22b8f5208c23a7200a442b2e5999f8bdf80233852122b5a4f6f37" +checksum = "559068e4c12950d7dcaa1857a61725c0d38d4fc03ff8e070ab31a75d6e316491" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.90" +version = "0.9.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" +checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" dependencies = [ "cc", "libc", @@ -4038,27 +4191,37 @@ dependencies = [ "num-traits", ] +[[package]] +name = "ordered-float" +version = "3.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a54938017eacd63036332b4ae5c8a49fc8c0c1d6d629893057e4f13609edd06" +dependencies = [ + "num-traits", +] + [[package]] name = "ouroboros" -version = "0.15.6" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1358bd1558bd2a083fed428ffeda486fbfb323e698cdda7794259d592ca72db" +checksum = "e2ba07320d39dfea882faa70554b4bd342a5f273ed59ba7c1c6b4c840492c954" dependencies = [ "aliasable", "ouroboros_macro", + "static_assertions", ] [[package]] name = "ouroboros_macro" -version = "0.15.6" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f7d21ccd03305a674437ee1248f3ab5d4b1db095cf1caf49f1713ddf61956b7" +checksum = "ec4c6225c69b4ca778c0aea097321a64c421cf4577b331c61b229267edabb6f8" dependencies = [ - "Inflector", + "heck", "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.37", ] [[package]] @@ -4084,7 +4247,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ - "ecdsa 0.16.7", + "ecdsa 0.16.8", "elliptic-curve 0.13.5", "primeorder", "sha2 0.10.7", @@ -4096,7 +4259,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70786f51bcc69f6a4c0360e063a4cac5419ef7c5cd5b3c99ad70f3be5ba79209" dependencies = [ - "ecdsa 0.16.7", + "ecdsa 0.16.8", "elliptic-curve 0.13.5", "primeorder", "sha2 0.10.7", @@ -4108,17 +4271,6 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", -] - [[package]] name = "parking_lot" version = "0.12.1" @@ -4126,21 +4278,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.8", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "winapi", + "parking_lot_core", ] [[package]] @@ -4151,9 +4289,9 @@ checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", + "redox_syscall", "smallvec", - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -4179,7 +4317,7 @@ checksum = "61a386cd715229d399604b50d1361683fe687066f42d56f54be995bc6868f71c" dependencies = [ "inlinable_string", "pear_codegen", - "yansi 1.0.0-rc", + "yansi 1.0.0-rc.1", ] [[package]] @@ -4191,7 +4329,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] @@ -4226,12 +4364,12 @@ checksum = "b687ff7b5da449d39e418ad391e5e08da53ec334903ddbb921db208908fc372c" [[package]] name = "pgp" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37a79d6411154d1a9908e7a2c4bac60a5742f6125823c2c30780c7039aef02f0" +checksum = "27e1f8e085bfa9b85763fe3ddaacbe90a09cd847b3833129153a6cb063bbe132" dependencies = [ "aes", - "base64 0.21.2", + "base64 0.21.4", "bitfield", "block-padding 0.3.3", "blowfish", @@ -4244,10 +4382,11 @@ dependencies = [ "chrono", "cipher", "crc24", + "curve25519-dalek 4.1.1", "derive_builder 0.12.0", "des", "digest 0.10.7", - "ed25519-dalek 2.0.0-rc.3", + "ed25519-dalek 2.0.0", "elliptic-curve 0.13.5", "flate2", "generic-array 0.14.7", @@ -4257,13 +4396,13 @@ dependencies = [ "md-5", "nom", "num-bigint-dig", - "num-derive", + "num-derive 0.4.0", "num-traits", "p256 0.13.2", "p384", "rand 0.8.5", "ripemd", - "rsa 0.9.0-pre.2", + "rsa 0.9.2", "sha1", "sha2 0.10.7", "sha3", @@ -4277,29 +4416,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] name = "pin-project-lite" -version = "0.2.10" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -4324,7 +4463,7 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" dependencies = [ - "der 0.7.7", + "der 0.7.8", "pkcs8 0.10.2", "spki 0.7.2", ] @@ -4356,7 +4495,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der 0.7.7", + "der 0.7.8", "spki 0.7.2", ] @@ -4368,9 +4507,9 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "platforms" -version = "3.0.2" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" +checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" [[package]] name = "polling" @@ -4467,9 +4606,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -4482,9 +4621,9 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", "version_check", - "yansi 1.0.0-rc", + "yansi 1.0.0-rc.1", ] [[package]] @@ -4511,7 +4650,7 @@ dependencies = [ "lazy_static", "libc", "memchr", - "parking_lot 0.12.1", + "parking_lot", "procfs", "protobuf", "thiserror", @@ -4554,9 +4693,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.31" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -4657,15 +4796,6 @@ dependencies = [ "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", -] - [[package]] name = "redox_syscall" version = "0.3.5" @@ -4675,47 +4805,36 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "redox_users" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" -dependencies = [ - "getrandom 0.2.10", - "redox_syscall 0.2.16", - "thiserror", -] - [[package]] name = "ref-cast" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1641819477c319ef452a075ac34a4be92eb9ba09f6841f62d594d50fdcf0bf6b" +checksum = "acde58d073e9c79da00f2b5b84eed919c8326832648a5b109b3fce1bb1175280" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68bf53dad9b6086826722cdc99140793afd9f62faa14a1ad07eb4f955e7a7216" +checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] name = "regex" -version = "1.9.1" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.3", - "regex-syntax 0.7.4", + "regex-automata 0.3.8", + "regex-syntax 0.7.5", ] [[package]] @@ -4729,13 +4848,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.3" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" +checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.4", + "regex-syntax 0.7.5", ] [[package]] @@ -4746,9 +4865,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "rend" @@ -4761,11 +4880,11 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.18" +version = "0.11.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", "bytes", "encoding_rs", "futures-core", @@ -4784,7 +4903,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.5", + "rustls 0.21.7", "rustls-pemfile", "serde", "serde_json", @@ -4798,7 +4917,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots", + "webpki-roots 0.25.2", "winreg", ] @@ -4906,7 +5025,7 @@ dependencies = [ "memchr", "multer", "num_cpus", - "parking_lot 0.12.1", + "parking_lot", "pin-project-lite", "rand 0.8.5", "ref-cast", @@ -4916,7 +5035,7 @@ dependencies = [ "serde_json", "state", "tempfile", - "time 0.3.23", + "time", "tokio", "tokio-stream", "tokio-util", @@ -4937,7 +5056,7 @@ dependencies = [ "proc-macro2", "quote", "rocket_http", - "syn 2.0.26", + "syn 2.0.37", "unicode-xid", ] @@ -4963,7 +5082,7 @@ dependencies = [ "smallvec", "stable-pattern", "state", - "time 0.3.23", + "time", "tokio", "uncased", ] @@ -4990,12 +5109,12 @@ dependencies = [ [[package]] name = "rsa" -version = "0.9.0-pre.2" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65db0998ad35adcaca498b7358992e088ee16cc783fe6fb899da203e113a63e5" +checksum = "6ab43bb47d23c1a631b4b680199a45255dce26fa9ab2fa902581f624ff13e6a8" dependencies = [ "byteorder", - "const-oid 0.9.4", + "const-oid 0.9.5", "digest 0.10.7", "num-bigint-dig", "num-integer", @@ -5005,20 +5124,19 @@ dependencies = [ "pkcs8 0.10.2", "rand_core 0.6.4", "signature 2.1.0", + "spki 0.7.2", "subtle", "zeroize", ] [[package]] name = "rust_decimal" -version = "1.30.0" +version = "1.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0446843641c69436765a35a5a77088e28c2e6a12da93e84aa3ab1cd4aa5a042" +checksum = "a4c4216490d5a413bc6d10fa4742bd7d4955941d062c0ef873141d6b0e7b30fd" dependencies = [ "arrayvec 0.7.4", "borsh", - "bytecheck", - "byteorder", "bytes", "num-traits", "rand 0.8.5", @@ -5072,14 +5190,14 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.4" +version = "0.38.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" +checksum = "747c788e9ce8e92b12cd485c49ddf90723550b654b32508f979b71a7b1ecda4f" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.0", "errno", "libc", - "linux-raw-sys 0.4.3", + "linux-raw-sys 0.4.7", "windows-sys 0.48.0", ] @@ -5093,26 +5211,14 @@ dependencies = [ "log", "ring", "sct 0.6.1", - "webpki 0.21.4", -] - -[[package]] -name = "rustls" -version = "0.20.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" -dependencies = [ - "log", - "ring", - "sct 0.7.0", - "webpki 0.22.0", + "webpki", ] [[package]] name = "rustls" -version = "0.21.5" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79ea77c539259495ce8ca47f53e66ae0330a8819f67e23ac96ca02f50e7b7d36" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ "log", "ring", @@ -5138,14 +5244,14 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", ] [[package]] name = "rustls-webpki" -version = "0.101.1" +version = "0.101.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f36a6828982f422756984e47912a7a51dcbc2a197aa791158f8ca61cd8204e" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" dependencies = [ "ring", "untrusted", @@ -5233,11 +5339,24 @@ dependencies = [ "untrusted", ] +[[package]] +name = "sea-bae" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bd3534a9978d0aa7edd2808dc1f8f31c4d0ecd31ddf71d997b3c98e9f3c9114" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.37", +] + [[package]] name = "sea-orm" -version = "0.11.3" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fade86e8d41fd1a4721f84cb834f4ca2783f973cc30e6212b7fafc134f169214" +checksum = "61f6c7daef05dde3476d97001e11fca7a52b655aa3bf4fd610ab2da1176a2ed5" dependencies = [ "async-stream", "async-trait", @@ -5250,12 +5369,12 @@ dependencies = [ "sea-orm-macros", "sea-query", "sea-query-binder", - "sea-strum", "serde", "serde_json", "sqlx", + "strum", "thiserror", - "time 0.3.23", + "time", "tracing", "url", "uuid", @@ -5263,22 +5382,23 @@ dependencies = [ [[package]] name = "sea-orm-macros" -version = "0.11.3" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28936f26d62234ff0be16f80115dbdeb3237fe9c25cf18fbcd1e3b3592360f20" +checksum = "cd90e73d5f5b184bad525767da29fbfec132b4e62ebd6f60d2f2737ec6468f62" dependencies = [ - "bae", - "heck 0.3.3", + "heck", "proc-macro2", "quote", - "syn 1.0.109", + "sea-bae", + "syn 2.0.37", + "unicode-ident", ] [[package]] name = "sea-orm-migration" -version = "0.11.3" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "278d3adfd0832b6ffc17d3cfbc574d3695a5c1b38814e0bc8ac238d33f3d87cf" +checksum = "21f673fcefb3a7e7b89a12b6c0e854ec0be14367635ac3435369c8ad7f11e09e" dependencies = [ "async-trait", "futures", @@ -5290,24 +5410,27 @@ dependencies = [ [[package]] name = "sea-query" -version = "0.28.5" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbab99b8cd878ab7786157b7eb8df96333a6807cc6e45e8888c85b51534b401a" +checksum = "28c05a5bf6403834be253489bbe95fa9b1e5486bc843b61f60d26b5c9c1e244b" dependencies = [ "bigdecimal", "chrono", + "derivative", + "inherent", + "ordered-float 3.9.1", "rust_decimal", "sea-query-derive", "serde_json", - "time 0.3.23", + "time", "uuid", ] [[package]] name = "sea-query-binder" -version = "0.3.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cea85029985b40dfbf18318d85fe985c04db7c1b4e5e8e0a0a0cdff5f1e30f9" +checksum = "36bbb68df92e820e4d5aeb17b4acd5cc8b5d18b2c36a4dd6f4626aabfa7ab1b9" dependencies = [ "bigdecimal", "chrono", @@ -5315,17 +5438,17 @@ dependencies = [ "sea-query", "serde_json", "sqlx", - "time 0.3.23", + "time", "uuid", ] [[package]] name = "sea-query-derive" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63f62030c60f3a691f5fe251713b4e220b306e50a71e1d6f9cce1f24bb781978" +checksum = "bd78f2e0ee8e537e9195d1049b752e0433e2cac125426bccb7b5c3e508096117" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", "syn 1.0.109", @@ -5334,9 +5457,9 @@ dependencies = [ [[package]] name = "sea-schema" -version = "0.11.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeb2940bb5a10bc6cd05b450ce6cd3993e27fddd7eface2becb97fc5af3a040e" +checksum = "0cd9561232bd1b82ea748b581f15909d11de0db6563ddcf28c5d908aee8282f1" dependencies = [ "futures", "sea-query", @@ -5345,35 +5468,13 @@ dependencies = [ [[package]] name = "sea-schema-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56821b7076f5096b8f726e2791ad255a99c82498e08ec477a65a96c461ff1927" -dependencies = [ - "heck 0.3.3", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "sea-strum" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391d06a6007842cfe79ac6f7f53911b76dfd69fc9a6769f1cf6569d12ce20e1b" -dependencies = [ - "sea-strum_macros", -] - -[[package]] -name = "sea-strum_macros" -version = "0.23.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69b4397b825df6ccf1e98bcdabef3bbcfc47ff5853983467850eeab878384f21" +checksum = "c6f686050f76bffc4f635cda8aea6df5548666b830b52387e8bc7de11056d11e" dependencies = [ - "heck 0.3.3", + "heck", "proc-macro2", "quote", - "rustversion", "syn 1.0.109", ] @@ -5404,7 +5505,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct 0.2.0", - "der 0.7.7", + "der 0.7.8", "generic-array 0.14.7", "pkcs8 0.10.2", "subtle", @@ -5413,9 +5514,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.1" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -5426,9 +5527,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -5442,9 +5543,9 @@ checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" [[package]] name = "serde" -version = "1.0.173" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91f70896d6720bc714a4a57d22fc91f1db634680e65c8efe13323f1fa38d53f" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] @@ -5469,23 +5570,23 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.173" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6250dde8342e0232232be9ca3db7aa40aceb5a3e5dd9bddbc00d99a007cde49" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] name = "serde_ipld_dagcbor" -version = "0.3.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2433e94ffb5977e67afbd75733abd6ada1c4f497125894a8c89b3fdc5fd6a058" +checksum = "8e880e0b1f9c7a8db874642c1217f7e19b29e325f24ab9f0fcb11818adec7f01" dependencies = [ "cbor4ii", - "cid", + "cid 0.10.1", "scopeguard", "serde", ] @@ -5503,9 +5604,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.103" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", @@ -5558,7 +5659,7 @@ dependencies = [ "serde", "serde_json", "serde_with_macros 2.3.3", - "time 0.3.23", + "time", ] [[package]] @@ -5582,14 +5683,14 @@ dependencies = [ "darling 0.20.3", "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -5651,16 +5752,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "signal-hook" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" -dependencies = [ - "libc", - "signal-hook-registry", -] - [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -5721,7 +5812,7 @@ dependencies = [ "rand 0.8.5", "sha3", "thiserror", - "time 0.3.23", + "time", ] [[package]] @@ -5738,11 +5829,29 @@ dependencies = [ "thiserror", ] +[[package]] +name = "siwe-recap" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054c5aea5227ca44212d3029576602ebefce5179d584bdfcc842997c73cc40d9" +dependencies = [ + "base64 0.12.3", + "cid 0.10.1", + "iri-string", + "serde", + "serde_jcs", + "serde_json", + "serde_with 2.3.3", + "siwe", + "thiserror", + "ucan-capabilities-object", +] + [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] @@ -5758,9 +5867,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "socket2" @@ -5772,6 +5881,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "spin" version = "0.5.2" @@ -5814,14 +5933,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" dependencies = [ "base64ct", - "der 0.7.7", + "der 0.7.8", ] [[package]] name = "sqlformat" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c12bc9199d1db8234678b7051747c07f517cdcf019262d1847b94ec8b1aee3e" +checksum = "6b7b278788e7be4d0d29c0f39497a0eef3fba6bbc8e70d8bf7fde46edeaa9e85" dependencies = [ "itertools", "nom", @@ -5830,108 +5949,222 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.6.3" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8de3b03a925878ed54a954f621e64bf55a3c1bd29652d0d1a17830405350188" +checksum = "8e58421b6bc416714d5115a2ca953718f6c621a51b68e4f4922aea5a4391a721" dependencies = [ "sqlx-core", "sqlx-macros", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", ] [[package]] name = "sqlx-core" -version = "0.6.3" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa8241483a83a3f33aa5fff7e7d9def398ff9990b2752b6c6112b83c6d246029" +checksum = "dd4cef4251aabbae751a3710927945901ee1d97ee96d757f6880ebb9a79bfd53" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.3", + "async-io", + "async-std", "atoi", - "base64 0.13.1", "bigdecimal", - "bitflags 1.3.2", "byteorder", "bytes", "chrono", + "crc", "crossbeam-queue", - "digest 0.10.7", - "dirs", "dotenvy", "either", "event-listener", - "flume", "futures-channel", "futures-core", - "futures-executor", "futures-intrusive", + "futures-io", "futures-util", - "generic-array 0.14.7", "hashlink", "hex", - "hkdf", - "hmac", - "indexmap 1.9.3", - "itoa", - "libc", - "libsqlite3-sys", + "indexmap 2.0.0", "log", - "md-5", "memchr", - "num-bigint", "once_cell", "paste", "percent-encoding", - "rand 0.8.5", - "rsa 0.6.1", "rust_decimal", - "rustls 0.20.8", + "rustls 0.21.7", "rustls-pemfile", "serde", "serde_json", - "sha1", "sha2 0.10.7", "smallvec", "sqlformat", - "sqlx-rt", - "stringprep", "thiserror", - "time 0.3.23", + "time", + "tokio", "tokio-stream", + "tracing", "url", "uuid", - "webpki-roots", - "whoami", + "webpki-roots 0.24.0", ] [[package]] name = "sqlx-macros" -version = "0.6.3" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9966e64ae989e7e575b19d7265cb79d7fc3cbbdf179835cb0d716f294c2049c9" +checksum = "208e3165167afd7f3881b16c1ef3f2af69fa75980897aac8874a0696516d12c2" dependencies = [ + "proc-macro2", + "quote", + "sqlx-core", + "sqlx-macros-core", + "syn 1.0.109", +] + +[[package]] +name = "sqlx-macros-core" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a4a8336d278c62231d87f24e8a7a74898156e34c1c18942857be2acb29c7dfc" +dependencies = [ + "async-std", "dotenvy", "either", - "heck 0.4.1", + "heck", + "hex", "once_cell", "proc-macro2", "quote", + "serde", "serde_json", + "sha2 0.10.7", "sqlx-core", - "sqlx-rt", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", "syn 1.0.109", + "tempfile", + "tokio", "url", ] [[package]] -name = "sqlx-rt" -version = "0.6.3" +name = "sqlx-mysql" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804d3f245f894e61b1e6263c84b23ca675d96753b5abfd5cc8597d86806e8024" +checksum = "8ca69bf415b93b60b80dc8fda3cb4ef52b2336614d8da2de5456cc942a110482" dependencies = [ - "async-std", - "futures-rustls", + "atoi", + "base64 0.21.4", + "bigdecimal", + "bitflags 2.4.0", + "byteorder", + "bytes", + "chrono", + "crc", + "digest 0.10.7", + "dotenvy", + "either", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "generic-array 0.14.7", + "hex", + "hkdf", + "hmac", + "itoa", + "log", + "md-5", + "memchr", "once_cell", - "tokio", - "tokio-rustls 0.23.4", + "percent-encoding", + "rand 0.8.5", + "rsa 0.9.2", + "rust_decimal", + "serde", + "sha1", + "sha2 0.10.7", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "time", + "tracing", + "uuid", + "whoami", +] + +[[package]] +name = "sqlx-postgres" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0db2df1b8731c3651e204629dd55e52adbae0462fa1bdcbed56a2302c18181e" +dependencies = [ + "atoi", + "base64 0.21.4", + "bigdecimal", + "bitflags 2.4.0", + "byteorder", + "chrono", + "crc", + "dotenvy", + "etcetera", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "hex", + "hkdf", + "hmac", + "home", + "itoa", + "log", + "md-5", + "memchr", + "num-bigint", + "once_cell", + "rand 0.8.5", + "rust_decimal", + "serde", + "serde_json", + "sha1", + "sha2 0.10.7", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "time", + "tracing", + "uuid", + "whoami", +] + +[[package]] +name = "sqlx-sqlite" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4c21bf34c7cae5b283efb3ac1bcc7670df7561124dc2f8bdc0b59be40f79a2" +dependencies = [ + "atoi", + "chrono", + "flume", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "libsqlite3-sys", + "log", + "percent-encoding", + "serde", + "sqlx-core", + "time", + "tracing", + "url", + "uuid", ] [[package]] @@ -5947,9 +6180,8 @@ dependencies = [ [[package]] name = "ssi" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a74add6dcfc3599495a73e953a7126ea19e9a0fc81860f5d593cabf1322cdf9" +version = "0.7.0" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "ssi-caips", "ssi-core", @@ -5959,7 +6191,7 @@ dependencies = [ "ssi-jwk", "ssi-jws", "ssi-jwt", - "ssi-ldp 0.2.1", + "ssi-ldp", "ssi-ssh", "ssi-tzkey", "ssi-ucan", @@ -5970,8 +6202,7 @@ dependencies = [ [[package]] name = "ssi-caips" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2c479690955bebece0279a5b1ab9d7d584402caed9f56ecec346d0bc63661f" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "bs58 0.4.0", "ssi-jwk", @@ -5981,14 +6212,12 @@ dependencies = [ [[package]] name = "ssi-contexts" version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3009b82cbae3d88a76f15460fb5fb3f30a1673eb0359ac6917ffaa3c57f7164" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" [[package]] name = "ssi-core" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e43f42016b80dc3e5eae8f7d2b22db3debbfe97b38e4fa449433497b3513048" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "async-trait", "serde", @@ -5998,8 +6227,7 @@ dependencies = [ [[package]] name = "ssi-crypto" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f41a12b15af9dce950a24a3295a2540be3b8500467621e31a97ddbe7618a5c8" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "bs58 0.4.0", "digest 0.9.0", @@ -6014,8 +6242,7 @@ dependencies = [ [[package]] name = "ssi-dids" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62e3c375b0fb2129c691e65e776c9105290ade34b56f39755f4f9c40ba98e41c" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "anyhow", "async-trait", @@ -6041,8 +6268,7 @@ dependencies = [ [[package]] name = "ssi-json-ld" version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50912984a4f415dd419853d461938b2daaa428dcafb8a5dfcde8dc07371371da" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "async-std", "combination", @@ -6063,8 +6289,7 @@ dependencies = [ [[package]] name = "ssi-jwk" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3c376df0c00621f6d8de45249e901cf2b3868bef84cf785fbcbce62842d815" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "base64 0.12.3", "blake2b_simd 0.5.11", @@ -6075,7 +6300,7 @@ dependencies = [ "lazy_static", "multibase 0.9.1", "num-bigint", - "num-derive", + "num-derive 0.3.3", "num-traits", "p256 0.11.1", "rand 0.7.3", @@ -6092,8 +6317,7 @@ dependencies = [ [[package]] name = "ssi-jws" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df9e36ec8624a4f81f21b0e407f1c2209c2cd89c0ff3c27b928999682b2e8912" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "base64 0.12.3", "blake2", @@ -6114,8 +6338,7 @@ dependencies = [ [[package]] name = "ssi-jwt" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46522391b37f4b749911bb29b3960a7e2e0b9936c7debf52035f431480b40123" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "chrono", "serde", @@ -6128,9 +6351,8 @@ dependencies = [ [[package]] name = "ssi-ldp" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de930bb18e3ed3c1f7b0a2b2b4fdba2887dffff34bb5f44b9967a983fea2d60c" +version = "0.3.0" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "async-trait", "bs58 0.4.0", @@ -6149,39 +6371,6 @@ dependencies = [ "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 = "ssi-ldp" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bb057ad335a08d78deca3a7cf8f8393087ca99d64c038e97ff844ea66fbd475" -dependencies = [ - "async-trait", - "bs58 0.4.0", - "chrono", - "grdf", - "hex", - "iref", - "json-syntax", - "lazy_static", - "locspan", - "multibase 0.8.0", - "rdf-types", - "serde", - "serde_jcs", - "serde_json", "sha2 0.10.7", "ssi-caips", "ssi-contexts", @@ -6191,6 +6380,7 @@ dependencies = [ "ssi-json-ld", "ssi-jwk", "ssi-jws", + "ssi-tzkey", "static-iref", "thiserror", ] @@ -6198,8 +6388,7 @@ dependencies = [ [[package]] name = "ssi-ssh" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22967c7882e2457a2813badebf613a1b6ea3240f77ccac5c7c03858806d56618" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "sshkeys", "ssi-jwk", @@ -6209,8 +6398,7 @@ dependencies = [ [[package]] name = "ssi-tzkey" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b57d919e20d214253a9a8dbc5f3b08ff555364934d99a09c828becab27a823" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "bs58 0.4.0", "ed25519-dalek 1.0.1", @@ -6221,14 +6409,14 @@ dependencies = [ [[package]] name = "ssi-ucan" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0982f62c7860922026a9d9edc6c604de79693ee4c5c6bd65be11e2ff66b1df09" +version = "0.2.0" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "base64 0.12.3", "chrono", - "libipld", + "libipld 0.16.0", "serde", + "serde_jcs", "serde_json", "serde_with 1.14.0", "ssi-caips", @@ -6238,42 +6426,41 @@ dependencies = [ "ssi-jws", "ssi-jwt", "thiserror", + "ucan-capabilities-object", ] [[package]] name = "ssi-vc" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd7a9a9dc254d976962fea4501ed40097b8a7c23c15f076a7f46fa97ed886bc7" +version = "0.2.0" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "async-trait", "base64 0.12.3", "bitvec 0.20.4", - "cacaos", + "cacaos 0.5.1", "chrono", "flate2", "iref", - "libipld", + "libipld 0.14.0", "multihash 0.16.3", "reqwest", "serde", "serde_json", - "siwe-recap", + "siwe-recap 0.1.0", "ssi-core", "ssi-dids", "ssi-json-ld", "ssi-jwk", "ssi-jws", "ssi-jwt", - "ssi-ldp 0.2.1", + "ssi-ldp", "thiserror", ] [[package]] name = "ssi-zcap-ld" version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8380152589e8876e91bb765ce1b363909bc071788c1550bfdb730152c5b7afe" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "async-trait", "iref", @@ -6283,7 +6470,7 @@ dependencies = [ "ssi-dids", "ssi-json-ld", "ssi-jwk", - "ssi-ldp 0.3.0", + "ssi-ldp", "thiserror", ] @@ -6322,10 +6509,11 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stringprep" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3737bde7edce97102e0e2b15365bf7a20bfdb5f60f4f9e8d7004258a51a8da" +checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" dependencies = [ + "finl_unicode", "unicode-bidi", "unicode-normalization", ] @@ -6342,6 +6530,12 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strum" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" + [[package]] name = "subtle" version = "2.5.0" @@ -6361,9 +6555,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.26" +version = "2.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c3457aacde3c65315de5031ec191ce46604304d2446e803d71ade03308d970" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ "proc-macro2", "quote", @@ -6390,36 +6584,35 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.6.0" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ - "autocfg", "cfg-if", - "fastrand", - "redox_syscall 0.3.5", - "rustix 0.37.23", + "fastrand 2.0.0", + "redox_syscall", + "rustix 0.38.14", "windows-sys 0.48.0", ] [[package]] name = "thiserror" -version = "1.0.43" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.43" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] @@ -6450,27 +6643,17 @@ dependencies = [ "byteorder", "integer-encoding", "log", - "ordered-float", + "ordered-float 1.1.1", "threadpool", ] [[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.23" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" +checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" dependencies = [ + "deranged", "itoa", "js-sys", "serde", @@ -6486,9 +6669,9 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.10" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ba15a897f3c86766b757e5ac7221554c6750054d74d5b28844fce5fb36a6c4" +checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" dependencies = [ "time-core", ] @@ -6519,11 +6702,10 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.29.1" +version = "1.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" dependencies = [ - "autocfg", "backtrace", "bytes", "libc", @@ -6531,7 +6713,7 @@ dependencies = [ "num_cpus", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.4", "tokio-macros", "windows-sys 0.48.0", ] @@ -6544,7 +6726,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] @@ -6565,18 +6747,7 @@ checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" dependencies = [ "rustls 0.19.1", "tokio", - "webpki 0.21.4", -] - -[[package]] -name = "tokio-rustls" -version = "0.23.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" -dependencies = [ - "rustls 0.20.8", - "tokio", - "webpki 0.22.0", + "webpki", ] [[package]] @@ -6585,7 +6756,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.5", + "rustls 0.21.7", "tokio", ] @@ -6614,9 +6785,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" dependencies = [ "bytes", "futures-core", @@ -6638,9 +6809,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" dependencies = [ "serde", "serde_spanned", @@ -6659,9 +6830,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.14" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap 2.0.0", "serde", @@ -6719,7 +6890,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] @@ -6814,9 +6985,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ubyte" @@ -6827,6 +6998,18 @@ dependencies = [ "serde", ] +[[package]] +name = "ucan-capabilities-object" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f39597d86523b7f8028e7c05989fc64c1868f381e68ffc9c4b8540e5a891382" +dependencies = [ + "iri-string", + "nutype", + "serde", + "thiserror", +] + [[package]] name = "uint" version = "0.9.5" @@ -6857,9 +7040,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -6890,9 +7073,9 @@ checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" [[package]] name = "unsigned-varint" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" +checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" [[package]] name = "untrusted" @@ -6902,9 +7085,9 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -6913,9 +7096,9 @@ dependencies = [ [[package]] name = "urlencoding" -version = "2.1.2" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8db7427f936968176eaa7cdf81b7f98b980b18495ec28f1b5791ac3bfe3eea9" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] name = "utf8-decode" @@ -6946,6 +7129,16 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d92ccd67fb88503048c01b59152a04effd0782d035a83a6d256ce6085f08f4a3" +[[package]] +name = "varsig" +version = "0.1.0" +source = "git+https://github.com/spruceid/cacao-rs?branch=feat/cacao-v3#92661420efc40f9d2b1345e6366d848f238828bd" +dependencies = [ + "serde", + "thiserror", + "unsigned-varint", +] + [[package]] name = "vcpkg" version = "0.2.15" @@ -6985,12 +7178,6 @@ 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" @@ -7018,7 +7205,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", "wasm-bindgen-shared", ] @@ -7052,7 +7239,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -7084,33 +7271,25 @@ dependencies = [ ] [[package]] -name = "webpki" -version = "0.22.0" +name = "webpki-roots" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +checksum = "b291546d5d9d1eab74f069c77749f2cb8504a12caa20f0f2de93ddbf6f411888" dependencies = [ - "ring", - "untrusted", + "rustls-webpki", ] [[package]] name = "webpki-roots" -version = "0.22.6" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" -dependencies = [ - "webpki 0.22.0", -] +checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" [[package]] name = "whoami" version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" -dependencies = [ - "wasm-bindgen", - "web-sys", -] [[package]] name = "winapi" @@ -7140,7 +7319,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -7158,7 +7337,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -7178,17 +7357,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -7199,9 +7378,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -7211,9 +7390,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -7223,9 +7402,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -7235,9 +7414,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -7247,9 +7426,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" @@ -7259,9 +7438,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -7271,26 +7450,27 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.0" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fac9742fd1ad1bd9643b991319f72dd031016d44b77039a26977eb667141e7" +checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" dependencies = [ "memchr", ] [[package]] name = "winreg" -version = "0.10.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "winapi", + "cfg-if", + "windows-sys 0.48.0", ] [[package]] @@ -7310,12 +7490,13 @@ dependencies = [ [[package]] name = "x25519-dalek" -version = "2.0.0-pre.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5da623d8af10a62342bcbbb230e33e58a63255a58012f8653c578e54bab48df" +checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" dependencies = [ - "curve25519-dalek 3.2.0", + "curve25519-dalek 4.1.1", "rand_core 0.6.4", + "serde", "zeroize", ] @@ -7333,9 +7514,9 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "yansi" -version = "1.0.0-rc" +version = "1.0.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ee746ad3851dd3bc40e4a028ab3b00b99278d929e48957bcb2d111874a7e43e" +checksum = "1367295b8f788d371ce2dbc842c7b709c73ee1364d30351dd300ec2203b12377" [[package]] name = "zeroize" @@ -7354,5 +7535,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", ] diff --git a/kepler-core/Cargo.toml b/kepler-core/Cargo.toml index 315f3173..e563cf55 100644 --- a/kepler-core/Cargo.toml +++ b/kepler-core/Cargo.toml @@ -15,19 +15,19 @@ tokio = ["sea-orm/runtime-tokio-rustls"] async-std = ["sea-orm/runtime-async-std-rustls"] [dependencies] -sea-orm = { version = "0.11", default-features = false, features = ["macros", "with-time", "with-json", "sqlx", "sea-orm-internal", "sqlx-dep"] } -sea-orm-migration = { version = "0.11", default-features = false } +sea-orm = { version = "0.12", default-features = false, features = ["macros", "with-time", "with-json", "sqlx", "sea-orm-internal", "sqlx-dep"] } +sea-orm-migration = { version = "0.12", default-features = false } futures = { default-features = false, version = "0.3", features = ["alloc", "std"] } pin-project = "1" time = "0.3" kepler-lib = { version = "0.2", path = "../lib" } libp2p = { version = "0.52.1", default-features = false, features = ["ed25519"] } thiserror = "1" -ssi = "0.6" +ssi = { version = "0.7", git = "https://github.com/spruceid/ssi", branch = "feat/ucan-0.10" } serde = { version = "1", features = ["derive"] } serde_json = "1" -serde_ipld_dagcbor = "0.3" +serde_ipld_dagcbor = "0.4" [dev-dependencies] -sea-orm = { version = "0.11", features = ["runtime-async-std-rustls", "sqlx-sqlite"] } +sea-orm = { version = "0.12", features = ["runtime-async-std-rustls", "sqlx-sqlite"] } async-std = { version = "1", features = ["attributes"] } diff --git a/kepler-core/src/db.rs b/kepler-core/src/db.rs index 5faa414c..5c7cfed8 100644 --- a/kepler-core/src/db.rs +++ b/kepler-core/src/db.rs @@ -1,4 +1,6 @@ -use crate::events::{epoch_hash, Delegation, Event, HashError, Invocation, Operation, Revocation}; +use crate::events::{ + epoch_hash, Event, HashError, Operation, SDelegation, SInvocation, SRevocation, +}; use crate::hash::Hash; use crate::keys::{get_did_key, Secrets}; use crate::migrations::Migrator; @@ -8,11 +10,11 @@ use crate::storage::{ either::EitherError, Content, HashBuffer, ImmutableDeleteStore, ImmutableReadStore, ImmutableStaging, ImmutableWriteStore, StorageSetup, StoreSize, }; -use crate::types::{Metadata, OrbitIdWrap, Resource}; -use crate::util::{Capability, DelegationInfo}; +use crate::types::{Metadata, OrbitIdWrap}; use kepler_lib::{ - authorization::{EncodingError, KeplerDelegation}, - resource::OrbitId, + authorization::{Delegation, EncodingError, Resources}, + resource::{OrbitId, ResourceId}, + ssi::ucan::capabilities::Ability, }; use sea_orm::{ entity::prelude::*, @@ -45,13 +47,13 @@ pub enum TxError { #[error("database error: {0}")] Db(#[from] DbErr), #[error(transparent)] - Ucan(#[from] ssi::ucan::Error), + Ucan(#[from] ssi::ucan::jose::VerificationError), #[error(transparent)] - Cacao(#[from] kepler_lib::cacaos::siwe_cacao::VerificationError), + Cacao(#[from] kepler_lib::cacaos::common::Error), #[error(transparent)] - InvalidDelegation(#[from] delegation::DelegationError), + InvalidDelegation(ValidationError), #[error(transparent)] - InvalidInvocation(#[from] invocation::InvocationError), + InvalidInvocation(ValidationError), #[error(transparent)] InvalidRevocation(#[from] revocation::RevocationError), #[error("Epoch Hashing Err: {0}")] @@ -64,6 +66,10 @@ pub enum TxError { Secrets(K::Error), #[error("Orbit not found")] OrbitNotFound, + #[error(transparent)] + Serde(#[from] serde_json::Error), + #[error("Missing event for service: {0} {1} {2:?}")] + MissingServiceEvent(ResourceId, String, Option<(i64, Hash, i64)>), } #[non_exhaustive] @@ -179,7 +185,7 @@ where pub async fn delegate( &self, - delegation: Delegation, + delegation: SDelegation, ) -> Result, TxError> { self.transact(vec![Event::Delegation(Box::new(delegation))]) .await @@ -187,7 +193,7 @@ where pub async fn revoke( &self, - revocation: Revocation, + revocation: SRevocation, ) -> Result, TxError> { self.transact(vec![Event::Revocation(Box::new(revocation))]) .await @@ -195,7 +201,7 @@ where pub async fn invoke( &self, - invocation: Invocation, + invocation: SInvocation, mut inputs: InvocationInputs, ) -> Result< ( @@ -212,40 +218,46 @@ where let mut stages = HashMap::new(); let mut ops = Vec::new(); // for each capability being invoked - for cap in invocation.0.capabilities.iter() { - match cap - .resource - .kepler_resource() - .and_then(|r| Some((r.service()?, cap.action.as_str(), r.orbit(), r.path()?))) - { - // stage inputs for content writes - Some(("kv", "put", orbit, path)) => { - let (metadata, mut stage) = inputs - .remove(&(orbit.clone(), path.to_string())) - .ok_or(TxStoreError::MissingInput)?; - - let value = stage.hash(); - - let norm_path = normalize_path(path); - - stages.insert((orbit.clone(), norm_path.to_string()), stage); - // add write for tx - ops.push(Operation::KvWrite { - orbit: orbit.clone(), - key: norm_path.to_string(), - metadata, - value, - }); - } - // add delete for tx - Some(("kv", "del", orbit, path)) => { - ops.push(Operation::KvDelete { - orbit: orbit.clone(), - key: normalize_path(path).to_string(), - version: None, - }); + let activity: HashMap<_, _> = Resources::<'_, ResourceId>::grants(&invocation.0) + .map(|(r, a)| (r, a.clone())) + .collect(); + for (resource, actions) in activity.iter() { + for action in actions.keys() { + match ( + action.namespace().as_ref(), + action.name().as_ref(), + resource.service(), + resource.path(), + ) { + // stage inputs for content writes + ("kv", "put", Some("kv"), Some(path)) => { + let (metadata, mut stage) = inputs + .remove(&(resource.orbit().clone(), path.to_string())) + .ok_or(TxStoreError::MissingInput)?; + + let value = stage.hash(); + + let norm_path = normalize_path(path); + + stages.insert((resource.orbit().clone(), norm_path.to_string()), stage); + // add write for tx + ops.push(Operation::KvWrite { + orbit: resource.orbit().clone(), + key: norm_path.to_string(), + metadata, + value, + }); + } + // add delete for tx + ("kv", "del", Some("kv"), Some(path)) => { + ops.push(Operation::KvDelete { + orbit: resource.orbit().clone(), + key: normalize_path(path).to_string(), + version: None, + }); + } + _ => {} } - _ => {} } } @@ -253,7 +265,6 @@ where .conn .begin_with_config(Some(sea_orm::IsolationLevel::ReadUncommitted), None) .await?; - let caps = invocation.0.capabilities.clone(); // verify and commit invocation and kv operations let commit = transact( &tx, @@ -265,50 +276,58 @@ where let mut results = Vec::new(); // perform and record side effects - for cap in caps { - match ( - cap.resource - .kepler_resource() - .and_then(|r| Some((r.orbit(), r.service()?, normalize_path(r.path()?)))), - cap.action.as_str(), - ) { - (Some((orbit, "kv", path)), "get") => results.push(InvocationOutcome::KvRead( - get_kv(&tx, &self.storage, orbit, path) - .await - .map_err(|e| match e { - EitherError::A(e) => TxStoreError::Tx(e.into()), - EitherError::B(e) => TxStoreError::StoreRead(e), - })?, - )), - (Some((orbit, "kv", path)), "list") => { - results.push(InvocationOutcome::KvList(list(&tx, orbit, path).await?)) - } - (Some((orbit, "kv", path)), "del") => { - let kv = get_kv_entity(&tx, orbit, path).await?; - if let Some(kv) = kv { - self.storage - .remove(orbit, &kv.value) - .await - .map_err(TxStoreError::StoreDelete)?; + for (resource, actions) in activity.iter() { + for action in actions.keys() { + match ( + action.namespace().as_ref(), + action.name().as_ref(), + resource.service(), + resource.path(), + ) { + ("kv", "get", Some("kv"), Some(path)) => { + results.push(InvocationOutcome::KvRead( + get_kv(&tx, &self.storage, resource.orbit(), path) + .await + .map_err(|e| match e { + EitherError::A(e) => TxStoreError::Tx(e.into()), + EitherError::B(e) => TxStoreError::StoreRead(e), + })?, + )) } - results.push(InvocationOutcome::KvDelete) - } - (Some((orbit, "kv", path)), "put") => { - if let Some(stage) = stages.remove(&(orbit.clone(), path.to_string())) { - self.storage - .persist(orbit, stage) - .await - .map_err(TxStoreError::StoreWrite)?; - results.push(InvocationOutcome::KvWrite) + ("kv", "list", Some("kv"), Some(path)) => results.push( + InvocationOutcome::KvList(list(&tx, resource.orbit(), path).await?), + ), + ("kv", "del", Some("kv"), Some(path)) => { + let kv = get_kv_entity(&tx, resource.orbit(), path).await?; + if let Some(kv) = kv { + self.storage + .remove(resource.orbit(), &kv.value) + .await + .map_err(TxStoreError::StoreDelete)?; + } + results.push(InvocationOutcome::KvDelete) + } + ("kv", "put", Some("kv"), Some(path)) => { + if let Some(stage) = + stages.remove(&(resource.orbit().clone(), path.to_string())) + { + self.storage + .persist(resource.orbit(), stage) + .await + .map_err(TxStoreError::StoreWrite)?; + results.push(InvocationOutcome::KvWrite) + } + } + ("kv", "metadata", Some("kv"), Some(path)) => results.push( + InvocationOutcome::KvMetadata(metadata(&tx, resource.orbit(), path).await?), + ), + ("kv", "read", Some("capabilities"), Some("all")) => { + results.push(InvocationOutcome::OpenSessions( + get_valid_delegations(&tx, resource.orbit(), None).await?, + )) } + _ => {} } - (Some((orbit, "kv", path)), "metadata") => results.push( - InvocationOutcome::KvMetadata(metadata(&tx, orbit, path).await?), - ), - (Some((orbit, "capabilities", "all")), "read") => results.push( - InvocationOutcome::OpenSessions(get_valid_delegations(&tx, orbit).await?), - ), - _ => {} } } @@ -325,25 +344,7 @@ pub enum InvocationOutcome { KvMetadata(Option), KvWrite, KvRead(Option<(Metadata, Content)>), - OpenSessions(HashMap), -} - -impl From for TxError { - fn from(e: delegation::Error) -> Self { - match e { - delegation::Error::InvalidDelegation(e) => Self::InvalidDelegation(e), - delegation::Error::Db(e) => Self::Db(e), - } - } -} - -impl From for TxError { - fn from(e: invocation::Error) -> Self { - match e { - invocation::Error::InvalidInvocation(e) => Self::InvalidInvocation(e), - invocation::Error::Db(e) => Self::Db(e), - } - } + OpenSessions(HashMap), } impl From for TxError { @@ -364,7 +365,7 @@ async fn event_orbits<'a, C: ConnectionTrait>( let revoked_events = event_order::Entity::find() .filter( event_order::Column::Event.is_in(ev.iter().filter_map(|(_, e)| match e { - Event::Revocation(r) => Some(Hash::from(r.0.revoked)), + Event::Revocation(r) => Some(Hash::from(r.0.revoke)), _ => None, })), ) @@ -373,23 +374,23 @@ async fn event_orbits<'a, C: ConnectionTrait>( for e in ev { match &e.1 { Event::Delegation(d) => { - for orbit in d.0.orbits() { - let entry = orbits.entry(orbit.clone()).or_insert_with(Vec::new); + for orbit in d.0.resources().map(|r: ResourceId| r.into_inner().0) { + let entry = orbits.entry(orbit).or_insert_with(Vec::new); if !entry.iter().any(|(h, _)| h == &e.0) { entry.push(e); } } } Event::Invocation(i, _) => { - for orbit in i.0.orbits() { - let entry = orbits.entry(orbit.clone()).or_insert_with(Vec::new); + for orbit in i.0.resources().map(|r: ResourceId| r.into_inner().0) { + let entry = orbits.entry(orbit).or_insert_with(Vec::new); if !entry.iter().any(|(h, _)| h == &e.0) { entry.push(e); } } } Event::Revocation(r) => { - let r_hash = Hash::from(r.0.revoked); + let r_hash = Hash::from(r.0.revoke); for revoked in &revoked_events { if r_hash == revoked.event { let entry = orbits @@ -418,21 +419,18 @@ pub(crate) async fn transact( .map(|e| (e.hash(), e)) .collect::>(); let event_orbits = event_orbits(db, &event_hashes).await?; + let host = Ability::new("orbit/host").unwrap(); let mut new_orbits = event_hashes .iter() .filter_map(|(_, e)| match e { - Event::Delegation(d) => Some(d.0.capabilities.iter().filter_map(|c| { - match (&c.resource, c.action.as_str()) { - (Resource::Kepler(r), "host") - if r.path().is_none() - && r.service().is_none() - && r.fragment().is_none() => - { - Some(OrbitIdWrap(r.orbit().clone())) - } - _ => None, - } - })), + Event::Delegation(d) => Some( + Resources::<'_, ResourceId>::grants(&d.0) + .filter_map(|(k, a)| match k.into_inner() { + (orbit, None, None, None) if a.contains_key(&host) => Some(orbit), + _ => None, + }) + .map(OrbitIdWrap), + ), _ => None, }) .flatten() @@ -591,23 +589,24 @@ pub(crate) async fn transact( for (hash, event) in event_hashes { match event { - Event::Delegation(d) => delegation::process(db, *d).await?, - Event::Invocation(i, ops) => { - invocation::process( - db, - *i, - ops.into_iter() - .map(|op| { - let v = orbit_order - .get(op.orbit()) - .and_then(|(s, e, _, h)| Some((s, e, h.get(&hash)?))) - .unwrap(); - op.version(*v.0, *v.1, *v.2) - }) - .collect(), - ) - .await? - } + Event::Delegation(d) => delegation::process(db, *d) + .await + .map_err(|e| e.into_del())?, + Event::Invocation(i, ops) => invocation::process( + db, + *i, + ops.into_iter() + .map(|op| { + let v = orbit_order + .get(op.orbit()) + .and_then(|(s, e, _, h)| Some((s, e, h.get(&hash)?))) + .unwrap(); + op.version(*v.0, *v.1, *v.2) + }) + .collect(), + ) + .await + .map_err(|e| e.into_inv())?, Event::Revocation(r) => revocation::process(db, *r).await?, }; } @@ -736,7 +735,8 @@ async fn get_kv_entity( async fn get_valid_delegations( db: &C, orbit: &OrbitId, -) -> Result, TxError> { + time: Option, +) -> Result, TxError> { let (dels, abilities): (Vec, Vec>) = delegation::Entity::find() .left_join(revocation::Entity) @@ -746,44 +746,26 @@ async fn get_valid_delegations( .await? .into_iter() .unzip(); - let parents = dels.load_many(parent_delegations::Entity, db).await?; - let now = time::OffsetDateTime::now_utc(); + let now = time.unwrap_or_else(time::OffsetDateTime::now_utc); Ok(dels .into_iter() .zip(abilities) - .zip(parents) - .filter_map(|((del, ability), parents)| { + .filter_map(|(del, ability)| { if del.expiry.map(|e| e > now).unwrap_or(true) && del.not_before.map(|n| n <= now).unwrap_or(true) - && ability.iter().any(|a| a.resource.orbit() == Some(orbit)) + && ability + .iter() + .any(|a| a.resource.as_ref().orbit() == Some(orbit)) { - Some(match KeplerDelegation::from_bytes(&del.serialization) { - Ok(delegation) => Ok(( - del.id, - DelegationInfo { - delegator: del.delegator, - delegate: del.delegatee, - parents: parents.into_iter().map(|p| p.parent.to_cid(0x55)).collect(), - expiry: del.expiry, - not_before: del.not_before, - issued_at: del.issued_at, - capabilities: ability - .into_iter() - .map(|a| Capability { - resource: a.resource, - action: a.ability, - }) - .collect(), - delegation, - }, - )), + Some(match del.reser_cacao() { + Ok(delegation) => Ok((del.id, delegation.0)), Err(e) => Err(e), }) } else { None } }) - .collect::, EncodingError>>()?) + .collect::, EncodingError>>()?) } fn normalize_path(p: &str) -> &str { diff --git a/kepler-core/src/events/mod.rs b/kepler-core/src/events/mod.rs index 191ca25f..28e6c297 100644 --- a/kepler-core/src/events/mod.rs +++ b/kepler-core/src/events/mod.rs @@ -1,12 +1,9 @@ use crate::{ hash::{hash, Hash}, types::Metadata, - util::{DelegationInfo, InvocationInfo, RevocationInfo}, }; pub use kepler_lib::{ - authorization::{ - EncodingError, HeaderEncode, KeplerDelegation, KeplerInvocation, KeplerRevocation, - }, + authorization::{Delegation, EncodingError, HeaderEncode, Invocation, Revocation}, libipld::cid::{ multihash::{Code, Error as MultihashError, MultihashDigest}, Cid, @@ -19,30 +16,18 @@ use serde_ipld_dagcbor::EncodeError; #[derive(Debug)] pub struct SerializedEvent(pub T, pub(crate) Vec); -#[non_exhaustive] -#[derive(thiserror::Error, Debug)] -pub enum FromReqErr { - #[error(transparent)] - Encoding(#[from] EncodingError), - #[error(transparent)] - TryFrom(T), -} - -impl SerializedEvent { - pub fn from_header_ser(s: &str) -> Result> - where - T: TryFrom, - I: HeaderEncode, - { - I::decode(s) - .map_err(FromReqErr::from) - .and_then(|(i, s)| Ok(Self(T::try_from(i).map_err(FromReqErr::TryFrom)?, s))) +impl SerializedEvent +where + T: HeaderEncode, +{ + pub fn from_header_ser(s: &str) -> Result { + T::decode(s).map(|(t, s)| Self(t, s)) } } -pub type Delegation = SerializedEvent; -pub type Invocation = SerializedEvent; -pub type Revocation = SerializedEvent; +pub type SDelegation = SerializedEvent; +pub type SInvocation = SerializedEvent; +pub type SRevocation = SerializedEvent; #[derive(Debug, Hash, PartialEq, Eq)] pub(crate) enum Operation { @@ -116,9 +101,9 @@ pub(crate) enum VersionedOperation { #[derive(Debug)] pub(crate) enum Event { - Invocation(Box, Vec), - Delegation(Box), - Revocation(Box), + Invocation(Box, Vec), + Delegation(Box), + Revocation(Box), } impl Event { diff --git a/kepler-core/src/keys.rs b/kepler-core/src/keys.rs index 3efe05c0..1775e6d8 100644 --- a/kepler-core/src/keys.rs +++ b/kepler-core/src/keys.rs @@ -18,7 +18,7 @@ pub(crate) fn get_did_key(key: PublicKey) -> String { use kepler_lib::libipld::cid::multibase; // only ed25519 feature is enabled, so this unwrap should never fail let ed25519_pk_bytes = key.try_into_ed25519().unwrap().to_bytes(); - let multicodec_pk = [[0xed].as_slice(), ed25519_pk_bytes.as_slice()].concat(); + let multicodec_pk = [[0xed, 0x01].as_slice(), ed25519_pk_bytes.as_slice()].concat(); format!( "did:key:{}", multibase::encode(multibase::Base::Base58Btc, multicodec_pk) diff --git a/kepler-core/src/lib.rs b/kepler-core/src/lib.rs index a6b29946..cde15342 100644 --- a/kepler-core/src/lib.rs +++ b/kepler-core/src/lib.rs @@ -8,7 +8,6 @@ pub mod models; pub mod relationships; pub mod storage; pub mod types; -pub mod util; pub use db::{Commit, InvocationOutcome, OrbitDatabase, TxError, TxStoreError}; pub use libp2p; diff --git a/kepler-core/src/models/abilities.rs b/kepler-core/src/models/abilities.rs index 681dcd8c..f7b33924 100644 --- a/kepler-core/src/models/abilities.rs +++ b/kepler-core/src/models/abilities.rs @@ -1,6 +1,6 @@ use super::*; use crate::hash::Hash; -use crate::types::{Caveats, Resource}; +use crate::types::{AbilityName, Caveats, Resource}; use sea_orm::entity::prelude::*; #[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)] @@ -9,7 +9,7 @@ pub struct Model { #[sea_orm(primary_key)] pub resource: Resource, #[sea_orm(primary_key)] - pub ability: String, + pub ability: AbilityName, #[sea_orm(primary_key)] pub delegation: Hash, diff --git a/kepler-core/src/models/delegation.rs b/kepler-core/src/models/delegation.rs index 494d7830..6e3c9e16 100644 --- a/kepler-core/src/models/delegation.rs +++ b/kepler-core/src/models/delegation.rs @@ -1,9 +1,13 @@ use crate::hash::Hash; -use crate::types::{Facts, Resource}; -use crate::{events::Delegation, models::*, relationships::*, util}; -use kepler_lib::{authorization::KeplerDelegation, resolver::DID_METHODS}; +use crate::types::Facts; +use crate::{ + events::{SDelegation, SerializedEvent}, + models::*, + relationships::*, +}; +use kepler_lib::authorization::{delegation_from_bytes, Delegation, EncodingError, Resources}; use sea_orm::{entity::prelude::*, sea_query::OnConflict, ConnectionTrait}; -use time::OffsetDateTime; +use time::{Duration, OffsetDateTime}; #[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)] #[sea_orm(table_name = "delegation")] @@ -20,6 +24,39 @@ pub struct Model { pub serialization: Vec, } +impl Model { + pub(crate) fn reser_cacao(&self) -> Result { + Ok(SerializedEvent( + delegation_from_bytes(&self.serialization)?, + self.serialization.clone(), + )) + } + + pub(crate) fn valid_at(&self, time: OffsetDateTime, skew: Option) -> bool { + let skew = skew.unwrap_or_else(|| Duration::seconds(0)); + self.expiry.map_or(true, |exp| time < exp + skew) + && self.not_before.map_or(true, |nbf| nbf <= time + skew) + } + + pub(crate) fn validate_bounds( + &self, + start: Option, + end: Option, + ) -> bool { + let a = match (self.not_before, start) { + (Some(nbf), Some(start)) => start >= nbf, + (None, Some(_)) => false, + _ => true, + }; + let b = match (self.expiry, end) { + (Some(exp), Some(end)) => exp >= end, + (None, Some(_)) => false, + _ => true, + }; + a && b + } +} + #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] pub enum Relation { // inverse relation, delegations belong to delegators @@ -95,146 +132,61 @@ impl Linked for Delegatee { impl ActiveModelBehavior for ActiveModel {} -#[derive(Debug, thiserror::Error)] -pub enum Error { - #[error(transparent)] - Db(#[from] DbErr), - #[error(transparent)] - InvalidDelegation(#[from] DelegationError), -} - -#[derive(Debug, thiserror::Error)] -pub enum DelegationError { - #[error("Delegation expired or not yet valid")] - InvalidTime, - #[error("Failed to verify signature")] - InvalidSignature, - #[error("Unauthorized Delegator: {0}")] - UnauthorizedDelegator(String), - #[error("Unauthorized Capability: {0}, {1}")] - UnauthorizedCapability(Resource, String), - #[error("Cannot find parent delegation")] - MissingParents, -} - pub(crate) async fn process( db: &C, - delegation: Delegation, -) -> Result { - let (d, ser) = (delegation.0, delegation.1); - verify(&d.delegation).await?; - - validate(db, &d).await?; + SerializedEvent(d, ser): SDelegation, +) -> Result { + let time = OffsetDateTime::now_utc(); + if !d.valid_at_time(time.unix_timestamp() as u64, None) { + return Err(ValidationError::InvalidTime.into()); + } + verify(&d).await?; + validate(db, &d, None).await?; save(db, d, ser).await } -// verify signatures and time -async fn verify(delegation: &KeplerDelegation) -> Result<(), Error> { - match delegation { - KeplerDelegation::Ucan(ref ucan) => { - ucan.verify_signature(DID_METHODS.to_resolver()) - .await - .map_err(|_| DelegationError::InvalidSignature)?; - ucan.payload - .validate_time(None) - .map_err(|_| DelegationError::InvalidTime)?; - } - KeplerDelegation::Cacao(ref cacao) => { - cacao - .verify() - .await - .map_err(|_| DelegationError::InvalidSignature)?; - if !cacao.payload().valid_now() { - return Err(DelegationError::InvalidTime)?; - } - } - }; - Ok(()) -} - -// verify parenthood and authorization -async fn validate( - db: &C, - delegation: &util::DelegationInfo, -) -> Result<(), Error> { - // get caps which rely on delegated caps - let dependant_caps: Vec<_> = delegation - .capabilities - .iter() - .filter(|c| { - // remove caps for which the delegator is the root authority - c.resource - .orbit() - .map(|o| o.did() != delegation.delegator) - .unwrap_or(true) - }) - .collect(); - - match (dependant_caps.is_empty(), delegation.parents.is_empty()) { - // no dependant caps, no parents needed, must be valid - (true, _) => Ok(()), - // dependant caps, no parents, invalid - (false, true) => Err(DelegationError::MissingParents.into()), - // dependant caps, parents, check parents - (false, false) => { - // get parents which have - let parents: Vec<_> = Entity::find() - // the correct id - .filter(Column::Id.is_in(delegation.parents.iter().map(|c| Hash::from(*c)))) - // the correct delegatee - .filter(Column::Delegatee.eq(delegation.delegator.clone())) - .all(db) - .await? - .into_iter() - .filter(|p| { - // valid time bounds - p.expiry < delegation.expiry - && p.not_before - .map(|pnbf| delegation.not_before.map(|nbf| pnbf > nbf).unwrap_or(true)) - .unwrap_or(false) - }) - .collect(); - - // get delegated abilities from each parent - let parent_abilities = parents.load_many(abilities::Entity, db).await?; - - // check each dependant cap is supported by at least one parent cap - match dependant_caps.iter().find(|c| { - !parent_abilities - .iter() - .flatten() - .any(|pc| c.resource.extends(&pc.resource) && c.action == pc.ability) - }) { - Some(c) => Err(DelegationError::UnauthorizedCapability( - c.resource.clone(), - c.action.clone(), - ) - .into()), - None => Ok(()), - } - } - } -} - async fn save( db: &C, - delegation: util::DelegationInfo, + delegation: Delegation, serialization: Vec, -) -> Result { - save_actors(&[&delegation.delegator, &delegation.delegate], db).await?; +) -> Result { + save_actors( + &[ + &delegation.issuer().to_string(), + &delegation.audience().to_string(), + ], + db, + ) + .await?; let hash: Hash = crate::hash::hash(&serialization); // save delegation match Entity::insert(ActiveModel::from(Model { id: hash, - delegator: delegation.delegator, - delegatee: delegation.delegate, - expiry: delegation.expiry, - issued_at: delegation.issued_at, - not_before: delegation.not_before, - facts: None, + delegator: delegation.issuer().to_string(), + delegatee: delegation.audience().to_string(), + expiry: delegation + .expiration() + .map(|i| OffsetDateTime::from_unix_timestamp(i as i64)) + .transpose() + .map_err(ValidationError::from)?, + issued_at: delegation + .issued_at() + .map(|i| OffsetDateTime::from_unix_timestamp(i as i64)) + .transpose() + .map_err(ValidationError::from)?, + not_before: delegation + .not_before() + .map(|i| OffsetDateTime::from_unix_timestamp(i as i64)) + .transpose() + .map_err(ValidationError::from)?, + facts: delegation + .facts() + // TODO not ideal + .map(|f| serde_json::from_value(serde_json::to_value(f)?)) + .transpose()?, serialization, })) .on_conflict(OnConflict::column(Column::Id).do_nothing().to_owned()) @@ -248,25 +200,27 @@ async fn save( }; // save abilities - if !delegation.capabilities.is_empty() { - abilities::Entity::insert_many(delegation.capabilities.into_iter().map(|ab| { - abilities::ActiveModel::from(abilities::Model { - delegation: hash, - resource: ab.resource, - ability: ab.action, - caveats: Default::default(), + if !delegation.capabilities().is_empty() { + let abilities = Resources::<'_, AnyResource>::grants(&delegation) + .flat_map(|(resource, abilities)| { + abilities.iter().map(move |(ability, c)| abilities::Model { + delegation: hash, + resource: resource.clone().into(), + ability: ability.clone().into(), + caveats: c.clone().into(), + }) }) - })) - .exec(db) - .await?; + .map(abilities::ActiveModel::from) + .collect::>(); + abilities::Entity::insert_many(abilities).exec(db).await?; } // save parent relationships - if !delegation.parents.is_empty() { - parent_delegations::Entity::insert_many(delegation.parents.into_iter().map(|p| { + if let Some(prf) = delegation.proof().filter(|p| !p.is_empty()) { + parent_delegations::Entity::insert_many(prf.iter().map(|p| { parent_delegations::ActiveModel::from(parent_delegations::Model { child: hash, - parent: p.into(), + parent: (*p).into(), }) })) .exec(db) diff --git a/kepler-core/src/models/invocation.rs b/kepler-core/src/models/invocation.rs index ab9c7c29..0079405a 100644 --- a/kepler-core/src/models/invocation.rs +++ b/kepler-core/src/models/invocation.rs @@ -1,12 +1,11 @@ use super::super::{ - events::{Invocation, VersionedOperation}, + events::{SInvocation, SerializedEvent, VersionedOperation}, models::*, relationships::*, - util, }; use crate::hash::Hash; -use crate::types::{Facts, OrbitIdWrap, Resource}; -use kepler_lib::{authorization::KeplerInvocation, resolver::DID_METHODS}; +use crate::types::{Facts, OrbitIdWrap}; +use kepler_lib::authorization::{Invocation, Resources}; use sea_orm::{entity::prelude::*, sea_query::OnConflict, Condition, ConnectionTrait, QueryOrder}; use time::OffsetDateTime; @@ -49,154 +48,42 @@ impl Related for Entity { impl ActiveModelBehavior for ActiveModel {} -#[derive(Debug, thiserror::Error)] -pub enum Error { - #[error(transparent)] - Db(#[from] DbErr), - #[error(transparent)] - InvalidInvocation(#[from] InvocationError), -} - -#[derive(Debug, thiserror::Error)] -pub enum InvocationError { - #[error("Invocation expired or not yet valid")] - InvalidTime, - #[error("Failed to verify signature")] - InvalidSignature, - #[error("Unauthorized Invoker")] - UnauthorizedInvoker(String), - #[error("Unauthorized Action: {0} / {1}")] - UnauthorizedAction(Resource, String), - #[error("Cannot find parent delegation")] - MissingParents, - #[error("No Such Key: {0}")] - MissingKvWrite(String), -} - pub(crate) async fn process( db: &C, - invocation: Invocation, + SerializedEvent(i, ser): SInvocation, ops: Vec, -) -> Result { - let (i, serialized) = (invocation.0, invocation.1); - verify(&i.invocation).await?; - - let now = OffsetDateTime::now_utc(); - validate(db, &i, Some(now)).await?; - - save(db, i, Some(now), serialized, ops).await -} - -async fn verify(invocation: &KeplerInvocation) -> Result<(), Error> { - invocation - .verify_signature(DID_METHODS.to_resolver()) - .await - .map_err(|_| InvocationError::InvalidSignature)?; - invocation - .payload - .validate_time(None) - .map_err(|_| InvocationError::InvalidTime)?; - Ok(()) -} - -// verify parenthood and authorization -async fn validate( - db: &C, - invocation: &util::InvocationInfo, - time: Option, -) -> Result<(), Error> { - // get caps which rely on delegated caps - let dependant_caps: Vec<_> = invocation - .capabilities - .iter() - .filter(|c| { - // remove caps for which the invoker is the root authority - c.resource - .orbit() - .map(|o| o.did() != invocation.invoker) - .unwrap_or(true) - }) - .collect(); - - match (dependant_caps.is_empty(), invocation.parents.is_empty()) { - // no dependant caps, no parents needed, must be valid - (true, _) => Ok(()), - // dependant caps, no parents, invalid - (false, true) => Err(InvocationError::MissingParents.into()), - // dependant caps, parents, check parents - (false, false) => { - // get parents which have - let parents = delegation::Entity::find() - // the correct id - .filter( - delegation::Column::Id.is_in(invocation.parents.iter().map(|c| Hash::from(*c))), - ) - // and also get their abilities - .find_with_related(abilities::Entity) - .all(db) - .await?; - - // check parent identifies correct invoker - parents - .iter() - .map(|(p, _)| { - if p.delegatee != invocation.invoker - && !invocation.invoker.starts_with(&p.delegatee) - { - Err(InvocationError::UnauthorizedInvoker( - invocation.invoker.clone(), - )) - } else { - Ok(()) - } - }) - .collect::, _>>()?; - - let now = time.unwrap_or_else(OffsetDateTime::now_utc); - - // only use parents which are valid at the time of invocation - let parents: Vec<_> = parents - .into_iter() - .filter(|(p, _)| { - p.expiry.map(|pexp| now < pexp).unwrap_or(true) - && p.not_before.map(|pnbf| now >= pnbf).unwrap_or(true) - }) - .collect(); - - // check each dependant cap is supported by at least one parent cap - match dependant_caps.iter().find(|c| { - !parents - .iter() - .flat_map(|(_, a)| a) - .any(|pc| c.resource.extends(&pc.resource) && c.action == pc.ability) - }) { - Some(c) => Err(InvocationError::UnauthorizedAction( - c.resource.clone(), - c.action.clone(), - ) - .into()), - None => Ok(()), - } - } +) -> Result { + let time = OffsetDateTime::now_utc(); + if !i.valid_at_time(time.unix_timestamp() as u64, None) { + return Err(ValidationError::InvalidTime.into()); } + verify(&i).await?; + validate(db, &i, Some(time)).await?; + save(db, i, Some(time), ser, ops).await } async fn save( db: &C, - invocation: util::InvocationInfo, + invocation: Invocation, time: Option, serialization: Vec, parameters: Vec, -) -> Result { +) -> Result { let hash = crate::hash::hash(&serialization); - let issued_at = time.unwrap_or_else(OffsetDateTime::now_utc); + let issued_at = time + .map(Ok) + .or(invocation + .issued_at() + .map(|i| OffsetDateTime::from_unix_timestamp(i as i64))) + .transpose()? + .unwrap_or_else(OffsetDateTime::now_utc); match Entity::insert(ActiveModel::from(Model { id: hash, issued_at, serialization, facts: None, - invoker: invocation.invoker, + invoker: invocation.issuer().to_string(), })) .on_conflict(OnConflict::column(Column::Id).do_nothing().to_owned()) .exec(db) @@ -209,23 +96,29 @@ async fn save( }; // save invoked abilities - if !invocation.capabilities.is_empty() { - invoked_abilities::Entity::insert_many(invocation.capabilities.into_iter().map(|c| { - invoked_abilities::ActiveModel::from(invoked_abilities::Model { - invocation: hash, - resource: c.resource, - ability: c.action, + if !invocation.capabilities().is_empty() { + let invoked = Resources::<'_, AnyResource>::grants(&invocation) + .flat_map(|(resource, actions)| { + actions.iter().map(move |(action, _)| { + invoked_abilities::ActiveModel::from(invoked_abilities::Model { + invocation: hash, + resource: resource.clone().into(), + ability: action.clone().into(), + }) + }) }) - })) - .exec(db) - .await?; + .collect::>(); + invoked_abilities::Entity::insert_many(invoked) + .exec(db) + .await?; } + // save parent relationships - if !invocation.parents.is_empty() { - parent_delegations::Entity::insert_many(invocation.parents.into_iter().map(|p| { + if let Some(prf) = invocation.proof().filter(|p| !p.is_empty()) { + parent_delegations::Entity::insert_many(prf.iter().map(|p| { parent_delegations::ActiveModel::from(parent_delegations::Model { child: hash, - parent: p.into(), + parent: (*p).into(), }) })) .exec(db) @@ -261,7 +154,7 @@ async fn save( version, orbit, } => { - let deleted_invocation_id = if let Some((s, e, es)) = version { + match if let Some((s, e, es)) = version { kv_write::Entity::find().filter( Condition::all() .add(kv_write::Column::Key.eq(key.clone())) @@ -280,15 +173,22 @@ async fn save( } .one(db) .await? - .ok_or_else(|| InvocationError::MissingKvWrite(key.clone()))? - .invocation; - kv_delete::Entity::insert(kv_delete::ActiveModel::from(kv_delete::Model { - key, - invocation_id: hash, - orbit: orbit.into(), - deleted_invocation_id, - })) - .exec(db) + { + Some(kv) => Ok(kv_delete::Entity::insert(kv_delete::ActiveModel::from( + kv_delete::Model { + key, + invocation_id: hash, + orbit: orbit.into(), + deleted_invocation_id: kv.invocation, + }, + )) + .exec(db)), + None => Err(EventProcessingError::MissingServiceEvent( + orbit.to_resource(Some("kv".to_string()), Some(key), None), + "kv/del".to_string(), + version, + )), + }? .await?; } } diff --git a/kepler-core/src/models/mod.rs b/kepler-core/src/models/mod.rs index a338ecf8..190aa352 100644 --- a/kepler-core/src/models/mod.rs +++ b/kepler-core/src/models/mod.rs @@ -7,3 +7,220 @@ pub mod kv_delete; pub mod kv_write; pub mod orbit; pub mod revocation; + +use crate::{hash::Hash, keys::Secrets, storage::StorageSetup, types::CaveatsInner, TxError}; +use kepler_lib::{ + authorization::Resources, + cacaos::{ + common::{CommonCacao, CommonVerifier, Error as CacaoError}, + Cacao, + }, + iri_string::types::{UriStr, UriString}, + resolver::DID_METHODS, + resource::{AnyResource, ResourceId}, + ssi::ucan::capabilities::{Ability, NotaBeneCollection}, +}; +use sea_orm::entity::prelude::*; +use std::{ + collections::{BTreeMap, HashMap, HashSet}, + iter::once, +}; +use time::OffsetDateTime; + +#[derive(Debug, thiserror::Error)] +pub enum EventProcessingError { + #[error(transparent)] + Db(#[from] DbErr), + #[error(transparent)] + InvalidMessage(#[from] ValidationError), + #[error(transparent)] + Serde(#[from] serde_json::Error), + #[error("Missing event for service: {0} {1} {2:?}")] + MissingServiceEvent(ResourceId, String, Option<(i64, Hash, i64)>), +} + +impl EventProcessingError { + pub(crate) fn into_del(self) -> TxError { + match self { + EventProcessingError::Db(e) => TxError::Db(e), + EventProcessingError::InvalidMessage(e) => TxError::InvalidDelegation(e), + EventProcessingError::Serde(e) => TxError::Serde(e), + EventProcessingError::MissingServiceEvent(id, service, version) => { + TxError::MissingServiceEvent(id, service, version) + } + } + } + pub(crate) fn into_inv(self) -> TxError { + match self { + EventProcessingError::Db(e) => TxError::Db(e), + EventProcessingError::InvalidMessage(e) => TxError::InvalidInvocation(e), + EventProcessingError::Serde(e) => TxError::Serde(e), + EventProcessingError::MissingServiceEvent(id, service, version) => { + TxError::MissingServiceEvent(id, service, version) + } + } + } +} + +impl From for EventProcessingError { + fn from(e: CacaoError) -> Self { + Self::InvalidMessage(e.into()) + } +} + +impl From for EventProcessingError { + fn from(e: time::error::ComponentRange) -> Self { + Self::InvalidMessage(e.into()) + } +} + +#[derive(Debug, thiserror::Error)] +pub enum ValidationError { + #[error("Message expired or not yet valid")] + InvalidTime, + #[error("Failed to verify signature: {0}")] + InvalidSignature(#[from] CacaoError), + #[error("Unauthorized Issuer: {0}")] + UnauthorizedIssuer(String), + #[error("Unauthorized Capabilities: {0:?}")] + UnauthorizedCapability(HashMap>), + #[error("Cannot find parent delegation")] + MissingParents, + #[error(transparent)] + UnixTimeError(#[from] time::error::ComponentRange), +} + +// verify signature +async fn verify(cacao: &CommonCacao) -> Result<(), ValidationError> { + Ok(cacao.verify(&CommonVerifier::new(&*DID_METHODS)).await?) +} + +// verify parenthood and authorization +async fn validate<'a, C: ConnectionTrait>( + db: &C, + message: &'a CommonCacao, + time: Option, +) -> Result<(), EventProcessingError> { + let mut required = get_required(message); + match (required.next(), message.proof()) { + // no dependant caps, no parents needed, must be valid + (None, _) => Ok(()), + // dependant caps and parents, check parents + (Some(rf), Some(prf)) if !prf.is_empty() => { + let mut unauthorized = take_unauthorized( + once(rf).chain(required), + // get all known parents of `message` + get_granted(db, message, time).await?, + ) + .map(|(r, a)| (r.into(), a.into_iter().cloned().collect())); + match unauthorized.next() { + Some(uf) => Err(ValidationError::UnauthorizedCapability( + once(uf).chain(unauthorized).collect(), + ) + .into()), + _ => Ok(()), + } + } + // dependant caps, no parents, invalid + _ => Err(ValidationError::MissingParents.into()), + } +} + +// get caps which rely on delegated parent caps +fn get_required<'a, S: 'a, F: 'a, NB: 'a>( + message: &'a Cacao, +) -> impl Iterator< + Item = ( + AnyResource<&'a UriStr>, + &'a BTreeMap>, + ), +> { + Resources::<'a, AnyResource<&'a UriStr>, NB>::grants(message) + // remove caps for which the delegator is the root authority + .filter(|(r, _)| { + r.orbit().map_or(true, |o| { + o.suffix() != message.issuer().method().to_string() + }) + }) +} + +// check each actioned cap is supported by at least one granted cap +// return caps which are not supported +fn take_unauthorized<'a>( + actioned: impl Iterator, &'a BTreeMap)>, + granted: HashMap, BTreeMap>, +) -> impl Iterator, HashSet<&'a Ability>)> { + actioned.filter_map(move |(r, a)| { + let unsupported = a + .keys() + .filter(|ab| { + // get unsupported abilities + !granted + .iter() + // only get applicable caps where the resource is right + .filter_map(|(gr, ga)| r.extends(gr).then_some(ga)) + // and the ability is not supported + .any(|ga| ga.contains_key(ab.as_ref())) + }) + .collect::>(); + if unsupported.is_empty() { + None + } else { + Some((r, unsupported)) + } + }) +} + +async fn get_granted( + db: &C, + message: &CommonCacao, + time: Option, +) -> Result>, EventProcessingError> { + Ok(match message.proof() { + // get delegated abilities from each parent + Some(prf) if !prf.is_empty() => { + let issuer = message.issuer().to_string(); + let nbf = message + .not_before() + .map(|i| OffsetDateTime::from_unix_timestamp(i as i64)) + .transpose()?; + let exp = message + .expiration() + .map(|i| OffsetDateTime::from_unix_timestamp(i as i64)) + .transpose()?; + + delegation::Entity::find() + // get parents which have + // the correct id + .filter(delegation::Column::Id.is_in(prf.iter().map(|c| Hash::from(*c)))) + // the correct delegatee + .filter(delegation::Column::Delegatee.eq(&issuer)) + // unrevoked + .left_join(revocation::Entity) + .filter(revocation::Column::Id.is_null()) + .all(db) + .await? + .into_iter() + // valid issuer + .filter(|p| p.delegatee == issuer) + // valid time bounds + .filter(|p| p.validate_bounds(nbf, exp)) + // extra check + .filter(|p| time.map_or(true, |t| p.valid_at(t, None))) + .collect::>() + .load_many(abilities::Entity, db) + .await? + .into_iter() + .flatten() + .fold(HashMap::new(), |mut acc, pc| { + acc.entry(pc.resource.0) + .or_default() + .entry(pc.ability.0.to_string()) + .or_default() + .extend(pc.caveats.0); + acc + }) + } + _ => HashMap::new(), + }) +} diff --git a/kepler-core/src/models/revocation.rs b/kepler-core/src/models/revocation.rs index bbd94ef0..699c0459 100644 --- a/kepler-core/src/models/revocation.rs +++ b/kepler-core/src/models/revocation.rs @@ -1,8 +1,7 @@ -use super::super::{events::Revocation, models::*, relationships::*}; +use super::super::{events::SRevocation, models::*}; use crate::hash::{hash, Hash}; -use kepler_lib::authorization::KeplerRevocation; +use kepler_lib::resolver::DID_METHODS; use sea_orm::{entity::prelude::*, sea_query::OnConflict, ConnectionTrait}; -use time::OffsetDateTime; #[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)] #[sea_orm(table_name = "revocation")] @@ -67,39 +66,31 @@ pub enum RevocationError { pub(crate) async fn process( db: &C, - revocation: Revocation, + revocation: SRevocation, ) -> Result { let (r, serialization) = (revocation.0, revocation.1); - let t = OffsetDateTime::now_utc(); - - match &r.revocation { - KeplerRevocation::Cacao(c) => { - c.verify() - .await - .map_err(|_| RevocationError::InvalidSignature)?; - if !c.payload().valid_at(&t) { - return Err(RevocationError::InvalidTime.into()); - }; - } - }; + r.verify_signature(&*DID_METHODS, None) + .await + .map_err(|_| RevocationError::InvalidSignature)?; let hash: Hash = hash(&serialization); - let delegation = delegation::Entity::find_by_id(Hash::from(r.revoked)) + // TODO get the whole delegation chain + let delegation = delegation::Entity::find_by_id(Hash::from(r.revoke)) .one(db) .await? .ok_or(RevocationError::MissingParents)?; // check the revoker is also the delegator - if delegation.delegator != r.revoker { - return Err(RevocationError::UnauthorizedRevoker(r.revoker).into()); + if delegation.delegator != r.issuer { + return Err(RevocationError::UnauthorizedRevoker(r.issuer).into()); }; match Entity::insert(ActiveModel::from(Model { id: hash, serialization, - revoker: r.revoker, - revoked: delegation.id, + revoker: r.issuer, + revoked: r.revoke.into(), })) .on_conflict(OnConflict::column(Column::Id).do_nothing().to_owned()) .exec(db) @@ -111,16 +102,5 @@ pub(crate) async fn process( } }; - if !r.parents.is_empty() { - parent_delegations::Entity::insert_many(r.parents.into_iter().map(|p| { - parent_delegations::ActiveModel::from(parent_delegations::Model { - child: hash, - parent: p.into(), - }) - })) - .exec(db) - .await?; - } - Ok(hash) } diff --git a/kepler-core/src/relationships/invoked_abilities.rs b/kepler-core/src/relationships/invoked_abilities.rs index 2f0102df..fe15877f 100644 --- a/kepler-core/src/relationships/invoked_abilities.rs +++ b/kepler-core/src/relationships/invoked_abilities.rs @@ -1,6 +1,6 @@ use super::super::models::*; use crate::hash::Hash; -use crate::types::Resource; +use crate::types::{AbilityName, Resource}; use sea_orm::entity::prelude::*; #[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)] @@ -11,7 +11,7 @@ pub struct Model { #[sea_orm(primary_key)] pub resource: Resource, #[sea_orm(primary_key)] - pub ability: String, + pub ability: AbilityName, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] diff --git a/kepler-core/src/types/ability_name.rs b/kepler-core/src/types/ability_name.rs new file mode 100644 index 00000000..eeddef1a --- /dev/null +++ b/kepler-core/src/types/ability_name.rs @@ -0,0 +1,104 @@ +use kepler_lib::ssi::ucan::capabilities::Ability; +use sea_orm::entity::prelude::*; +use serde::{Deserialize, Serialize}; + +#[derive(Serialize, Deserialize, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +pub struct AbilityName(pub Ability); + +impl AsRef for AbilityName { + fn as_ref(&self) -> &Ability { + &self.0 + } +} + +impl From for AbilityName { + fn from(id: Ability) -> Self { + AbilityName(id) + } +} + +impl From for Ability { + fn from(id: AbilityName) -> Self { + id.0 + } +} + +impl From for Value { + fn from(r: AbilityName) -> Self { + Value::String(Some(Box::new(r.to_string()))) + } +} + +impl PartialEq for AbilityName { + fn eq(&self, other: &Ability) -> bool { + self.0 == *other + } +} + +impl AbilityName { + pub fn into_inner(self) -> Ability { + self.0 + } +} + +impl sea_orm::TryGetable for AbilityName { + fn try_get_by( + res: &QueryResult, + idx: I, + ) -> Result { + Ok(res + .try_get_by::(idx)? + .parse() + .map_err(|e| DbErr::TryIntoErr { + from: "String", + into: "AbilityName", + source: Box::new(e), + })?) + } +} + +impl sea_orm::sea_query::ValueType for AbilityName { + fn try_from(v: Value) -> Result { + match v { + Value::String(Some(x)) => x.parse().or(Err(sea_orm::sea_query::ValueTypeErr)), + _ => Err(sea_orm::sea_query::ValueTypeErr), + } + } + + fn type_name() -> String { + stringify!(AbilityName).to_owned() + } + + fn array_type() -> sea_orm::sea_query::ArrayType { + sea_orm::sea_query::ArrayType::String + } + + fn column_type() -> sea_orm::sea_query::ColumnType { + sea_orm::sea_query::ColumnType::String(None) + } +} + +impl std::str::FromStr for AbilityName { + type Err = ::Err; + fn from_str(s: &str) -> Result { + Ok(Self(Ability::from_str(s)?)) + } +} + +impl std::fmt::Display for AbilityName { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.0) + } +} + +impl sea_orm::sea_query::Nullable for AbilityName { + fn null() -> Value { + Value::String(None) + } +} + +impl sea_orm::TryFromU64 for AbilityName { + fn try_from_u64(_: u64) -> Result { + Err(DbErr::ConvertFromU64(stringify!($type))) + } +} diff --git a/kepler-core/src/types/caveats.rs b/kepler-core/src/types/caveats.rs index 5e72d89d..8ea06e7d 100644 --- a/kepler-core/src/types/caveats.rs +++ b/kepler-core/src/types/caveats.rs @@ -1,9 +1,11 @@ use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; -use std::collections::BTreeMap; +use ssi::ucan::capabilities::NotaBeneCollection; + +pub type CaveatsInner = NotaBeneCollection; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Eq, Default)] -pub struct Caveats(pub BTreeMap); +pub struct Caveats(pub CaveatsInner); impl From for Value { fn from(source: Caveats) -> Self { @@ -11,6 +13,12 @@ impl From for Value { } } +impl From for Caveats { + fn from(source: CaveatsInner) -> Self { + Self(source) + } +} + impl sea_orm::TryGetableFromJson for Caveats {} impl sea_orm::sea_query::ValueType for Caveats { diff --git a/kepler-core/src/types/mod.rs b/kepler-core/src/types/mod.rs index 12380f58..47a7b53e 100644 --- a/kepler-core/src/types/mod.rs +++ b/kepler-core/src/types/mod.rs @@ -1,10 +1,12 @@ +mod ability_name; mod caveats; mod facts; mod metadata; mod orbit_id_wrap; mod resource; -pub use caveats::Caveats; +pub use ability_name::AbilityName; +pub use caveats::{Caveats, CaveatsInner}; pub use facts::Facts; pub use metadata::Metadata; pub use orbit_id_wrap::OrbitIdWrap; diff --git a/kepler-core/src/types/orbit_id_wrap.rs b/kepler-core/src/types/orbit_id_wrap.rs index 287a5cf4..04efdcc8 100644 --- a/kepler-core/src/types/orbit_id_wrap.rs +++ b/kepler-core/src/types/orbit_id_wrap.rs @@ -1,7 +1,6 @@ use kepler_lib::resource::OrbitId; use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; -use std::str::FromStr; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Eq, Hash, PartialOrd, Ord)] pub struct OrbitIdWrap(pub OrbitId); @@ -47,23 +46,25 @@ impl sea_orm::TryGetable for OrbitIdWrap { res: &QueryResult, idx: I, ) -> Result { - let s: String = res.try_get_by(idx).map_err(sea_orm::TryGetError::DbErr)?; - Ok(OrbitIdWrap(OrbitId::from_str(&s).map_err(|e| { - sea_orm::TryGetError::DbErr(DbErr::TryIntoErr { - from: "String", - into: "OrbitId", - source: Box::new(e), - }) - })?)) + Ok(OrbitIdWrap( + res.try_get_by::(idx)?.parse().map_err(|e| { + sea_orm::TryGetError::DbErr(DbErr::TryIntoErr { + from: "String", + into: "OrbitId", + source: Box::new(e), + }) + })?, + )) } } impl sea_orm::sea_query::ValueType for OrbitIdWrap { fn try_from(v: Value) -> Result { match v { - Value::String(Some(x)) => Ok(OrbitId::from_str(&x) - .map_err(|_| sea_orm::sea_query::ValueTypeErr)? - .into()), + Value::String(Some(s)) => s + .parse() + .or(Err(sea_orm::sea_query::ValueTypeErr)) + .map(Self), _ => Err(sea_orm::sea_query::ValueTypeErr), } } diff --git a/kepler-core/src/types/resource.rs b/kepler-core/src/types/resource.rs index 2efac425..c8fa837c 100644 --- a/kepler-core/src/types/resource.rs +++ b/kepler-core/src/types/resource.rs @@ -1,51 +1,69 @@ -use kepler_lib::resource::{OrbitId, ResourceId}; +use kepler_lib::{ + iri_string::types::{UriStr, UriString}, + resource::{AnyResource, ResourceId}, +}; use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; use std::{fmt::Display, str::FromStr}; #[derive(Serialize, Deserialize, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] -#[serde(untagged)] -pub enum Resource { - Kepler(ResourceId), - Other(String), +pub struct Resource(pub AnyResource); + +impl AsRef for Resource { + fn as_ref(&self) -> &AnyResource { + &self.0 + } } impl Resource { - pub fn orbit(&self) -> Option<&OrbitId> { - match self { - Resource::Kepler(id) => Some(id.orbit()), - Resource::Other(_) => None, + pub fn extends, S: AsRef>>(&self, other: &S) -> bool { + match (&self.0, other.as_ref()) { + (AnyResource::Kepler(a), AnyResource::Kepler(b)) => a.extends(b).is_ok(), + (AnyResource::Other(a), AnyResource::Other(b)) => a.as_str().starts_with(b.as_ref()), + _ => false, } } +} - pub fn extends(&self, other: &Self) -> bool { - match (self, other) { - (Resource::Kepler(a), Resource::Kepler(b)) => a.extends(b).is_ok(), - (Resource::Other(a), Resource::Other(b)) => a.starts_with(b), - _ => false, - } +impl From for Resource { + fn from(id: ResourceId) -> Self { + Resource(id.into()) } +} - pub fn kepler_resource(&self) -> Option<&ResourceId> { - match self { - Resource::Kepler(id) => Some(id), - Resource::Other(_) => None, - } +impl From for Resource { + fn from(id: UriString) -> Self { + Resource(id.into()) } } -impl From for Resource { - fn from(id: ResourceId) -> Self { - Resource::Kepler(id) +impl From<&UriString> for Resource { + fn from(id: &UriString) -> Self { + Resource(id.into()) + } +} + +impl From<&UriStr> for Resource { + fn from(id: &UriStr) -> Self { + Resource(id.into()) + } +} + +impl From> for Resource { + fn from(id: AnyResource) -> Self { + Resource(id) + } +} + +impl<'a> From> for Resource { + fn from(id: AnyResource<&'a UriStr>) -> Self { + Resource(id.into()) } } impl From for Value { fn from(r: Resource) -> Self { - Value::String(Some(Box::new(match r { - Resource::Kepler(k) => k.to_string(), - Resource::Other(o) => o, - }))) + Value::String(Some(Box::new(r.to_string()))) } } @@ -54,15 +72,21 @@ impl sea_orm::TryGetable for Resource { res: &QueryResult, idx: I, ) -> Result { - let s: String = res.try_get_by(idx).map_err(sea_orm::TryGetError::DbErr)?; - Ok(Resource::from(s)) + Ok(res + .try_get_by::(idx)? + .parse() + .map_err(|e| DbErr::TryIntoErr { + from: "String", + into: "Resource", + source: Box::new(e), + })?) } } impl sea_orm::sea_query::ValueType for Resource { fn try_from(v: Value) -> Result { match v { - Value::String(Some(x)) => Ok(Resource::from(*x)), + Value::String(Some(s)) => s.parse().or(Err(sea_orm::sea_query::ValueTypeErr)), _ => Err(sea_orm::sea_query::ValueTypeErr), } } @@ -80,22 +104,16 @@ impl sea_orm::sea_query::ValueType for Resource { } } -impl From for Resource { - fn from(s: String) -> Self { - if let Ok(resource_id) = ResourceId::from_str(&s) { - Resource::Kepler(resource_id) - } else { - Resource::Other(s) - } +impl FromStr for Resource { + type Err = ::Err; + fn from_str(s: &str) -> Result { + Ok(Self(AnyResource::from_str(s)?)) } } impl Display for Resource { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Resource::Kepler(resource_id) => write!(f, "{}", resource_id), - Resource::Other(s) => write!(f, "{}", s), - } + write!(f, "{}", self.as_ref()) } } diff --git a/kepler-core/src/util.rs b/kepler-core/src/util.rs deleted file mode 100644 index 6166922e..00000000 --- a/kepler-core/src/util.rs +++ /dev/null @@ -1,232 +0,0 @@ -use crate::types::Resource; -use kepler_lib::{ - authorization::{KeplerDelegation, KeplerInvocation, KeplerRevocation}, - cacaos::siwe::Message, - libipld::Cid, - resource::OrbitId, - siwe_recap::{extract_capabilities, verify_statement, Capability as SiweCap}, - ssi::ucan::Capability as UcanCap, -}; -use serde::{Deserialize, Serialize}; -use std::str::FromStr; -use time::OffsetDateTime; - -#[derive(Serialize, Deserialize, Clone, Debug, Hash, PartialEq, Eq)] -pub struct Capability { - pub resource: Resource, - pub action: String, -} - -#[non_exhaustive] -#[derive(thiserror::Error, Debug)] -pub enum CapExtractError { - #[error("Default actions are not allowed for Kepler capabilities")] - DefaultActions, - #[error("Invalid Extra Fields")] - InvalidFields, - #[error(transparent)] - Cid(#[from] kepler_lib::libipld::cid::Error), -} - -fn extract_ucan_cap(c: &UcanCap) -> Result { - Ok(Capability { - resource: c.with.to_string().into(), - action: c.can.capability.clone(), - }) -} - -fn extract_siwe_cap(c: SiweCap) -> Result<(Vec, Vec), CapExtractError> { - if !c.default_actions.as_ref().is_empty() { - Err(CapExtractError::DefaultActions) - } else { - Ok(( - c.targeted_actions - .into_iter() - .flat_map(|(r, acs)| { - acs.into_iter() - .map(|action| Capability { - resource: Resource::from(r.clone()), - action, - }) - .collect::>() - }) - .collect(), - match &c - .extra_fields - .iter() - .map(|(n, a)| (n.as_str(), a)) - .collect::>()[..] - { - [] => vec![], - [("parents", serde_json::Value::Array(a))] => a - .iter() - .map(|s| { - s.as_str() - .map(Cid::from_str) - .ok_or(kepler_lib::libipld::cid::Error::ParsingError)? - }) - .collect::, kepler_lib::libipld::cid::Error>>()?, - _ => return Err(CapExtractError::InvalidFields), - }, - )) - } -} - -#[derive(Debug, Clone)] -pub struct DelegationInfo { - pub capabilities: Vec, - pub delegator: String, - pub delegate: String, - pub parents: Vec, - pub delegation: KeplerDelegation, - pub expiry: Option, - pub not_before: Option, - pub issued_at: Option, -} - -impl DelegationInfo { - pub fn orbits(&self) -> impl Iterator + '_ { - self.capabilities.iter().filter_map(|c| c.resource.orbit()) - } -} - -#[non_exhaustive] -#[derive(thiserror::Error, Debug)] -pub enum DelegationError { - #[error(transparent)] - InvalidCapability(#[from] CapExtractError), - #[error("Missing Delegator")] - MissingDelegator, - #[error("Missing Delegate")] - MissingDelegate, - #[error(transparent)] - SiweConversion(#[from] kepler_lib::cacaos::siwe_cacao::SIWEPayloadConversionError), - #[error(transparent)] - SiweCapError(#[from] kepler_lib::siwe_recap::Error), - #[error("Invalid Siwe Statement")] - InvalidStatement, -} - -impl TryFrom for DelegationInfo { - type Error = DelegationError; - fn try_from(d: KeplerDelegation) -> Result { - Ok(match d { - KeplerDelegation::Ucan(ref u) => Self { - capabilities: u - .payload - .attenuation - .iter() - .map(extract_ucan_cap) - .collect::, CapExtractError>>()?, - delegator: u.payload.issuer.clone(), - delegate: u.payload.audience.clone(), - parents: u.payload.proof.clone(), - expiry: OffsetDateTime::from_unix_timestamp_nanos( - (u.payload.expiration.as_seconds() * 1_000_000_000.0) as i128, - ) - .ok(), - not_before: u.payload.not_before.and_then(|t| { - OffsetDateTime::from_unix_timestamp_nanos( - (t.as_seconds() * 1_000_000_000.0) as i128, - ) - .ok() - }), - delegation: d, - issued_at: None, - }, - KeplerDelegation::Cacao(ref c) => { - let m: Message = c.payload().clone().try_into()?; - if !verify_statement(&m)? { - return Err(DelegationError::InvalidStatement); - }; - let (capabilities, parents) = extract_capabilities(&m)? - .remove(&"kepler".parse()?) - .map(extract_siwe_cap) - .transpose()? - .unwrap_or_default(); - Self { - capabilities, - delegator: c.payload().iss.to_string(), - delegate: c.payload().aud.to_string(), - parents, - expiry: c.payload().exp.as_ref().map(|t| *t.as_ref()), - not_before: c.payload().nbf.as_ref().map(|t| *t.as_ref()), - issued_at: Some(*c.payload().iat.as_ref()), - delegation: d, - } - } - }) - } -} - -#[derive(Debug, Clone)] -pub struct InvocationInfo { - pub capabilities: Vec, - pub invoker: String, - pub parents: Vec, - pub invocation: KeplerInvocation, -} - -impl InvocationInfo { - pub fn orbits(&self) -> impl Iterator + '_ { - self.capabilities.iter().filter_map(|c| c.resource.orbit()) - } -} - -#[non_exhaustive] -#[derive(thiserror::Error, Debug)] -pub enum InvocationError { - #[error("Missing Resource")] - MissingResource, - #[error(transparent)] - ResourceParse(#[from] CapExtractError), -} - -impl TryFrom for InvocationInfo { - type Error = InvocationError; - fn try_from(invocation: KeplerInvocation) -> Result { - Ok(Self { - capabilities: invocation - .payload - .attenuation - .iter() - .map(extract_ucan_cap) - .collect::, CapExtractError>>()?, - invoker: invocation.payload.issuer.clone(), - parents: invocation.payload.proof.clone(), - invocation, - }) - } -} - -#[derive(Debug, Clone)] -pub struct RevocationInfo { - // TODO these should be hash - pub parents: Vec, - pub revoked: Cid, - pub revoker: String, - pub revocation: KeplerRevocation, -} - -#[derive(thiserror::Error, Debug)] -pub enum RevocationError { - #[error("Invalid Target")] - InvalidTarget, -} - -impl TryFrom for RevocationInfo { - type Error = RevocationError; - fn try_from(r: KeplerRevocation) -> Result { - match r { - KeplerRevocation::Cacao(ref c) => match c.payload().aud.as_str().split_once(':') { - Some(("ucan", ps)) => Ok(Self { - parents: Vec::new(), - revoked: ps.parse().map_err(|_| RevocationError::InvalidTarget)?, - revoker: c.payload().iss.to_string(), - revocation: r, - }), - _ => Err(RevocationError::InvalidTarget), - }, - } - } -} diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 3c447cc2..00cdeb25 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -6,31 +6,28 @@ edition = "2021" [dependencies] async-trait = "0.1" iri-string = "0.6" -libipld = { version = "0.14", default-features = false, features = ["dag-cbor", "dag-json", "derive", "serde-codec"]} +libipld = { version = "0.16", default-features = false, features = ["dag-cbor", "dag-json", "derive", "serde-codec"]} serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" serde_with = "1.0" thiserror = "1" base64 = "0.13" -cacaos = "0.5" -siwe-recap = "0.1.0" +cacaos = { git = "https://github.com/spruceid/cacao-rs", branch = "feat/cacao-v3" } +siwe-recap = "0.2.0" lazy_static = "1.4" -did-method-key = { default-features = false, version = "0.2" } -did-tz = { default-features = false, version = "0.2" } -did-ethr = { default-features = false, version = "0.2" } -did-pkh = { version = "0.2" } -did-web = { default-features = false, version = "0.2" } -did-webkey = { default-features = false, version = "0.2" } -did-onion = { default-features = false, version = "0.2" } - -[target.'cfg(target_arch = "wasm32")'.dependencies] -uuid = { version = "1", features = ["v4", "js"] } - -[target.'cfg(not(target_arch = "wasm32"))'.dependencies] -uuid = { version = "1", features = ["v4"] } +did-method-key = { git = "https://github.com/spruceid/ssi", branch = "feat/ucan-0.10", default-features = false, version = "0.2" } +did-tz = { git = "https://github.com/spruceid/ssi", branch = "feat/ucan-0.10", default-features = false, version = "0.2" } +did-ethr = { git = "https://github.com/spruceid/ssi", branch = "feat/ucan-0.10", default-features = false, version = "0.2" } +did-pkh = { git = "https://github.com/spruceid/ssi", branch = "feat/ucan-0.10", version = "0.2" } +did-web = { git = "https://github.com/spruceid/ssi", branch = "feat/ucan-0.10", default-features = false, version = "0.2" } +did-webkey = { git = "https://github.com/spruceid/ssi", branch = "feat/ucan-0.10", default-features = false, version = "0.2" } +did-onion = { git = "https://github.com/spruceid/ssi", branch = "feat/ucan-0.10", default-features = false, version = "0.2" } +serde_ipld_dagcbor = "0.4" [dependencies.ssi] -version = "0.6" +git = "https://github.com/spruceid/ssi" +branch = "feat/ucan-0.10" +version = "0.7" default-features = false features = ["ed25519", "rsa", "secp256k1"] diff --git a/lib/src/authorization.rs b/lib/src/authorization.rs index 1254f10c..641fc55f 100644 --- a/lib/src/authorization.rs +++ b/lib/src/authorization.rs @@ -1,12 +1,11 @@ -use crate::resource::{ResourceCapErr, ResourceId}; -use cacaos::siwe_cacao::SiweCacao; -use libipld::{cbor::DagCborCodec, prelude::*}; -use ssi::{ - jwk::JWK, - ucan::{Payload, Ucan}, - vc::NumericDate, +use crate::resource::{AnyResource, ResourceId}; +use cacaos::{common::CommonCacao, varsig::either::EitherSignature, Cacao}; +use iri_string::types::{UriStr, UriString}; +use ssi::ucan::{capabilities::*, jose, jwt::Jwt, Revocation as URevocation, Ucan, UcanDecode}; +use std::{ + collections::BTreeMap, + iter::{FilterMap, Map}, }; -use uuid::Uuid; pub use libipld::Cid; @@ -17,123 +16,142 @@ pub trait HeaderEncode { Self: Sized; } -#[derive(Clone, Debug)] -pub enum KeplerDelegation { - Ucan(Box), - Cacao(Box), +pub type ResourceIter = Map::Item) -> O>; + +pub trait Resources<'a, RO: 'a = &'a UriStr, NB: 'a = serde_json::Value> { + type Iter: Iterator>)>; + fn grants(&'a self) -> Self::Iter; + fn resources(&'a self) -> ResourceIter { + self.grants().map(|(r, _)| r) + } } -impl HeaderEncode for KeplerDelegation { +pub type Delegation = CommonCacao; + +impl HeaderEncode for Delegation { fn encode(&self) -> Result { - use std::ops::Deref; - Ok(match self { - Self::Ucan(u) => u.encode()?, - Self::Cacao(c) => { - base64::encode_config(DagCborCodec.encode(c.deref())?, base64::URL_SAFE) + Ok(match self.signature().sig() { + EitherSignature::A(_) => { + base64::encode_config(serde_ipld_dagcbor::to_vec(self)?, base64::URL_SAFE) } + EitherSignature::B(_) => self.serialize_jwt()?.ok_or(EncodingError::NotAJwt)?, }) } fn decode(s: &str) -> Result<(Self, Vec), EncodingError> { Ok(if s.contains('.') { ( - Self::Ucan(Box::new(Ucan::decode(s)?)), + >::decode(s)?.try_into()?, s.as_bytes().to_vec(), ) } else { let v = base64::decode_config(s, base64::URL_SAFE)?; - (Self::Cacao(Box::new(DagCborCodec.decode(&v)?)), v) + (serde_ipld_dagcbor::from_slice(&v)?, v) }) } } -impl KeplerDelegation { - pub fn from_bytes(b: &[u8]) -> Result { - match DagCborCodec.decode(b) { - Ok(cacao) => Ok(Self::Cacao(Box::new(cacao))), - Err(_) => Ok(Self::Ucan(Box::new(Ucan::decode( - &String::from_utf8_lossy(b), - )?))), - } +impl<'a, NB: 'a, RO: 'a, F: 'a, S: 'a> Resources<'a, RO, NB> for Cacao +where + Capabilities: Resources<'a, RO, NB>, +{ + type Iter = as Resources<'a, RO, NB>>::Iter; + fn grants(&'a self) -> Self::Iter { + self.capabilities().grants() } } -// turn everything into url safe, b64-cacao or jwt +impl<'a, NB: 'a> Resources<'a, ResourceId, NB> for Capabilities { + type Iter = FilterMap< + std::collections::btree_map::Iter<'a, UriString, BTreeMap>>, + fn( + (&'a UriString, &'a BTreeMap>), + ) -> Option<(ResourceId, &'a BTreeMap>)>, + >; + fn grants(&'a self) -> Self::Iter { + self.abilities() + .iter() + .filter_map(|(r, a)| r.try_into().map(|k| (k, a)).ok()) + } +} -pub type KeplerInvocation = Ucan; +impl<'a, NB: 'a> Resources<'a, &'a UriStr, NB> for Capabilities { + type Iter = Map< + std::collections::btree_map::Iter<'a, UriString, BTreeMap>>, + fn( + (&'a UriString, &'a BTreeMap>), + ) -> (&'a UriStr, &'a BTreeMap>), + >; + fn grants(&'a self) -> Self::Iter { + self.abilities().iter().map(|(r, a)| (r.as_ref(), a)) + } +} -impl HeaderEncode for KeplerInvocation { - fn encode(&self) -> Result { - Ok(self.encode()?) +impl<'a, NB: 'a> Resources<'a, AnyResource, NB> for Capabilities { + type Iter = Map< + std::collections::btree_map::Iter<'a, UriString, BTreeMap>>, + fn( + (&'a UriString, &'a BTreeMap>), + ) -> (AnyResource, &'a BTreeMap>), + >; + fn grants(&'a self) -> Self::Iter { + self.abilities().iter().map(|(r, a)| (r.into(), a)) } - fn decode(s: &str) -> Result<(Self, Vec), EncodingError> { - Ok((Self::decode(s)?, s.as_bytes().to_vec())) +} + +impl<'a, NB: 'a> Resources<'a, AnyResource<&'a UriStr>, NB> for Capabilities { + type Iter = Map< + std::collections::btree_map::Iter<'a, UriString, BTreeMap>>, + fn( + (&'a UriString, &'a BTreeMap>), + ) -> ( + AnyResource<&'a UriStr>, + &'a BTreeMap>, + ), + >; + fn grants(&'a self) -> Self::Iter { + self.abilities().iter().map(|(r, a)| (r.into(), a)) } } -#[derive(Debug, Clone)] -pub enum KeplerRevocation { - Cacao(SiweCacao), +pub fn delegation_from_bytes(b: &[u8]) -> Result { + match serde_ipld_dagcbor::from_slice(b) { + Ok(cacao) => Ok(cacao), + Err(_) => Ok(>::decode(&String::from_utf8_lossy(b))?.try_into()?), + } } -impl HeaderEncode for KeplerRevocation { +pub type Invocation = CommonCacao; + +pub type Revocation = URevocation; + +impl HeaderEncode for Revocation { fn encode(&self) -> Result { - match self { - Self::Cacao(c) => Ok(base64::encode_config( - DagCborCodec.encode(&c)?, - base64::URL_SAFE, - )), - } + Ok(base64::encode_config( + serde_ipld_dagcbor::to_vec(&self)?, + base64::URL_SAFE, + )) } fn decode(s: &str) -> Result<(Self, Vec), EncodingError> { let v = base64::decode_config(s, base64::URL_SAFE)?; - Ok((Self::Cacao(DagCborCodec.decode(&v)?), v)) - } -} - -pub async fn make_invocation( - invocation_target: Vec, - delegation: Cid, - jwk: &JWK, - verification_method: String, - expiration: f64, - not_before: Option, - nonce: Option, -) -> Result { - Ok(Payload { - issuer: verification_method.clone(), - audience: verification_method, - not_before: not_before.map(NumericDate::try_from_seconds).transpose()?, - expiration: NumericDate::try_from_seconds(expiration)?, - nonce: Some(nonce.unwrap_or_else(|| format!("urn:uuid:{}", Uuid::new_v4()))), - facts: None, - proof: vec![delegation], - attenuation: invocation_target - .into_iter() - .map(|t| t.try_into()) - .collect::, _>>()?, + Ok((serde_ipld_dagcbor::from_slice(&v)?, v)) } - .sign(jwk.get_algorithm().unwrap_or_default(), jwk)?) -} - -#[derive(Debug, thiserror::Error)] -pub enum InvocationError { - #[error(transparent)] - ResourceCap(#[from] ResourceCapErr), - #[error(transparent)] - NumericDateConversion(#[from] ssi::jwt::NumericDateConversionError), - #[error(transparent)] - UCAN(#[from] ssi::ucan::error::Error), } #[derive(Debug, thiserror::Error)] pub enum EncodingError { #[error(transparent)] - SSIError(#[from] ssi::ucan::error::Error), + UCAN(#[from] ssi::ucan::jwt::DecodeError), + #[error(transparent)] + CacaoError(#[from] cacaos::common::Error), #[error(transparent)] - IpldError(#[from] libipld::error::Error), + ToIpldError(#[from] serde_ipld_dagcbor::EncodeError), #[error(transparent)] Base64(#[from] base64::DecodeError), + #[error(transparent)] + FromIpldError(#[from] serde_ipld_dagcbor::DecodeError), + #[error("CACAO not a JWT")] + NotAJwt, } pub enum CapabilitiesQuery { diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 9059f9da..6fda03f1 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -3,6 +3,7 @@ pub mod resolver; pub mod resource; pub use cacaos; +pub use iri_string; pub use libipld; pub use siwe_recap; pub use ssi; diff --git a/lib/src/resource.rs b/lib/src/resource.rs index 12274e0b..bc5b5a18 100644 --- a/lib/src/resource.rs +++ b/lib/src/resource.rs @@ -1,4 +1,7 @@ -use iri_string::{types::UriString, validate::Error as UriError}; +use iri_string::{ + types::{UriStr, UriString}, + validate::Error as UriError, +}; use libipld::{ cbor::DagCborCodec, cid::{ @@ -8,11 +11,9 @@ use libipld::{ codec::{Decode, Encode}, error::Error as IpldError, }; +use serde::{Deserialize, Serialize}; use serde_with::{DeserializeFromStr, SerializeDisplay}; -use ssi::{ - did::DIDURL, - ucan::{Capability, UcanResource, UcanScope}, -}; +use ssi::did::DIDURL; use std::io::{Read, Seek, Write}; use std::{convert::TryFrom, fmt, str::FromStr}; @@ -143,45 +144,6 @@ pub enum ResourceCapErr { MissingAction, } -impl TryInto for ResourceId { - type Error = ResourceCapErr; - fn try_into(self) -> Result { - Ok(Capability { - with: UcanResource::URI(ssi::vc::URI::String(format!( - "{}/{}{}", - &self.orbit, - &self.service.as_deref().unwrap_or(""), - &self.path.as_deref().unwrap_or("") - ))), - can: UcanScope { - namespace: match self.service { - Some(s) => format!("kepler.{s}"), - None => "kepler".to_string(), - }, - capability: self.fragment.ok_or(ResourceCapErr::MissingAction)?, - }, - additional_fields: None, - }) - } -} - -impl TryFrom<&Capability> for ResourceId { - type Error = KRIParseError; - fn try_from(c: &Capability) -> Result { - let n = &c.can.namespace; - let mut r = Self::from_str(&c.with.to_string())?; - if n.starts_with("kepler") - && ((n.get(6..7) == Some(".") && n.get(7..) == r.service.as_deref()) - || (n.get(6..7).is_none() && r.service.is_none())) - { - r.fragment = Some(c.can.capability.clone()); - Ok(r) - } else { - Err(KRIParseError::IncorrectForm) - } - } -} - #[derive(Error, Debug)] pub enum ResourceCheckError { #[error("Base and Extension Orbits do not match")] @@ -289,6 +251,27 @@ impl FromStr for ResourceId { } } +impl TryFrom for ResourceId { + type Error = KRIParseError; + fn try_from(u: UriString) -> Result { + u.as_str().parse() + } +} + +impl<'a> TryFrom<&'a UriStr> for ResourceId { + type Error = KRIParseError; + fn try_from(u: &'a UriStr) -> Result { + u.as_str().parse() + } +} + +impl TryFrom<&UriString> for ResourceId { + type Error = KRIParseError; + fn try_from(u: &UriString) -> Result { + u.as_str().parse() + } +} + impl Encode for ResourceId { fn encode(&self, c: DagCborCodec, w: &mut W) -> Result<(), IpldError> where @@ -307,6 +290,131 @@ impl Decode for ResourceId { } } +#[derive(Serialize, Deserialize, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[serde(untagged)] +pub enum AnyResource { + Kepler(ResourceId), + Other(O), +} + +impl AnyResource { + pub fn orbit(&self) -> Option<&OrbitId> { + match self { + AnyResource::Kepler(id) => Some(id.orbit()), + AnyResource::Other(_) => None, + } + } + + pub fn kepler_resource(&self) -> Option<&ResourceId> { + match self { + AnyResource::Kepler(id) => Some(id), + AnyResource::Other(_) => None, + } + } +} + +impl AnyResource +where + O: AsRef, +{ + pub fn extends>(&self, other: &AnyResource) -> bool { + match (self, other) { + (AnyResource::Kepler(a), AnyResource::Kepler(b)) => a.extends(b).is_ok(), + (AnyResource::Other(a), AnyResource::Other(b)) => a.as_ref().starts_with(b.as_ref()), + _ => false, + } + } +} + +impl From for AnyResource { + fn from(id: ResourceId) -> Self { + AnyResource::Kepler(id) + } +} + +impl<'a> From<&'a UriStr> for AnyResource<&'a UriStr> { + fn from(id: &'a UriStr) -> Self { + id.as_str() + .parse() + .map(AnyResource::Kepler) + .unwrap_or(AnyResource::Other(id)) + } +} + +impl<'a> From<&'a UriString> for AnyResource<&'a UriStr> { + fn from(id: &'a UriString) -> Self { + id.as_str() + .parse() + .map(AnyResource::Kepler) + .unwrap_or(AnyResource::Other(id)) + } +} + +impl From for AnyResource { + fn from(id: UriString) -> Self { + id.as_str() + .parse() + .map(AnyResource::Kepler) + .unwrap_or(AnyResource::Other(id)) + } +} + +impl From<&UriString> for AnyResource { + fn from(id: &UriString) -> Self { + id.as_str() + .parse() + .map(AnyResource::Kepler) + .unwrap_or(AnyResource::Other(id.clone())) + } +} + +impl From<&UriStr> for AnyResource { + fn from(id: &UriStr) -> Self { + id.as_str() + .parse() + .map(AnyResource::Kepler) + .unwrap_or(AnyResource::Other(id.to_owned())) + } +} + +impl<'a> From> for AnyResource<&'a UriStr> { + fn from(id: AnyResource<&'a UriString>) -> Self { + match id { + AnyResource::Kepler(id) => AnyResource::Kepler(id), + AnyResource::Other(id) => AnyResource::Other(id.as_ref()), + } + } +} + +impl<'a> From> for AnyResource { + fn from(id: AnyResource<&'a UriStr>) -> Self { + match id { + AnyResource::Kepler(id) => AnyResource::Kepler(id), + AnyResource::Other(id) => AnyResource::Other(id.to_owned()), + } + } +} + +impl std::fmt::Display for AnyResource { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + AnyResource::Kepler(resource_id) => write!(f, "{}", resource_id), + AnyResource::Other(s) => write!(f, "{}", s), + } + } +} + +impl FromStr for AnyResource { + type Err = KRIParseError; + fn from_str(s: &str) -> Result { + if s.starts_with("kepler:") { + Ok(AnyResource::Kepler(s.parse()?)) + } else { + Ok(AnyResource::Other(s.parse()?)) + } + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/sdk-wasm/src/lib.rs b/sdk-wasm/src/lib.rs index 064c7c23..b142a32b 100644 --- a/sdk-wasm/src/lib.rs +++ b/sdk-wasm/src/lib.rs @@ -75,7 +75,6 @@ pub fn invoke(session: String, service: String, path: String, action: String) -> serde_json::from_str(&session).map_err(authorization::Error::JSONDeserializing)?, vec![(service, path, action)], ) - .await .and_then(|headers| { serde_json::to_string(&headers).map_err(authorization::Error::JSONSerializing) }) @@ -99,7 +98,7 @@ pub fn siweToDelegationHeaders(signedSIWEMessage: String) -> Result, - ) -> Result { + pub fn from(session: Session, actions: Vec<(String, String, String)>) -> Result { Ok(Self { - invocation: session - .invoke(actions) - .await - .map_err(Error::FailedToMakeInvocation)?, + invocation: session.invoke(actions)?, }) } } impl DelegationHeaders { - pub fn new(delegation: KeplerDelegation) -> Self { + pub fn new(delegation: Delegation) -> Self { Self { delegation } } } @@ -38,7 +32,7 @@ impl DelegationHeaders { #[derive(Debug, thiserror::Error)] pub enum Error { #[error("failed to generate proof for invocation: {0}")] - FailedToMakeInvocation(kepler_lib::authorization::InvocationError), + FailedToMakeInvocation(#[from] crate::session::Error), #[error("failed to translate response to JSON: {0}")] JSONSerializing(serde_json::Error), #[error("failed to parse session from JSON: {0}")] diff --git a/sdk/src/serde_siwe.rs b/sdk/src/serde_siwe.rs index b6486601..f87d3b2f 100644 --- a/sdk/src/serde_siwe.rs +++ b/sdk/src/serde_siwe.rs @@ -14,8 +14,8 @@ pub mod address { } pub mod signature { + use crate::session::SIWESignature; use hex::FromHex; - use kepler_lib::cacaos::siwe_cacao::SIWESignature; use serde::de::{Deserialize, Deserializer, Error}; pub fn deserialize<'de, D>(d: D) -> Result @@ -24,7 +24,7 @@ pub mod signature { { String::deserialize(d).and_then(|sig| { <[u8; 65]>::from_hex(sig.strip_prefix("0x").unwrap_or(&sig)) - .map(Into::into) + .map(SIWESignature) .map_err(|e| D::Error::custom(format!("failed to parse SIWE signature: {e}"))) }) } diff --git a/sdk/src/session.rs b/sdk/src/session.rs index 4d1d3a46..69ca55df 100644 --- a/sdk/src/session.rs +++ b/sdk/src/session.rs @@ -1,27 +1,25 @@ use crate::authorization::DelegationHeaders; use http::uri::Authority; use kepler_lib::{ - authorization::{make_invocation, InvocationError, KeplerInvocation}, - cacaos::{ - siwe::{generate_nonce, Message, TimeStamp, Version as SIWEVersion}, - siwe_cacao::SIWESignature, - }, + authorization::{Delegation, Invocation}, + cacaos::siwe::{generate_nonce, Message, TimeStamp, Version as SIWEVersion}, libipld::Cid, resolver::DID_METHODS, resource::OrbitId, - siwe_recap::Builder, - ssi::{did::Source, jwk::JWK, vc::get_verification_method}, + ssi::{did::Source, jwk::JWK, ucan::capabilities::Capabilities, vc::get_verification_method}, }; use serde::{Deserialize, Serialize}; use serde_with::{serde_as, DisplayFromStr}; -use std::collections::HashMap; -use time::{ext::NumericalDuration, Duration, OffsetDateTime}; +use time::OffsetDateTime; + +pub struct SIWESignature(pub [u8; 65]); #[serde_as] #[derive(Deserialize, Clone)] #[serde(rename_all = "camelCase")] pub struct SessionConfig { - pub actions: HashMap>>, + #[serde(default)] + pub actions: Capabilities, #[serde(with = "crate::serde_siwe::address")] pub address: [u8; 20], pub chain_id: u64, @@ -77,38 +75,20 @@ pub struct Session { impl SessionConfig { fn into_message(self, delegate: &str) -> Result { - use serde_json::Value; - let ns = "kepler" - .parse() - .map_err(|e| format!("error parsing kepler as Siwe Capability namespace: {e}"))?; - let b = self - .actions - .into_iter() - .fold(Builder::new(), |builder, (service, actions)| { - actions.into_iter().fold(builder, |b, (path, action)| { - b.with_actions( - &ns, - self.orbit_id - .clone() - .to_resource(Some(service.clone()), Some(path), None) - .to_string(), - action, - ) - }) - }); - match self.parents { - Some(p) => b.with_extra_fields( - &ns, - [( - "parents".to_string(), - Value::Array(p.iter().map(|c| Value::String(c.to_string())).collect()), - )] + use kepler_lib::siwe_recap::Capability; + let caps = + self.actions + .into_inner() .into_iter() - .collect(), - ), - None => b, + .fold(Capability::new(), |mut caps, (k, v)| { + caps.with_actions(k, v); + caps + }); + match self.parents { + Some(p) => caps.with_proofs(&p), + None => caps, } - .build(Message { + .build_message(Message { address: self.address, chain_id: self.chain_id, domain: self.domain, @@ -129,29 +109,38 @@ impl SessionConfig { } impl Session { - pub async fn invoke( - self, - actions: Vec<(String, String, String)>, - ) -> Result { - let targets = actions - .into_iter() - .map(|(s, p, a)| self.orbit_id.clone().to_resource(Some(s), Some(p), Some(a))); + pub fn invoke(self, actions: Vec<(String, String, String)>) -> Result { + use kepler_lib::ssi::ucan::Payload; + use serde_json::Value; + let targets = + actions + .into_iter() + .try_fold(Capabilities::::new(), |mut acc, (s, p, a)| { + let action = format!("{s}/{a}"); + acc.with_action_convert( + self.orbit_id + .clone() + .to_resource(Some(s), Some(p), None) + .to_string(), + action, + [], + ) + .map_err(|_| Error::InvalidAction)?; + Ok::, Error>(acc) + })?; let now = OffsetDateTime::now_utc(); - let nanos = now.nanosecond(); let unix = now.unix_timestamp(); // 60 seconds in the future - let exp = (unix.seconds() + Duration::nanoseconds(nanos.into()) + Duration::MINUTE) - .as_seconds_f64(); - make_invocation( - targets.collect(), - self.delegation_cid, - &self.jwk, + let exp = unix + 60; + let mut p = Payload::::new( + self.verification_method.clone(), self.verification_method, - exp, - None, - None, - ) - .await + ); + p.expiration = Some(exp as u64); + p.proof = Some(vec![self.delegation_cid]); + p.nonce = Some(format!("urn:uuid:{}", uuid::Uuid::new_v4())); + p.capabilities = targets; + Ok(p.sign_with_jwk(&self.jwk, None)?.try_into()?) } } @@ -185,21 +174,14 @@ pub async fn prepare_session(config: SessionConfig) -> Result Result { - use kepler_lib::{ - authorization::KeplerDelegation, - cacaos::siwe_cacao::SiweCacao, - libipld::{cbor::DagCborCodec, multihash::Code, store::DefaultParams, Block}, - }; - let delegation = SiweCacao::new( - signed_session.session.siwe.into(), - signed_session.signature, - None, + use kepler_lib::libipld::multihash::{Code, MultihashDigest}; + let delegation = + Delegation::try_from((signed_session.session.siwe, signed_session.signature.0))?; + let delegation_cid = Cid::new_v1( + 0x71, + Code::Blake3_256.digest(&serde_ipld_dagcbor::to_vec(&delegation)?), ); - let delegation_cid = - *Block::::encode(DagCborCodec, Code::Blake3_256, &delegation) - .map_err(Error::UnableToGenerateCid)? - .cid(); - let delegation_header = DelegationHeaders::new(KeplerDelegation::Cacao(Box::new(delegation))); + let delegation_header = DelegationHeaders::new(delegation); Ok(Session { delegation_header, @@ -219,11 +201,17 @@ pub enum Error { #[error("unable to generate the SIWE message to start the session: {0}")] UnableToGenerateSIWEMessage(String), #[error("unable to generate the CID: {0}")] - UnableToGenerateCid(kepler_lib::libipld::error::Error), + UnableToGenerateCid(#[from] serde_ipld_dagcbor::EncodeError), #[error("failed to translate response to JSON: {0}")] JSONSerializing(serde_json::Error), #[error("failed to parse input from JSON: {0}")] JSONDeserializing(serde_json::Error), + #[error(transparent)] + CacaoError(#[from] kepler_lib::cacaos::common::Error), + #[error(transparent)] + UcanError(#[from] kepler_lib::ssi::ucan::payload::Error), + #[error("Invalid Actions or Resources")] + InvalidAction, } #[cfg(test)] @@ -232,8 +220,15 @@ pub mod test { use serde_json::json; pub async fn test_session() -> Session { let config = json!({ - "actions": { "kv": { "path": vec!["put", "get", "list", "del", "metadata"] }, - "capabilities": { "": vec!["read"] }}, + "actions": { + "kepler:pkh:eip155:1:0x7BD63AA37326a64d458559F44432103e3d6eEDE9://default/kv/path": { + "kv/put": [{}], + "kv/get": [{}], + "kv/list": [{}], + "kv/del": [{}], + "kv/metadata": [{}], + }, + }, "address": "0x7BD63AA37326a64d458559F44432103e3d6eEDE9", "chainId": 1u8, "domain": "example.com", @@ -259,7 +254,6 @@ pub mod test { test_session() .await .invoke(vec![("kv".into(), "path".into(), "get".into())]) - .await .expect("failed to create invocation"); } } diff --git a/sdk/src/siwe_utils.rs b/sdk/src/siwe_utils.rs index b33d1fc3..36a46d5c 100644 --- a/sdk/src/siwe_utils.rs +++ b/sdk/src/siwe_utils.rs @@ -1,15 +1,11 @@ use http::uri::Authority; -use kepler_lib::authorization::KeplerDelegation; -use kepler_lib::cacaos::{ - siwe::{generate_nonce, Message, TimeStamp, Version}, - siwe_cacao::{SIWESignature, SiweCacao}, -}; +use kepler_lib::cacaos::recap_cacao::siwe::{generate_nonce, Message, TimeStamp, Version}; use kepler_lib::resource::OrbitId; -use kepler_lib::siwe_recap::Builder; +use kepler_lib::siwe_recap::Capability; use serde::Deserialize; use serde_with::{serde_as, DisplayFromStr}; -use crate::authorization::DelegationHeaders; +use crate::{authorization::DelegationHeaders, session::SIWESignature}; #[serde_as] #[derive(Deserialize)] @@ -39,15 +35,14 @@ pub struct SignedMessage { impl TryFrom for Message { type Error = String; fn try_from(c: HostConfig) -> Result { - Builder::new() - .with_action( - &"kepler" - .parse() - .map_err(|e| format!("failed to parse kepler as namespace: {e}"))?, + Capability::::new() + .with_action_convert( c.orbit_id.to_resource(None, None, None).to_string(), - "host".to_string(), + "orbit/host".to_string(), + [], ) - .build(Self { + .map_err(|e| format!("failed to create capability: {}", e))? + .build_message(Self { address: c.address, chain_id: c.chain_id, domain: c.domain, @@ -72,12 +67,12 @@ pub fn generate_host_siwe_message(config: HostConfig) -> Result Message::try_from(config).map_err(Error::UnableToGenerateSIWEMessage) } -pub fn siwe_to_delegation_headers(signed_message: SignedMessage) -> DelegationHeaders { - DelegationHeaders::new(KeplerDelegation::Cacao(Box::new(SiweCacao::new( - signed_message.siwe.into(), - signed_message.signature, - None, - )))) +pub fn siwe_to_delegation_headers( + signed_message: SignedMessage, +) -> Result { + Ok(DelegationHeaders::new( + (signed_message.siwe, signed_message.signature.0).try_into()?, + )) } #[derive(Debug, thiserror::Error)] @@ -88,4 +83,6 @@ pub enum Error { JSONSerializing(serde_json::Error), #[error("failed to parse input from JSON: {0}")] JSONDeserializing(serde_json::Error), + #[error(transparent)] + CacaoError(#[from] kepler_lib::cacaos::common::Error), } diff --git a/src/auth_guards.rs b/src/auth_guards.rs index a500751d..8a42f782 100644 --- a/src/auth_guards.rs +++ b/src/auth_guards.rs @@ -1,14 +1,6 @@ use anyhow::Result; -use kepler_core::{ - types::Metadata, - util::{Capability, DelegationInfo}, - InvocationOutcome, -}; -use kepler_lib::{ - authorization::{EncodingError, HeaderEncode}, - libipld::cid::Cid, - resource::OrbitId, -}; +use kepler_core::{types::Metadata, InvocationOutcome}; +use kepler_lib::{authorization::Delegation, resource::OrbitId}; use rocket::{ data::{Capped, FromData}, futures::io::AsyncRead, @@ -19,7 +11,6 @@ use rocket::{ serde::json::Json, Data, }; -use serde::{Deserialize, Serialize}; use std::collections::{BTreeMap, HashMap}; use tokio_util::compat::FuturesAsyncReadCompatExt; use tracing::{info_span, Instrument}; @@ -88,13 +79,8 @@ where InvocationOutcome::OpenSessions(sessions) => Json( sessions .into_iter() - .map(|(hash, del)| { - Ok(( - hash.to_cid(0x55).to_string(), - CapJsonRep::from_delegation(del)?, - )) - }) - .collect::>>() + .map(|(hash, del)| Ok((hash.to_cid(0x55).to_string(), del))) + .collect::>>() .map_err(|_| Status::InternalServerError)?, ) .respond_to(request), @@ -115,27 +101,6 @@ where } } -#[derive(Serialize, Deserialize)] -pub struct CapJsonRep { - pub capabilities: Vec, - pub delegator: String, - pub delegate: String, - pub parents: Vec, - raw: String, -} - -impl CapJsonRep { - pub fn from_delegation(d: DelegationInfo) -> Result { - Ok(Self { - capabilities: d.capabilities, - delegator: d.delegator, - delegate: d.delegate, - parents: d.parents, - raw: d.delegation.encode()?, - }) - } -} - pub struct ObjectHeaders(pub Metadata); #[async_trait] diff --git a/src/authorization.rs b/src/authorization.rs index 4caaf330..ce64497f 100644 --- a/src/authorization.rs +++ b/src/authorization.rs @@ -1,26 +1,22 @@ -use kepler_core::{ - events::{FromReqErr, SerializedEvent}, - util::{DelegationInfo, InvocationInfo, RevocationInfo}, -}; -use kepler_lib::authorization::{KeplerDelegation, KeplerInvocation, KeplerRevocation}; +use kepler_core::events::SerializedEvent; +use kepler_lib::authorization::{Delegation, EncodingError, Revocation}; use rocket::{ http::Status, request::{FromRequest, Outcome, Request}, }; -use std::convert::TryFrom; pub struct AuthHeaderGetter(pub SerializedEvent); macro_rules! impl_fromreq { - ($type:ident, $inter:ident, $name:tt) => { + ($type:ident, $name:tt) => { #[rocket::async_trait] impl<'r> FromRequest<'r> for AuthHeaderGetter<$type> { - type Error = FromReqErr<<$type as TryFrom<$inter>>::Error>; + type Error = EncodingError; async fn from_request(request: &'r Request<'_>) -> Outcome { match request .headers() .get_one($name) - .map(SerializedEvent::<$type>::from_header_ser::<$inter>) + .map(SerializedEvent::<$type>::from_header_ser) { Some(Ok(e)) => Outcome::Success(AuthHeaderGetter(e)), Some(Err(e)) => Outcome::Failure((Status::Unauthorized, e)), @@ -31,78 +27,7 @@ macro_rules! impl_fromreq { }; } -impl_fromreq!(DelegationInfo, KeplerDelegation, "Authorization"); -impl_fromreq!(InvocationInfo, KeplerInvocation, "Authorization"); -impl_fromreq!(RevocationInfo, KeplerRevocation, "Authorization"); - -#[cfg(test)] -mod test { - use kepler_lib::{ - libipld::cid::Cid, - resolver::DID_METHODS, - ssi::{ - did::{Document, Source}, - did_resolve::DIDResolver, - jwk::{Algorithm, JWK}, - jws::Header, - ucan::{Capability, Payload}, - vc::NumericDate, - }, - }; - - async fn gen( - iss: &JWK, - aud: String, - caps: Vec, - exp: f64, - prf: Vec, - ) -> (Document, Thing) { - let did = DID_METHODS - .generate(&Source::KeyAndPattern(iss, "key")) - .unwrap(); - ( - DID_METHODS - .resolve(&did, &Default::default()) - .await - .1 - .unwrap(), - gen_ucan((iss, did), aud, caps, exp, prf).await, - ) - } - async fn gen_ucan( - iss: (&JWK, String), - audience: String, - attenuation: Vec, - exp: f64, - proof: Vec, - ) -> Thing { - let p = Payload { - issuer: iss.1, - audience, - attenuation, - proof, - nonce: None, - not_before: None, - facts: None, - expiration: NumericDate::try_from_seconds(exp).unwrap(), - } - .sign(Algorithm::EdDSA, iss.0) - .unwrap(); - Thing { - token: p.encode().unwrap(), - payload: p.payload, - header: p.header, - } - } - - #[derive(serde::Serialize)] - struct Thing { - pub token: String, - pub payload: Payload, - pub header: Header, - } - #[test] - async fn basic() -> anyhow::Result<()> { - Ok(()) - } -} +impl_fromreq!(Delegation, "Authorization"); +// currently delegations and invocations are really the same type +// impl_fromreq!(Invocation, "Authorization"); +impl_fromreq!(Revocation, "Authorization"); diff --git a/src/routes/mod.rs b/src/routes/mod.rs index 29bf536c..4970f154 100644 --- a/src/routes/mod.rs +++ b/src/routes/mod.rs @@ -14,11 +14,13 @@ use crate::{ use kepler_core::{ sea_orm::DbErr, storage::{ImmutableReadStore, ImmutableStaging}, - types::Resource, - util::{DelegationInfo, InvocationInfo}, TxError, TxStoreError, }; - +use kepler_lib::{ + authorization::{Delegation, Invocation, Resources}, + resource::ResourceId, + ssi::ucan::capabilities::ability::Ability, +}; pub mod util; use util::LimitedReader; @@ -60,7 +62,7 @@ pub async fn open_host_key( #[post("/delegate")] pub async fn delegate( - d: AuthHeaderGetter, + d: AuthHeaderGetter, req_span: TracingSpan, kepler: &State, ) -> Result { @@ -78,7 +80,7 @@ pub async fn delegate( ( match e { TxError::OrbitNotFound => Status::NotFound, - TxError::Db(DbErr::ConnectionAcquire) => Status::InternalServerError, + TxError::Db(DbErr::ConnectionAcquire(_)) => Status::InternalServerError, _ => Status::Unauthorized, }, e.to_string(), @@ -100,7 +102,7 @@ pub async fn delegate( #[post("/invoke", data = "")] pub async fn invoke( - i: AuthHeaderGetter, + i: AuthHeaderGetter, req_span: TracingSpan, headers: ObjectHeaders, data: DataIn<'_>, @@ -116,29 +118,27 @@ pub async fn invoke( .with_label_values(&["invoke"]) .start_timer(); - let mut put_iter = - i.0 .0 - .capabilities - .iter() - .filter_map(|c| match (&c.resource, c.action.as_str()) { - (Resource::Kepler(r), "put") if r.service() == Some("kv") => { - r.path().map(|p| (r.orbit(), p)) - } - _ => None, - }); + let d = Ability::new("kv/put").unwrap(); + let mut put_iter = Resources::<'_, ResourceId, _>::grants(&i.0 .0).filter_map(|(r, a)| { + let (o, s, p, _) = r.into_inner(); + match (s.as_deref(), p, a.contains_key(&d)) { + (Some("kv"), Some(p), true) => Some((o, p)), + _ => None, + } + }); let inputs = match (data, put_iter.next(), put_iter.next()) { (DataIn::None | DataIn::One(_), None, _) => HashMap::new(), (DataIn::One(d), Some((orbit, path)), None) => { let mut stage = staging - .stage(orbit) + .stage(&orbit) .await .map_err(|e| (Status::InternalServerError, e.to_string()))?; let open_data = d.open(1u8.gigabytes()).compat(); if let Some(limit) = config.storage.limit { let current_size = kepler - .store_size(orbit) + .store_size(&orbit) .await .map_err(|e| (Status::InternalServerError, e.to_string()))? .ok_or_else(|| (Status::NotFound, "orbit not found".to_string()))?; @@ -197,7 +197,7 @@ pub async fn invoke( ( match e { TxStoreError::Tx(TxError::OrbitNotFound) => Status::NotFound, - TxStoreError::Tx(TxError::Db(DbErr::ConnectionAcquire)) => { + TxStoreError::Tx(TxError::Db(DbErr::ConnectionAcquire(_))) => { Status::InternalServerError } _ => Status::Unauthorized, diff --git a/test/load/signer/Cargo.lock b/test/load/signer/Cargo.lock index 12188616..25578a78 100644 --- a/test/load/signer/Cargo.lock +++ b/test/load/signer/Cargo.lock @@ -14,9 +14,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -62,9 +62,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" dependencies = [ "memchr", ] @@ -86,9 +86,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.72" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "arrayref" @@ -138,7 +138,7 @@ dependencies = [ "async-lock", "async-task", "concurrent-queue", - "fastrand", + "fastrand 1.9.0", "futures-lite", "slab", ] @@ -172,17 +172,17 @@ dependencies = [ "log", "parking", "polling", - "rustix", + "rustix 0.37.23", "slab", - "socket2", + "socket2 0.4.9", "waker-fn", ] [[package]] name = "async-lock" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ "event-listener", ] @@ -222,13 +222,13 @@ checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" [[package]] name = "async-trait" -version = "0.1.71" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] @@ -286,7 +286,7 @@ checksum = "acee9fd5073ab6b045a275b3e709c163dd36c90685219cb21804a147b58dba43" dependencies = [ "async-trait", "axum-core", - "bitflags", + "bitflags 1.3.2", "bytes", "futures-util", "http", @@ -327,9 +327,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -388,9 +388,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "base64ct" @@ -410,6 +410,12 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf9ff0bbfd639f15c74af777d81383cf53efb7c93613f6cab67c6c11e05bbf8b" +[[package]] +name = "bech32" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" + [[package]] name = "bincode" version = "1.3.3" @@ -431,6 +437,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" + [[package]] name = "bitvec" version = "0.17.4" @@ -487,31 +499,31 @@ dependencies = [ [[package]] name = "blake2b_simd" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" +checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq 0.2.6", + "constant_time_eq 0.3.0", ] [[package]] name = "blake2s_simd" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6637f448b9e61dfadbdcbae9a885fadee1f3eaffb1f8d3c1965d3ade8bdfd44f" +checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq 0.2.6", + "constant_time_eq 0.3.0", ] [[package]] name = "blake3" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "199c42ab6972d92c9f8995f086273d25c42fc0f7b2a1fcefba465c1352d25ba5" +checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" dependencies = [ "arrayref", "arrayvec 0.7.4", @@ -578,7 +590,7 @@ dependencies = [ "async-lock", "async-task", "atomic-waker", - "fastrand", + "fastrand 1.9.0", "futures-lite", "log", ] @@ -602,11 +614,20 @@ dependencies = [ "sha2 0.9.9", ] +[[package]] +name = "bs58" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +dependencies = [ + "tinyvec", +] + [[package]] name = "bstr" -version = "1.6.0" +version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" +checksum = "4c2f7349907b712260e64b0afe2f84692af14a454be26187d9df565c7f69266a" dependencies = [ "memchr", "serde", @@ -624,9 +645,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byte-slice-cast" @@ -648,13 +669,39 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" dependencies = [ "serde", ] +[[package]] +name = "cacaos" +version = "0.5.0" +source = "git+https://github.com/spruceid/cacao-rs?branch=feat/cacao-v3#92661420efc40f9d2b1345e6366d848f238828bd" +dependencies = [ + "async-trait", + "hex", + "http", + "iri-string", + "libipld 0.16.0", + "multidid", + "serde", + "serde_json", + "siwe", + "siwe-recap 0.2.0", + "ssi-dids", + "ssi-jwk", + "ssi-jwt", + "ssi-ucan", + "thiserror", + "time", + "ucan-capabilities-object", + "url", + "varsig", +] + [[package]] name = "cacaos" version = "0.5.1" @@ -665,12 +712,12 @@ dependencies = [ "hex", "http", "iri-string", - "libipld", + "libipld 0.14.0", "serde", "serde_with 2.3.3", "siwe", "thiserror", - "time 0.3.23", + "time", "url", ] @@ -735,11 +782,23 @@ dependencies = [ "cipher", ] +[[package]] +name = "cbor4ii" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544cf8c89359205f4f990d0e6f3828db42df85b5dac95d09157a250eb0749c4" +dependencies = [ + "serde", +] + [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfb-mode" @@ -758,18 +817,17 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "serde", - "time 0.1.45", "wasm-bindgen", - "winapi", + "windows-targets", ] [[package]] @@ -780,7 +838,20 @@ checksum = "f6ed9c8b2d17acb8110c46f1da5bf4a696d745e1474a16db0cd2b49cd0249bf2" dependencies = [ "core2", "multibase 0.9.1", - "multihash", + "multihash 0.16.3", + "serde", + "unsigned-varint", +] + +[[package]] +name = "cid" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd94671561e36e4e7de75f753f577edafb0e7c05d6e4547229fdf7938fbcd2c3" +dependencies = [ + "core2", + "multibase 0.9.1", + "multihash 0.18.1", "serde", "serde_bytes", "unsigned-varint", @@ -812,7 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "634c509653de24b439672164bbf56f5f582a2ab0e313d3b0f6af0b7345cf2560" dependencies = [ "bincode", - "bs58", + "bs58 0.4.0", "coins-core", "digest 0.10.7", "getrandom 0.2.10", @@ -885,9 +956,9 @@ checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" [[package]] name = "const-oid" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] name = "constant_time_eq" @@ -895,12 +966,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" -[[package]] -name = "constant_time_eq" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" - [[package]] name = "constant_time_eq" version = "0.3.0" @@ -1010,9 +1075,9 @@ dependencies = [ [[package]] name = "crypto-bigint" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" +checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", @@ -1054,9 +1119,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.0.0-rc.3" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436ace70fc06e06f7f689d2624dc4e2f0ea666efb5aa704215f7249ae6e047a7" +checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" dependencies = [ "cfg-if", "cpufeatures", @@ -1077,7 +1142,7 @@ checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] @@ -1173,7 +1238,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] @@ -1217,7 +1282,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core 0.20.3", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] @@ -1269,21 +1334,30 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" dependencies = [ - "const-oid 0.9.4", + "const-oid 0.9.5", "zeroize", ] [[package]] name = "der" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7ed52955ce76b1554f509074bb357d3fb8ac9b51288a65a3fd480d1dfba946" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ - "const-oid 0.9.4", + "const-oid 0.9.5", "pem-rfc7468 0.7.0", "zeroize", ] +[[package]] +name = "deranged" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +dependencies = [ + "serde", +] + [[package]] name = "derivative" version = "2.2.0" @@ -1374,8 +1448,7 @@ dependencies = [ [[package]] name = "did-ethr" version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d22b1adcd156bf1041f87f80cd027bf6f82a34849bada30d59b869e831df19d" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "async-trait", "chrono", @@ -1391,8 +1464,7 @@ dependencies = [ [[package]] name = "did-method-key" version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "543b322ff52ab4892f4fd30ceb8fa1007aca4e3c5e89ad55793036846f0cc74e" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "async-trait", "multibase 0.8.0", @@ -1407,8 +1479,7 @@ dependencies = [ [[package]] name = "did-onion" version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8e1ba10a5415931c5d436a6343bbd72673a42284a16d4acd501fbfb9d882db5" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "async-trait", "http", @@ -1421,12 +1492,11 @@ dependencies = [ [[package]] name = "did-pkh" version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "074c4ae82880d60a25048cd3bf2e8aaaa881922d7c73fbb9ec29fc67fa0d33e4" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "async-trait", "bech32 0.8.1", - "bs58", + "bs58 0.4.0", "chrono", "iref", "serde", @@ -1441,12 +1511,11 @@ dependencies = [ [[package]] name = "did-tz" version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "562670fedf756b20c047dcf4ef88d020c5c86c2115f954fb3aef072952015ba4" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "anyhow", "async-trait", - "bs58", + "bs58 0.4.0", "chrono", "json-patch", "reqwest", @@ -1462,8 +1531,7 @@ dependencies = [ [[package]] name = "did-web" version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e239187ee5cf6b778c75252ad22bb8289508dcaf05a7c718222a3093460ca0d2" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "async-trait", "http", @@ -1475,8 +1543,7 @@ dependencies = [ [[package]] name = "did-webkey" version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88fb811ef9b08a872eac80c1d1bcb0cabf4cd6a205d75971d8864f06ea2a9c2a" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "anyhow", "async-trait", @@ -1517,7 +1584,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", - "const-oid 0.9.4", + "const-oid 0.9.5", "crypto-common", "subtle", ] @@ -1542,11 +1609,11 @@ dependencies = [ [[package]] name = "ecdsa" -version = "0.16.7" +version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0997c976637b606099b9985693efa3581e84e41f5c11ba5255f88711058ad428" +checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" dependencies = [ - "der 0.7.7", + "der 0.7.8", "digest 0.10.7", "elliptic-curve 0.13.5", "rfc6979 0.4.0", @@ -1565,9 +1632,9 @@ dependencies = [ [[package]] name = "ed25519" -version = "2.2.1" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb04eee5d9d907f29e80ee6b0e78f7e2c82342c63e3580d8c4f69d9d5aad963" +checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" dependencies = [ "pkcs8 0.10.2", "signature 2.1.0", @@ -1589,12 +1656,12 @@ dependencies = [ [[package]] name = "ed25519-dalek" -version = "2.0.0-rc.3" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa8e9049d5d72bfc12acbc05914731b5322f79b5e2f195e9f2d705fca22ab4c" +checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" dependencies = [ - "curve25519-dalek 4.0.0-rc.3", - "ed25519 2.2.1", + "curve25519-dalek 4.1.1", + "ed25519 2.2.2", "serde", "sha2 0.10.7", "zeroize", @@ -1602,9 +1669,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "elliptic-curve" @@ -1633,7 +1700,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" dependencies = [ "base16ct 0.2.0", - "crypto-bigint 0.5.2", + "crypto-bigint 0.5.3", "digest 0.10.7", "ff 0.13.0", "generic-array 0.14.7", @@ -1649,18 +1716,18 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] [[package]] name = "errno" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" dependencies = [ "errno-dragonfly", "libc", @@ -1991,6 +2058,12 @@ dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + [[package]] name = "ff" version = "0.12.1" @@ -2013,9 +2086,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.1.20" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" +checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d" [[package]] name = "fixed-hash" @@ -2040,9 +2113,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" dependencies = [ "crc32fast", "miniz_oxide", @@ -2144,7 +2217,7 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ - "fastrand", + "fastrand 1.9.0", "futures-core", "futures-io", "memchr", @@ -2171,7 +2244,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] @@ -2265,9 +2338,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "gloo-timers" @@ -2317,9 +2390,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.20" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -2375,9 +2448,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hex" @@ -2427,9 +2500,9 @@ dependencies = [ [[package]] name = "http-range-header" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" +checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" [[package]] name = "httparse" @@ -2439,9 +2512,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" @@ -2460,7 +2533,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -2803,9 +2876,9 @@ dependencies = [ [[package]] name = "json-number" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c724484d970b5aabe46934b9571980e255fd50a9ef1b13f23ed2b5c2a19bbb69" +checksum = "280f53da10842ffc42737ac8a6f2c14ced71f950de1cdb6765264a2eb1100cc5" dependencies = [ "lexical", "ryu-js", @@ -2826,9 +2899,9 @@ dependencies = [ [[package]] name = "json-syntax" -version = "0.9.4" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9043ed89d8285e64843df5e12696d5d14f1efc0642bdde62852239917fa7e1f" +checksum = "9f2f4557e0fe320cc102bdebf9fa9471b8513e13bb34b5fc23d7e270c5f9b1cc" dependencies = [ "contextual", "decoded-char", @@ -2881,7 +2954,7 @@ version = "0.2.0" dependencies = [ "async-trait", "base64 0.13.1", - "cacaos", + "cacaos 0.5.0", "did-ethr", "did-method-key", "did-onion", @@ -2891,14 +2964,14 @@ dependencies = [ "did-webkey", "iri-string", "lazy_static", - "libipld", + "libipld 0.16.0", "serde", + "serde_ipld_dagcbor", "serde_json", "serde_with 1.14.0", - "siwe-recap", + "siwe-recap 0.2.0", "ssi", "thiserror", - "uuid 1.4.1", ] [[package]] @@ -2911,11 +2984,13 @@ dependencies = [ "iri-string", "kepler-lib", "serde", + "serde_ipld_dagcbor", "serde_json", "serde_with 1.14.0", "thiserror", - "time 0.3.23", + "time", "tracing", + "uuid 1.4.1", ] [[package]] @@ -3017,9 +3092,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.147" +version = "0.2.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" [[package]] name = "libipld" @@ -3030,17 +3105,33 @@ dependencies = [ "async-trait", "cached", "fnv", - "libipld-cbor", - "libipld-cbor-derive", - "libipld-core", - "libipld-json", - "libipld-macro", + "libipld-cbor 0.14.0", + "libipld-cbor-derive 0.14.0", + "libipld-core 0.14.0", + "libipld-macro 0.14.0", "log", - "multihash", + "multihash 0.16.3", "parking_lot 0.12.1", "thiserror", ] +[[package]] +name = "libipld" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1ccd6b8ffb3afee7081fcaec00e1b099fd1c7ccf35ba5729d88538fcc3b4599" +dependencies = [ + "fnv", + "libipld-cbor 0.16.0", + "libipld-cbor-derive 0.16.0", + "libipld-core 0.16.0", + "libipld-json", + "libipld-macro 0.16.0", + "log", + "multihash 0.18.1", + "thiserror", +] + [[package]] name = "libipld-cbor" version = "0.14.0" @@ -3048,7 +3139,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8dd1ab68c9d26f20c7d0dfea6eecbae8c00359875210001b33ca27d4a02f3d09" dependencies = [ "byteorder", - "libipld-core", + "libipld-core 0.14.0", + "thiserror", +] + +[[package]] +name = "libipld-cbor" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77d98c9d1747aa5eef1cf099cd648c3fd2d235249f5fed07522aaebc348e423b" +dependencies = [ + "byteorder", + "libipld-core 0.16.0", "thiserror", ] @@ -3065,6 +3167,19 @@ dependencies = [ "synstructure", ] +[[package]] +name = "libipld-cbor-derive" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5ba3a729b72973e456a1812b0afe2e176a376c1836cc1528e9fc98ae8cb838" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + [[package]] name = "libipld-core" version = "0.14.0" @@ -3072,22 +3187,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d44790246ec6b7314cba745992c23d479d018073e66d49ae40ae1b64e5dd8eb5" dependencies = [ "anyhow", - "cid", + "cid 0.8.6", + "core2", + "multibase 0.9.1", + "multihash 0.16.3", + "thiserror", +] + +[[package]] +name = "libipld-core" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5acd707e8d8b092e967b2af978ed84709eaded82b75effe6cb6f6cc797ef8158" +dependencies = [ + "anyhow", + "cid 0.10.1", "core2", "multibase 0.9.1", - "multihash", + "multihash 0.18.1", "serde", "thiserror", ] [[package]] name = "libipld-json" -version = "0.14.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18aa481a87f084d98473dd9ece253a9569c762b75f6bbba8217d54e48c9d63b3" +checksum = "25856def940047b07b25c33d4e66d248597049ab0202085215dc4dca0487731c" dependencies = [ - "libipld-core", - "multihash", + "libipld-core 0.16.0", + "multihash 0.18.1", "serde", "serde_json", ] @@ -3098,7 +3227,16 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "852c011562ae5059b67c3a917f9f5945af5a68df8e39ede4444fff33274d25e2" dependencies = [ - "libipld-core", + "libipld-core 0.14.0", +] + +[[package]] +name = "libipld-macro" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71171c54214f866ae6722f3027f81dff0931e600e5a61e6b1b6a49ca0b5ed4ae" +dependencies = [ + "libipld-core 0.16.0", ] [[package]] @@ -3113,6 +3251,12 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +[[package]] +name = "linux-raw-sys" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" + [[package]] name = "lock_api" version = "0.4.10" @@ -3125,9 +3269,9 @@ dependencies = [ [[package]] name = "locspan" -version = "0.7.13" +version = "0.7.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685e26b5a3e4266c351baf3c00793a097e40f4293270ac508b3f4cbc41e72e54" +checksum = "6eb541fabac50f90782ec4fafa7b0b3961adc0d1862c7c7a863dc94ed5541d73" dependencies = [ "contextual", "hashbrown 0.13.2", @@ -3147,9 +3291,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" dependencies = [ "value-bag", ] @@ -3180,9 +3324,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] name = "mime" @@ -3244,13 +3388,40 @@ dependencies = [ "data-encoding-macro", ] +[[package]] +name = "multidid" +version = "0.1.0" +source = "git+https://github.com/spruceid/cacao-rs?branch=feat/cacao-v3#92661420efc40f9d2b1345e6366d848f238828bd" +dependencies = [ + "bech32 0.9.1", + "bs58 0.5.0", + "hex", + "iri-string", + "serde", + "sha3", + "thiserror", + "unsigned-varint", +] + [[package]] name = "multihash" version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c346cf9999c631f002d8f977c4eaeaa0e6386f16007202308d0b3757522c2cc" dependencies = [ - "blake2b_simd 1.0.1", + "blake3", + "core2", + "multihash-derive", + "unsigned-varint", +] + +[[package]] +name = "multihash" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfd8a792c1694c6da4f68db0a9d707c72bd260994da179e6030a5dcee00bb815" +dependencies = [ + "blake2b_simd 1.0.2", "blake2s_simd", "blake3", "core2", @@ -3317,9 +3488,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", @@ -3355,6 +3526,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "num-derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e6a0fd4f737c707bd9086cc16c925f294943eb62eb71499e9fd4cf71f8b9f4e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.37", +] + [[package]] name = "num-integer" version = "0.1.45" @@ -3378,9 +3560,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", "libm", @@ -3396,11 +3578,31 @@ dependencies = [ "libc", ] +[[package]] +name = "nutype" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "060a7fdadbae85c7063375e8fb9dd88c9ac336a22d1f0eb2fefd53dbf98edcb5" +dependencies = [ + "nutype_macros", +] + +[[package]] +name = "nutype_macros" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a0d2e869a6039d8b1d10f8a478f76538958808fbf95dae367875ee9635430b9" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "object" -version = "0.31.1" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -3450,11 +3652,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.55" +version = "0.10.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" +checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" dependencies = [ - "bitflags", + "bitflags 2.4.0", "cfg-if", "foreign-types", "libc", @@ -3471,7 +3673,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] @@ -3482,18 +3684,18 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "111.26.0+1.1.1u" +version = "300.1.5+3.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efc62c9f12b22b8f5208c23a7200a442b2e5999f8bdf80233852122b5a4f6f37" +checksum = "559068e4c12950d7dcaa1857a61725c0d38d4fc03ff8e070ab31a75d6e316491" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.90" +version = "0.9.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" +checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" dependencies = [ "cc", "libc", @@ -3525,7 +3727,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ - "ecdsa 0.16.7", + "ecdsa 0.16.8", "elliptic-curve 0.13.5", "primeorder", "sha2 0.10.7", @@ -3537,7 +3739,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70786f51bcc69f6a4c0360e063a4cac5419ef7c5cd5b3c99ad70f3be5ba79209" dependencies = [ - "ecdsa 0.16.7", + "ecdsa 0.16.8", "elliptic-curve 0.13.5", "primeorder", "sha2 0.10.7", @@ -3545,9 +3747,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.4" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8e946cc0cc711189c0b0249fb8b599cbeeab9784d83c415719368bb8d4ac64" +checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" dependencies = [ "arrayvec 0.7.4", "bitvec 1.0.1", @@ -3559,9 +3761,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.4" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a296c3079b5fefbc499e1de58dc26c09b1b9a5952d26694ee89f04a43ebbb3e" +checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -3687,12 +3889,12 @@ checksum = "b687ff7b5da449d39e418ad391e5e08da53ec334903ddbb921db208908fc372c" [[package]] name = "pgp" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37a79d6411154d1a9908e7a2c4bac60a5742f6125823c2c30780c7039aef02f0" +checksum = "27e1f8e085bfa9b85763fe3ddaacbe90a09cd847b3833129153a6cb063bbe132" dependencies = [ "aes", - "base64 0.21.2", + "base64 0.21.4", "bitfield", "block-padding 0.3.3", "blowfish", @@ -3705,10 +3907,11 @@ dependencies = [ "chrono", "cipher", "crc24", + "curve25519-dalek 4.1.1", "derive_builder 0.12.0", "des", "digest 0.10.7", - "ed25519-dalek 2.0.0-rc.3", + "ed25519-dalek 2.0.0", "elliptic-curve 0.13.5", "flate2", "generic-array 0.14.7", @@ -3718,13 +3921,13 @@ dependencies = [ "md-5", "nom", "num-bigint-dig", - "num-derive", + "num-derive 0.4.0", "num-traits", "p256 0.13.2", "p384", "rand 0.8.5", "ripemd", - "rsa 0.9.0-pre.2", + "rsa 0.9.2", "sha1", "sha2 0.10.7", "sha3", @@ -3748,29 +3951,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] name = "pin-project-lite" -version = "0.2.10" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -3795,7 +3998,7 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" dependencies = [ - "der 0.7.7", + "der 0.7.8", "pkcs8 0.10.2", "spki 0.7.2", ] @@ -3827,7 +4030,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der 0.7.7", + "der 0.7.8", "spki 0.7.2", ] @@ -3839,9 +4042,9 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "platforms" -version = "3.0.2" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" +checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" [[package]] name = "polling" @@ -3850,7 +4053,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" dependencies = [ "autocfg", - "bitflags", + "bitflags 1.3.2", "cfg-if", "concurrent-queue", "libc", @@ -3943,18 +4146,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.31" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -4067,7 +4270,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -4076,19 +4279,19 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] name = "regex" -version = "1.9.1" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.3", - "regex-syntax 0.7.4", + "regex-automata 0.3.8", + "regex-syntax 0.7.5", ] [[package]] @@ -4102,13 +4305,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.3" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" +checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.4", + "regex-syntax 0.7.5", ] [[package]] @@ -4119,17 +4322,17 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "reqwest" -version = "0.11.18" +version = "0.11.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", "bytes", "encoding_rs", "futures-core", @@ -4265,12 +4468,12 @@ dependencies = [ [[package]] name = "rsa" -version = "0.9.0-pre.2" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65db0998ad35adcaca498b7358992e088ee16cc783fe6fb899da203e113a63e5" +checksum = "6ab43bb47d23c1a631b4b680199a45255dce26fa9ab2fa902581f624ff13e6a8" dependencies = [ "byteorder", - "const-oid 0.9.4", + "const-oid 0.9.5", "digest 0.10.7", "num-bigint-dig", "num-integer", @@ -4280,6 +4483,7 @@ dependencies = [ "pkcs8 0.10.2", "rand_core 0.6.4", "signature 2.1.0", + "spki 0.7.2", "subtle", "zeroize", ] @@ -4311,19 +4515,32 @@ version = "0.37.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno", "io-lifetimes", "libc", - "linux-raw-sys", + "linux-raw-sys 0.3.8", + "windows-sys", +] + +[[package]] +name = "rustix" +version = "0.38.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "747c788e9ce8e92b12cd485c49ddf90723550b654b32508f979b71a7b1ecda4f" +dependencies = [ + "bitflags 2.4.0", + "errno", + "libc", + "linux-raw-sys 0.4.7", "windows-sys", ] [[package]] name = "rustls" -version = "0.21.5" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79ea77c539259495ce8ca47f53e66ae0330a8819f67e23ac96ca02f50e7b7d36" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ "log", "ring", @@ -4337,14 +4554,14 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", ] [[package]] name = "rustls-webpki" -version = "0.101.1" +version = "0.101.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f36a6828982f422756984e47912a7a51dcbc2a197aa791158f8ca61cd8204e" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" dependencies = [ "ring", "untrusted", @@ -4480,7 +4697,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct 0.2.0", - "der 0.7.7", + "der 0.7.8", "generic-array 0.14.7", "pkcs8 0.10.2", "subtle", @@ -4489,11 +4706,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.1" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", @@ -4502,9 +4719,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -4527,9 +4744,9 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.173" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91f70896d6720bc714a4a57d22fc91f1db634680e65c8efe13323f1fa38d53f" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] @@ -4564,13 +4781,25 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.173" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6250dde8342e0232232be9ca3db7aa40aceb5a3e5dd9bddbc00d99a007cde49" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", +] + +[[package]] +name = "serde_ipld_dagcbor" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e880e0b1f9c7a8db874642c1217f7e19b29e325f24ab9f0fcb11818adec7f01" +dependencies = [ + "cbor4ii", + "cid 0.10.1", + "scopeguard", + "serde", ] [[package]] @@ -4586,9 +4815,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.103" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", @@ -4631,7 +4860,7 @@ dependencies = [ "serde", "serde_json", "serde_with_macros 2.3.3", - "time 0.3.23", + "time", ] [[package]] @@ -4655,14 +4884,14 @@ dependencies = [ "darling 0.20.3", "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -4795,7 +5024,7 @@ dependencies = [ "rand 0.8.5", "sha3", "thiserror", - "time 0.3.23", + "time", ] [[package]] @@ -4812,11 +5041,29 @@ dependencies = [ "thiserror", ] +[[package]] +name = "siwe-recap" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054c5aea5227ca44212d3029576602ebefce5179d584bdfcc842997c73cc40d9" +dependencies = [ + "base64 0.12.3", + "cid 0.10.1", + "iri-string", + "serde", + "serde_jcs", + "serde_json", + "serde_with 2.3.3", + "siwe", + "thiserror", + "ucan-capabilities-object", +] + [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] @@ -4832,9 +5079,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "socket2" @@ -4846,6 +5093,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +dependencies = [ + "libc", + "windows-sys", +] + [[package]] name = "spin" version = "0.5.2" @@ -4879,7 +5136,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" dependencies = [ "base64ct", - "der 0.7.7", + "der 0.7.8", ] [[package]] @@ -4895,9 +5152,8 @@ dependencies = [ [[package]] name = "ssi" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a74add6dcfc3599495a73e953a7126ea19e9a0fc81860f5d593cabf1322cdf9" +version = "0.7.0" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "ssi-caips", "ssi-core", @@ -4907,7 +5163,7 @@ dependencies = [ "ssi-jwk", "ssi-jws", "ssi-jwt", - "ssi-ldp 0.2.1", + "ssi-ldp", "ssi-ssh", "ssi-tzkey", "ssi-ucan", @@ -4918,10 +5174,9 @@ dependencies = [ [[package]] name = "ssi-caips" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2c479690955bebece0279a5b1ab9d7d584402caed9f56ecec346d0bc63661f" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ - "bs58", + "bs58 0.4.0", "ssi-jwk", "thiserror", ] @@ -4929,14 +5184,12 @@ dependencies = [ [[package]] name = "ssi-contexts" version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3009b82cbae3d88a76f15460fb5fb3f30a1673eb0359ac6917ffaa3c57f7164" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" [[package]] name = "ssi-core" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e43f42016b80dc3e5eae8f7d2b22db3debbfe97b38e4fa449433497b3513048" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "async-trait", "serde", @@ -4946,10 +5199,9 @@ dependencies = [ [[package]] name = "ssi-crypto" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f41a12b15af9dce950a24a3295a2540be3b8500467621e31a97ddbe7618a5c8" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ - "bs58", + "bs58 0.4.0", "digest 0.9.0", "k256", "keccak-hash", @@ -4962,12 +5214,11 @@ dependencies = [ [[package]] name = "ssi-dids" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62e3c375b0fb2129c691e65e776c9105290ade34b56f39755f4f9c40ba98e41c" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "anyhow", "async-trait", - "bs58", + "bs58 0.4.0", "chrono", "derive_builder 0.9.0", "hex", @@ -4989,8 +5240,7 @@ dependencies = [ [[package]] name = "ssi-json-ld" version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50912984a4f415dd419853d461938b2daaa428dcafb8a5dfcde8dc07371371da" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "async-std", "combination", @@ -5011,19 +5261,18 @@ dependencies = [ [[package]] name = "ssi-jwk" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3c376df0c00621f6d8de45249e901cf2b3868bef84cf785fbcbce62842d815" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "base64 0.12.3", "blake2b_simd 0.5.11", - "bs58", + "bs58 0.4.0", "ed25519-dalek 1.0.1", "getrandom 0.2.10", "k256", "lazy_static", "multibase 0.9.1", "num-bigint", - "num-derive", + "num-derive 0.3.3", "num-traits", "p256 0.11.1", "rand 0.7.3", @@ -5040,8 +5289,7 @@ dependencies = [ [[package]] name = "ssi-jws" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df9e36ec8624a4f81f21b0e407f1c2209c2cd89c0ff3c27b928999682b2e8912" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "base64 0.12.3", "blake2", @@ -5062,8 +5310,7 @@ dependencies = [ [[package]] name = "ssi-jwt" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46522391b37f4b749911bb29b3960a7e2e0b9936c7debf52035f431480b40123" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "chrono", "serde", @@ -5074,52 +5321,19 @@ dependencies = [ "thiserror", ] -[[package]] -name = "ssi-ldp" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de930bb18e3ed3c1f7b0a2b2b4fdba2887dffff34bb5f44b9967a983fea2d60c" -dependencies = [ - "async-trait", - "bs58", - "chrono", - "grdf", - "hex", - "iref", - "json-syntax", - "k256", - "lazy_static", - "locspan", - "multibase 0.8.0", - "rdf-types", - "serde", - "serde_jcs", - "serde_json", - "ssi-caips", - "ssi-contexts", - "ssi-core", - "ssi-crypto", - "ssi-dids", - "ssi-json-ld", - "ssi-jwk", - "ssi-jws", - "static-iref", - "thiserror", -] - [[package]] name = "ssi-ldp" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bb057ad335a08d78deca3a7cf8f8393087ca99d64c038e97ff844ea66fbd475" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "async-trait", - "bs58", + "bs58 0.4.0", "chrono", "grdf", "hex", "iref", "json-syntax", + "k256", "lazy_static", "locspan", "multibase 0.8.0", @@ -5143,8 +5357,7 @@ dependencies = [ [[package]] name = "ssi-ssh" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22967c7882e2457a2813badebf613a1b6ea3240f77ccac5c7c03858806d56618" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "sshkeys", "ssi-jwk", @@ -5154,10 +5367,9 @@ dependencies = [ [[package]] name = "ssi-tzkey" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b57d919e20d214253a9a8dbc5f3b08ff555364934d99a09c828becab27a823" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ - "bs58", + "bs58 0.4.0", "ed25519-dalek 1.0.1", "ssi-jwk", "ssi-jws", @@ -5166,14 +5378,14 @@ dependencies = [ [[package]] name = "ssi-ucan" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0982f62c7860922026a9d9edc6c604de79693ee4c5c6bd65be11e2ff66b1df09" +version = "0.2.0" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "base64 0.12.3", "chrono", - "libipld", + "libipld 0.16.0", "serde", + "serde_jcs", "serde_json", "serde_with 1.14.0", "ssi-caips", @@ -5183,42 +5395,41 @@ dependencies = [ "ssi-jws", "ssi-jwt", "thiserror", + "ucan-capabilities-object", ] [[package]] name = "ssi-vc" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd7a9a9dc254d976962fea4501ed40097b8a7c23c15f076a7f46fa97ed886bc7" +version = "0.2.0" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "async-trait", "base64 0.12.3", "bitvec 0.20.4", - "cacaos", + "cacaos 0.5.1", "chrono", "flate2", "iref", - "libipld", - "multihash", + "libipld 0.14.0", + "multihash 0.16.3", "reqwest", "serde", "serde_json", - "siwe-recap", + "siwe-recap 0.1.0", "ssi-core", "ssi-dids", "ssi-json-ld", "ssi-jwk", "ssi-jws", "ssi-jwt", - "ssi-ldp 0.2.1", + "ssi-ldp", "thiserror", ] [[package]] name = "ssi-zcap-ld" version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8380152589e8876e91bb765ce1b363909bc071788c1550bfdb730152c5b7afe" +source = "git+https://github.com/spruceid/ssi?branch=feat/ucan-0.10#7c92ac58f5fd1cd2bc72fb0bc866949db33b9ab0" dependencies = [ "async-trait", "iref", @@ -5228,7 +5439,7 @@ dependencies = [ "ssi-dids", "ssi-json-ld", "ssi-jwk", - "ssi-ldp 0.3.0", + "ssi-ldp", "thiserror", ] @@ -5300,9 +5511,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.26" +version = "2.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c3457aacde3c65315de5031ec191ce46604304d2446e803d71ade03308d970" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ "proc-macro2", "quote", @@ -5335,36 +5546,35 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.6.0" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ - "autocfg", "cfg-if", - "fastrand", + "fastrand 2.0.0", "redox_syscall 0.3.5", - "rustix", + "rustix 0.38.14", "windows-sys", ] [[package]] name = "thiserror" -version = "1.0.43" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.43" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] @@ -5379,21 +5589,11 @@ dependencies = [ [[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.23" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" +checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" dependencies = [ + "deranged", "itoa", "serde", "time-core", @@ -5408,9 +5608,9 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.10" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ba15a897f3c86766b757e5ac7221554c6750054d74d5b28844fce5fb36a6c4" +checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" dependencies = [ "time-core", ] @@ -5441,11 +5641,10 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.29.1" +version = "1.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" dependencies = [ - "autocfg", "backtrace", "bytes", "libc", @@ -5454,7 +5653,7 @@ dependencies = [ "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.4", "tokio-macros", "windows-sys", ] @@ -5467,7 +5666,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] @@ -5504,9 +5703,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" dependencies = [ "bytes", "futures-core", @@ -5547,7 +5746,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" dependencies = [ - "bitflags", + "bitflags 1.3.2", "bytes", "futures-core", "futures-util", @@ -5593,7 +5792,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", ] [[package]] @@ -5671,9 +5870,21 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "ucan-capabilities-object" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f39597d86523b7f8028e7c05989fc64c1868f381e68ffc9c4b8540e5a891382" +dependencies = [ + "iri-string", + "nutype", + "serde", + "thiserror", +] [[package]] name = "uint" @@ -5695,9 +5906,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -5722,9 +5933,9 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "unsigned-varint" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" +checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" [[package]] name = "untrusted" @@ -5734,9 +5945,9 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -5781,6 +5992,16 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d92ccd67fb88503048c01b59152a04effd0782d035a83a6d256ce6085f08f4a3" +[[package]] +name = "varsig" +version = "0.1.0" +source = "git+https://github.com/spruceid/cacao-rs?branch=feat/cacao-v3#92661420efc40f9d2b1345e6366d848f238828bd" +dependencies = [ + "serde", + "thiserror", + "unsigned-varint", +] + [[package]] name = "vcpkg" version = "0.2.15" @@ -5801,9 +6022,9 @@ checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" [[package]] name = "walkdir" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", "winapi-util", @@ -5824,12 +6045,6 @@ 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" @@ -5857,7 +6072,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", "wasm-bindgen-shared", ] @@ -5891,7 +6106,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5927,24 +6142,11 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "webpki-roots" -version = "0.22.6" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" -dependencies = [ - "webpki", -] +checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" [[package]] name = "winapi" @@ -5964,9 +6166,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -5997,9 +6199,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -6012,53 +6214,54 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winreg" -version = "0.10.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "winapi", + "cfg-if", + "windows-sys", ] [[package]] @@ -6097,12 +6300,13 @@ dependencies = [ [[package]] name = "x25519-dalek" -version = "2.0.0-pre.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5da623d8af10a62342bcbbb230e33e58a63255a58012f8653c578e54bab48df" +checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" dependencies = [ - "curve25519-dalek 3.2.0", + "curve25519-dalek 4.1.1", "rand_core 0.6.4", + "serde", "zeroize", ] @@ -6123,5 +6327,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.37", ] diff --git a/test/load/signer/src/main.rs b/test/load/signer/src/main.rs index ea27393b..5a5e48a1 100644 --- a/test/load/signer/src/main.rs +++ b/test/load/signer/src/main.rs @@ -4,10 +4,10 @@ use ethers::{ prelude::rand::{prelude::StdRng, SeedableRng}, signers::{LocalWallet, Signer}, }; -use kepler_lib::{cacaos::siwe::TimeStamp, resource::OrbitId, ssi::jwk::JWK}; +use kepler_lib::{cacaos::siwe::TimeStamp, resource::OrbitId, ssi::{jwk::JWK, ucan::capabilities::Capabilities}, authorization::HeaderEncode}; use kepler_sdk::{ authorization::{DelegationHeaders, InvocationHeaders}, - session::{complete_session_setup, prepare_session, Session, SessionConfig, SignedSession}, + session::{complete_session_setup, prepare_session, Session, SessionConfig, SignedSession, SIWESignature}, siwe_utils::{ generate_host_siwe_message, siwe_to_delegation_headers, HostConfig, SignedMessage, }, @@ -31,22 +31,14 @@ async fn new_user(wallet: LocalWallet, jwk: JWK) -> User { String::from("default"), ); + let mut actions = Capabilities::new(); + actions.with_actions_convert( + orbit_id.clone().to_resource(Some("kv".into()), None, None).to_string(), + ["put", "get", "del", "metadata", "list"].into_iter().map(|a| (format!("kv/{a}"), [])) + ).unwrap(); + let session_config = SessionConfig { - actions: [( - "kv".into(), - [( - "".into(), - vec![ - "put".into(), - "get".into(), - "del".into(), - "metadata".into(), - "list".into(), - ], - )] - .into(), - )] - .into(), + actions, address: wallet.address().into(), chain_id: 1, domain: "localhost".try_into().unwrap(), @@ -64,7 +56,7 @@ async fn new_user(wallet: LocalWallet, jwk: JWK) -> User { .unwrap(); let session = complete_session_setup(SignedSession { session: prepared_session, - signature: signature.to_vec().try_into().unwrap(), + signature: SIWESignature(signature.to_vec().try_into().unwrap()), }) .unwrap(); @@ -89,12 +81,10 @@ struct OrbitParams { async fn create_orbit( Path(id): Path, Json(params): Json, - Extension(jwk): Extension>, Extension(users): Extension>>>, ) -> Json { let reader = users.read().await; let user = reader.get(&id).unwrap(); - let message = generate_host_siwe_message(HostConfig { address: user.session_config.address, chain_id: user.session_config.chain_id, @@ -107,8 +97,8 @@ async fn create_orbit( let signature = user.wallet.sign_message(message.to_string()).await.unwrap(); let delegation = siwe_to_delegation_headers(SignedMessage { siwe: message, - signature: signature.to_vec().try_into().unwrap(), - }); + signature: SIWESignature(signature.to_vec().try_into().unwrap()), + }).unwrap(); Json(delegation) } @@ -143,6 +133,7 @@ async fn create_session( .clone(), ) } + async fn invoke_session( Path(id): Path, Json(params): Json, @@ -152,7 +143,6 @@ async fn invoke_session( users.read().await.get(&id).unwrap().session.clone(), vec![("kv".into(), params.name, params.action)] ) - .await .unwrap(); Json(headers) }