diff --git a/Cargo.lock b/Cargo.lock index 97c7b8f..f94daec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,28 +2,19 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "actions-proto-rs" -version = "0.1.2" -source = "sparse+https://ok.software/api/packages/ok/cargo/" -checksum = "82413645b9516043d46c6a00b76793e4e83d0cb9d696925dd94eff9510c2ae1c" -dependencies = [ - "hyper", - "prost", - "prost-build", - "prost-types", - "tonic", - "tonic-build", -] - [[package]] name = "actions-proto-rs" version = "0.1.3" dependencies = [ - "hyper", + "axum 0.7.5", + "axum-connect", + "axum-connect-build", + "hyper 0.14.28", + "okstd", "prost", "prost-build", "prost-types", + "tokio", "tonic", "tonic-build", ] @@ -43,6 +34,17 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[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 = "aho-corasick" version = "1.1.3" @@ -122,12 +124,6 @@ dependencies = [ "syn", ] -[[package]] -name = "atomic" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" - [[package]] name = "autocfg" version = "1.3.0" @@ -141,13 +137,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" dependencies = [ "async-trait", - "axum-core", + "axum-core 0.3.4", "bitflags 1.3.2", "bytes", "futures-util", - "http", - "http-body", - "hyper", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.28", "itoa", "matchit", "memchr", @@ -156,12 +152,84 @@ dependencies = [ "pin-project-lite", "rustversion", "serde", - "sync_wrapper", + "sync_wrapper 0.1.2", "tower", "tower-layer", "tower-service", ] +[[package]] +name = "axum" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" +dependencies = [ + "async-trait", + "axum-core 0.4.3", + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.3.1", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "multer", + "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", + "tracing", +] + +[[package]] +name = "axum-connect" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eecdf47a1ad4ec418f4dcb6874a53146e43fd1f0e7d30e06c9d0116f8ebff506" +dependencies = [ + "async-stream", + "async-trait", + "axum 0.7.5", + "base64 0.21.7", + "futures", + "pbjson", + "pbjson-types", + "prost", + "serde", + "serde_json", + "serde_qs", +] + +[[package]] +name = "axum-connect-build" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "975d0bdffa4b6597a14c6a5d4a17234a6e38f55e52d549a92bd857a55329361c" +dependencies = [ + "anyhow", + "convert_case", + "pbjson-build", + "proc-macro2", + "prost", + "prost-build", + "prost-reflect", + "protoc-fetcher", + "quote", + "syn", +] + [[package]] name = "axum-core" version = "0.3.4" @@ -171,14 +239,35 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http", - "http-body", + "http 0.2.12", + "http-body 0.4.6", "mime", "rustversion", "tower-layer", "tower-service", ] +[[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 1.1.0", + "http-body 1.0.0", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper 0.1.2", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "backtrace" version = "0.3.71" @@ -200,6 +289,18 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + [[package]] name = "bitflags" version = "1.3.2" @@ -218,20 +319,58 @@ version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array", + "generic-array 0.14.7", ] +[[package]] +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 = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + [[package]] name = "cc" version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" +dependencies = [ + "jobserver", + "libc", + "once_cell", +] [[package]] name = "cfg-if" @@ -239,6 +378,61 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chrono" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +dependencies = [ + "num-traits", +] + +[[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 = "colored" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f741c91823341bebf717d4c71bda820630ce065443b58bd1b7451af008355" +dependencies = [ + "is-terminal", + "lazy_static", + "winapi", +] + +[[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 = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -255,16 +449,75 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +[[package]] +name = "core2" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239fa3ae9b63c2dc74bd3fa852d4792b8b305ae64eeede946265b6af62f1fff3" +dependencies = [ + "memchr", +] + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crc16" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "338089f42c427b86394a5ee60ff321da23a5c89c9d89514c829687b26359fcff" + +[[package]] +name = "crc32_digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45d5efbc16ba04a6c1691aee22f18e9cce02fb7b7bdf85296d99139389b41983" +dependencies = [ + "crc32fast", + "digest 0.8.1", + "generic-array 0.12.4", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + [[package]] name = "crypto-common" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array", + "generic-array 0.14.7", "typenum", ] +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array 0.12.4", +] + [[package]] name = "digest" version = "0.10.7" @@ -273,6 +526,7 @@ checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", + "subtle", ] [[package]] @@ -281,6 +535,15 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +[[package]] +name = "encoding_rs" +version = "0.8.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +dependencies = [ + "cfg-if", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -303,12 +566,41 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +[[package]] +name = "fastvlq" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91264802066db11aa1bb46c294231afd8765d078ea3200986b444fd223539eaf" +dependencies = [ + "core2", +] + +[[package]] +name = "fern" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9f0c14694cbd524c8720dd69b0e3179344f04ebb5f90f2e4a440c6ea3b2f1ee" +dependencies = [ + "colored 1.9.4", + "log", +] + [[package]] name = "fixedbitset" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +[[package]] +name = "flate2" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + [[package]] name = "fnv" version = "1.0.7" @@ -339,6 +631,21 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + [[package]] name = "futures-channel" version = "0.3.30" @@ -346,6 +653,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", + "futures-sink", ] [[package]] @@ -354,6 +662,34 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "futures-sink" version = "0.3.30" @@ -372,10 +708,25 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ + "futures-channel", "futures-core", + "futures-io", + "futures-macro", + "futures-sink", "futures-task", + "memchr", "pin-project-lite", "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", ] [[package]] @@ -407,12 +758,21 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "gump" -version = "0.1.2" +version = "0.1.3" dependencies = [ - "actions-proto-rs 0.1.2", + "actions-proto-rs", "argh", - "hyper", + "axum 0.7.5", + "axum-connect", + "bytes", + "http 1.1.0", + "http-body-util", + "hyper 0.14.28", "hyper-tls", + "okstd", + "prost", + "serde", + "serde_json", "tokio", "tonic", "tonic-web", @@ -432,7 +792,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http", + "http 0.2.12", "indexmap 2.2.6", "slab", "tokio", @@ -452,6 +812,12 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + [[package]] name = "heck" version = "0.5.0" @@ -464,6 +830,21 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "http" version = "0.2.12" @@ -475,6 +856,17 @@ dependencies = [ "itoa", ] +[[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 = "0.4.6" @@ -482,7 +874,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http", + "http 0.2.12", + "pin-project-lite", +] + +[[package]] +name = "http-body" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +dependencies = [ + "bytes", + "http 1.1.0", +] + +[[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 1.1.0", + "http-body 1.0.0", "pin-project-lite", ] @@ -515,8 +930,8 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http", - "http-body", + "http 0.2.12", + "http-body 0.4.6", "httparse", "httpdate", "itoa", @@ -528,13 +943,32 @@ dependencies = [ "want", ] +[[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", + "http 1.1.0", + "http-body 1.0.0", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", +] + [[package]] name = "hyper-timeout" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "hyper", + "hyper 0.14.28", "pin-project-lite", "tokio", "tokio-io-timeout", @@ -547,12 +981,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper", + "hyper 0.14.28", "native-tls", "tokio", "tokio-native-tls", ] +[[package]] +name = "hyper-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +dependencies = [ + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "hyper 1.3.1", + "pin-project-lite", + "tokio", +] + [[package]] name = "idna" version = "0.5.0" @@ -583,6 +1032,41 @@ dependencies = [ "hashbrown 0.14.5", ] +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "is-terminal" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.12.1" @@ -598,6 +1082,24 @@ 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 = "lazy_static" version = "1.4.0" @@ -638,16 +1140,6 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" -[[package]] -name = "md-5" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" -dependencies = [ - "cfg-if", - "digest", -] - [[package]] name = "memchr" version = "2.7.2" @@ -680,6 +1172,23 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "multer" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83e87776546dc87511aa5ee218730c92b666d7264ab6ed41f9d215af9cd5224b" +dependencies = [ + "bytes", + "encoding_rs", + "futures-util", + "http 1.1.0", + "httparse", + "memchr", + "mime", + "spin", + "version_check", +] + [[package]] name = "multimap" version = "0.10.0" @@ -704,6 +1213,15 @@ dependencies = [ "tempfile", ] +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + [[package]] name = "num_cpus" version = "1.16.0" @@ -723,6 +1241,43 @@ dependencies = [ "memchr", ] +[[package]] +name = "ok_macros" +version = "0.1.9" +source = "sparse+https://ok.software/api/packages/ok/cargo/" +checksum = "769aac233e4883cafe74ae54d6ed7195f32498efce93eb325656408fc7fb4f07" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "okstd" +version = "0.1.9" +source = "sparse+https://ok.software/api/packages/ok/cargo/" +checksum = "a444fcc714b7bfe7ad667ae981c432cbb3dae61887f10279a6ea294e5ae06ee8" +dependencies = [ + "anyhow", + "base64 0.22.1", + "colored 2.1.0", + "crc16", + "crc32_digest", + "fastvlq", + "fern", + "futures", + "hex", + "log", + "num_cpus", + "ok_macros", + "rustc-demangle", + "serde", + "serde_json", + "termcolor", + "tokio", + "url", +] + [[package]] name = "once_cell" version = "1.19.0" @@ -796,6 +1351,66 @@ dependencies = [ "windows-targets 0.52.5", ] +[[package]] +name = "password-hash" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +dependencies = [ + "base64ct", + "rand_core", + "subtle", +] + +[[package]] +name = "pbjson" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1030c719b0ec2a2d25a5df729d6cff1acf3cc230bf766f4f97833591f7577b90" +dependencies = [ + "base64 0.21.7", + "serde", +] + +[[package]] +name = "pbjson-build" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2580e33f2292d34be285c5bc3dba5259542b083cfad6037b6d70345f24dcb735" +dependencies = [ + "heck 0.4.1", + "itertools 0.11.0", + "prost", + "prost-types", +] + +[[package]] +name = "pbjson-types" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18f596653ba4ac51bdecbb4ef6773bc7f56042dc13927910de1684ad3d32aa12" +dependencies = [ + "bytes", + "chrono", + "pbjson", + "pbjson-build", + "prost", + "prost-build", + "serde", +] + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.7", + "hmac", + "password-hash", + "sha2", +] + [[package]] name = "percent-encoding" version = "2.3.1" @@ -892,8 +1507,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" dependencies = [ "bytes", - "heck", - "itertools", + "heck 0.5.0", + "itertools 0.12.1", "log", "multimap", "once_cell", @@ -913,12 +1528,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", - "itertools", + "itertools 0.12.1", "proc-macro2", "quote", "syn", ] +[[package]] +name = "prost-reflect" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "057237efdb71cf4b3f9396302a3d6599a92fa94063ba537b66130980ea9909f3" +dependencies = [ + "once_cell", + "prost", + "prost-types", +] + [[package]] name = "prost-types" version = "0.12.6" @@ -928,6 +1554,17 @@ dependencies = [ "prost", ] +[[package]] +name = "protoc-fetcher" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dc3a19dc5cf866ffd03a0366da6a3187fdc9f471a29a2ff603c170c879944fd" +dependencies = [ + "anyhow", + "reqwest", + "zip-extract", +] + [[package]] name = "quote" version = "1.0.36" @@ -1005,6 +1642,46 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +[[package]] +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "base64 0.21.7", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.28", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 0.1.2", + "system-configuration", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + [[package]] name = "rustc-demangle" version = "0.1.24" @@ -1024,12 +1701,27 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + [[package]] name = "rustversion" version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + [[package]] name = "schannel" version = "0.1.23" @@ -1070,18 +1762,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.202" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.202" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", @@ -1089,10 +1781,70 @@ dependencies = [ ] [[package]] -name = "sha1_smol" -version = "1.0.0" +name = "serde_json" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +dependencies = [ + "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_qs" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0431a35568651e363364210c91983c1da5eb29404d9f0928b67d4ebcfa7d330c" +dependencies = [ + "percent-encoding", + "serde", + "thiserror", +] + +[[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 = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] [[package]] name = "signal-hook-registry" @@ -1128,6 +1880,18 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + [[package]] name = "syn" version = "2.0.66" @@ -1145,6 +1909,33 @@ 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 = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tempfile" version = "3.10.1" @@ -1157,6 +1948,35 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -1174,9 +1994,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.37.0" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", "bytes", @@ -1203,9 +2023,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", @@ -1254,13 +2074,13 @@ checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" dependencies = [ "async-stream", "async-trait", - "axum", - "base64", + "axum 0.6.20", + "base64 0.21.7", "bytes", "h2", - "http", - "http-body", - "hyper", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.28", "hyper-timeout", "percent-encoding", "pin-project", @@ -1292,11 +2112,11 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc3b0e1cedbf19fdfb78ef3d672cb9928e0a91a9cb4629cc0c916e8cff8aaaa1" dependencies = [ - "base64", + "base64 0.21.7", "bytes", - "http", - "http-body", - "hyper", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.28", "pin-project", "tokio-stream", "tonic", @@ -1336,8 +2156,8 @@ dependencies = [ "bytes", "futures-core", "futures-util", - "http", - "http-body", + "http 0.2.12", + "http-body 0.4.6", "http-range-header", "pin-project-lite", "tower-layer", @@ -1421,6 +2241,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-segmentation" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" + [[package]] name = "url" version = "2.5.0" @@ -1438,10 +2264,7 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ - "atomic", "getrandom", - "md-5", - "sha1_smol", ] [[package]] @@ -1471,6 +2294,113 @@ 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", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[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", + "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 = "web-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[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-util" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +dependencies = [ + "windows-sys 0.52.0", +] + +[[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-sys" version = "0.48.0" @@ -1609,3 +2539,72 @@ name = "windows_x86_64_msvc" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "aes", + "byteorder", + "bzip2", + "constant_time_eq", + "crc32fast", + "crossbeam-utils", + "flate2", + "hmac", + "pbkdf2", + "sha1", + "zstd", +] + +[[package]] +name = "zip-extract" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e109e5a291403b4c1e514d39f8a22d3f98d257e691a52bb1f16051bb1ffed63e" +dependencies = [ + "log", + "thiserror", + "zip", +] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.10+zstd.1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/Cargo.toml b/Cargo.toml index bf05390..6397f9d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,11 +10,16 @@ license = "MIT" build = "build.rs" [dependencies] +axum = "0.7.5" +axum-connect = "0.3.2" +okstd = { version = "0.1.9", registry = "oksoftware", features = ["macros"] } prost = "0.12" prost-types = "0.12" +tokio = { version = "1.38.0", features = ["full"] } tonic = "0.11.0" [build-dependencies] prost-build = "0.12.6" tonic-build = "0.11" -hyper = { version = "0.14" } \ No newline at end of file +hyper = { version = "0.14" } +axum-connect-build = "0.3.2" diff --git a/build.rs b/build.rs index 346b5d1..037492d 100644 --- a/build.rs +++ b/build.rs @@ -1,3 +1,4 @@ +use axum_connect_build::{axum_connect_codegen, AxumConnectGenSettings}; use std::env; use std::path::PathBuf; use std::process::Command; @@ -15,7 +16,7 @@ fn main() { "-L", "-o", outfile.to_str().unwrap(), - "https://ok.software/ok/actions-proto-def/archive/main.tar.gz", + "https://ok.software/mirrors/actions-proto-def/archive/main.tar.gz", ]) .status() .unwrap(); @@ -32,29 +33,32 @@ fn main() { .unwrap(); // Check if protoc is installed - let status = Command::new("protoc").arg("--version").status().unwrap(); - if !status.success() { - panic!("protoc is not installed"); + let status = Command::new("protoc").arg("--version").status(); + match status { + Err(_) => panic!("protoc is not installed"), + _ => {} } + let protos_dir = out_dir.join("actions-proto-def/proto"); + let settings = AxumConnectGenSettings::from_directory_recursive(protos_dir.to_str().unwrap()) + .expect("failed to glob protos"); + axum_connect_codegen(settings).unwrap(); + // // Create longer-lived values for the proto paths + // let ping_proto_path = out_dir.join("actions-proto-def/proto/ping/v1/services.proto"); + // let runner_proto_path = out_dir.join("actions-proto-def/proto/runner/v1/services.proto"); + // let proto_files = &[ + // ping_proto_path.to_str().unwrap(), + // runner_proto_path.to_str().unwrap(), + // ]; - // Create longer-lived values for the proto paths - let ping_proto_path = out_dir.join("actions-proto-def/proto/ping/v1/services.proto"); - let runner_proto_path = out_dir.join("actions-proto-def/proto/runner/v1/services.proto"); + // let includes_path = out_dir.join("actions-proto-def/proto/"); - let proto_files = &[ - ping_proto_path.to_str().unwrap(), - runner_proto_path.to_str().unwrap(), - ]; - - let includes_path = out_dir.join("actions-proto-def/proto/"); - - // Compile the proto files - // Compile the proto files using tonic_build - tonic_build::configure() - .out_dir(&out_dir) - .compile(proto_files, &[includes_path]) - .unwrap(); + // // Compile the proto files + // // Compile the proto files using tonic_build + // tonic_build::configure() + // .out_dir(&out_dir) + // .compile(proto_files, &[includes_path]) + // .unwrap(); // // Generate additional services and codecs as needed // let descriptor_set_path = out_dir.join("descriptor.bin"); @@ -62,5 +66,4 @@ fn main() { // .file_descriptor_set_path(&descriptor_set_path) // .compile(proto_files, &[includes_path]) // .unwrap(); - -} \ No newline at end of file +} diff --git a/gump/Cargo.toml b/gump/Cargo.toml index 817c61a..a61f28d 100644 --- a/gump/Cargo.toml +++ b/gump/Cargo.toml @@ -9,7 +9,7 @@ repository = "https://ok.software/ok/runner_rs.git" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -actions-proto-rs = { version = "0.1.1", registry = "oksoftware" } +actions-proto-rs = { version = "*", path = ".." } url = "2.2.2" argh = "0.1.1" hyper = { version = "0.14" } @@ -18,11 +18,13 @@ tokio = { version = "1.37.0", features = ["full"] } tonic = "0.11.0" tonic-web = "0.11.0" tower = "0.4.13" -uuid = { version = "1.8.0", features = [ - "v4", - "v1", - "v3", - "v5", - "v8", -] } - +uuid = { version = "1.8.0", features = ["v4"] } +okstd = { version = "0.1.9", registry = "oksoftware", features = ["macros"] } +axum-connect = "0.3.2" +prost = "0.12.6" +axum = "0.7.5" +serde_json = "1.0.117" +http = "1.1.0" +serde = "1.0.203" +bytes = "1.6.0" +http-body-util = "0.1.1" diff --git a/gump/src/main.rs b/gump/src/main.rs index 446f5f0..8577d9c 100644 --- a/gump/src/main.rs +++ b/gump/src/main.rs @@ -1,30 +1,37 @@ -use actions_proto_rs::ping_service_client::PingServiceClient; -use actions_proto_rs::runner_service_client::RunnerServiceClient; -use actions_proto_rs::RegisterRequest; -use hyper::Uri; -use hyper::client::HttpConnector; -use hyper::Client; -use hyper_tls::HttpsConnector; -use tonic::codegen::InterceptedService; -use tonic::metadata::AsciiMetadataValue; -use tonic::metadata::MetadataMap; -use tonic::metadata::MetadataValue; -use tonic::service::Interceptor; -use tonic::Extensions; -use tonic::{transport::Channel, Request}; -use tonic_web::GrpcWebClientLayer; -use url::Url; +use actions_proto_rs::{FetchTaskRequest, FetchTaskResponse, PingRequest, RegisterRequest, RegisterResponse}; use argh::FromArgs; +use axum::http::{HeaderMap, HeaderValue}; +use hyper::{Client, Uri}; +use hyper_tls::HttpsConnector; +use okstd::prelude::*; +use serde_json::json; +use bytes::Bytes; +use http_body_util::{BodyExt, Empty}; +use hyper::{body::Buf, Request}; +use serde::Deserialize; const UUID_HEADER_KEY: &str = "x-runner-uuid"; const TOKEN_HEADER_KEY: &str = "x-runner-token"; const VERSION_HEADER_KEY: &str = "x-runner-version"; - -// Structure to hold command-line arguments #[derive(FromArgs, Debug)] /// Actions Runner Client struct Gump { + #[argh(subcommand)] + nested: Commands, +} + +#[derive(FromArgs, Debug)] +#[argh(subcommand)] +enum Commands { + Ping(PingCmd), + Register(RegisterCmd), +} + +#[derive(FromArgs, Debug)] +/// Ping Command +#[argh(subcommand, name = "ping")] +struct PingCmd { /// authentication token #[argh(option, short = 't', long = "token")] token: String, @@ -39,60 +46,110 @@ struct Gump { base_url: Option, } -#[tokio::main] -async fn main() -> Result<(), Box> { - // Parse arguments using argh +#[derive(FromArgs, Debug)] +/// Register Command +#[argh(subcommand, name = "register")] +struct RegisterCmd { + /// authentication token + #[argh(option, short = 't', long = "token")] + token: String, + /// runner version + #[argh(option, short = 'v', long = "version")] + version: Option, + /// unique identifier + #[argh(option, short = 'u', long = "uuid")] + uuid: Option, + /// base URL of the API server + #[argh(option, short = 'b', long = "base-url")] + base_url: Option, +} + +#[okstd::log(trace)] +#[okstd::main] +async fn main() { let args: Gump = argh::from_env(); - // Parse base URL - let base_url = args.base_url.unwrap_or("https://ok.software/api/actions".to_string()); - let version = args.version.unwrap_or(concat!("v", env!("CARGO_PKG_VERSION")).to_string()); - let base_url = base_url.parse::().unwrap(); - - let client = hyper::Client::builder().build(HttpsConnector::new()); - let svc = tower::ServiceBuilder::new() - .layer(GrpcWebClientLayer::new()) - .service(client); - let mut runner_client = RunnerServiceClient::with_origin( - svc.clone(), - base_url.clone(), - ); - let mut ping_client = PingServiceClient::with_origin(svc, base_url); - - let token = args.token; - - let uuid = args.uuid.unwrap_or(uuid::Uuid::new_v4().to_string()); - - // Log the client creation - println!("Client created with UUID: {}", uuid); - let mut metadata = MetadataMap::new(); - metadata.insert(VERSION_HEADER_KEY, version.parse().unwrap()); - - metadata.insert(UUID_HEADER_KEY, uuid.parse().unwrap()); - metadata.insert(TOKEN_HEADER_KEY, token.parse().unwrap()); - metadata.insert(VERSION_HEADER_KEY, version.parse().unwrap()); - - // register meta data needs to be empty - let reg_metadata = metadata.clone(); - // ping request - let ping_request = Request::from_parts( - reg_metadata.clone(), - Extensions::default(), - actions_proto_rs::PingRequest { - data: "nixos".to_string(), - }, - ); - - // Log ping request - println!("Ping Request: {:?}", ping_request); - match ping_client.ping(ping_request).await { - Ok(resp) => { - println!("Response: {:?}", resp); - } - Err(e) => { - println!("Error: {:?}", e); - } + match args.nested { + Commands::Ping(cmd) => handle_ping(cmd).await, + Commands::Register(cmd) => handle_register(cmd).await, } + .expect("command didn't run successfully"); +} + +async fn handle_ping(cmd: PingCmd) -> Result<(), Box> { + let base_url = cmd + .base_url + .unwrap_or("https://ok.software/api/actions".to_string()); + let version = cmd + .version + .unwrap_or(concat!("v", env!("CARGO_PKG_VERSION")).to_string()); + + let base_uri = Uri::builder() + .scheme("https") + .authority("ok.software") + .path_and_query("/api/actions/ping.v1.PingService/Ping") + .build() + .unwrap(); + + let https = HttpsConnector::new(); + let client = Client::builder().build::<_, hyper::Body>(https); + + let token = cmd.token; + let uuid = cmd.uuid.unwrap_or(uuid::Uuid::new_v4().to_string()); + + info!("Ping client created with UUID: {}", uuid); + let mut headers = HeaderMap::new(); + headers.insert(VERSION_HEADER_KEY, HeaderValue::from_str(&version).unwrap()); + headers.insert(UUID_HEADER_KEY, HeaderValue::from_str(&uuid).unwrap()); + headers.insert(TOKEN_HEADER_KEY, HeaderValue::from_str(&token).unwrap()); + + let ping_request = PingRequest { + data: "nixos".to_string(), + }; + + let request = hyper::Request::builder() + .method(hyper::Method::POST) + .uri(base_uri) + .header("Content-Type", "application/json") + .header(VERSION_HEADER_KEY, version) + .header(UUID_HEADER_KEY, uuid) + .header(TOKEN_HEADER_KEY, token) + .body(hyper::Body::from(json!(ping_request).to_string())) + .unwrap(); + + info!("Ping Request: {:?}", request); + let response = client.request(request).await?; + info!("Ping Response: {:?}", response); + + Ok(()) +} + +async fn handle_register(cmd: RegisterCmd) -> Result<(), Box> { + let base_url = cmd + .base_url + .unwrap_or("https://ok.software/api/actions".to_string()); + let version = cmd + .version + .unwrap_or(concat!("v", env!("CARGO_PKG_VERSION")).to_string()); + + let base_uri = Uri::builder() + .scheme("https") + .authority("ok.software") + .path_and_query("/api/actions/runner.v1.RunnerService/Register") + .build() + .unwrap(); + + let https = HttpsConnector::new(); + let client = Client::builder().build::<_, hyper::Body>(https); + + let token = cmd.token; + let uuid = cmd.uuid.unwrap_or(uuid::Uuid::new_v4().to_string()); + + info!("Register client created with UUID: {}", uuid); + let mut headers = HeaderMap::new(); + headers.insert(VERSION_HEADER_KEY, HeaderValue::from_str(&version).unwrap()); + headers.insert(UUID_HEADER_KEY, HeaderValue::from_str(&uuid).unwrap()); + headers.insert(TOKEN_HEADER_KEY, HeaderValue::from_str(&token).unwrap()); let labels = vec![ "ubuntu-latest:docker://gitea/runner-images:ubuntu-latest".to_string(), @@ -100,42 +157,31 @@ async fn main() -> Result<(), Box> { "ubuntu-20.04:docker://gitea/runner-images:ubuntu-20.04".to_string(), ]; - // Log metadata - println!("Metadata: {:?}", metadata); - let request = Request::from_parts( - reg_metadata, - Extensions::default(), - RegisterRequest { - name: "nixos".to_string(), - version: version, - token: token.to_string(), - labels: labels.clone(), - agent_labels: labels, - custom_labels: vec![], - }, - ); + let register_request = RegisterRequest { + name: "nixos".to_string(), + version: version.clone(), + token: token.clone(), + labels: labels.clone(), + agent_labels: labels.clone(), + custom_labels: vec![], + }; - // Log request - println!("Request: {:?}", request); - let resp = runner_client.register(request).await; - match resp { - Ok(resp) => { - println!("Response: {:?}", resp); - } - Err(e) => { - println!("Error: {:?}", e); - } - } - - let fetch_task_request = Request::from_parts( - metadata, - Extensions::default(), - actions_proto_rs::FetchTaskRequest { tasks_version: 0 }, - ); - - // Log fetch task request - println!("Fetch Task Request: {:?}", fetch_task_request); - let response = runner_client.fetch_task(fetch_task_request).await?; + let request = hyper::Request::builder() + .method(hyper::Method::POST) + .uri(base_uri) + .header("Content-Type", "application/json") + .header(VERSION_HEADER_KEY, version) + .header(UUID_HEADER_KEY, uuid) + .header(TOKEN_HEADER_KEY, token) + .body(hyper::Body::from(json!(register_request).to_string())) + .unwrap(); + info!("Register Request: {:?}", request); + let response = client.request(request).await?; + info!("Register Response: {:?}", response); + let body = hyper::body::aggregate(response).await?; + + let register_response: RegisterResponse = serde_json::from_reader(body.reader())?; + info!("Register Response: {:?}", register_response); Ok(()) } diff --git a/rust-toolchain b/rust-toolchain new file mode 100644 index 0000000..404a7d6 --- /dev/null +++ b/rust-toolchain @@ -0,0 +1,3 @@ +[toolchain] +channel = "1.78" +components = [ "rustfmt", "clippy", "llvm-tools-preview", "rust-src" ]