diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index f6520e86..fb4e28b8 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -51,7 +51,7 @@ jobs: - id: cargo-set-version name: Set Version - run: cargo set-version --bump ${{ inputs.version }} + run: cargo set-version --bump ${{ inputs.version }} --exclude protocol - name: Set Crate Version as Environment Variable id: set_crate_version diff --git a/Cargo.lock b/Cargo.lock index 1cb4fe59..5486f9e5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -65,7 +65,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -183,14 +183,14 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] name = "addr2line" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] @@ -249,7 +249,7 @@ dependencies = [ [[package]] name = "agent" -version = "3.2.0" +version = "3.3.0" dependencies = [ "actix-rt", "actix-web", @@ -340,9 +340,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -355,49 +355,49 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.90" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37bf3594c4c988a53154954629820791dde498571819ae4ca50ca811e060cc95" +checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" [[package]] name = "arbitrary" -version = "1.3.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" dependencies = [ "derive_arbitrary", ] @@ -421,9 +421,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" @@ -491,7 +491,7 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bin" -version = "3.2.0" +version = "3.3.0" dependencies = [ "agent", "clap", @@ -585,9 +585,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "bytestring" @@ -621,9 +621,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.21" +version = "1.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" +checksum = "baee610e9452a8f6f0a1b6194ec09ff9e2d85dea54432acdae41aa0761c95d70" dependencies = [ "jobserver", "libc", @@ -738,7 +738,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -749,9 +749,9 @@ checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "const-oid" @@ -799,7 +799,7 @@ checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "controller" -version = "3.2.0" +version = "3.3.0" dependencies = [ "chrono", "dirs 5.0.1", @@ -1036,7 +1036,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -1090,13 +1090,13 @@ dependencies = [ [[package]] name = "derive_arbitrary" -version = "1.3.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" +checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -1109,7 +1109,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -1221,7 +1221,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -1325,9 +1325,9 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] @@ -1393,7 +1393,7 @@ dependencies = [ "proc-macro2", "quote", "syn 1.0.109", - "synstructure", + "synstructure 0.12.6", ] [[package]] @@ -1430,9 +1430,9 @@ checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "flate2" -version = "1.0.33" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" dependencies = [ "crc32fast", "miniz_oxide", @@ -1440,9 +1440,9 @@ dependencies = [ [[package]] name = "flume" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" dependencies = [ "futures-core", "futures-sink", @@ -1466,9 +1466,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -1481,9 +1481,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -1491,15 +1491,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -1508,32 +1508,32 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-timer" @@ -1543,9 +1543,9 @@ checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -1615,9 +1615,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "git2" @@ -1681,9 +1681,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" [[package]] name = "heck" @@ -1814,9 +1814,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -1832,9 +1832,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" dependencies = [ "bytes", "futures-channel", @@ -1859,7 +1859,7 @@ dependencies = [ "http 1.1.0", "hyper", "hyper-util", - "rustls 0.23.13", + "rustls 0.23.16", "rustls-native-certs 0.8.0", "rustls-pki-types", "tokio", @@ -1869,9 +1869,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.8" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ "bytes", "futures-channel", @@ -1882,7 +1882,6 @@ dependencies = [ "pin-project-lite", "socket2", "tokio", - "tower", "tower-service", "tracing", ] @@ -1910,27 +1909,156 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] name = "impl-more" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206ca75c9c03ba3d4ace2460e57b189f39f43de612c2f85836e65c929701bb2d" +checksum = "aae21c3177a27788957044151cc2800043d127acaa460a47ebb9b84dfa2c6aa0" [[package]] name = "indexmap" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", "hashbrown", @@ -1947,9 +2075,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.10.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is_debug" @@ -1980,9 +2108,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -2043,9 +2171,9 @@ checksum = "884609db30d6c40a6bd8e0e22b0b5002546e4dcb53295d33fc700b1644b8a656" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libgit2-sys" @@ -2081,6 +2209,12 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + [[package]] name = "local-channel" version = "0.1.5" @@ -2307,18 +2441,18 @@ dependencies = [ [[package]] name = "object" -version = "0.36.4" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "opaque-debug" @@ -2400,31 +2534,11 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.77", -] - [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -2454,9 +2568,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "poly1305" @@ -2507,16 +2621,16 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] [[package]] name = "protocol" -version = "0.3.0" +version = "0.2.0" dependencies = [ "actix-rt", "chrono", @@ -2549,7 +2663,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.23.13", + "rustls 0.23.16", "socket2", "thiserror", "tokio", @@ -2566,7 +2680,7 @@ dependencies = [ "rand 0.8.5", "ring", "rustc-hash", - "rustls 0.23.13", + "rustls 0.23.16", "slab", "thiserror", "tinyvec", @@ -2575,10 +2689,11 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" +checksum = "7d5a626c6807713b15cac82a6acaccd6043c9a5408c24baae07611fec3f243da" dependencies = [ + "cfg_aliases 0.2.1", "libc", "once_cell", "socket2", @@ -2688,9 +2803,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.4" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags", ] @@ -2708,9 +2823,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.6" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -2720,9 +2835,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", @@ -2737,9 +2852,9 @@ checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a" [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "relative-path" @@ -2749,9 +2864,9 @@ checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" [[package]] name = "reqwest" -version = "0.12.7" +version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" +checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" dependencies = [ "base64 0.22.1", "bytes", @@ -2771,8 +2886,8 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.13", - "rustls-native-certs 0.7.3", + "rustls 0.23.16", + "rustls-native-certs 0.8.0", "rustls-pemfile", "rustls-pki-types", "serde", @@ -2840,7 +2955,7 @@ dependencies = [ "regex", "relative-path", "rustc_version", - "syn 2.0.77", + "syn 2.0.87", "unicode-ident", ] @@ -2899,9 +3014,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.13" +version = "0.23.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +checksum = "eee87ff5d9b36712a58574e12e9f0ea80f915a5b0ac518d322b24a465617925e" dependencies = [ "once_cell", "ring", @@ -2939,19 +3054,18 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" [[package]] name = "rustls-webpki" @@ -2978,9 +3092,9 @@ checksum = "6518fc26bced4d53678a22d6e423e9d8716377def84545fe328236e3af070e7f" [[package]] name = "schannel" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ "windows-sys 0.59.0", ] @@ -3037,22 +3151,22 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -3172,9 +3286,9 @@ dependencies = [ [[package]] name = "shadow-rs" -version = "0.35.1" +version = "0.35.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2311e39772c00391875f40e34d43efef247b23930143a70ca5fbec9505937420" +checksum = "f1b2328fb3ec0d5302f95915e7e77cfc2ff943714d9970bc4b66e9eacf318687" dependencies = [ "const_format", "git2", @@ -3277,6 +3391,12 @@ dependencies = [ "der 0.7.9", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "strsim" version = "0.11.1" @@ -3302,9 +3422,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.77" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -3332,6 +3452,17 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "sysinfo" version = "0.30.13" @@ -3358,22 +3489,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -3409,6 +3540,16 @@ dependencies = [ "time-core", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -3426,9 +3567,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.40.0" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" dependencies = [ "backtrace", "bytes", @@ -3450,7 +3591,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -3470,7 +3611,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.13", + "rustls 0.23.16", "rustls-pki-types", "tokio", ] @@ -3505,36 +3646,15 @@ checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" [[package]] name = "toml_edit" -version = "0.22.21" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap", "toml_datetime", "winnow", ] -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" - [[package]] name = "tower-service" version = "0.3.3" @@ -3569,7 +3689,7 @@ checksum = "70977707304198400eb4835a78f6a9f928bf41bba420deb8fdb175cd965d77a7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -3613,27 +3733,12 @@ dependencies = [ "tz-rs", ] -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - [[package]] name = "unicode-ident" version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" -[[package]] -name = "unicode-normalization" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" -dependencies = [ - "tinyvec", -] - [[package]] name = "unicode-xid" version = "0.2.6" @@ -3664,15 +3769,27 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.2" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -3681,9 +3798,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "getrandom 0.2.15", "rand 0.8.5", @@ -3693,13 +3810,13 @@ dependencies = [ [[package]] name = "uuid-macro-internal" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee1cd046f83ea2c4e920d6ee9f7c3537ef928d75dce5d84a87c2c5d6b3999a3a" +checksum = "6b91f57fe13a38d0ce9e28a03463d8d3c2468ed03d75375110ec71d93b449a08" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -3737,9 +3854,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -3748,24 +3865,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -3775,9 +3892,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3785,28 +3902,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", @@ -3893,7 +4010,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -3904,7 +4021,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", ] [[package]] @@ -4087,13 +4204,25 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.18" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "x25519-dalek" version = "1.1.1" @@ -4117,6 +4246,30 @@ dependencies = [ "zeroize", ] +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure 0.13.1", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -4135,7 +4288,28 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", +] + +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure 0.13.1", ] [[package]] @@ -4155,7 +4329,29 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.87", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index dcc83f0e..1d3e5a94 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,14 +14,14 @@ keywords = ["did", "embedded", "iot", "root-of-trust"] license-file = "LICENSE" readme = "README.md" repository = "https://github.com/nodecross/nodex" -version = "3.2.0" +version = "3.3.0" [workspace.dependencies] actix-rt = "2.9.0" actix-web = "4.9.0" agent = { path = "./agent" } -anyhow = "1.0.90" -bytes = "1.6.1" +anyhow = "1.0.92" +bytes = "1.8.0" controller = { path = "./controller" } chrono = { version = "0.4", features = ["serde"] } cuid = "1.3.2" @@ -43,14 +43,14 @@ reqwest = { version = "0.12", features = [ ], default-features = false } rstest = "0.21.0" rumqttc = "0.24.0" -serde = { version = "1.0.209", features = ["derive"] } +serde = { version = "1.0.214", features = ["derive"] } serde_jcs = "0.1.0" serde_json = "1.0.132" sha2 = "0.10.8" shadow-rs = "0.35.1" sysinfo = "0.30.13" -thiserror = "1.0.64" -tokio = { version = "1.40.0", features = ["full"] } +thiserror = "1.0.69" +tokio = { version = "1.41.1", features = ["full"] } trait-variant = "0.1.2" url = "2.5.2" uuid = { version = "1.10.0", features = [ diff --git a/README.md b/README.md index d2130b27..6a257b96 100644 --- a/README.md +++ b/README.md @@ -28,10 +28,6 @@ This repo where we develop libraries to be installed into your devices. It enabl - Mutiple OS support for Linux kernel x86(32bit) & x86-64(64bit), FreeRTOS ARM Cortex-M33(32bit) - RoT extensions for TPM, ARM TrustZone, and Renesas SCE -## Install - -- [Build Guide](https://docs.nodecross.io/installation/00-overview.html) - ## Developer's Document - NodeX Official Website
diff --git a/agent/Cargo.toml b/agent/Cargo.toml index cf292094..5e4404a7 100644 --- a/agent/Cargo.toml +++ b/agent/Cargo.toml @@ -47,7 +47,7 @@ daemonize = "0.5.0" nix = { version = "0.29.0", features = ["signal"] } [build-dependencies] -shadow-rs = "0.35.1" +shadow-rs = "0.35.2" [dev-dependencies] rstest = { workspace = true } diff --git a/agent/src/controllers/internal/network.rs b/agent/src/controllers/internal/network.rs index 89ee184a..00574d3c 100644 --- a/agent/src/controllers/internal/network.rs +++ b/agent/src/controllers/internal/network.rs @@ -1,4 +1,7 @@ -use crate::services::studio::Studio; +use crate::{ + errors::{AgentError, AgentErrorCode}, + services::studio::Studio, +}; use actix_web::{web, HttpRequest, HttpResponse}; use serde::{Deserialize, Serialize}; use serde_json::Value; @@ -12,13 +15,13 @@ pub struct MessageContainer { pub async fn handler( _req: HttpRequest, web::Json(_): web::Json, -) -> actix_web::Result { +) -> actix_web::Result { let studio = Studio::new(); match studio.network().await { Ok(_) => Ok(HttpResponse::Ok().json("ok")), Err(e) => { log::error!("{:?}", e); - Ok(HttpResponse::InternalServerError().json("Internal Server Error")) + Err(AgentErrorCode::NetworkInternal)? } } } diff --git a/agent/src/controllers/internal/version.rs b/agent/src/controllers/internal/version.rs index dfba7864..5fbfe59c 100644 --- a/agent/src/controllers/internal/version.rs +++ b/agent/src/controllers/internal/version.rs @@ -1,4 +1,7 @@ -use crate::services::nodex::NodeX; +use crate::{ + errors::{AgentError, AgentErrorCode}, + services::nodex::NodeX, +}; use actix_web::{web, HttpRequest, HttpResponse}; use serde::{Deserialize, Serialize}; use serde_json::{json, Value}; @@ -18,18 +21,18 @@ pub async fn handler_get(_req: HttpRequest) -> actix_web::Result { pub async fn handler_update( _req: HttpRequest, web::Json(json): web::Json, -) -> actix_web::Result { +) -> actix_web::Result { let binary_url = match json.message["binary_url"].as_str() { Some(url) => url, - None => return Ok(HttpResponse::BadRequest().json("binary_url is required")), + None => Err(AgentErrorCode::VersionNoBinaryUrl)?, }; let path = match json.message["path"].as_str() { Some(p) => p, - None => return Ok(HttpResponse::BadRequest().json("path is required")), + None => Err(AgentErrorCode::VersionNoPath)?, }; let nodex = NodeX::new(); match nodex.update_version(binary_url, PathBuf::from(path)).await { Ok(_) => Ok(HttpResponse::Ok().json("ok")), - Err(_) => Ok(HttpResponse::InternalServerError().finish()), + Err(_) => Err(AgentErrorCode::VersionInternal)?, } } diff --git a/agent/src/controllers/public/mod.rs b/agent/src/controllers/public/mod.rs index b3130fc3..47b7cf8b 100644 --- a/agent/src/controllers/public/mod.rs +++ b/agent/src/controllers/public/mod.rs @@ -5,7 +5,7 @@ pub mod nodex_find_identifier; pub mod nodex_receive; pub mod nodex_verify_didcomm_message; pub mod nodex_verify_verifiable_message; -pub mod send_attributes; +pub mod send_attribute; pub mod send_custom_metric; pub mod send_event; mod utils; diff --git a/agent/src/controllers/public/nodex_create_didcomm_message.rs b/agent/src/controllers/public/nodex_create_didcomm_message.rs index 4532b408..683dda6c 100644 --- a/agent/src/controllers/public/nodex_create_didcomm_message.rs +++ b/agent/src/controllers/public/nodex_create_didcomm_message.rs @@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize}; use protocol::didcomm::encrypted::DidCommEncryptedServiceGenerateError as S; +use crate::errors::{AgentError, AgentErrorCode}; use crate::nodex::utils::did_accessor::DidAccessorImpl; use crate::usecase::didcomm_message_usecase::GenerateDidcommMessageUseCaseError as U; use crate::{services::studio::Studio, usecase::didcomm_message_usecase::DidcommMessageUseCase}; @@ -13,15 +14,28 @@ use super::utils; // NOTE: POST /create-didcomm-message #[derive(Deserialize, Serialize)] pub struct MessageContainer { + #[serde(default)] destination_did: String, + #[serde(default)] message: String, + #[serde(default)] operation_tag: String, } pub async fn handler( _req: HttpRequest, web::Json(json): web::Json, -) -> actix_web::Result { +) -> actix_web::Result { + if json.destination_did.is_empty() { + Err(AgentErrorCode::CreateDidCommMessageNoDestinationDid)? + } + if json.message.is_empty() { + Err(AgentErrorCode::CreateDidCommMessageNoMessage)? + } + if json.operation_tag.is_empty() { + Err(AgentErrorCode::CreateDidCommMessageNoOperationTag)? + } + let now = Utc::now(); let usecase = @@ -33,30 +47,30 @@ pub async fn handler( { Ok(v) => Ok(HttpResponse::Ok().body(v)), Err(e) => match e { - U::MessageActivity(e) => Ok(utils::handle_status(e)), + U::MessageActivity(e) => Err(utils::handle_status(e)), U::ServiceGenerate(S::DidDocNotFound(target)) => { - log::warn!("Target DID not found. did = {}", target); - Ok(HttpResponse::NotFound().finish()) + log::warn!("target DID not found. did = {}", target); + Err(AgentErrorCode::CreateDidCommMessageNoDid)? } U::ServiceGenerate(S::DidPublicKeyNotFound(e)) => { - log::warn!("cannot public key: {}", e); - Ok(HttpResponse::BadRequest().body(e.to_string())) + log::warn!("cannot find public key: {}", e); + Err(AgentErrorCode::CreateDidCommMessageNoPubKey)? } U::Json(e) | U::ServiceGenerate(S::Json(e)) => { log::warn!("json error: {}", e); - Ok(HttpResponse::InternalServerError().finish()) + Err(AgentErrorCode::CreateDidcommMessageInternal)? } U::ServiceGenerate(S::VcService(e)) => { - log::warn!("verify error: {}", e); - Ok(HttpResponse::Unauthorized().finish()) + log::warn!("verify failed: {}", e); + Err(AgentErrorCode::CreateDidCommMessageVerifyFailed)? } U::ServiceGenerate(S::SidetreeFindRequestFailed(e)) => { log::warn!("sidetree error: {}", e); - Ok(HttpResponse::InternalServerError().finish()) + Err(AgentErrorCode::CreateDidcommMessageInternal)? } U::ServiceGenerate(S::EncryptFailed(e)) => { log::warn!("decrypt failed: {}", e); - Ok(HttpResponse::InternalServerError().finish()) + Err(AgentErrorCode::CreateDidcommMessageInternal)? } }, } diff --git a/agent/src/controllers/public/nodex_create_identifier.rs b/agent/src/controllers/public/nodex_create_identifier.rs index 58ec1ad3..aafe5e1c 100644 --- a/agent/src/controllers/public/nodex_create_identifier.rs +++ b/agent/src/controllers/public/nodex_create_identifier.rs @@ -1,18 +1,20 @@ use actix_web::{HttpRequest, HttpResponse}; use serde::{Deserialize, Serialize}; +use crate::errors::{AgentError, AgentErrorCode}; + // NOTE: POST /identifiers #[derive(Deserialize, Serialize)] struct MessageContainer {} -pub async fn handler(_req: HttpRequest) -> actix_web::Result { +pub async fn handler(_req: HttpRequest) -> actix_web::Result { let service = crate::services::nodex::NodeX::new(); match service.create_identifier().await { Ok(v) => Ok(HttpResponse::Ok().json(&v)), Err(e) => { log::error!("{:?}", e); - Ok(HttpResponse::InternalServerError().finish()) + Err(AgentErrorCode::CreateIdentifierInternal)? } } } diff --git a/agent/src/controllers/public/nodex_create_verifiable_message.rs b/agent/src/controllers/public/nodex_create_verifiable_message.rs index 687d391a..a0279917 100644 --- a/agent/src/controllers/public/nodex_create_verifiable_message.rs +++ b/agent/src/controllers/public/nodex_create_verifiable_message.rs @@ -2,6 +2,7 @@ use actix_web::{web, HttpRequest, HttpResponse}; use chrono::Utc; use serde::{Deserialize, Serialize}; +use crate::errors::{AgentError, AgentErrorCode}; use crate::nodex::utils::did_accessor::DidAccessorImpl; use crate::usecase::verifiable_message_usecase::CreateVerifiableMessageUseCaseError as U; use crate::{ @@ -13,15 +14,27 @@ use super::utils; // NOTE: POST /create-verifiable-message #[derive(Deserialize, Serialize)] pub struct MessageContainer { + #[serde(default)] destination_did: String, + #[serde(default)] message: String, + #[serde(default)] operation_tag: String, } pub async fn handler( _req: HttpRequest, web::Json(json): web::Json, -) -> actix_web::Result { +) -> actix_web::Result { + if json.destination_did.is_empty() { + Err(AgentErrorCode::CreateVerifiableMessageNoDestinationDid)? + } + if json.message.is_empty() { + Err(AgentErrorCode::CreateVerifiableMessageNoMessage)? + } + if json.operation_tag.is_empty() { + Err(AgentErrorCode::CreateVerifiableMessageNoOperationTag)? + } let now = Utc::now(); let repo = utils::did_repository(); @@ -34,20 +47,20 @@ pub async fn handler( { Ok(v) => Ok(HttpResponse::Ok().body(v)), Err(e) => match e { - U::MessageActivity(e) => Ok(utils::handle_status(e)), + U::MessageActivity(e) => Err(utils::handle_status(e)), U::DestinationNotFound(e) => { if let Some(e) = e { log::error!("{:?}", e); } - Ok(HttpResponse::NotFound().finish()) + Err(AgentErrorCode::CreateVerifiableMessageNoTargetDid)? } U::DidVcServiceGenerate(e) => { log::error!("{:?}", e); - Ok(HttpResponse::InternalServerError().finish()) + Err(AgentErrorCode::CreateVerifiableMessageInternal)? } U::Json(e) => { log::warn!("json error: {}", e); - Ok(HttpResponse::InternalServerError().finish()) + Err(AgentErrorCode::CreateVerifiableMessageInternal)? } }, } diff --git a/agent/src/controllers/public/nodex_find_identifier.rs b/agent/src/controllers/public/nodex_find_identifier.rs index ec95890a..c88ac355 100644 --- a/agent/src/controllers/public/nodex_find_identifier.rs +++ b/agent/src/controllers/public/nodex_find_identifier.rs @@ -1,18 +1,23 @@ use actix_web::{web, HttpRequest, HttpResponse}; use serde::{Deserialize, Serialize}; +use crate::errors::{AgentError, AgentErrorCode}; + // NOTE: GET /identifiers/${ did } #[derive(Deserialize, Serialize)] struct MessageContainer {} -pub async fn handler(_req: HttpRequest, did: web::Path) -> actix_web::Result { +pub async fn handler( + _req: HttpRequest, + did: web::Path, +) -> actix_web::Result { let service = crate::services::nodex::NodeX::new(); match service.find_identifier(&did).await { Ok(v) => Ok(HttpResponse::Ok().json(&v)), Err(e) => { log::error!("{:?}", e); - Ok(HttpResponse::InternalServerError().finish()) + Err(AgentErrorCode::FindIdentifierInternal)? } } } diff --git a/agent/src/controllers/public/nodex_verify_didcomm_message.rs b/agent/src/controllers/public/nodex_verify_didcomm_message.rs index cdabef1e..96f20cec 100644 --- a/agent/src/controllers/public/nodex_verify_didcomm_message.rs +++ b/agent/src/controllers/public/nodex_verify_didcomm_message.rs @@ -5,6 +5,7 @@ use serde::{Deserialize, Serialize}; use protocol::didcomm::encrypted::DidCommEncryptedServiceVerifyError as S; use protocol::didcomm::types::DidCommMessage; +use crate::errors::{AgentError, AgentErrorCode}; use crate::nodex::utils::did_accessor::DidAccessorImpl; use crate::{ services::studio::Studio, @@ -18,60 +19,64 @@ use super::utils; // NOTE: POST /verify-verifiable-message #[derive(Deserialize, Serialize)] pub struct MessageContainer { + #[serde(default)] message: String, } pub async fn handler( _req: HttpRequest, web::Json(json): web::Json, -) -> actix_web::Result { +) -> actix_web::Result { let now = Utc::now(); let usecase = DidcommMessageUseCase::new(Studio::new(), utils::did_repository(), DidAccessorImpl {}); match serde_json::from_str::(&json.message) { - Err(e) => Ok(HttpResponse::BadRequest().body(e.to_string())), + Err(e) => { + log::warn!("json error: {}", e); + Err(AgentErrorCode::VerifyDidcommMessageJsonError)? + } Ok(message) => match usecase.verify(message, now).await { Ok(v) => Ok(HttpResponse::Ok().json(v)), Err(e) => match e { - U::MessageActivity(e) => Ok(utils::handle_status(e)), + U::MessageActivity(e) => Err(utils::handle_status(e)), U::NotAddressedToMe => { - log::warn!("its not to me: {}", e); - Ok(HttpResponse::Forbidden().finish()) + log::warn!("this message is not addressed to me: {}", e); + Err(AgentErrorCode::VerifyDidcommMessageNotAddressedToMe)? } U::ServiceVerify(S::FindSender(e)) => { log::warn!("cannot find sender: {}", e); - Ok(HttpResponse::BadRequest().body(e.to_string())) + Err(AgentErrorCode::VerifyDidcommMessageNoSender)? } U::ServiceVerify(S::DidPublicKeyNotFound(e)) => { - log::warn!("cannot public key: {}", e); - Ok(HttpResponse::BadRequest().body(e.to_string())) + log::warn!("cannot find public key: {}", e); + Err(AgentErrorCode::VerifyDidcommMessageNoPublicKey)? } U::ServiceVerify(S::MetadataBodyNotFound(e)) => { let e = e.map(|e| e.to_string()).unwrap_or("".to_string()); - log::warn!("cannot find sender: {}", e); - Ok(HttpResponse::BadRequest().body(e)) + log::warn!("cannot find metadata: {}", e); + Err(AgentErrorCode::VerifyDidcommMessageNoMetadata)? } U::ServiceVerify(S::VcService(e)) => { - log::warn!("verify error: {}", e); - Ok(HttpResponse::Unauthorized().finish()) + log::warn!("verify failed: {}", e); + Err(AgentErrorCode::VerifyDidcommMessageVerifyFailed)? } U::ServiceVerify(S::DidDocNotFound(target)) => { - log::warn!("Target DID not found. did = {}", target); - Ok(HttpResponse::NotFound().finish()) + log::warn!("target DID not found. DID = {}", target); + Err(AgentErrorCode::VerifyDidcommMessageNoTargetDid)? } U::Json(e) | U::ServiceVerify(S::Json(e)) => { log::warn!("json error: {}", e); - Ok(HttpResponse::InternalServerError().finish()) + Err(AgentErrorCode::VerifyDidcommMessageInternal)? } U::ServiceVerify(S::DecryptFailed(e)) => { log::warn!("decrypt failed: {}", e); - Ok(HttpResponse::InternalServerError().finish()) + Err(AgentErrorCode::VerifyDidcommMessageInternal)? } U::ServiceVerify(S::SidetreeFindRequestFailed(e)) => { log::warn!("sidetree error: {}", e); - Ok(HttpResponse::InternalServerError().finish()) + Err(AgentErrorCode::VerifyDidcommMessageInternal)? } }, }, diff --git a/agent/src/controllers/public/nodex_verify_verifiable_message.rs b/agent/src/controllers/public/nodex_verify_verifiable_message.rs index 842cc184..aafaf08b 100644 --- a/agent/src/controllers/public/nodex_verify_verifiable_message.rs +++ b/agent/src/controllers/public/nodex_verify_verifiable_message.rs @@ -5,6 +5,7 @@ use serde::{Deserialize, Serialize}; use protocol::verifiable_credentials::did_vc::DidVcServiceVerifyError as S; use protocol::verifiable_credentials::types::VerifiableCredentials; +use crate::errors::{AgentError, AgentErrorCode}; use crate::nodex::utils::did_accessor::DidAccessorImpl; use crate::usecase::verifiable_message_usecase::VerifyVerifiableMessageUseCaseError as U; use crate::{ @@ -16,13 +17,14 @@ use super::utils; // NOTE: POST /verify-verifiable-message #[derive(Deserialize, Serialize)] pub struct MessageContainer { + #[serde(default)] message: String, } pub async fn handler( _req: HttpRequest, web::Json(json): web::Json, -) -> actix_web::Result { +) -> actix_web::Result { let now = Utc::now(); let repo = utils::did_repository(); @@ -30,31 +32,37 @@ pub async fn handler( VerifiableMessageUseCase::new(Studio::new(), repo.clone(), DidAccessorImpl {}, repo); match serde_json::from_str::(&json.message) { - Err(e) => Ok(HttpResponse::BadRequest().body(e.to_string())), + Err(e) => { + log::warn!("json error: {}", e); + Err(AgentErrorCode::VerifyVerifiableMessageJsonError)? + } Ok(vc) => match usecase.verify(vc, now).await { Ok(v) => Ok(HttpResponse::Ok().json(v)), Err(e) => match e { - U::MessageActivity(e) => Ok(utils::handle_status(e)), + U::MessageActivity(e) => Err(utils::handle_status(e)), U::DidVcServiceVerify(S::VerifyFailed(e)) => { - log::warn!("verify error: {}", e); - Ok(HttpResponse::Unauthorized().finish()) + log::warn!("verify failed: {}", e); + Err(AgentErrorCode::VerifyVerifiableMessageVerifyFailed)? } U::DidVcServiceVerify(S::FindIdentifier(e)) => { log::warn!("find identifier error: {}", e); - Ok(HttpResponse::NotFound().finish()) + Err(AgentErrorCode::VerifyVerifiableMessageNoIdentifier)? } U::DidVcServiceVerify(S::DidDocNotFound(target)) => { - log::warn!("Target DID not found. did = {}", target); - Ok(HttpResponse::NotFound().finish()) + log::warn!("target DID not found. DID = {}", target); + Err(AgentErrorCode::VerifyVerifiableMessageNoTargetDid)? + } + U::NotAddressedToMe => { + log::warn!("this message is not addressed to me: {}", e); + Err(AgentErrorCode::VerifyVerifiableMessageNotAddressedToMe)? } - U::NotAddressedToMe => Ok(HttpResponse::Forbidden().finish()), U::Json(e) => { log::warn!("json error: {}", e); - Ok(HttpResponse::InternalServerError().finish()) + Err(AgentErrorCode::VerifyVerifiableMessageInternal)? } U::DidVcServiceVerify(S::PublicKeyNotFound(e)) => { - log::warn!("cannot public key: {}", e); - Ok(HttpResponse::BadRequest().body(e.to_string())) + log::warn!("cannot find public key: {}", e); + Err(AgentErrorCode::VerifyVerifiableMessageNoPublicKey)? } }, }, diff --git a/agent/src/controllers/public/send_attributes.rs b/agent/src/controllers/public/send_attribute.rs similarity index 75% rename from agent/src/controllers/public/send_attributes.rs rename to agent/src/controllers/public/send_attribute.rs index 171dcd59..800b3ba7 100644 --- a/agent/src/controllers/public/send_attributes.rs +++ b/agent/src/controllers/public/send_attribute.rs @@ -2,25 +2,28 @@ use actix_web::{web, HttpRequest, HttpResponse}; use serde::{Deserialize, Serialize}; use crate::{ + errors::{AgentError, AgentErrorCode}, repository::attribute_repository::AttributeStoreRequest, usecase::attribute_usecase::AttributeUsecase, }; #[derive(Deserialize, Serialize)] pub struct MessageContainer { + #[serde(default)] key_name: String, + #[serde(default)] value: String, } pub async fn handler( _req: HttpRequest, web::Json(json): web::Json, -) -> actix_web::Result { +) -> actix_web::Result { if json.key_name.is_empty() { - return Ok(HttpResponse::BadRequest().json("key_name is required")); + Err(AgentErrorCode::SendAttributeNoKeyName)? } if json.value.is_empty() { - return Ok(HttpResponse::BadRequest().json("value is required")); + Err(AgentErrorCode::SendAttributeNoValue)? } let usecase = AttributeUsecase::new(); @@ -37,7 +40,7 @@ pub async fn handler( } Err(e) => { log::error!("{:?}", e); - Ok(HttpResponse::InternalServerError().json("internal server error")) + Err(AgentErrorCode::SendAttributeInternal)? } } } diff --git a/agent/src/controllers/public/send_custom_metric.rs b/agent/src/controllers/public/send_custom_metric.rs index bddac1fc..58431959 100644 --- a/agent/src/controllers/public/send_custom_metric.rs +++ b/agent/src/controllers/public/send_custom_metric.rs @@ -1,38 +1,33 @@ +use super::utils::str2time; use actix_web::{web, HttpRequest, HttpResponse}; -use chrono::DateTime; + use serde::{Deserialize, Serialize}; use crate::{ + errors::{AgentError, AgentErrorCode}, repository::custom_metric_repository::CustomMetricStoreRequest, usecase::custom_metric_usecase::CustomMetricUsecase, }; #[derive(Deserialize, Serialize)] pub struct MessageContainer { + #[serde(default)] key: String, value: f32, + #[serde(default)] occurred_at: String, } pub async fn handler( _req: HttpRequest, web::Json(json): web::Json, -) -> actix_web::Result { +) -> actix_web::Result { if json.key.is_empty() { - return Ok(HttpResponse::BadRequest().json("key is required")); + Err(AgentErrorCode::SendCustomMetricNoKey)? } - let occurred_at = match json.occurred_at.parse::() { - Ok(timestamp) => match DateTime::from_timestamp(timestamp, 0) { - Some(dt) => dt, - _ => { - return Ok(HttpResponse::BadRequest().json("occurred_at is invalid format")); - } - }, - Err(_) => { - return Ok(HttpResponse::BadRequest().json("occurred_at is invalid format")); - } - }; + let occurred_at = + str2time(&json.occurred_at).ok_or(AgentErrorCode::SendCustomMetricInvalidOccurredAt)?; let usecase = CustomMetricUsecase::new(); match usecase @@ -49,7 +44,7 @@ pub async fn handler( } Err(e) => { log::error!("{:?}", e); - Ok(HttpResponse::InternalServerError().json("internal server error")) + Err(AgentErrorCode::SendCustomMetricInternal)? } } } diff --git a/agent/src/controllers/public/send_event.rs b/agent/src/controllers/public/send_event.rs index d865da34..af86f703 100644 --- a/agent/src/controllers/public/send_event.rs +++ b/agent/src/controllers/public/send_event.rs @@ -1,40 +1,38 @@ use actix_web::{web, HttpRequest, HttpResponse}; -use chrono::DateTime; + use serde::{Deserialize, Serialize}; use crate::{ - repository::event_repository::EventStoreRequest, usecase::event_usecase::EventUsecase, + errors::{AgentError, AgentErrorCode}, + repository::event_repository::EventStoreRequest, + usecase::event_usecase::EventUsecase, }; +use super::utils::str2time; + #[derive(Deserialize, Serialize)] pub struct MessageContainer { + #[serde(default)] key: String, + #[serde(default)] detail: String, + #[serde(default)] occurred_at: String, } pub async fn handler( _req: HttpRequest, web::Json(json): web::Json, -) -> actix_web::Result { +) -> actix_web::Result { if json.key.is_empty() { - return Ok(HttpResponse::BadRequest().json("key is required")); + Err(AgentErrorCode::SendEventNoKey)? } if json.detail.is_empty() { - return Ok(HttpResponse::BadRequest().json("detail is required")); + Err(AgentErrorCode::SendEventNoDetail)? } - let occurred_at = match json.occurred_at.parse::() { - Ok(timestamp) => match DateTime::from_timestamp(timestamp, 0) { - Some(dt) => dt, - _ => { - return Ok(HttpResponse::BadRequest().json("occurred_at is invalid format")); - } - }, - Err(_) => { - return Ok(HttpResponse::BadRequest().json("occurred_at is invalid format")); - } - }; + let occurred_at = + str2time(&json.occurred_at).ok_or(AgentErrorCode::SendEventInvalidOccurredAt)?; let usecase = EventUsecase::new(); match usecase @@ -51,7 +49,7 @@ pub async fn handler( } Err(e) => { log::error!("{:?}", e); - Ok(HttpResponse::InternalServerError().json("internal server error")) + Err(AgentErrorCode::SendEventInternal)? } } } diff --git a/agent/src/controllers/public/utils.rs b/agent/src/controllers/public/utils.rs index 69e5894f..67f96ddb 100644 --- a/agent/src/controllers/public/utils.rs +++ b/agent/src/controllers/public/utils.rs @@ -1,8 +1,9 @@ -use actix_web::HttpResponse; use anyhow::Context as _; +use chrono::{DateTime, Utc}; use protocol::did::did_repository::DidRepositoryImpl; +use crate::errors::{AgentError, AgentErrorCode}; use crate::nodex::utils::sidetree_client::SideTreeClient; use crate::repository::message_activity_repository::MessageActivityHttpError; use crate::server_config; @@ -15,28 +16,33 @@ pub fn did_repository() -> DidRepositoryImpl { DidRepositoryImpl::new(sidetree_client) } -pub fn handle_status(e: MessageActivityHttpError) -> HttpResponse { +pub fn handle_status(e: MessageActivityHttpError) -> AgentError { match e { MessageActivityHttpError::BadRequest(message) => { log::warn!("Bad Request: {}", message); - HttpResponse::BadRequest().body(message) - } - MessageActivityHttpError::Unauthorized(message) => { - log::warn!("Unauthorized: {}", message); - HttpResponse::Unauthorized().body(message) + AgentErrorCode::MessageActivityBadRequest.into() } MessageActivityHttpError::Forbidden(message) => { log::warn!("Forbidden: {}", message); - HttpResponse::Forbidden().body(message) + AgentErrorCode::MessageActivityForbidden.into() + } + MessageActivityHttpError::Unauthorized(message) => { + log::warn!("Unauthorized: {}", message); + AgentErrorCode::MessageActivityUnauthorized.into() } MessageActivityHttpError::NotFound(message) => { log::warn!("Not Found: {}", message); - HttpResponse::NotFound().body(message) + AgentErrorCode::MessageActivityNotFound.into() } MessageActivityHttpError::Conflict(message) => { log::warn!("Conflict: {}", message); - HttpResponse::Conflict().body(message) + AgentErrorCode::MessageActivityConflict.into() } - _ => HttpResponse::InternalServerError().finish(), + _ => AgentErrorCode::MessageActivityInternal.into(), } } + +pub fn str2time(value: &str) -> Option> { + let timestamp = value.parse::().ok()?; + DateTime::from_timestamp(timestamp, 0) +} diff --git a/agent/src/errors.rs b/agent/src/errors.rs new file mode 100644 index 00000000..ff9823f5 --- /dev/null +++ b/agent/src/errors.rs @@ -0,0 +1,170 @@ +use actix_web::HttpResponse; +use actix_web::{error, http::StatusCode}; +use serde::Serialize; +use std::convert::From; +use thiserror::Error; + +#[derive(Serialize, Clone, Copy, Debug, Error)] +pub enum AgentErrorCode { + #[error("binary_url is required")] + VersionNoBinaryUrl = 1001, + #[error("path is required")] + VersionNoPath = 1002, + #[error("destination_did is required")] + CreateDidCommMessageNoDestinationDid = 1003, + #[error("message is required")] + CreateDidCommMessageNoMessage = 1004, + #[error("operation_tag is required")] + CreateDidCommMessageNoOperationTag = 1005, + #[error("cannot find public key")] + CreateDidCommMessageNoPubKey = 1006, + #[error("destination_did is required")] + CreateVerifiableMessageNoDestinationDid = 1007, + #[error("message is required")] + CreateVerifiableMessageNoMessage = 1008, + #[error("operation_tag is required")] + CreateVerifiableMessageNoOperationTag = 1009, + #[error("sender not found")] + VerifyDidcommMessageNoSender = 1010, + #[error("public key not found")] + VerifyDidcommMessageNoPublicKey = 1011, + #[error("metadata not found")] + VerifyDidcommMessageNoMetadata = 1012, + #[error("json error")] + VerifyDidcommMessageJsonError = 1013, + #[error("public key not found")] + VerifyVerifiableMessageNoPublicKey = 1014, + #[error("json error")] + VerifyVerifiableMessageJsonError = 1015, + #[error("key_name is required")] + SendAttributeNoKeyName = 1016, + #[error("value is required")] + SendAttributeNoValue = 1017, + #[error("key is required")] + SendCustomMetricNoKey = 1018, + #[error("occurred_at is invalid format")] + SendCustomMetricInvalidOccurredAt = 1019, + #[error("key is invalid")] + SendEventNoKey = 1020, + #[error("detail is invalid")] + SendEventNoDetail = 1021, + #[error("occurred_at is invalid format")] + SendEventInvalidOccurredAt = 1022, + #[error("Bad Request")] + MessageActivityBadRequest = 1023, + + #[error("this message is not addressed to me")] + VerifyDidcommMessageNotAddressedToMe = 2001, + #[error("this message is not addressed to me")] + VerifyVerifiableMessageNotAddressedToMe = 2002, + #[error("Forbidden")] + MessageActivityForbidden = 2003, + + #[error("verify failed")] + CreateDidCommMessageVerifyFailed = 3001, + #[error("verify failed")] + VerifyDidcommMessageVerifyFailed = 3002, + #[error("verify failed")] + VerifyVerifiableMessageVerifyFailed = 3003, + #[error("Unauthorized")] + MessageActivityUnauthorized = 3004, + + #[error("target DID not found")] + CreateDidCommMessageNoDid = 4001, + #[error("target DID not found")] + CreateVerifiableMessageNoTargetDid = 4002, + #[error("target DID not found")] + VerifyDidcommMessageNoTargetDid = 4003, + #[error("identifier not found")] + VerifyVerifiableMessageNoIdentifier = 4004, + #[error("target DID not found")] + VerifyVerifiableMessageNoTargetDid = 4005, + #[error("Not Found")] + MessageActivityNotFound = 4006, + + #[error("Internal Server Error")] + NetworkInternal = 5001, + #[error("Internal Server Error")] + VersionInternal = 5002, + #[error("Internal Server Error")] + CreateDidcommMessageInternal = 5003, + #[error("Internal Server Error")] + CreateIdentifierInternal = 5004, + #[error("Internal Server Error")] + CreateVerifiableMessageInternal = 5005, + #[error("Internal Server Error")] + FindIdentifierInternal = 5006, + #[error("Internal Server Error")] + VerifyDidcommMessageInternal = 5007, + #[error("Internal Server Error")] + VerifyVerifiableMessageInternal = 5008, + #[error("Internal Server Error")] + SendAttributeInternal = 5009, + #[error("Internal Server Error")] + SendCustomMetricInternal = 5010, + #[error("Internal Server Error")] + SendEventInternal = 5011, + #[error("Internal Server Error")] + MessageActivityInternal = 5012, + + #[error("it have already been verified")] + MessageActivityConflict = 6001, +} + +#[derive(Serialize, Debug)] +pub struct AgentError { + code: u16, + message: String, +} + +impl std::fmt::Display for AgentError { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + write!(f, "code: {}, message: {}", self.code, self.message) + } +} + +impl AgentError { + pub fn new(code: AgentErrorCode) -> Self { + Self { + code: code as u16, + message: format!("{}", code), + } + } +} +impl From<&AgentError> for HttpResponse { + fn from(error: &AgentError) -> Self { + let code = error.code; + if (1000..2000).contains(&code) { + HttpResponse::BadRequest().json(error) + } else if (2000..3000).contains(&code) { + HttpResponse::Forbidden().json(error) + } else if (3000..4000).contains(&code) { + HttpResponse::Unauthorized().json(error) + } else if (4000..5000).contains(&code) { + HttpResponse::NotFound().json(error) + } else if (5000..6000).contains(&code) { + HttpResponse::InternalServerError().json(error) + } else if (6000..6100).contains(&code) { + HttpResponse::Conflict().json(error) + } else { + HttpResponse::InternalServerError().json(error) + } + } +} + +impl From for AgentError { + fn from(code: AgentErrorCode) -> Self { + AgentError::new(code) + } +} + +impl error::ResponseError for AgentError { + fn error_response(&self) -> HttpResponse { + self.into() + } + + fn status_code(&self) -> StatusCode { + let res: HttpResponse = self.into(); + res.status() + } +} diff --git a/agent/src/lib.rs b/agent/src/lib.rs index f325f378..c0266cb7 100644 --- a/agent/src/lib.rs +++ b/agent/src/lib.rs @@ -32,6 +32,7 @@ use usecase::metric_usecase::MetricUsecase; pub mod cli; mod config; mod controllers; +mod errors; mod handlers; mod network; mod nodex; diff --git a/agent/src/server.rs b/agent/src/server.rs index 3e09f88d..83b723c1 100644 --- a/agent/src/server.rs +++ b/agent/src/server.rs @@ -91,7 +91,7 @@ fn config_app( ) .route( "/attributes", - web::post().to(controllers::public::send_attributes::handler), + web::post().to(controllers::public::send_attribute::handler), ) // NOTE: Internal (Private) Routes .service( diff --git a/examples/python/src/sock.py b/examples/python/src/sock.py index 90790474..0af70445 100644 --- a/examples/python/src/sock.py +++ b/examples/python/src/sock.py @@ -2,6 +2,7 @@ import requests_unixsocket import json import urllib.parse +import sys # Create a session that can make requests to Unix sockets @@ -9,7 +10,11 @@ default_path = os.path.join(os.path.expanduser("~"), ".nodex/run/nodex.sock") path_by_installed_deb = "/home/nodex/.nodex/run/nodex.sock" -sock_path = path_by_installed_deb if os.path.exists(path_by_installed_deb) else default_path +sock_path = ( + path_by_installed_deb + if os.path.exists(path_by_installed_deb) + else default_path +) # Construct the base URL using the Unix socket path base = f'http+unix://{urllib.parse.quote(sock_path, safe="")}' @@ -21,25 +26,24 @@ def call(method, path, payload): print(f"- Method: {method.upper()}") print(f"- URL: {urllib.parse.unquote(url)}\n") - try: - if method == "get": - response = session.get(url) - elif method == "post": - response = session.post(url, json=payload) - else: - raise ValueError(f"Unsupported method: {method}") - - # Raises stored HTTPError, if one occurred. - response.raise_for_status() - if response.status_code == 204: - return "No content" - return json.dumps(response.json(), indent=4) - except Exception as e: - return ( - f"{e.response.status_code} " - f"{e.response.reason} " - f"{e.response.text}" + if method == "get": + response = session.get(url) + elif method == "post": + response = session.post(url, json=payload) + else: + raise ValueError(f"Unsupported method: {method}") + + if response.status_code != 200 and response.status_code != 204: + print( + f"{response.status_code} {response.reason}\n" + f"body : {json.dumps(response.json(), indent=4)}" ) + sys.exit(1) + + elif response.status_code == 204: + return "No content" + else: + return json.dumps(response.json(), indent=4) def get(path): diff --git a/protocol/Cargo.toml b/protocol/Cargo.toml index 96b0d39b..df121221 100644 --- a/protocol/Cargo.toml +++ b/protocol/Cargo.toml @@ -2,7 +2,7 @@ authors = { workspace = true } edition = { workspace = true } name = "protocol" -version = "0.3.0" +version = "0.2.0" [dependencies] chrono = { workspace = true }