diff --git a/.gitignore b/.gitignore index 2ad11bee5..3bdd7284b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ node_modules/ NOTES config/local* +http-server/target # KaTeX files *.min.css diff --git a/http-server/Cargo.lock b/http-server/Cargo.lock new file mode 100644 index 000000000..f87b76055 --- /dev/null +++ b/http-server/Cargo.lock @@ -0,0 +1,3248 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array", +] + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "aes-gcm" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", +] + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "amplify" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e711289a6cb28171b4f0e6c8019c69ff9476050508dc082167575d458ff74d0" +dependencies = [ + "amplify_derive", + "amplify_num", + "ascii", + "wasm-bindgen", +] + +[[package]] +name = "amplify_derive" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759dcbfaf94d838367a86d493ec34ccc8aa6fe365cb7880d6bf89006de24d9c1" +dependencies = [ + "amplify_syn", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "amplify_num" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04c009c5c4de814911b177e2ea59e4930bb918978ed3cce4900d846a6ceb0838" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "amplify_syn" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7736fb8d473c0d83098b5bac44df6a561e20470375cd8bcae30516dc889fd62a" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anstream" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" + +[[package]] +name = "anstyle-parse" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + +[[package]] +name = "anyhow" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" + +[[package]] +name = "ascii" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" + +[[package]] +name = "async-trait" +version = "0.1.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "autocfg" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" + +[[package]] +name = "axum" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" +dependencies = [ + "async-trait", + "axum-core", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper 1.0.1", + "tokio", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-auth" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8169113a185f54f68614fcfc3581df585d30bf8542bcb99496990e1025e4120a" +dependencies = [ + "async-trait", + "axum-core", + "base64 0.21.7", + "http", +] + +[[package]] +name = "axum-core" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper 0.1.2", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-server" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ad46c3ec4e12f4a4b6835e173ba21c25e484c9d02b49770bf006ce5367c036" +dependencies = [ + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "pin-project-lite", + "tokio", + "tower", + "tower-service", +] + +[[package]] +name = "backtrace" +version = "0.3.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base-x" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base32" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23ce669cd6c8588f79e15cf450314f9638f967fc5770ff1c7c1deb0925ea7cfa" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bcrypt-pbkdf" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6aeac2e1fe888769f34f05ac343bbef98b14d1ffb292ab69d4608b3abc86f2a2" +dependencies = [ + "blowfish", + "pbkdf2", + "sha2", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-padding" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" +dependencies = [ + "generic-array", +] + +[[package]] +name = "blowfish" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e412e2cd0f2b2d93e02543ceae7917b3c70331573df19ee046bcbc35e45e87d7" +dependencies = [ + "byteorder", + "cipher", +] + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" + +[[package]] +name = "cbc" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6" +dependencies = [ + "cipher", +] + +[[package]] +name = "cc" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" +dependencies = [ + "jobserver", + "libc", + "once_cell", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chacha20" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "chrono" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "windows-targets 0.52.5", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "colored" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" +dependencies = [ + "lazy_static", + "windows-sys 0.48.0", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "ct-codecs" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3b7eb4404b8195a9abb6356f4ac07d8ba267045c8d6d220ac4dc992e6cc75df" + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + +[[package]] +name = "cypheraddr" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5c54d2ad4ab9941383519471b75d12abc1a7b4779265e233168f2703a730d9" +dependencies = [ + "amplify", + "base32", + "cyphergraphy", + "sha3", +] + +[[package]] +name = "cyphergraphy" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67c16c8ef5ddcdab57aab83fd8e770540ea3682ccdae09642c63575b0da2184" +dependencies = [ + "amplify", + "ec25519", +] + +[[package]] +name = "cyphernet" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac949369884a7a1d802cc669821269c707be8cec4d65043382e253733d2e62e1" +dependencies = [ + "cypheraddr", + "cyphergraphy", + "socks5-client", +] + +[[package]] +name = "data-encoding" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" + +[[package]] +name = "data-encoding-macro" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20c01c06f5f429efdf2bae21eb67c28b3df3cf85b7dd2d8ef09c0838dac5d33e" +dependencies = [ + "data-encoding", + "data-encoding-macro-internal", +] + +[[package]] +name = "data-encoding-macro-internal" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0047d07f2c89b17dd631c80450d69841a6b5d7fb17278cbc43d7e4cfcf2576f3" +dependencies = [ + "data-encoding", + "syn 1.0.109", +] + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "dyn-clone" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" + +[[package]] +name = "ec25519" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdfd533a2fc01178c738c99412ae1f7e1ad2cb37c2e14bfd87e9d4618171c825" +dependencies = [ + "ct-codecs", + "ed25519", + "getrandom", +] + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature 2.2.0", + "spki", +] + +[[package]] +name = "ed25519" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "signature 1.6.4", +] + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "pkcs8", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "escargot" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f474c6844cbd04e783d0f25757583db4f491770ca618bedf2fb01815fc79939" +dependencies = [ + "log", + "once_cell", + "serde", + "serde_json", +] + +[[package]] +name = "fastrand" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "filetime" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "windows-sys 0.52.0", +] + +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "ghash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" +dependencies = [ + "opaque-debug", + "polyval", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "git-ref-format" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "137adab7111fcb575db6f07dae3a7d37f3c2630878954c9931f7135dfa33eeef" +dependencies = [ + "git-ref-format-core", + "git-ref-format-macro", +] + +[[package]] +name = "git-ref-format-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebb6549ddc63ba5722acb98c823b0eccb7f8b979407bd2a8fd616f581ae50982" +dependencies = [ + "serde", + "thiserror", +] + +[[package]] +name = "git-ref-format-macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18ffd0101a3bd9a3aba39602b8b20751ddb7ee11596debb58be3074209dad2ae" +dependencies = [ + "git-ref-format-core", + "proc-macro-error", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "git2" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "232e6a7bfe35766bf715e55a88b39a700596c0ccfd88cd3680b4cdb40d66ef70" +dependencies = [ + "bitflags 2.5.0", + "libc", + "libgit2-sys", + "log", + "url", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "h2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "816ec7294445779408f36fe57bc5b7fc1cf59664059096c65f905c1c61f58069" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +dependencies = [ + "bytes", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "block-padding", + "generic-array", +] + +[[package]] +name = "inquire" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fddf93031af70e75410a2511ec04d49e758ed2f26dad3404a934e0fb45cc12a" +dependencies = [ + "bitflags 2.5.0", + "dyn-clone", + "fxhash", + "newline-converter", + "once_cell", + "tempfile", + "termion 2.0.3", + "unicode-segmentation", + "unicode-width", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "jobserver" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin", +] + +[[package]] +name = "lexopt" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baff4b617f7df3d896f97fe922b64817f6cd9a756bb81d40f8883f2f66dcb401" + +[[package]] +name = "libc" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "libgit2-sys" +version = "0.16.2+1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee4126d8b4ee5c9d9ea891dd875cfdc1e9d0950437179104b183d7d8a74d24e8" +dependencies = [ + "cc", + "libc", + "libz-sys", + "pkg-config", +] + +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "libredox" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" +dependencies = [ + "bitflags 2.5.0", + "libc", + "redox_syscall", +] + +[[package]] +name = "libz-sys" +version = "1.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e143b5e666b2695d28f6bca6497720813f699c9602dd7f5cac91008b8ada7f9" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "localtime" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "016a009e0bb8ba6e3229fb74bf11a8fe6ef24542cc6ef35ef38863ac13f96d87" +dependencies = [ + "serde", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "lru" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +dependencies = [ + "hashbrown", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "multibase" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b3539ec3c1f04ac9748a260728e855f261b4977f5c3406612c884564f329404" +dependencies = [ + "base-x", + "data-encoding", + "data-encoding-macro", +] + +[[package]] +name = "newline-converter" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b6b097ecb1cbfed438542d16e84fd7ad9b0c76c8a65b7f9039212a3d14dc7f" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "nonempty" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ff7ac1e5ea23db6d61ad103e91864675049644bf47c35912336352fa4e9c109" + +[[package]] +name = "nonempty" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "995defdca0a589acfdd1bd2e8e3b896b4d4f7675a31fd14c32611440c7f608e6" +dependencies = [ + "serde", +] + +[[package]] +name = "normalize-line-endings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand", + "smallvec", + "zeroize", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "numtoa" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "p384" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70786f51bcc69f6a4c0360e063a4cac5419ef7c5cd5b3c99ad70f3be5ba79209" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "p521" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc9e2161f1f215afdfce23677034ae137bbd45016a880c2eb3ba8eb95f085b2" +dependencies = [ + "base16ct", + "ecdsa", + "elliptic-curve", + "primeorder", + "rand_core", + "sha2", +] + +[[package]] +name = "pbkdf2" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +dependencies = [ + "digest", +] + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.3.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.60", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs1" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" +dependencies = [ + "der", + "pkcs8", + "spki", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "poly1305" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" +dependencies = [ + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "polyval" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "pretty_assertions" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" +dependencies = [ + "diff", + "yansi", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "qcheck" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b439bd4242da51d62d18c95e6a6add749346756b0d1a587dfd0cc22fa6b5f3f0" +dependencies = [ + "rand", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radicle" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2c96b3901ca5b7bfe06da3fb18105c32dc5f9f5c48a217cfc7104385a687195" +dependencies = [ + "amplify", + "base64 0.21.7", + "chrono", + "colored", + "crossbeam-channel", + "cyphernet", + "fastrand", + "git2", + "libc", + "localtime", + "log", + "multibase", + "nonempty 0.9.0", + "once_cell", + "qcheck", + "radicle-cob", + "radicle-crypto", + "radicle-git-ext", + "radicle-ssh", + "serde", + "serde_json", + "siphasher", + "sqlite", + "tempfile", + "thiserror", + "unicode-normalization", +] + +[[package]] +name = "radicle-cli" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5347c326bec844b7ced9c8f8bcfec88104ea2066c029d49d5128dd09a4148c50" +dependencies = [ + "anyhow", + "chrono", + "git-ref-format", + "lexopt", + "localtime", + "log", + "nonempty 0.9.0", + "radicle", + "radicle-cli-test", + "radicle-cob", + "radicle-crypto", + "radicle-git-ext", + "radicle-surf", + "radicle-term", + "serde", + "serde_json", + "shlex", + "tempfile", + "thiserror", + "timeago", + "tree-sitter", + "tree-sitter-bash", + "tree-sitter-c", + "tree-sitter-css", + "tree-sitter-go", + "tree-sitter-highlight", + "tree-sitter-html", + "tree-sitter-json", + "tree-sitter-md", + "tree-sitter-python", + "tree-sitter-ruby", + "tree-sitter-rust", + "tree-sitter-toml", + "tree-sitter-typescript", + "zeroize", +] + +[[package]] +name = "radicle-cli-test" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5bbd1dc7cb2801693d6d00f937021adb0d398e9fec6b998e4830ebba32fdfdd" +dependencies = [ + "escargot", + "log", + "pretty_assertions", + "radicle", + "shlex", + "snapbox", + "thiserror", +] + +[[package]] +name = "radicle-cob" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36d8268661b22cec768bdf687aa9d98db2dcd9c8f974e8208f8658244074b539" +dependencies = [ + "fastrand", + "git2", + "log", + "nonempty 0.9.0", + "once_cell", + "radicle-crypto", + "radicle-dag", + "radicle-git-ext", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "radicle-crypto" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb86116dc5d9daa0d0b8e07fb71c9887d537b3fecebffc0cde6624b07176c711" +dependencies = [ + "amplify", + "cyphernet", + "ec25519", + "fastrand", + "multibase", + "qcheck", + "radicle-git-ext", + "radicle-ssh", + "serde", + "sqlite", + "ssh-key", + "thiserror", + "zeroize", +] + +[[package]] +name = "radicle-dag" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a678c3049a88ae6a34dd9f52ea9a5f9f066a0af63466b75cf8c48840303067" +dependencies = [ + "fastrand", +] + +[[package]] +name = "radicle-git-ext" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ba40f0288f73b9464c0f52c09261593777ed6f195ef3be6a12d8f8e920d7885" +dependencies = [ + "git-ref-format", + "git2", + "percent-encoding", + "radicle-std-ext", + "serde", + "thiserror", +] + +[[package]] +name = "radicle-httpd" +version = "0.10.0" +dependencies = [ + "anyhow", + "axum", + "axum-auth", + "axum-server", + "base64 0.21.7", + "chrono", + "fastrand", + "flate2", + "hyper", + "lexopt", + "lru", + "nonempty 0.9.0", + "pretty_assertions", + "radicle", + "radicle-cli", + "radicle-crypto", + "radicle-surf", + "radicle-term", + "serde", + "serde_json", + "tempfile", + "thiserror", + "time", + "tokio", + "tower", + "tower-http", + "tracing", + "tracing-logfmt", + "tracing-subscriber", + "ureq", + "url", +] + +[[package]] +name = "radicle-signals" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0633d483e40eb96a8e57264727f1c4f0d188348eb5c155cf1369469c121c6c87" +dependencies = [ + "crossbeam-channel", + "libc", +] + +[[package]] +name = "radicle-ssh" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbee758010fb64482be4b18591fbeb3cbc15b16450d143edf4edb5484c7366c6" +dependencies = [ + "byteorder", + "log", + "thiserror", + "zeroize", +] + +[[package]] +name = "radicle-std-ext" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db20136bbc9ae63f3fec8e5a6c369f4902fac2244501b5dfc6d668e43475aaa4" + +[[package]] +name = "radicle-surf" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fae23233ff8be809a822d923e93e56e5282179039b19f345f39f592c1ca0765" +dependencies = [ + "anyhow", + "base64 0.13.1", + "flate2", + "git2", + "log", + "nonempty 0.5.0", + "radicle-git-ext", + "radicle-std-ext", + "serde", + "tar", + "thiserror", + "url", +] + +[[package]] +name = "radicle-term" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a46c7b39b0fabe11cbb1f697979f1e1021122aef76b476f5d385c48a02400310" +dependencies = [ + "anstyle-query", + "anyhow", + "crossbeam-channel", + "git2", + "inquire", + "libc", + "once_cell", + "radicle-signals", + "shlex", + "termion 3.0.0", + "thiserror", + "unicode-display-width", + "unicode-segmentation", + "zeroize", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_termios" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20145670ba436b55d91fc92d25e71160fbfbdd57831631c8d7d36377a476f1cb" + +[[package]] +name = "regex" +version = "1.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.3", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "rsa" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" +dependencies = [ + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core", + "sha2", + "signature 2.2.0", + "spki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustversion" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" + +[[package]] +name = "ryu" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "serde" +version = "1.0.198" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.198" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "serde_json" +version = "1.0.116" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" +dependencies = [ + "indexmap", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" +dependencies = [ + "itoa", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "similar" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa42c91313f1d05da9b26f267f931cf178d4aba455b4c4622dd7355eb80c6640" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "snapbox" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b831b6e80fbcd2889efa75b185d24005f85981431495f995292b25836519d84" +dependencies = [ + "anstream", + "anstyle", + "normalize-line-endings", + "similar", + "snapbox-macros", +] + +[[package]] +name = "snapbox-macros" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1c4b838b05d15ab22754068cb73500b2f3b07bf09d310e15b27f88160f1de40" +dependencies = [ + "anstream", +] + +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "socks5-client" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc7dcf6fab1d65d82d633006a4cc658d76ce436e01cf1a7c71873c0eeba324c" +dependencies = [ + "amplify", + "cypheraddr", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "sqlite" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03801c10193857d6a4a71ec46cee198a15cbc659622aabe1db0d0bdbefbcf8e6" +dependencies = [ + "libc", + "sqlite3-sys", +] + +[[package]] +name = "sqlite3-src" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfc95a51a1ee38839599371685b9d4a926abb51791f0bc3bf8c3bb7867e6e454" +dependencies = [ + "cc", + "pkg-config", +] + +[[package]] +name = "sqlite3-sys" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2752c669433e40ebb08fde824146f50d9628aa0b66a3b7fc6be34db82a8063b" +dependencies = [ + "libc", + "sqlite3-src", +] + +[[package]] +name = "ssh-cipher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caac132742f0d33c3af65bfcde7f6aa8f62f0e991d80db99149eb9d44708784f" +dependencies = [ + "aes", + "aes-gcm", + "cbc", + "chacha20", + "cipher", + "ctr", + "poly1305", + "ssh-encoding", + "subtle", +] + +[[package]] +name = "ssh-encoding" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9242b9ef4108a78e8cd1a2c98e193ef372437f8c22be363075233321dd4a15" +dependencies = [ + "base64ct", + "pem-rfc7468", + "sha2", +] + +[[package]] +name = "ssh-key" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca9b366a80cf18bb6406f4cf4d10aebfb46140a8c0c33f666a144c5c76ecbafc" +dependencies = [ + "bcrypt-pbkdf", + "p256", + "p384", + "p521", + "rand_core", + "rsa", + "sec1", + "sha2", + "signature 2.2.0", + "ssh-cipher", + "ssh-encoding", + "subtle", + "zeroize", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" + +[[package]] +name = "tar" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "tempfile" +version = "3.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +dependencies = [ + "cfg-if", + "fastrand", + "rustix", + "windows-sys 0.52.0", +] + +[[package]] +name = "termion" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4648c7def6f2043b2568617b9f9b75eae88ca185dbc1f1fda30e95a85d49d7d" +dependencies = [ + "libc", + "libredox", + "numtoa", + "redox_termios", +] + +[[package]] +name = "termion" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "417813675a504dfbbf21bfde32c03e5bf9f2413999962b479023c02848c1c7a5" +dependencies = [ + "libc", + "libredox", + "numtoa", + "redox_termios", +] + +[[package]] +name = "thiserror" +version = "1.0.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "timeago" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1710e589de0a76aaf295cd47a6699f6405737dbfd3cf2b75c92d000b548d0e6" + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "pin-project-lite", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "tokio-util" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[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", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" +dependencies = [ + "bitflags 2.5.0", + "bytes", + "http", + "http-body", + "http-body-util", + "pin-project-lite", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-logfmt" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22b8e455f6caa5212a102ec530bf86b8dc5a4c536299bffd84b238fed9119be7" +dependencies = [ + "time", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "thread_local", + "tracing", + "tracing-core", +] + +[[package]] +name = "tree-sitter" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e747b1f9b7b931ed39a548c1fae149101497de3c1fc8d9e18c62c1a66c683d3d" +dependencies = [ + "cc", + "regex", +] + +[[package]] +name = "tree-sitter-bash" +version = "0.20.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57da2032c37eb2ce29fd18df7d3b94355fec8d6d854d8f80934955df542b5906" +dependencies = [ + "cc", + "tree-sitter", +] + +[[package]] +name = "tree-sitter-c" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bbd5f3d8658c08581f8f2adac6c391c2e9fa00fe9246bf6c5f52213b9cc6b72" +dependencies = [ + "cc", + "tree-sitter", +] + +[[package]] +name = "tree-sitter-css" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3306ddefa1d2681adda2613d11974ffabfbeb215e23235da6c862f3493a04fd" +dependencies = [ + "cc", + "tree-sitter", +] + +[[package]] +name = "tree-sitter-go" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad6d11f19441b961af2fda7f12f5d0dac325f6d6de83836a1d3750018cc5114" +dependencies = [ + "cc", + "tree-sitter", +] + +[[package]] +name = "tree-sitter-highlight" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "042342584c5a7a0b833d9fc4e2bdab3f9868ddc6c4b339a1e01451c6720868bc" +dependencies = [ + "regex", + "thiserror", + "tree-sitter", +] + +[[package]] +name = "tree-sitter-html" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "017822b6bd42843c4bd67fabb834f61ce23254e866282dd93871350fd6b7fa1d" +dependencies = [ + "cc", + "tree-sitter", +] + +[[package]] +name = "tree-sitter-json" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9a38a9c679b55cc8d17350381ec08d69fa1a17a53fcf197f344516e485ed4d" +dependencies = [ + "cc", + "tree-sitter", +] + +[[package]] +name = "tree-sitter-md" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c20d3ef8d202430b644a307e6299d84bf8ed87fa1b796e4638f8805a595060c" +dependencies = [ + "cc", + "tree-sitter", +] + +[[package]] +name = "tree-sitter-python" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c93b1b1fbd0d399db3445f51fd3058e43d0b4dcff62ddbdb46e66550978aa5" +dependencies = [ + "cc", + "tree-sitter", +] + +[[package]] +name = "tree-sitter-ruby" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d50ef383469df8485f024c5fb01faced8cb90368192a7ba02605b43b2427fe" +dependencies = [ + "cc", + "tree-sitter", +] + +[[package]] +name = "tree-sitter-rust" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0832309b0b2b6d33760ce5c0e818cb47e1d72b468516bfe4134408926fa7594" +dependencies = [ + "cc", + "tree-sitter", +] + +[[package]] +name = "tree-sitter-toml" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca517f578a98b23d20780247cc2688407fa81effad5b627a5a364ec3339b53e8" +dependencies = [ + "cc", + "tree-sitter", +] + +[[package]] +name = "tree-sitter-typescript" +version = "0.20.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8bc1d2c24276a48ef097a71b56888ac9db63717e8f8d0b324668a27fd619670" +dependencies = [ + "cc", + "tree-sitter", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-display-width" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a43273b656140aa2bb8e65351fe87c255f0eca706b2538a9bd4a590a3490bf3" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" + +[[package]] +name = "unicode-width" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" + +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + +[[package]] +name = "ureq" +version = "2.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11f214ce18d8b2cbe84ed3aa6486ed3f5b285cf8d8fbdbce9f3f767a724adc35" +dependencies = [ + "base64 0.21.7", + "log", + "once_cell", + "serde", + "serde_json", + "url", +] + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.60", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +dependencies = [ + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" + +[[package]] +name = "xattr" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" +dependencies = [ + "libc", + "linux-raw-sys", + "rustix", +] + +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" diff --git a/http-server/Cargo.toml b/http-server/Cargo.toml new file mode 100644 index 000000000..e242fa768 --- /dev/null +++ b/http-server/Cargo.toml @@ -0,0 +1,67 @@ +[package] +name = "radicle-httpd" +description = "Radicle HTTP daemon" +homepage = "https://radicle.xyz" +license = "MIT OR Apache-2.0" +version = "0.10.0" +authors = ["cloudhead "] +edition = "2021" +default-run = "radicle-httpd" +build = "build.rs" + +[features] +default = [] +logfmt = [ + "tracing-logfmt", + "tracing-subscriber/env-filter" +] + +[[bin]] +name = "radicle-httpd" +path = "src/main.rs" + +[[bin]] +name = "rad-web" +path = "src/bin/rad-web.rs" + +[dependencies] +anyhow = { version = "1" } +axum = { version = "0.7.2", default-features = false, features = ["json", "query", "tokio", "http1"] } +axum-auth = { version= "0.7.0", default-features = false, features = ["auth-bearer"] } +axum-server = { version = "0.6.0", default-features = false } +base64 = "0.21.3" +chrono = { version = "0.4.22", default-features = false, features = ["clock"] } +fastrand = { version = "2.0.0" } +flate2 = { version = "1" } +hyper = { version = "1.0.1", default-features = false } +lexopt = { version = "0.3.0" } +lru = { version = "0.12.0" } +nonempty = { version = "0.9.0", features = ["serialize"] } +radicle-surf = { version = "0.21.0", default-features = false, features = ["serde"] } +serde = { version = "1", features = ["derive"] } +serde_json = { version = "1", features = ["preserve_order"] } +thiserror = { version = "1" } +time = { version = "0.3.17", features = ["parsing", "serde"] } +tokio = { version = "1.21", default-features = false, features = ["macros", "rt-multi-thread"] } +tower-http = { version = "0.5", default-features = false, features = ["trace", "cors", "set-header"] } +tracing = { version = "0.1.37", default-features = false, features = ["std", "log"] } +tracing-logfmt = { version = "0.3", optional = true } +tracing-subscriber = { version = "0.3", default-features = false, features = ["std", "ansi", "fmt"] } +ureq = { version = "2.9", default-features = false, features = ["json"] } +url = { version = "2.5.0" } + +[dependencies.radicle] +version = "0.11.0" + +[dependencies.radicle-term] +version = "0.10.0" + +[dependencies.radicle-cli] +version = "0.10.0" + +[dev-dependencies] +hyper = { version = "1.0.1", default-features = false, features = ["client"] } +pretty_assertions = { version = "1.3.0" } +radicle-crypto = { version = "0.10.0", features = ["test"] } +tempfile = { version = "3.3.0" } +tower = { version = "0.4", features = ["util"] } diff --git a/http-server/build.rs b/http-server/build.rs new file mode 100644 index 000000000..4105170c6 --- /dev/null +++ b/http-server/build.rs @@ -0,0 +1,54 @@ +use std::env; +use std::process::Command; + +fn main() -> Result<(), Box> { + // Set a build-time `GIT_HEAD` env var which includes the commit id; + // such that we can tell which code is running. + let hash = env::var("GIT_HEAD").unwrap_or_else(|_| { + Command::new("git") + .arg("rev-parse") + .arg("--short") + .arg("HEAD") + .output() + .ok() + .and_then(|output| { + if output.status.success() { + String::from_utf8(output.stdout).ok() + } else { + None + } + }) + .unwrap_or("unknown".into()) + }); + + let version = if let Ok(version) = env::var("RADICLE_VERSION") { + version + } else { + "pre-release".to_owned() + }; + + // Set a build-time `GIT_COMMIT_TIME` env var which includes the commit time. + let commit_time = env::var("GIT_COMMIT_TIME").unwrap_or_else(|_| { + Command::new("git") + .arg("log") + .arg("-1") + .arg("--pretty=%ct") + .arg("HEAD") + .output() + .ok() + .and_then(|output| { + if output.status.success() { + String::from_utf8(output.stdout).ok() + } else { + None + } + }) + .unwrap_or(0.to_string()) + }); + + println!("cargo::rustc-env=RADICLE_VERSION={version}"); + println!("cargo::rustc-env=GIT_COMMIT_TIME={commit_time}"); + println!("cargo::rustc-env=GIT_HEAD={hash}"); + + Ok(()) +} diff --git a/http-server/radicle-httpd.1.adoc b/http-server/radicle-httpd.1.adoc new file mode 100644 index 000000000..3be21bc30 --- /dev/null +++ b/http-server/radicle-httpd.1.adoc @@ -0,0 +1,25 @@ += radicle-httpd(1) +The Radicle Team +:doctype: manpage +:revnumber: 1.0.0 +:revdate: 2024-04-22 +:mansource: rad {revnumber} +:manmanual: Radicle CLI Manual + +== Name + +radicle-httpd - Radicle HTTP daemon + +== Synopsis + +*radicle-httpd* --help + +== Description + +A Radicle HTTP daemon exposing a JSON HTTP API that allows someone to browse local +repositories on a Radicle node via their web browser. This manual page is a +placeholder to point you at the *--help* option. + +== SEE ALSO == + +*rad*(1) diff --git a/http-server/rust-toolchain b/http-server/rust-toolchain new file mode 100644 index 000000000..f23daf402 --- /dev/null +++ b/http-server/rust-toolchain @@ -0,0 +1 @@ +1.77 \ No newline at end of file diff --git a/http-server/src/api.rs b/http-server/src/api.rs new file mode 100644 index 000000000..36bb531c4 --- /dev/null +++ b/http-server/src/api.rs @@ -0,0 +1,261 @@ +pub mod auth; + +use std::collections::HashMap; +use std::sync::Arc; +use std::time::Duration; + +use axum::http::header::{AUTHORIZATION, CONTENT_TYPE}; +use axum::http::Method; +use axum::response::{IntoResponse, Json}; +use axum::routing::get; +use axum::Router; +use radicle::issue::cache::Issues as _; +use radicle::patch::cache::Patches as _; +use radicle::storage::git::Repository; +use serde::{Deserialize, Serialize}; +use serde_json::json; +use tokio::sync::RwLock; +use tower_http::cors::{self, CorsLayer}; + +use radicle::cob::{issue, patch, Author}; +use radicle::identity::{DocAt, RepoId}; +use radicle::node::policy::Scope; +use radicle::node::routing::Store; +use radicle::node::AliasStore; +use radicle::node::{Handle, NodeId}; +use radicle::storage::{ReadRepository, ReadStorage}; +use radicle::{Node, Profile}; + +mod error; +mod json; +mod v1; + +use crate::api::error::Error; +use crate::cache::Cache; +use crate::Options; + +pub const RADICLE_VERSION: &str = env!("RADICLE_VERSION"); +// This version has to be updated on every breaking change to the radicle-httpd API. +pub const API_VERSION: &str = "0.1.0"; + +/// Identifier for sessions +type SessionId = String; + +#[derive(Clone)] +pub struct Context { + profile: Arc, + sessions: Arc>>, + cache: Option, +} + +impl Context { + pub fn new(profile: Arc, options: &Options) -> Self { + Self { + profile, + sessions: Default::default(), + cache: options.cache.map(Cache::new), + } + } + + pub fn project_info( + &self, + repo: &R, + doc: DocAt, + ) -> Result { + let (_, head) = repo.head()?; + let DocAt { doc, .. } = doc; + let id = repo.id(); + + let payload = doc.project()?; + let aliases = self.profile.aliases(); + let delegates = doc + .delegates + .into_iter() + .map(|did| json::author(&Author::new(did), aliases.alias(did.as_key()))) + .collect::>(); + let issues = self.profile.issues(repo)?.counts()?; + let patches = self.profile.patches(repo)?.counts()?; + let db = &self.profile.database()?; + let seeding = db.count(&id).unwrap_or_default(); + + Ok(project::Info { + payload, + delegates, + threshold: doc.threshold, + visibility: doc.visibility, + head, + issues, + patches, + id, + seeding, + }) + } + + /// Get a repository by RID, checking to make sure we're allowed to view it. + pub fn repo(&self, rid: RepoId) -> Result<(Repository, DocAt), error::Error> { + let repo = self.profile.storage.repository(rid)?; + let doc = repo.identity_doc()?; + // Don't allow accessing private repos. + if doc.visibility.is_private() { + return Err(Error::NotFound); + } + Ok((repo, doc)) + } + + #[cfg(test)] + pub fn profile(&self) -> &Arc { + &self.profile + } + + #[cfg(test)] + pub fn sessions(&self) -> &Arc>> { + &self.sessions + } +} + +pub fn router(ctx: Context) -> Router { + Router::new() + .route("/", get(root_handler)) + .merge(v1::router(ctx)) + .layer( + CorsLayer::new() + .max_age(Duration::from_secs(86400)) + .allow_origin(cors::Any) + .allow_methods([ + Method::GET, + Method::POST, + Method::PATCH, + Method::PUT, + Method::DELETE, + ]) + .allow_headers([CONTENT_TYPE, AUTHORIZATION]), + ) +} + +async fn root_handler() -> impl IntoResponse { + let response = json!({ + "path": "/api", + "links": [ + { + "href": "/v1", + "rel": "v1", + "type": "GET" + } + ] + }); + + Json(response) +} + +#[derive(Serialize, Deserialize, Clone)] +#[serde(rename_all = "camelCase")] +pub struct PaginationQuery { + #[serde(default)] + pub show: ProjectQuery, + pub page: Option, + pub per_page: Option, +} + +#[derive(Serialize, Deserialize, Clone, Default)] +#[serde(rename_all = "camelCase")] +pub enum ProjectQuery { + All, + #[default] + Pinned, +} + +#[derive(Serialize, Deserialize, Clone)] +#[serde(rename_all = "camelCase")] +pub struct RawQuery { + pub mime: Option, +} + +#[derive(Serialize, Deserialize, Clone)] +#[serde(rename_all = "camelCase")] +pub struct CobsQuery { + pub page: Option, + pub per_page: Option, + pub state: Option, +} + +#[derive(Serialize, Deserialize, Clone)] +#[serde(rename_all = "camelCase")] +pub struct PoliciesQuery { + /// The NID from which to fetch from after tracking a repo. + pub from: Option, + pub scope: Option, +} + +#[derive(Default, Serialize, Deserialize, Clone)] +#[serde(rename_all = "camelCase")] +pub enum IssueState { + Closed, + #[default] + Open, +} + +impl IssueState { + pub fn matches(&self, issue: &issue::State) -> bool { + match self { + Self::Open => matches!(issue, issue::State::Open), + Self::Closed => matches!(issue, issue::State::Closed { .. }), + } + } +} + +#[derive(Default, Serialize, Deserialize, Clone)] +#[serde(rename_all = "camelCase")] +pub enum PatchState { + #[default] + Open, + Draft, + Archived, + Merged, +} + +impl PatchState { + pub fn matches(&self, patch: &patch::State) -> bool { + match self { + Self::Open => matches!(patch, patch::State::Open { .. }), + Self::Draft => matches!(patch, patch::State::Draft), + Self::Archived => matches!(patch, patch::State::Archived), + Self::Merged => matches!(patch, patch::State::Merged { .. }), + } + } +} + +mod project { + use serde::Serialize; + use serde_json::Value; + + use radicle::cob; + use radicle::git::Oid; + use radicle::identity::project::Project; + use radicle::identity::{RepoId, Visibility}; + + /// Project info. + #[derive(Serialize)] + #[serde(rename_all = "camelCase")] + pub struct Info { + /// Project metadata. + #[serde(flatten)] + pub payload: Project, + pub delegates: Vec, + pub threshold: usize, + pub visibility: Visibility, + pub head: Oid, + pub patches: cob::patch::PatchCounts, + pub issues: cob::issue::IssueCounts, + pub id: RepoId, + pub seeding: usize, + } +} + +/// Announce refs to the network for the given RID. +pub fn announce_refs(mut node: Node, rid: RepoId) -> Result<(), Error> { + match node.announce_refs(rid) { + Ok(_) => Ok(()), + Err(e) if e.is_connection_err() => Ok(()), + Err(e) => Err(e.into()), + } +} diff --git a/http-server/src/api/auth.rs b/http-server/src/api/auth.rs new file mode 100644 index 000000000..255de7753 --- /dev/null +++ b/http-server/src/api/auth.rs @@ -0,0 +1,44 @@ +use serde::{Deserialize, Serialize}; +use time::serde::timestamp; +use time::{Duration, OffsetDateTime}; + +use radicle::crypto::PublicKey; +use radicle::node::Alias; + +use crate::api::error::Error; +use crate::api::Context; + +pub const UNAUTHORIZED_SESSIONS_EXPIRATION: Duration = Duration::seconds(60); +pub const AUTHORIZED_SESSIONS_EXPIRATION: Duration = Duration::weeks(1); + +#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)] +#[serde(rename_all = "lowercase")] +pub enum AuthState { + Authorized, + Unauthorized, +} + +#[derive(Clone, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Session { + pub status: AuthState, + pub public_key: PublicKey, + pub alias: Alias, + #[serde(with = "timestamp")] + pub issued_at: OffsetDateTime, + #[serde(with = "timestamp")] + pub expires_at: OffsetDateTime, +} + +pub async fn validate(ctx: &Context, token: &str) -> Result<(), Error> { + let sessions_store = ctx.sessions.read().await; + let session = sessions_store + .get(token) + .ok_or(Error::Auth("Unauthorized"))?; + + if session.status != AuthState::Authorized || session.expires_at <= OffsetDateTime::now_utc() { + return Err(Error::Auth("Unauthorized")); + } + + Ok(()) +} diff --git a/http-server/src/api/error.rs b/http-server/src/api/error.rs new file mode 100644 index 000000000..da1005663 --- /dev/null +++ b/http-server/src/api/error.rs @@ -0,0 +1,158 @@ +use axum::http::StatusCode; +use axum::response::{IntoResponse, Response}; +use axum::Json; +use serde_json::json; + +/// Errors relating to the API backend. +#[derive(Debug, thiserror::Error)] +pub enum Error { + /// The entity was not found. + #[error("entity not found")] + NotFound, + + /// An error occurred during an authentication process. + #[error("could not authenticate: {0}")] + Auth(&'static str), + + /// An error occurred with env variables. + #[error(transparent)] + Env(#[from] std::env::VarError), + + /// Profile error. + #[error(transparent)] + Profile(#[from] radicle::profile::Error), + + /// Crypto error. + #[error(transparent)] + Crypto(#[from] radicle::crypto::Error), + + /// Storage error. + #[error(transparent)] + Storage(#[from] radicle::storage::Error), + + /// Cob cache error. + #[error(transparent)] + CobCache(#[from] radicle::cob::cache::Error), + + /// Cob issue cache error. + #[error(transparent)] + CacheIssue(#[from] radicle::cob::issue::cache::Error), + + /// Cob issue error. + #[error(transparent)] + CobIssue(#[from] radicle::cob::issue::Error), + + /// Cob patch error. + #[error(transparent)] + CobPatch(#[from] radicle::cob::patch::Error), + + /// Cob patch cache error. + #[error(transparent)] + CachePatch(#[from] radicle::cob::patch::cache::Error), + + /// Cob store error. + #[error(transparent)] + CobStore(#[from] radicle::cob::store::Error), + + /// Repository error. + #[error(transparent)] + Repository(#[from] radicle::storage::RepositoryError), + + /// Routing error. + #[error(transparent)] + Routing(#[from] radicle::node::routing::Error), + + /// Project doc error. + #[error(transparent)] + ProjectDoc(#[from] radicle::identity::doc::PayloadError), + + /// Surf directory error. + #[error(transparent)] + SurfDir(#[from] radicle_surf::fs::error::Directory), + + /// Surf error. + #[error(transparent)] + Surf(#[from] radicle_surf::Error), + + /// Git2 error. + #[error(transparent)] + Git2(#[from] radicle::git::raw::Error), + + /// Storage refs error. + #[error(transparent)] + StorageRef(#[from] radicle::storage::refs::Error), + + /// Identity doc error. + #[error(transparent)] + IdentityDoc(#[from] radicle::identity::doc::DocError), + + /// Tracking store error. + #[error(transparent)] + TrackingStore(#[from] radicle::node::policy::store::Error), + + /// Node database error. + #[error(transparent)] + Database(#[from] radicle::node::db::Error), + + /// Node error. + #[error(transparent)] + Node(#[from] radicle::node::Error), + + /// Invalid update to issue or patch. + #[error("{0}")] + BadRequest(String), +} + +impl IntoResponse for Error { + fn into_response(self) -> Response { + let message = self.to_string(); + let (status, msg) = match self { + Error::NotFound => (StatusCode::NOT_FOUND, None), + Error::CobStore(e @ radicle::cob::store::Error::NotFound(_, _)) => { + (StatusCode::NOT_FOUND, Some(e.to_string())) + } + Error::Auth(msg) => (StatusCode::UNAUTHORIZED, Some(msg.to_string())), + Error::Crypto(msg) => (StatusCode::BAD_REQUEST, Some(msg.to_string())), + Error::Surf(radicle_surf::Error::Git(e)) if radicle::git::is_not_found_err(&e) => { + (StatusCode::NOT_FOUND, Some(e.message().to_owned())) + } + Error::Surf(radicle_surf::Error::Directory( + e @ radicle_surf::fs::error::Directory::PathNotFound(_), + )) => (StatusCode::NOT_FOUND, Some(e.to_string())), + Error::Git2(e) if radicle::git::is_not_found_err(&e) => { + (StatusCode::NOT_FOUND, Some(e.message().to_owned())) + } + Error::Git2(e) => ( + StatusCode::INTERNAL_SERVER_ERROR, + Some(e.message().to_owned()), + ), + Error::Storage(err) if err.is_not_found() => { + (StatusCode::NOT_FOUND, Some(err.to_string())) + } + Error::Repository(err) if err.is_not_found() => { + (StatusCode::NOT_FOUND, Some(err.to_string())) + } + Error::StorageRef(err) if err.is_not_found() => { + (StatusCode::NOT_FOUND, Some(err.to_string())) + } + Error::BadRequest(msg) => (StatusCode::BAD_REQUEST, Some(msg)), + other => { + tracing::error!("Error: {message}"); + tracing::debug!("Error Debug: {:?}", other); + + if cfg!(debug_assertions) { + (StatusCode::INTERNAL_SERVER_ERROR, Some(other.to_string())) + } else { + (StatusCode::INTERNAL_SERVER_ERROR, None) + } + } + }; + + let body = Json(json!({ + "error": msg.or_else(|| status.canonical_reason().map(|r| r.to_string())), + "code": status.as_u16() + })); + + (status, body).into_response() + } +} diff --git a/http-server/src/api/json.rs b/http-server/src/api/json.rs new file mode 100644 index 000000000..2686d3069 --- /dev/null +++ b/http-server/src/api/json.rs @@ -0,0 +1,312 @@ +//! Utilities for building JSON responses of our API. + +use std::collections::BTreeMap; +use std::path::Path; +use std::str; + +use base64::prelude::{Engine, BASE64_STANDARD}; +use radicle::cob::{CodeLocation, Reaction}; +use radicle::patch::ReviewId; +use serde_json::{json, Value}; + +use radicle::cob::issue::{Issue, IssueId}; +use radicle::cob::patch::{Merge, Patch, PatchId, Review}; +use radicle::cob::thread::{Comment, CommentId, Edit}; +use radicle::cob::{ActorId, Author}; +use radicle::git::RefString; +use radicle::node::{Alias, AliasStore}; +use radicle::prelude::NodeId; +use radicle::storage::{git, refs, RemoteRepository}; +use radicle_surf::blob::Blob; +use radicle_surf::tree::{EntryKind, Tree}; +use radicle_surf::{Commit, Oid}; + +use crate::api::auth::Session; + +/// Returns JSON of a commit. +pub(crate) fn commit(commit: &Commit) -> Value { + json!({ + "id": commit.id, + "author": { + "name": commit.author.name, + "email": commit.author.email + }, + "summary": commit.summary, + "description": commit.description(), + "parents": commit.parents, + "committer": { + "name": commit.committer.name, + "email": commit.committer.email, + "time": commit.committer.time.seconds() + } + }) +} + +/// Returns JSON of a session. +pub(crate) fn session(session_id: String, session: &Session) -> Value { + json!({ + "sessionId": session_id, + "status": session.status, + "publicKey": session.public_key, + "alias": session.alias, + "issuedAt": session.issued_at.unix_timestamp(), + "expiresAt": session.expires_at.unix_timestamp() + }) +} + +/// Returns JSON for a blob with a given `path`. +pub(crate) fn blob>(blob: &Blob, path: &str) -> Value { + json!({ + "binary": blob.is_binary(), + "name": name_in_path(path), + "content": blob_content(blob), + "path": path, + "lastCommit": commit(blob.commit()) + }) +} + +/// Returns a string for the blob content, encoded in base64 if binary. +pub fn blob_content>(blob: &Blob) -> String { + match str::from_utf8(blob.content()) { + Ok(s) => s.to_owned(), + Err(_) => BASE64_STANDARD.encode(blob.content()), + } +} + +/// Returns JSON for a tree with a given `path` and `stats`. +pub(crate) fn tree(tree: &Tree, path: &str) -> Value { + let prefix = Path::new(path); + let entries = tree + .entries() + .iter() + .map(|entry| { + json!({ + "path": prefix.join(entry.name()), + "oid": entry.object_id(), + "name": entry.name(), + "kind": match entry.entry() { + EntryKind::Tree(_) => "tree", + EntryKind::Blob(_) => "blob", + EntryKind::Submodule { .. } => "submodule" + }, + }) + }) + .collect::>(); + + json!({ + "entries": &entries, + "lastCommit": commit(tree.commit()), + "name": name_in_path(path), + "path": path, + }) +} + +/// Returns JSON for an `issue`. +pub(crate) fn issue(id: IssueId, issue: Issue, aliases: &impl AliasStore) -> Value { + json!({ + "id": id.to_string(), + "author": author(&issue.author(), aliases.alias(issue.author().id())), + "title": issue.title(), + "state": issue.state(), + "assignees": issue.assignees().map(|assignee| + author(&Author::from(*assignee.as_key()), aliases.alias(assignee)) + ).collect::>(), + "discussion": issue.comments().map(|(id, c)| issue_comment(id, c, aliases)).collect::>(), + "labels": issue.labels().collect::>(), + }) +} + +/// Returns JSON for a `patch`. +pub(crate) fn patch( + id: PatchId, + patch: Patch, + repo: &git::Repository, + aliases: &impl AliasStore, +) -> Value { + json!({ + "id": id.to_string(), + "author": author(patch.author(), aliases.alias(patch.author().id())), + "title": patch.title(), + "state": patch.state(), + "target": patch.target(), + "labels": patch.labels().collect::>(), + "merges": patch.merges().map(|(nid, m)| merge(nid, m, aliases)).collect::>(), + "assignees": patch.assignees().map(|assignee| + author(&Author::from(*assignee), aliases.alias(&assignee)) + ).collect::>(), + "revisions": patch.revisions().map(|(id, rev)| { + json!({ + "id": id, + "author": author(rev.author(), aliases.alias(rev.author().id())), + "description": rev.description(), + "edits": rev.edits().map(|e| edit(e, aliases)).collect::>(), + "reactions": rev.reactions().iter().flat_map(|(location, reaction)| { + reactions(reaction.iter().fold(BTreeMap::new(), |mut acc: BTreeMap<&Reaction, Vec<_>>, (author, emoji)| { + acc.entry(emoji).or_default().push(author); + acc + }), location.as_ref(), aliases) + }).collect::>(), + "base": rev.base(), + "oid": rev.head(), + "refs": get_refs(repo, patch.author().id(), &rev.head()).unwrap_or_default(), + "discussions": rev.discussion().comments().map(|(id, c)| { + patch_comment(id, c, aliases) + }).collect::>(), + "timestamp": rev.timestamp().as_secs(), + "reviews": patch.reviews_of(id).map(move |(id, r)| { + review(id, r, aliases) + }).collect::>(), + }) + }).collect::>(), + }) +} + +/// Returns JSON for a `reaction`. +fn reactions( + reactions: BTreeMap<&Reaction, Vec<&ActorId>>, + location: Option<&CodeLocation>, + aliases: &impl AliasStore, +) -> Vec { + reactions + .into_iter() + .map(|(emoji, authors)| { + if let Some(l) = location { + json!({ "location": l, "emoji": emoji, "authors": authors.into_iter().map(|a| + author(&Author::from(*a), aliases.alias(a)) + ).collect::>()}) + } else { + json!({ "emoji": emoji, "authors": authors.into_iter().map(|a| + author(&Author::from(*a), aliases.alias(a)) + ).collect::>()}) + } + }) + .collect::>() +} + +/// Returns JSON for an `author` and fills in `alias` when present. +pub(crate) fn author(author: &Author, alias: Option) -> Value { + match alias { + Some(alias) => json!({ + "id": author.id, + "alias": alias, + }), + None => json!(author), + } +} + +/// Returns JSON for a patch `Merge` and fills in `alias` when present. +fn merge(nid: &NodeId, merge: &Merge, aliases: &impl AliasStore) -> Value { + json!({ + "author": author(&Author::from(*nid), aliases.alias(nid)), + "commit": merge.commit, + "timestamp": merge.timestamp.as_secs(), + "revision": merge.revision, + }) +} + +/// Returns JSON for a patch `Review` and fills in `alias` when present. +fn review(id: &ReviewId, review: &Review, aliases: &impl AliasStore) -> Value { + let a = review.author(); + json!({ + "id": id, + "author": author(a, aliases.alias(a.id())), + "verdict": review.verdict(), + "summary": review.summary(), + "comments": review.comments().map(|(id, c)| review_comment(id, c, aliases)).collect::>(), + "timestamp": review.timestamp().as_secs(), + }) +} + +/// Returns JSON for an `Edit`. +fn edit(edit: &Edit, aliases: &impl AliasStore) -> Value { + json!({ + "author": author(&Author::from(edit.author), aliases.alias(&edit.author)), + "body": edit.body, + "timestamp": edit.timestamp.as_secs(), + "embeds": edit.embeds, + }) +} + +/// Returns JSON for a Issue `Comment`. +fn issue_comment(id: &CommentId, comment: &Comment, aliases: &impl AliasStore) -> Value { + json!({ + "id": *id, + "author": author(&Author::from(comment.author()), aliases.alias(&comment.author())), + "body": comment.body(), + "edits": comment.edits().map(|e| edit(e, aliases)).collect::>(), + "embeds": comment.embeds().to_vec(), + "reactions": reactions(comment.reactions(), None, aliases), + "timestamp": comment.timestamp().as_secs(), + "replyTo": comment.reply_to(), + "resolved": comment.is_resolved(), + }) +} + +/// Returns JSON for a Patch `Comment`. +fn patch_comment( + id: &CommentId, + comment: &Comment, + aliases: &impl AliasStore, +) -> Value { + json!({ + "id": *id, + "author": author(&Author::from(comment.author()), aliases.alias(&comment.author())), + "body": comment.body(), + "edits": comment.edits().map(|e| edit(e, aliases)).collect::>(), + "embeds": comment.embeds().to_vec(), + "reactions": reactions(comment.reactions(), None, aliases), + "timestamp": comment.timestamp().as_secs(), + "replyTo": comment.reply_to(), + "location": comment.location(), + "resolved": comment.is_resolved(), + }) +} + +/// Returns JSON for a `Review`. +fn review_comment( + id: &CommentId, + comment: &Comment, + aliases: &impl AliasStore, +) -> Value { + json!({ + "id": *id, + "author": author(&Author::from(comment.author()), aliases.alias(&comment.author())), + "body": comment.body(), + "edits": comment.edits().map(|e| edit(e, aliases)).collect::>(), + "embeds": comment.embeds().to_vec(), + "reactions": reactions(comment.reactions(), None, aliases), + "timestamp": comment.timestamp().as_secs(), + "replyTo": comment.reply_to(), + "location": comment.location(), + "resolved": comment.is_resolved(), + }) +} + +/// Returns the name part of a path string. +fn name_in_path(path: &str) -> &str { + match path.rsplit('/').next() { + Some(name) => name, + None => path, + } +} + +fn get_refs( + repo: &git::Repository, + id: &ActorId, + head: &Oid, +) -> Result, refs::Error> { + let remote = repo.remote(id)?; + let refs = remote + .refs + .iter() + .filter_map(|(name, o)| { + if o == head { + Some(name.to_owned()) + } else { + None + } + }) + .collect::>(); + + Ok(refs) +} diff --git a/http-server/src/api/v1.rs b/http-server/src/api/v1.rs new file mode 100644 index 000000000..3815091b5 --- /dev/null +++ b/http-server/src/api/v1.rs @@ -0,0 +1,71 @@ +mod delegates; +mod node; +mod profile; +mod projects; +mod sessions; +mod stats; + +use axum::extract::State; +use axum::response::{IntoResponse, Json}; +use axum::routing::get; +use axum::Router; +use serde_json::json; + +use crate::api::{Context, API_VERSION, RADICLE_VERSION}; + +pub fn router(ctx: Context) -> Router { + let root_router = Router::new() + .route("/", get(root_handler)) + .with_state(ctx.clone()); + + let routes = Router::new() + .merge(root_router) + .merge(node::router(ctx.clone())) + .merge(profile::router(ctx.clone())) + .merge(sessions::router(ctx.clone())) + .merge(delegates::router(ctx.clone())) + .merge(projects::router(ctx.clone())) + .merge(stats::router(ctx)); + + Router::new().nest("/v1", routes) +} + +async fn root_handler(State(ctx): State) -> impl IntoResponse { + let response = json!({ + "message": "Welcome!", + "service": "radicle-httpd", + "version": format!("{}-{}", RADICLE_VERSION, env!("GIT_HEAD")), + "apiVersion": API_VERSION, + "nid": ctx.profile.public_key, + "path": "/api/v1", + "links": [ + { + "href": "/projects", + "rel": "projects", + "type": "GET" + }, + { + "href": "/node", + "rel": "node", + "type": "GET" + }, + { + "href": "/delegates/:did/projects", + "rel": "projects", + "type": "GET" + }, + { + "href": "/profile", + "rel": "profile", + "type": "GET" + }, + { + "href": "/stats", + "rel": "stats", + "type": "GET" + } + ] + }); + + Json(response) +} diff --git a/http-server/src/api/v1/delegates.rs b/http-server/src/api/v1/delegates.rs new file mode 100644 index 000000000..bfd53bb57 --- /dev/null +++ b/http-server/src/api/v1/delegates.rs @@ -0,0 +1,225 @@ +use axum::extract::State; +use axum::response::IntoResponse; +use axum::routing::get; +use axum::{Json, Router}; + +use radicle::cob::Author; +use radicle::identity::Did; +use radicle::issue::cache::Issues as _; +use radicle::node::routing::Store; +use radicle::node::AliasStore; +use radicle::patch::cache::Patches as _; +use radicle::storage::{ReadRepository, ReadStorage}; + +use crate::api::error::Error; +use crate::api::json; +use crate::api::project::Info; +use crate::api::Context; +use crate::api::{PaginationQuery, ProjectQuery}; +use crate::axum_extra::{Path, Query}; + +pub fn router(ctx: Context) -> Router { + Router::new() + .route( + "/delegates/:delegate/projects", + get(delegates_projects_handler), + ) + .with_state(ctx) +} + +/// List all projects which delegate is a part of. +/// `GET /delegates/:delegate/projects` +async fn delegates_projects_handler( + State(ctx): State, + Path(delegate): Path, + Query(qs): Query, +) -> impl IntoResponse { + let PaginationQuery { + show, + page, + per_page, + } = qs; + let page = page.unwrap_or(0); + let per_page = per_page.unwrap_or(10); + let storage = &ctx.profile.storage; + let db = &ctx.profile.database()?; + let pinned = &ctx.profile.config.web.pinned; + let mut projects = match show { + ProjectQuery::All => storage + .repositories()? + .into_iter() + .filter(|repo| repo.doc.visibility.is_public()) + .collect::>(), + ProjectQuery::Pinned => storage.repositories_by_id(pinned.repositories.iter())?, + }; + projects.sort_by_key(|p| p.rid); + + let infos = projects + .into_iter() + .filter_map(|id| { + if !id.doc.delegates.iter().any(|d| *d == delegate) { + return None; + } + let Ok(repo) = storage.repository(id.rid) else { + return None; + }; + let Ok((_, head)) = repo.head() else { + return None; + }; + let Ok(payload) = id.doc.project() else { + return None; + }; + let Ok(issues) = ctx.profile.issues(&repo) else { + return None; + }; + let Ok(issues) = issues.counts() else { + return None; + }; + let Ok(patches) = ctx.profile.patches(&repo) else { + return None; + }; + let Ok(patches) = patches.counts() else { + return None; + }; + + let aliases = ctx.profile.aliases(); + let delegates = id + .doc + .delegates + .into_iter() + .map(|did| json::author(&Author::new(did), aliases.alias(did.as_key()))) + .collect::>(); + let seeding = db.count(&id.rid).unwrap_or_default(); + + Some(Info { + payload, + delegates, + threshold: id.doc.threshold, + visibility: id.doc.visibility, + head, + issues, + patches, + id: id.rid, + seeding, + }) + }) + .skip(page * per_page) + .take(per_page) + .collect::>(); + + Ok::<_, Error>(Json(infos)) +} + +#[cfg(test)] +mod routes { + use std::net::SocketAddr; + + use axum::extract::connect_info::MockConnectInfo; + use axum::http::StatusCode; + use serde_json::json; + + use crate::test::{self, get, HEAD, RID}; + + #[tokio::test] + async fn test_delegates_projects() { + let tmp = tempfile::tempdir().unwrap(); + let seed = test::seed(tmp.path()); + let app = super::router(seed.clone()) + .layer(MockConnectInfo(SocketAddr::from(([127, 0, 0, 1], 8080)))); + let response = get( + &app, + "/delegates/did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi/projects?show=all", + ) + .await; + + assert_eq!( + response.status(), + StatusCode::OK, + "failed response: {:?}", + response.json().await + ); + assert_eq!( + response.json().await, + json!([ + { + "name": "hello-world", + "description": "Rad repository for tests", + "defaultBranch": "master", + "delegates": [ + { + "id": "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", + "alias": "seed" + } + ], + "threshold": 1, + "visibility": { + "type": "public" + }, + "head": HEAD, + "patches": { + "open": 1, + "draft": 0, + "archived": 0, + "merged": 0, + }, + "issues": { + "open": 1, + "closed": 0, + }, + "id": RID, + "seeding": 0, + }, + ]) + ); + + let app = super::router(seed).layer(MockConnectInfo(SocketAddr::from(( + [192, 168, 13, 37], + 8080, + )))); + let response = get( + &app, + "/delegates/did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi/projects?show=all", + ) + .await; + + assert_eq!( + response.status(), + StatusCode::OK, + "failed response: {:?}", + response.json().await + ); + assert_eq!( + response.json().await, + json!([ + { + "name": "hello-world", + "description": "Rad repository for tests", + "defaultBranch": "master", + "delegates": [ + { + "id": "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", + "alias": "seed" + } + ], + "threshold": 1, + "visibility": { + "type": "public" + }, + "head": HEAD, + "patches": { + "open": 1, + "draft": 0, + "archived": 0, + "merged": 0, + }, + "issues": { + "open": 1, + "closed": 0, + }, + "id": RID, + "seeding": 0, + } + ]) + ); + } +} diff --git a/http-server/src/api/v1/node.rs b/http-server/src/api/v1/node.rs new file mode 100644 index 000000000..3e2382384 --- /dev/null +++ b/http-server/src/api/v1/node.rs @@ -0,0 +1,135 @@ +use axum::extract::State; +use axum::response::IntoResponse; +use axum::routing::{get, put}; +use axum::{Json, Router}; +use axum_auth::AuthBearer; +use hyper::StatusCode; +use serde_json::json; + +use radicle::identity::RepoId; +use radicle::node::routing::Store; +use radicle::node::{ + policy::{Policy, SeedPolicy}, + AliasStore, Handle, NodeId, DEFAULT_TIMEOUT, +}; +use radicle::Node; + +use crate::api::error::Error; +use crate::api::{self, Context, PoliciesQuery, RADICLE_VERSION}; +use crate::axum_extra::{Path, Query}; + +pub fn router(ctx: Context) -> Router { + Router::new() + .route("/node", get(node_handler)) + .route("/node/policies/repos", get(node_policies_repos_handler)) + .route( + "/node/policies/repos/:rid", + put(node_policies_seed_handler).delete(node_policies_unseed_handler), + ) + .route("/nodes/:nid", get(nodes_handler)) + .route("/nodes/:nid/inventory", get(nodes_inventory_handler)) + .with_state(ctx) +} + +/// Return local node information. +/// `GET /node` +async fn node_handler(State(ctx): State) -> impl IntoResponse { + let node = Node::new(ctx.profile.socket()); + let node_id = ctx.profile.public_key; + let node_state = if node.is_running() { + "running" + } else { + "stopped" + }; + let config = match node.config() { + Ok(config) => Some(config), + Err(err) => { + tracing::error!("Error getting node config: {:#}", err); + None + } + }; + let response = json!({ + "id": node_id.to_string(), + "version": format!("{}-{}", RADICLE_VERSION, env!("GIT_HEAD")), + "config": config, + "state": node_state, + }); + + Ok::<_, Error>(Json(response)) +} + +/// Return stored information about other nodes. +/// `GET /nodes/:nid` +async fn nodes_handler(State(ctx): State, Path(nid): Path) -> impl IntoResponse { + let aliases = ctx.profile.aliases(); + let response = json!({ + "alias": aliases.alias(&nid), + }); + + Ok::<_, Error>(Json(response)) +} + +/// Return stored information about other nodes. +/// `GET /nodes/:nid/inventory` +async fn nodes_inventory_handler( + State(ctx): State, + Path(nid): Path, +) -> impl IntoResponse { + let db = &ctx.profile.database()?; + let resources = db.get_resources(&nid)?; + + Ok::<_, Error>(Json(resources)) +} + +/// Return local repo policies information. +/// `GET /node/policies/repos` +async fn node_policies_repos_handler(State(ctx): State) -> impl IntoResponse { + let policies = ctx.profile.policies()?; + let mut repos = Vec::new(); + + for SeedPolicy { rid: id, policy } in policies.seed_policies()? { + repos.push(json!({ + "id": id, + "scope": policy.scope().unwrap_or_default(), + "policy": Policy::from(policy), + })); + } + + Ok::<_, Error>(Json(repos)) +} + +/// Seed a new repo. +/// `PUT /node/policies/repos/:rid` +async fn node_policies_seed_handler( + State(ctx): State, + AuthBearer(token): AuthBearer, + Path(project): Path, + Query(qs): Query, +) -> impl IntoResponse { + api::auth::validate(&ctx, &token).await?; + let mut node = Node::new(ctx.profile.socket()); + node.seed(project, qs.scope.unwrap_or_default())?; + + if let Some(from) = qs.from { + let results = node.fetch(project, from, DEFAULT_TIMEOUT)?; + return Ok::<_, Error>(( + StatusCode::OK, + Json(json!({ "success": true, "results": results })), + )); + } + Ok::<_, Error>((StatusCode::OK, Json(json!({ "success": true })))) +} + +/// Unseed a repo. +/// `DELETE /node/policies/repos/:rid` +async fn node_policies_unseed_handler( + State(ctx): State, + AuthBearer(token): AuthBearer, + Path(project): Path, +) -> impl IntoResponse { + api::auth::validate(&ctx, &token).await?; + let mut node = Node::new(ctx.profile.socket()); + node.unseed(project)?; + + Ok::<_, Error>((StatusCode::OK, Json(json!({ "success": true })))) +} diff --git a/http-server/src/api/v1/profile.rs b/http-server/src/api/v1/profile.rs new file mode 100644 index 000000000..6b869af1d --- /dev/null +++ b/http-server/src/api/v1/profile.rs @@ -0,0 +1,123 @@ +use std::net::SocketAddr; + +use axum::extract::{ConnectInfo, State}; +use axum::response::IntoResponse; +use axum::routing::get; +use axum::{Json, Router}; +use serde_json::json; + +use crate::api::error::Error; +use crate::api::Context; + +pub fn router(ctx: Context) -> Router { + Router::new() + .route("/profile", get(profile_handler)) + .with_state(ctx) +} + +/// Return local profile information. +/// `GET /profile` +async fn profile_handler( + State(ctx): State, + ConnectInfo(addr): ConnectInfo, +) -> impl IntoResponse { + if !addr.ip().is_loopback() { + return Err(Error::Auth("Profile data is only shown for localhost")); + } + + Ok::<_, Error>(Json( + json!({ "config": ctx.profile.config, "home": ctx.profile.home.path() }), + )) +} + +#[cfg(test)] +mod routes { + use std::net::SocketAddr; + + use axum::extract::connect_info::MockConnectInfo; + use axum::http::StatusCode; + use serde_json::json; + + use crate::test::{self, get}; + + #[tokio::test] + async fn test_remote_profile() { + let tmp = tempfile::tempdir().unwrap(); + let seed = test::seed(tmp.path()); + let app = super::router(seed.clone()) + .layer(MockConnectInfo(SocketAddr::from(([192, 168, 1, 1], 8080)))); + let response = get(&app, "/profile").await; + + assert_eq!(response.status(), StatusCode::UNAUTHORIZED); + assert_eq!( + response.json().await, + json!({ + "error": "Profile data is only shown for localhost", + "code": 401 + }) + ) + } + + #[tokio::test] + async fn test_profile() { + let tmp = tempfile::tempdir().unwrap(); + let seed = test::seed(tmp.path()); + let app = super::router(seed.clone()) + .layer(MockConnectInfo(SocketAddr::from(([127, 0, 0, 1], 8080)))); + let response = get(&app, "/profile").await; + + assert_eq!(response.status(), StatusCode::OK); + assert_eq!( + response.json().await, + json!({ + "config": { + "publicExplorer": "https://app.radicle.xyz/nodes/$host/$rid$path", + "preferredSeeds": [ + "z6MkrLMMsiPWUcNPHcRajuMi9mDfYckSoJyPwwnknocNYPm7@seed.radicle.garden:8776", + "z6Mkmqogy2qEM2ummccUthFEaaHvyYmYBYh3dbe9W4ebScxo@ash.radicle.garden:8776" + ], + "web": { "pinned": { "repositories": [] } }, + "cli": { + "hints": true + }, + "node": { + "alias": "seed", + "listen": [], + "peers": { "type": "dynamic" }, + "connect": [], + "externalAddresses": [], + "network": "main", + "log": "INFO", + "relay": "auto", + "limits": { + "routingMaxSize": 1000, + "routingMaxAge": 604800, + "gossipMaxAge": 1209600, + "fetchConcurrency": 1, + "maxOpenFiles": 4096, + "rate": { + "inbound": { + "fillRate": 5.0, + "capacity": 1024 + }, + "outbound": { + "fillRate": 10.0, + "capacity": 2048 + } + }, + "connection": { + "inbound": 128, + "outbound": 16 + } + }, + "workers": 8, + "seedingPolicy": { + "default": "block", + } + } + }, + "home": seed.profile.path() + }) + ); + } +} diff --git a/http-server/src/api/v1/projects.rs b/http-server/src/api/v1/projects.rs new file mode 100644 index 000000000..9efa70521 --- /dev/null +++ b/http-server/src/api/v1/projects.rs @@ -0,0 +1,3565 @@ +use std::collections::{BTreeMap, HashMap}; + +use axum::extract::{DefaultBodyLimit, State}; +use axum::handler::Handler; +use axum::http::{header, HeaderValue}; +use axum::response::{IntoResponse, Response}; +use axum::routing::{get, patch, post}; +use axum::{Json, Router}; +use axum_auth::AuthBearer; +use hyper::StatusCode; +use radicle_surf::blob::BlobRef; +use serde::{Deserialize, Serialize}; +use serde_json::json; +use tower_http::set_header::SetResponseHeaderLayer; + +use radicle::cob::{ + issue, issue::cache::Issues as _, patch, patch::cache::Patches as _, resolve_embed, Author, + Embed, Label, Uri, +}; +use radicle::identity::{Did, RepoId}; +use radicle::node::routing::Store; +use radicle::node::{AliasStore, Node, NodeId}; +use radicle::storage::{ReadRepository, ReadStorage, RemoteRepository, WriteRepository}; +use radicle_surf::{diff, Glob, Oid, Repository}; + +use crate::api::error::Error; +use crate::api::project::Info; +use crate::api::{self, announce_refs, CobsQuery, Context, PaginationQuery, ProjectQuery}; +use crate::axum_extra::{immutable_response, Path, Query}; + +const CACHE_1_HOUR: &str = "public, max-age=3600, must-revalidate"; +const MAX_BODY_LIMIT: usize = 4_194_304; + +pub fn router(ctx: Context) -> Router { + Router::new() + .route("/projects", get(project_root_handler)) + .route("/projects/:project", get(project_handler)) + .route("/projects/:project/commits", get(history_handler)) + .route("/projects/:project/commits/:sha", get(commit_handler)) + .route("/projects/:project/diff/:base/:oid", get(diff_handler)) + .route( + "/projects/:project/activity", + get( + activity_handler.layer(SetResponseHeaderLayer::if_not_present( + header::CACHE_CONTROL, + |response: &Response| { + response + .status() + .is_success() + .then_some(HeaderValue::from_static(CACHE_1_HOUR)) + }, + )), + ), + ) + .route("/projects/:project/tree/:sha/", get(tree_handler_root)) + .route("/projects/:project/tree/:sha/*path", get(tree_handler)) + .route( + "/projects/:project/stats/tree/:sha", + get(stats_tree_handler), + ) + .route("/projects/:project/remotes", get(remotes_handler)) + .route("/projects/:project/remotes/:peer", get(remote_handler)) + .route("/projects/:project/blob/:sha/*path", get(blob_handler)) + .route("/projects/:project/readme/:sha", get(readme_handler)) + .route( + "/projects/:project/issues", + post(issue_create_handler).get(issues_handler), + ) + .route( + "/projects/:project/issues/:id", + patch(issue_update_handler).get(issue_handler), + ) + .route( + "/projects/:project/patches", + post(patch_create_handler).get(patches_handler), + ) + .route( + "/projects/:project/patches/:id", + patch(patch_update_handler).get(patch_handler), + ) + .with_state(ctx) + .layer(DefaultBodyLimit::max(MAX_BODY_LIMIT)) +} + +/// List all projects. +/// `GET /projects` +async fn project_root_handler( + State(ctx): State, + Query(qs): Query, +) -> impl IntoResponse { + let PaginationQuery { + show, + page, + per_page, + } = qs; + let page = page.unwrap_or(0); + let per_page = per_page.unwrap_or(10); + let storage = &ctx.profile.storage; + let db = &ctx.profile.database()?; + let pinned = &ctx.profile.config.web.pinned; + let policies = ctx.profile.policies()?; + + let mut projects = match show { + ProjectQuery::All => storage + .repositories()? + .into_iter() + .filter(|repo| repo.doc.visibility.is_public()) + .collect::>(), + ProjectQuery::Pinned => storage + .repositories_by_id(pinned.repositories.iter())? + .into_iter() + .filter(|repo| repo.doc.visibility.is_public()) + .collect::>(), + }; + projects.sort_by_key(|p| p.rid); + + let infos = projects + .into_iter() + .filter_map(|info| { + if !policies.is_seeding(&info.rid).unwrap_or_default() { + return None; + } + let Ok(repo) = storage.repository(info.rid) else { + return None; + }; + let Ok((_, head)) = repo.head() else { + return None; + }; + let Ok(payload) = info.doc.project() else { + return None; + }; + let Ok(issues) = ctx.profile.issues(&repo) else { + return None; + }; + let Ok(issues) = issues.counts() else { + return None; + }; + let Ok(patches) = ctx.profile.patches(&repo) else { + return None; + }; + let Ok(patches) = patches.counts() else { + return None; + }; + let aliases = ctx.profile.aliases(); + let delegates = info + .doc + .delegates + .into_iter() + .map(|did| api::json::author(&Author::new(did), aliases.alias(did.as_key()))) + .collect::>(); + let seeding = db.count(&info.rid).unwrap_or_default(); + + Some(Info { + payload, + delegates, + head, + threshold: info.doc.threshold, + visibility: info.doc.visibility, + issues, + patches, + id: info.rid, + seeding, + }) + }) + .skip(page * per_page) + .take(per_page) + .collect::>(); + + Ok::<_, Error>(Json(infos)) +} + +/// Get project metadata. +/// `GET /projects/:project` +async fn project_handler(State(ctx): State, Path(rid): Path) -> impl IntoResponse { + let (repo, doc) = ctx.repo(rid)?; + let info = ctx.project_info(&repo, doc)?; + + Ok::<_, Error>(Json(info)) +} + +#[derive(Serialize, Deserialize, Clone)] +#[serde(rename_all = "camelCase")] +pub struct CommitsQueryString { + pub parent: Option, + pub since: Option, + pub until: Option, + pub page: Option, + pub per_page: Option, +} + +/// Get project commit range. +/// `GET /projects/:project/commits?parent=` +async fn history_handler( + State(ctx): State, + Path(rid): Path, + Query(qs): Query, +) -> impl IntoResponse { + let (repo, doc) = ctx.repo(rid)?; + let CommitsQueryString { + since, + until, + parent, + page, + per_page, + } = qs; + + // If the parent commit is provided, the response depends only on the query + // string and not on the state of the repository. This means we can instruct + // the caches to treat the response as immutable. + let is_immutable = parent.is_some(); + + let sha = match parent { + Some(commit) => commit, + None => ctx.project_info(&repo, doc)?.head.to_string(), + }; + let repo = Repository::open(repo.path())?; + + // If a pagination is defined, we do not want to paginate the commits, and we return all of them on the first page. + let page = page.unwrap_or(0); + let per_page = if per_page.is_none() && (since.is_some() || until.is_some()) { + usize::MAX + } else { + per_page.unwrap_or(30) + }; + + let commits = repo + .history(&sha)? + .filter_map(|commit| { + let commit = commit.ok()?; + let time = commit.committer.time.seconds(); + let commit = api::json::commit(&commit); + match (since, until) { + (Some(since), Some(until)) if time >= since && time < until => Some(commit), + (Some(since), None) if time >= since => Some(commit), + (None, Some(until)) if time < until => Some(commit), + (None, None) => Some(commit), + _ => None, + } + }) + .skip(page * per_page) + .take(per_page) + .collect::>(); + + if is_immutable { + Ok::<_, Error>(immutable_response(commits).into_response()) + } else { + Ok::<_, Error>(Json(commits).into_response()) + } +} + +/// Get project commit. +/// `GET /projects/:project/commits/:sha` +async fn commit_handler( + State(ctx): State, + Path((project, sha)): Path<(RepoId, Oid)>, +) -> impl IntoResponse { + let (repo, _) = ctx.repo(project)?; + let repo = Repository::open(repo.path())?; + let commit = repo.commit(sha)?; + + let diff = repo.diff_commit(commit.id)?; + let glob = Glob::all_heads().branches().and(Glob::all_remotes()); + let branches: Vec = repo + .revision_branches(commit.id, glob)? + .iter() + .map(|b| b.refname().to_string()) + .collect(); + + let mut files: HashMap> = HashMap::new(); + diff.files().for_each(|file_diff| match file_diff { + diff::FileDiff::Added(added) => { + if let Ok(blob) = repo.blob_ref(added.new.oid) { + files.insert(blob.id(), blob); + } + } + diff::FileDiff::Deleted(deleted) => { + if let Ok(old_blob) = repo.blob_ref(deleted.old.oid) { + files.insert(old_blob.id(), old_blob); + } + } + diff::FileDiff::Modified(modified) => { + if let (Ok(old_blob), Ok(new_blob)) = ( + repo.blob_ref(modified.old.oid), + repo.blob_ref(modified.new.oid), + ) { + files.insert(old_blob.id(), old_blob); + files.insert(new_blob.id(), new_blob); + } + } + diff::FileDiff::Moved(moved) => { + if let (Ok(old_blob), Ok(new_blob)) = + (repo.blob_ref(moved.old.oid), repo.blob_ref(moved.new.oid)) + { + files.insert(old_blob.id(), old_blob); + files.insert(new_blob.id(), new_blob); + } + } + diff::FileDiff::Copied(copied) => { + if let (Ok(old_blob), Ok(new_blob)) = + (repo.blob_ref(copied.old.oid), repo.blob_ref(copied.new.oid)) + { + files.insert(old_blob.id(), old_blob); + files.insert(new_blob.id(), new_blob); + } + } + }); + + let response: serde_json::Value = json!({ + "commit": api::json::commit(&commit), + "diff": diff, + "files": files, + "branches": branches + }); + Ok::<_, Error>(immutable_response(response)) +} + +/// Get diff between two commits +/// `GET /projects/:project/diff/:base/:oid` +async fn diff_handler( + State(ctx): State, + Path((project, base, oid)): Path<(RepoId, Oid, Oid)>, +) -> impl IntoResponse { + let (repo, _) = ctx.repo(project)?; + let repo = Repository::open(repo.path())?; + let base = repo.commit(base)?; + let commit = repo.commit(oid)?; + let diff = repo.diff(base.id, commit.id)?; + let mut files: HashMap> = HashMap::new(); + diff.files().for_each(|file_diff| match file_diff { + diff::FileDiff::Added(added) => { + if let Ok(new_blob) = repo.blob_ref(added.new.oid) { + files.insert(new_blob.id(), new_blob); + } + } + diff::FileDiff::Deleted(deleted) => { + if let Ok(old_blob) = repo.blob_ref(deleted.old.oid) { + files.insert(old_blob.id(), old_blob); + } + } + diff::FileDiff::Modified(modified) => { + if let (Ok(new_blob), Ok(old_blob)) = ( + repo.blob_ref(modified.old.oid), + repo.blob_ref(modified.new.oid), + ) { + files.insert(new_blob.id(), new_blob); + files.insert(old_blob.id(), old_blob); + } + } + diff::FileDiff::Moved(moved) => { + if let (Ok(new_blob), Ok(old_blob)) = + (repo.blob_ref(moved.new.oid), repo.blob_ref(moved.old.oid)) + { + files.insert(new_blob.id(), new_blob); + files.insert(old_blob.id(), old_blob); + } + } + diff::FileDiff::Copied(copied) => { + if let (Ok(new_blob), Ok(old_blob)) = + (repo.blob_ref(copied.new.oid), repo.blob_ref(copied.old.oid)) + { + files.insert(new_blob.id(), new_blob); + files.insert(old_blob.id(), old_blob); + } + } + }); + + let commits = repo + .history(commit.id)? + .take_while(|c| { + if let Ok(c) = c { + c.id != base.id + } else { + false + } + }) + .map(|r| r.map(|c| api::json::commit(&c))) + .collect::, _>>()?; + + let response = json!({ "diff": diff, "files": files, "commits": commits }); + + Ok::<_, Error>(immutable_response(response)) +} + +/// Get project activity for the past year. +/// `GET /projects/:project/activity` +async fn activity_handler( + State(ctx): State, + Path(project): Path, +) -> impl IntoResponse { + let (repo, _) = ctx.repo(project)?; + let current_date = chrono::Utc::now().timestamp(); + // SAFETY: The number of weeks is static and not out of bounds. + #[allow(clippy::unwrap_used)] + let one_year_ago = chrono::Duration::try_weeks(52).unwrap(); + let repo = Repository::open(repo.path())?; + let head = repo.head()?; + let timestamps = repo + .history(head)? + .filter_map(|a| { + if let Ok(a) = a { + let seconds = a.committer.time.seconds(); + if seconds > current_date - one_year_ago.num_seconds() { + return Some(seconds); + } + } + None + }) + .collect::>(); + + Ok::<_, Error>((StatusCode::OK, Json(json!({ "activity": timestamps })))) +} + +/// Get project source tree for '/' path. +/// `GET /projects/:project/tree/:sha/` +async fn tree_handler_root( + State(ctx): State, + Path((rid, sha)): Path<(RepoId, Oid)>, +) -> impl IntoResponse { + tree_handler(State(ctx), Path((rid, sha, String::new()))).await +} + +/// Get project source tree. +/// `GET /projects/:project/tree/:sha/*path` +async fn tree_handler( + State(ctx): State, + Path((project, sha, path)): Path<(RepoId, Oid, String)>, +) -> impl IntoResponse { + let (repo, _) = ctx.repo(project)?; + + if let Some(ref cache) = ctx.cache { + let cache = &mut cache.tree.lock().await; + if let Some(response) = cache.get(&(project, sha, path.clone())) { + return Ok::<_, Error>(immutable_response(response.clone())); + } + } + + let repo = Repository::open(repo.path())?; + let tree = repo.tree(sha, &path)?; + let response = api::json::tree(&tree, &path); + + if let Some(cache) = &ctx.cache { + let cache = &mut cache.tree.lock().await; + cache.put((project, sha, path.clone()), response.clone()); + } + + Ok::<_, Error>(immutable_response(response)) +} + +/// Get project source tree stats. +/// `GET /projects/:project/stats/tree/:sha` +async fn stats_tree_handler( + State(ctx): State, + Path((project, sha)): Path<(RepoId, Oid)>, +) -> impl IntoResponse { + let (repo, _) = ctx.repo(project)?; + let repo = Repository::open(repo.path())?; + let stats = repo.stats_from(&sha)?; + + Ok::<_, Error>(immutable_response(stats)) +} + +/// Get all project remotes. +/// `GET /projects/:project/remotes` +async fn remotes_handler( + State(ctx): State, + Path(project): Path, +) -> impl IntoResponse { + let (repo, doc) = ctx.repo(project)?; + let delegates = &doc.delegates; + let aliases = &ctx.profile.aliases(); + let remotes = repo + .remotes()? + .filter_map(|r| r.map(|r| r.1).ok()) + .map(|remote| { + let refs = remote + .refs + .iter() + .filter_map(|(r, oid)| { + r.as_str() + .strip_prefix("refs/heads/") + .map(|head| (head.to_string(), oid)) + }) + .collect::>(); + + match aliases.alias(&remote.id) { + Some(alias) => json!({ + "id": remote.id, + "alias": alias, + "heads": refs, + "delegate": delegates.contains(&remote.id.into()), + }), + None => json!({ + "id": remote.id, + "heads": refs, + "delegate": delegates.contains(&remote.id.into()), + }), + } + }) + .collect::>(); + + Ok::<_, Error>(Json(remotes)) +} + +/// Get project remote. +/// `GET /projects/:project/remotes/:peer` +async fn remote_handler( + State(ctx): State, + Path((project, node_id)): Path<(RepoId, NodeId)>, +) -> impl IntoResponse { + let (repo, doc) = ctx.repo(project)?; + let delegates = &doc.delegates; + let remote = repo.remote(&node_id)?; + let refs = remote + .refs + .iter() + .filter_map(|(r, oid)| { + r.as_str() + .strip_prefix("refs/heads/") + .map(|head| (head.to_string(), oid)) + }) + .collect::>(); + let remote = json!({ + "id": remote.id, + "heads": refs, + "delegate": delegates.contains(&remote.id.into()), + }); + + Ok::<_, Error>(Json(remote)) +} + +/// Get project source file. +/// `GET /projects/:project/blob/:sha/*path` +async fn blob_handler( + State(ctx): State, + Path((project, sha, path)): Path<(RepoId, Oid, String)>, +) -> impl IntoResponse { + let (repo, _) = ctx.repo(project)?; + let repo = Repository::open(repo.path())?; + let blob = repo.blob(sha, &path)?; + + if blob.size() > MAX_BODY_LIMIT { + return Ok::<_, Error>( + ( + StatusCode::PAYLOAD_TOO_LARGE, + [(header::CACHE_CONTROL, "no-cache")], + Json(json!([])), + ) + .into_response(), + ); + } + Ok::<_, Error>(immutable_response(api::json::blob(&blob, &path)).into_response()) +} + +/// Get project readme. +/// `GET /projects/:project/readme/:sha` +async fn readme_handler( + State(ctx): State, + Path((project, sha)): Path<(RepoId, Oid)>, +) -> impl IntoResponse { + let (repo, _) = ctx.repo(project)?; + let repo = Repository::open(repo.path())?; + let paths = [ + "README", + "README.md", + "README.markdown", + "README.txt", + "README.rst", + "Readme.md", + ]; + + for path in paths + .iter() + .map(ToString::to_string) + .chain(paths.iter().map(|p| p.to_lowercase())) + { + if let Ok(blob) = repo.blob(sha, &path) { + if blob.size() > MAX_BODY_LIMIT { + return Ok::<_, Error>( + ( + StatusCode::PAYLOAD_TOO_LARGE, + [(header::CACHE_CONTROL, "no-cache")], + Json(json!([])), + ) + .into_response(), + ); + } + + return Ok::<_, Error>( + immutable_response(api::json::blob(&blob, &path)).into_response(), + ); + } + } + + Err(Error::NotFound) +} + +/// Get project issues list. +/// `GET /projects/:project/issues` +async fn issues_handler( + State(ctx): State, + Path(project): Path, + Query(qs): Query>, +) -> impl IntoResponse { + let (repo, _) = ctx.repo(project)?; + let CobsQuery { + page, + per_page, + state, + } = qs; + let page = page.unwrap_or(0); + let per_page = per_page.unwrap_or(10); + let state = state.unwrap_or_default(); + let issues = ctx.profile.issues(&repo)?; + let mut issues: Vec<_> = issues + .list()? + .filter_map(|r| { + let (id, issue) = r.ok()?; + (state.matches(issue.state())).then_some((id, issue)) + }) + .collect::>(); + + issues.sort_by(|(_, a), (_, b)| b.timestamp().cmp(&a.timestamp())); + let aliases = &ctx.profile.aliases(); + let issues = issues + .into_iter() + .map(|(id, issue)| api::json::issue(id, issue, aliases)) + .skip(page * per_page) + .take(per_page) + .collect::>(); + + Ok::<_, Error>(Json(issues)) +} + +#[derive(Debug, Deserialize, Serialize)] +pub struct IssueCreate { + pub title: String, + pub description: String, + pub labels: Vec