From 3a984bc75b5845c81974e6d0a92f68d7eacbccd8 Mon Sep 17 00:00:00 2001 From: Michael Lieberman Date: Wed, 10 Apr 2024 12:47:19 +0000 Subject: [PATCH] Add list output functionality This required a lot more refactoring to get stuff working in a reasonable way. This also removed Surrealdb dependency that was no longer used. --- Cargo.lock | 1953 +--------------------------- Cargo.toml | 5 +- skootrs-bin/src/helpers.rs | 394 ++---- skootrs-bin/src/main.rs | 50 +- skootrs-lib/src/service/mod.rs | 6 +- skootrs-lib/src/service/output.rs | 105 ++ skootrs-lib/src/service/project.rs | 41 +- skootrs-model/src/skootrs/mod.rs | 51 + skootrs-rest/src/server/project.rs | 18 +- skootrs-rest/src/server/rest.rs | 5 +- skootrs-statestore/Cargo.toml | 1 - skootrs-statestore/src/lib.rs | 61 - 12 files changed, 342 insertions(+), 2348 deletions(-) create mode 100644 skootrs-lib/src/service/output.rs diff --git a/Cargo.lock b/Cargo.lock index f4e4717..961aba5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -29,7 +29,7 @@ dependencies = [ "actix-rt", "actix-service", "actix-utils", - "ahash 0.8.7", + "ahash", "base64", "bitflags 2.4.1", "brotli", @@ -144,7 +144,7 @@ dependencies = [ "actix-service", "actix-utils", "actix-web-codegen", - "ahash 0.8.7", + "ahash", "bytes", "bytestring", "cfg-if", @@ -181,15 +181,6 @@ dependencies = [ "syn 2.0.48", ] -[[package]] -name = "addr" -version = "0.15.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a93b8a41dbe230ad5087cc721f8d41611de654542180586b315d9f4cf6b72bef" -dependencies = [ - "psl-types", -] - [[package]] name = "addr2line" version = "0.21.0" @@ -205,17 +196,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "ahash" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - [[package]] name = "ahash" version = "0.8.7" @@ -253,12 +233,6 @@ dependencies = [ "alloc-no-stdlib", ] -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "android-tzdata" version = "0.1.1" @@ -322,54 +296,12 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "any_ascii" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea50b14b7a4b9343f8c627a7a53c52076482bd4bdad0a24fd3ec533ed616cc2c" - -[[package]] -name = "approx" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" -dependencies = [ - "num-traits", -] - [[package]] name = "arc-swap" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" -[[package]] -name = "argon2" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ba4cac0a46bc1d2912652a751c47f2a9f3a7fe89bcae2275d418f5270402f9" -dependencies = [ - "base64ct", - "blake2", - "cpufeatures", - "password-hash", -] - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "ascii-canvas" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" -dependencies = [ - "term", -] - [[package]] name = "askama" version = "0.12.1" @@ -414,59 +346,6 @@ dependencies = [ "nom", ] -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - -[[package]] -name = "async-executor" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" -dependencies = [ - "async-lock", - "async-task", - "concurrent-queue", - "fastrand", - "futures-lite", - "slab", -] - -[[package]] -name = "async-lock" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" -dependencies = [ - "event-listener 4.0.3", - "event-listener-strategy", - "pin-project-lite", -] - -[[package]] -name = "async-recursion" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "async-task" -version = "4.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" - [[package]] name = "async-trait" version = "0.1.74" @@ -478,32 +357,6 @@ dependencies = [ "syn 2.0.48", ] -[[package]] -name = "async_io_stream" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" -dependencies = [ - "futures", - "pharos", - "rustc_version", -] - -[[package]] -name = "atomic" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" - -[[package]] -name = "atomic-polyfill" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" -dependencies = [ - "critical-section", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -531,12 +384,6 @@ 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 = "basic-toml" version = "0.1.7" @@ -546,64 +393,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bcrypt" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d1c9c15093eb224f0baa400f38fcd713fc1391a6f1c389d886beef146d60a3" -dependencies = [ - "base64", - "blowfish", - "getrandom", - "subtle", - "zeroize", -] - -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[package]] -name = "bindgen" -version = "0.65.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" -dependencies = [ - "bitflags 1.3.2", - "cexpr", - "clang-sys", - "lazy_static", - "lazycell", - "peeking_take_while", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.48", -] - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - [[package]] name = "bitflags" version = "1.3.2" @@ -616,27 +405,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "blake2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" -dependencies = [ - "digest", -] - [[package]] name = "block-buffer" version = "0.10.4" @@ -646,40 +414,6 @@ 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 = "borsh" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58b559fd6448c6e2fd0adb5720cd98a2506594cafa4737ff98c396f3e82f667" -dependencies = [ - "borsh-derive", - "cfg_aliases", -] - -[[package]] -name = "borsh-derive" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aadb5b6ccbd078890f6d7003694e33816e6b784358f18e15e7e6d9f065a57cd" -dependencies = [ - "once_cell", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.48", - "syn_derive", -] - [[package]] name = "brotli" version = "3.4.0" @@ -707,34 +441,6 @@ version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" -[[package]] -name = "bytecheck" -version = "0.6.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" -dependencies = [ - "bytecheck_derive", - "ptr_meta", - "simdutf8", -] - -[[package]] -name = "bytecheck_derive" -version = "0.6.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "bytemuck" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" - [[package]] name = "byteorder" version = "1.5.0" @@ -756,17 +462,6 @@ dependencies = [ "bytes", ] -[[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.83" @@ -777,84 +472,12 @@ dependencies = [ "libc", ] -[[package]] -name = "cedar-policy" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d91e3b10a0f7f2911774d5e49713c4d25753466f9e11d1cd2ec627f8a2dc857" -dependencies = [ - "cedar-policy-core", - "cedar-policy-validator", - "itertools 0.10.5", - "lalrpop-util", - "ref-cast", - "serde", - "serde_json", - "smol_str", - "thiserror", -] - -[[package]] -name = "cedar-policy-core" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd2315591c6b7e18f8038f0a0529f254235fd902b6c217aabc04f2459b0d9995" -dependencies = [ - "either", - "ipnet", - "itertools 0.10.5", - "lalrpop", - "lalrpop-util", - "lazy_static", - "miette", - "regex", - "rustc_lexer", - "serde", - "serde_json", - "serde_with", - "smol_str", - "stacker", - "thiserror", -] - -[[package]] -name = "cedar-policy-validator" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e756e1b2a5da742ed97e65199ad6d0893e9aa4bd6b34be1de9e70bd1e6adc7df" -dependencies = [ - "cedar-policy-core", - "itertools 0.10.5", - "serde", - "serde_json", - "serde_with", - "smol_str", - "stacker", - "thiserror", - "unicode-security", -] - -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "cfg_aliases" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" - [[package]] name = "chrono" version = "0.4.31" @@ -870,27 +493,6 @@ dependencies = [ "windows-targets 0.48.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 = "clang-sys" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" -dependencies = [ - "glob", - "libc", - "libloading", -] - [[package]] name = "clap" version = "4.4.10" @@ -962,21 +564,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" -[[package]] -name = "concurrent-queue" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - [[package]] name = "convert_case" version = "0.4.0" @@ -1028,12 +615,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "critical-section" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" - [[package]] name = "crossbeam-channel" version = "0.5.11" @@ -1077,12 +658,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - [[package]] name = "crypto-common" version = "0.1.6" @@ -1093,58 +668,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "darling" -version = "0.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.48", -] - -[[package]] -name = "darling_macro" -version = "0.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" -dependencies = [ - "darling_core", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "data-encoding" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" - -[[package]] -name = "der" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" -dependencies = [ - "const-oid", - "pem-rfc7468", - "zeroize", -] - [[package]] name = "deranged" version = "0.3.10" @@ -1152,7 +675,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" dependencies = [ "powerfmt", - "serde", ] [[package]] @@ -1168,18 +690,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "deunicode" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ae2a35373c5c74340b79ae6780b498b2b183915ec5dacf263aac5a099bf485a" - -[[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" @@ -1187,9 +697,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", - "const-oid", "crypto-common", - "subtle", ] [[package]] @@ -1201,16 +709,6 @@ dependencies = [ "dirs-sys", ] -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if", - "dirs-sys-next", -] - [[package]] name = "dirs-sys" version = "0.4.1" @@ -1223,26 +721,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "dmp" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfaa1135a34d26e5cc5b4927a8935af887d4f30a5653a797c33b9a4222beb6d9" -dependencies = [ - "urlencoding", -] - [[package]] name = "doc-comment" version = "0.3.3" @@ -1255,31 +733,12 @@ version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" -[[package]] -name = "earcutr" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79127ed59a85d7687c409e9978547cffb7dc79675355ed22da6b66fd5f6ead01" -dependencies = [ - "itertools 0.11.0", - "num-traits", -] - [[package]] name = "either" version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" -[[package]] -name = "ena" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1" -dependencies = [ - "log", -] - [[package]] name = "encoding_rs" version = "0.8.33" @@ -1289,12 +748,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - [[package]] name = "equivalent" version = "1.0.1" @@ -1311,45 +764,12 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "event-listener" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" -dependencies = [ - "event-listener 4.0.3", - "pin-project-lite", -] - [[package]] name = "fastrand" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" -[[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.28" @@ -1360,24 +780,6 @@ dependencies = [ "miniz_oxide", ] -[[package]] -name = "float_next_after" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf7cc16383c4b8d58b9905a8509f02926ce3058053c056376248d958c9df1e8" - -[[package]] -name = "flume" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" -dependencies = [ - "futures-core", - "futures-sink", - "nanorand", - "spin 0.9.8", -] - [[package]] name = "fnv" version = "1.0.7" @@ -1408,24 +810,12 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fst" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab85b9b05e3978cc9a9cf8fea7f01b494e1a09ed3037e16ba39edc7a29eb61a" - [[package]] name = "fuchsia-cprng" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - [[package]] name = "futures" version = "0.3.30" @@ -1451,19 +841,6 @@ dependencies = [ "futures-sink", ] -[[package]] -name = "futures-concurrency" -version = "7.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef6712e11cdeed5c8cf21ea0b90fec40fbe64afc9bbf2339356197eeca829fc3" -dependencies = [ - "bitvec", - "futures-core", - "pin-project", - "slab", - "smallvec", -] - [[package]] name = "futures-core" version = "0.3.30" @@ -1487,19 +864,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" -[[package]] -name = "futures-lite" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" -dependencies = [ - "fastrand", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", -] - [[package]] name = "futures-macro" version = "0.3.30" @@ -1541,15 +905,6 @@ dependencies = [ "slab", ] -[[package]] -name = "fuzzy-matcher" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54614a3312934d066701a80f20f15fa3b56d67ac7722b39eea5b4c9dd1d66c94" -dependencies = [ - "thread_local", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -1560,62 +915,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "geo" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1645cf1d7fea7dac1a66f7357f3df2677ada708b8d9db8e9b043878930095a96" -dependencies = [ - "earcutr", - "float_next_after", - "geo-types", - "geographiclib-rs", - "log", - "num-traits", - "robust", - "rstar", - "serde", -] - -[[package]] -name = "geo" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4841b40fdbccd4b7042bd6195e4de91da54af34c50632e371bcbfcdfb558b873" -dependencies = [ - "earcutr", - "float_next_after", - "geo-types", - "geographiclib-rs", - "log", - "num-traits", - "robust", - "rstar", - "serde", - "spade", -] - -[[package]] -name = "geo-types" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567495020b114f1ce9bed679b29975aa0bfae06ac22beacd5cfde5dabe7b05d6" -dependencies = [ - "approx", - "num-traits", - "rstar", - "serde", -] - -[[package]] -name = "geographiclib-rs" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea804e7bd3c6a4ca6a01edfa35231557a8a81d4d3f3e1e2b650d028c42592be" -dependencies = [ - "lazy_static", -] - [[package]] name = "gethostname" version = "0.2.3" @@ -1663,38 +962,20 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.2.3", + "indexmap", "slab", "tokio", "tokio-util", "tracing", ] -[[package]] -name = "hash32" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" -dependencies = [ - "byteorder", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.7", -] - [[package]] name = "hashbrown" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.7", + "ahash", ] [[package]] @@ -1702,23 +983,6 @@ name = "hashbrown" version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash 0.8.7", - "allocator-api2", -] - -[[package]] -name = "heapless" -version = "0.7.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" -dependencies = [ - "atomic-polyfill", - "hash32", - "rustc_version", - "spin 0.9.8", - "stable_deref_trait", -] [[package]] name = "heck" @@ -1732,21 +996,6 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" -[[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", -] - [[package]] name = "http" version = "0.2.11" @@ -1796,12 +1045,6 @@ dependencies = [ "libm", ] -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - [[package]] name = "hyper" version = "0.14.27" @@ -1888,13 +1131,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +] [[package]] name = "idna" @@ -1906,17 +1143,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - [[package]] name = "indexmap" version = "2.2.3" @@ -1928,15 +1154,6 @@ dependencies = [ "serde", ] -[[package]] -name = "inout" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" -dependencies = [ - "generic-array", -] - [[package]] name = "inquire" version = "0.6.2" @@ -1986,24 +1203,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.9" @@ -2036,45 +1235,13 @@ checksum = "5c7ea04a7c5c055c175f189b6dc6ba036fd62306b58c66c9f6389036c503a3f4" dependencies = [ "base64", "js-sys", - "pem 3.0.2", + "pem", "ring 0.17.6", "serde", "serde_json", "simple_asn1", ] -[[package]] -name = "lalrpop" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da4081d44f4611b66c6dd725e6de3169f9f63905421e8626fcb86b6a898998b8" -dependencies = [ - "ascii-canvas", - "bit-set", - "diff", - "ena", - "is-terminal", - "itertools 0.10.5", - "lalrpop-util", - "petgraph", - "pico-args", - "regex", - "regex-syntax 0.7.5", - "string_cache", - "term", - "tiny-keccak", - "unicode-xid", -] - -[[package]] -name = "lalrpop-util" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f35c735096c0293d313e8f2a641627472b83d01b937177fe76e5e2708d31e0d" -dependencies = [ - "regex", -] - [[package]] name = "language-tags" version = "0.3.2" @@ -2086,24 +1253,6 @@ name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -dependencies = [ - "spin 0.5.2", -] - -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - -[[package]] -name = "lexicmp" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7378d131ddf24063b32cbd7e91668d183140c4b3906270635a4d633d1068ea5d" -dependencies = [ - "any_ascii", -] [[package]] name = "libc" @@ -2111,16 +1260,6 @@ version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" -[[package]] -name = "libloading" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "libm" version = "0.2.8" @@ -2138,33 +1277,6 @@ dependencies = [ "redox_syscall", ] -[[package]] -name = "librocksdb-sys" -version = "0.11.0+8.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3386f101bcb4bd252d8e9d2fb41ec3b0862a15a62b478c355b2982efa469e3e" -dependencies = [ - "bindgen", - "bzip2-sys", - "cc", - "glob", - "libc", - "libz-sys", - "lz4-sys", - "zstd-sys", -] - -[[package]] -name = "libz-sys" -version = "1.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "295c17e837573c8c821dbaeb3cceb3d745ad082f7572191409e69cbc1b3fd050" -dependencies = [ - "cc", - "pkg-config", - "vcpkg", -] - [[package]] name = "linux-raw-sys" version = "0.4.13" @@ -2204,25 +1316,6 @@ version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" -[[package]] -name = "lru" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2994eeba8ed550fd9b47a0b38f0242bc3344e496483c6180b69139cc2fa5d1d7" -dependencies = [ - "hashbrown 0.14.3", -] - -[[package]] -name = "lz4-sys" -version = "1.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "matchers" version = "0.1.0" @@ -2232,45 +1325,12 @@ dependencies = [ "regex-automata 0.1.10", ] -[[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.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" -[[package]] -name = "miette" -version = "5.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" -dependencies = [ - "miette-derive", - "once_cell", - "thiserror", - "unicode-width", -] - -[[package]] -name = "miette-derive" -version = "5.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - [[package]] name = "mime" version = "0.3.17" @@ -2320,24 +1380,6 @@ version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d02c0b00610773bb7fc61d85e13d86c7858cbdf00e1a120bfc41bc055dbaa0e" -[[package]] -name = "nanoid" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ffa00dec017b5b1a8b7cf5e2c008bfda1aa7e0697ac1508b491fdf2622fb4d8" -dependencies = [ - "rand 0.8.5", -] - -[[package]] -name = "nanorand" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" -dependencies = [ - "getrandom", -] - [[package]] name = "native-tls" version = "0.2.11" @@ -2356,12 +1398,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "new_debug_unreachable" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" - [[package]] name = "newline-converter" version = "0.2.2" @@ -2371,15 +1407,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - [[package]] name = "nom" version = "7.1.3" @@ -2411,23 +1438,6 @@ dependencies = [ "num-traits", ] -[[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 0.8.5", - "smallvec", - "zeroize", -] - [[package]] name = "num-integer" version = "0.1.45" @@ -2438,17 +1448,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-iter" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.17" @@ -2456,7 +1455,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", - "libm", ] [[package]] @@ -2478,27 +1476,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "object_store" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2524735495ea1268be33d200e1ee97455096a0846295a21548cd2f3541de7050" -dependencies = [ - "async-trait", - "bytes", - "chrono", - "futures", - "humantime", - "itertools 0.11.0", - "parking_lot", - "percent-encoding", - "snafu", - "tokio", - "tracing", - "url", - "walkdir", -] - [[package]] name = "octocrab" version = "0.32.0" @@ -2631,7 +1608,7 @@ checksum = "1e32339a5dc40459130b3bd269e9892439f55b33e772d2a9d402a789baaf4e8a" dependencies = [ "futures-core", "futures-sink", - "indexmap 2.2.3", + "indexmap", "js-sys", "once_cell", "pin-project-lite", @@ -2716,12 +1693,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" -[[package]] -name = "parking" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" - [[package]] name = "parking_lot" version = "0.12.1" @@ -2745,57 +1716,12 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "password-hash" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" -dependencies = [ - "base64ct", - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "paste" version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" -[[package]] -name = "path-clean" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17359afc20d7ab31fdb42bb844c8b3bb1dabd7dcf7e68428492da7f16966fcef" - -[[package]] -name = "pbkdf2" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" -dependencies = [ - "digest", - "hmac", - "password-hash", - "sha2", -] - -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - -[[package]] -name = "pem" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b13fe415cdf3c8e44518e18a7c95a13431d9bdf6d15367d82b23c377fdd441a" -dependencies = [ - "base64", - "serde", -] - [[package]] name = "pem" version = "3.0.2" @@ -2806,56 +1732,12 @@ dependencies = [ "serde", ] -[[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 = "petgraph" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" -dependencies = [ - "fixedbitset", - "indexmap 2.2.3", -] - -[[package]] -name = "pharos" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" -dependencies = [ - "futures", - "rustc_version", -] - -[[package]] -name = "phf_shared" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" -dependencies = [ - "siphasher", -] - -[[package]] -name = "pico-args" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" - [[package]] name = "pin-project" version = "1.1.3" @@ -2884,30 +1766,9 @@ checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[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" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" -dependencies = [ - "der", - "spki", -] +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" @@ -2927,31 +1788,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[package]] -name = "precomputed-hash" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" - -[[package]] -name = "prettyplease" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" -dependencies = [ - "proc-macro2", - "syn 2.0.48", -] - -[[package]] -name = "proc-macro-crate" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" -dependencies = [ - "toml_edit", -] - [[package]] name = "proc-macro-error" version = "1.0.4" @@ -2985,41 +1821,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "psl-types" -version = "2.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33cb294fe86a74cbcf50d4445b37da762029549ebeea341421c7c70370f86cac" - -[[package]] -name = "psm" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" -dependencies = [ - "cc", -] - -[[package]] -name = "ptr_meta" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" -dependencies = [ - "ptr_meta_derive", -] - -[[package]] -name = "ptr_meta_derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "quote" version = "1.0.35" @@ -3029,23 +1830,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", - "serde", -] - [[package]] name = "rand" version = "0.4.6" @@ -3133,26 +1917,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "ref-cast" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53313ec9f12686aeeffb43462c3ac77aa25f590a5f630eb2cde0de59417b29c7" -dependencies = [ - "ref-cast-impl", -] - -[[package]] -name = "ref-cast-impl" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2566c4bf6845f2c2e83b27043c3f5dfcd5ba8f2937d6c00dc009bfb51a079dc4" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - [[package]] name = "regex" version = "1.10.2" @@ -3191,12 +1955,6 @@ version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" -[[package]] -name = "regex-syntax" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" - [[package]] name = "regex-syntax" version = "0.8.2" @@ -3222,15 +1980,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "rend" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" -dependencies = [ - "bytecheck", -] - [[package]] name = "reqwest" version = "0.11.24" @@ -3246,18 +1995,15 @@ dependencies = [ "http", "http-body", "hyper", - "hyper-rustls", "hyper-tls", "ipnet", "js-sys", "log", "mime", - "mime_guess", "native-tls", "once_cell", "percent-encoding", "pin-project-lite", - "rustls", "rustls-pemfile", "serde", "serde_json", @@ -3266,55 +2012,14 @@ dependencies = [ "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls", - "tokio-util", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", - "wasm-streams", "web-sys", - "webpki-roots", "winreg", ] -[[package]] -name = "retain_mut" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c31b5c4033f8fdde8700e4657be2c497e7288f01515be52168c631e2e4d4086" - -[[package]] -name = "revision" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87eb86913082f8976b06d07a59f17df9120e6f38b882cf3fc5a45b4499e224b6" -dependencies = [ - "bincode", - "chrono", - "geo 0.26.0", - "regex", - "revision-derive", - "roaring", - "rust_decimal", - "serde", - "thiserror", - "uuid", -] - -[[package]] -name = "revision-derive" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf996fc5f61f1dbec35799b5c00c6dda12e8862e8cb782ed24e10d0292e60ed3" -dependencies = [ - "darling", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.48", -] - [[package]] name = "ring" version = "0.16.20" @@ -3344,100 +2049,12 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "rkyv" -version = "0.7.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "527a97cdfef66f65998b5f3b637c26f5a5ec09cc52a3f9932313ac645f4190f5" -dependencies = [ - "bitvec", - "bytecheck", - "bytes", - "hashbrown 0.12.3", - "ptr_meta", - "rend", - "rkyv_derive", - "seahash", - "tinyvec", - "uuid", -] - -[[package]] -name = "rkyv_derive" -version = "0.7.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5c462a1328c8e67e4d6dbad1eb0355dd43e8ab432c6e227a43657f16ade5033" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "roaring" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6106b5cf8587f5834158895e9715a3c6c9716c8aefab57f1f7680917191c7873" -dependencies = [ - "bytemuck", - "byteorder", - "retain_mut", - "serde", -] - -[[package]] -name = "robust" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf4a6aa5f6d6888f39e980649f3ad6b666acdce1d78e95b8a2cb076e687ae30" - -[[package]] -name = "rocksdb" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb6f170a4041d50a0ce04b0d2e14916d6ca863ea2e422689a5b694395d299ffe" -dependencies = [ - "libc", - "librocksdb-sys", -] - [[package]] name = "roff" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b833d8d034ea094b1ea68aa6d5c740e0d04bad9d16568d08ba6f76823a114316" -[[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 0.6.4", - "signature", - "spki", - "subtle", - "zeroize", -] - -[[package]] -name = "rstar" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73111312eb7a2287d229f06c00ff35b51ddee180f017ab6dec1f69d62ac098d6" -dependencies = [ - "heapless", - "num-traits", - "smallvec", -] - [[package]] name = "rust-embed" version = "8.1.0" @@ -3473,53 +2090,12 @@ dependencies = [ "walkdir", ] -[[package]] -name = "rust-stemmers" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e46a2036019fdb888131db7a4c847a1063a7493f971ed94ea82c67eada63ca54" -dependencies = [ - "serde", - "serde_derive", -] - -[[package]] -name = "rust_decimal" -version = "1.33.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06676aec5ccb8fc1da723cc8c0f9a46549f21ebb8753d3915c6c41db1e7f1dc4" -dependencies = [ - "arrayvec", - "borsh", - "bytes", - "num-traits", - "rand 0.8.5", - "rkyv", - "serde", - "serde_json", -] - [[package]] name = "rustc-demangle" version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustc_lexer" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c86aae0c77166108c01305ee1a36a1e77289d7dc6ca0a3cd91ff4992de2d16a5" -dependencies = [ - "unicode-xid", -] - [[package]] name = "rustc_version" version = "0.4.0" @@ -3597,15 +2173,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" -[[package]] -name = "salsa20" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" -dependencies = [ - "cipher", -] - [[package]] name = "same-file" version = "1.0.6" @@ -3656,18 +2223,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "scrypt" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0516a385866c09368f0b5bcd1caff3366aace790fcd46e2bb032697bb172fd1f" -dependencies = [ - "password-hash", - "pbkdf2", - "salsa20", - "sha2", -] - [[package]] name = "sct" version = "0.7.1" @@ -3678,12 +2233,6 @@ dependencies = [ "untrusted 0.9.0", ] -[[package]] -name = "seahash" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" - [[package]] name = "secrecy" version = "0.8.0" @@ -3721,15 +2270,6 @@ name = "semver" version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" -dependencies = [ - "serde", -] - -[[package]] -name = "send_wrapper" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" @@ -3768,7 +2308,6 @@ version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ - "indexmap 2.2.3", "itoa", "ryu", "serde", @@ -3796,42 +2335,13 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_with" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" -dependencies = [ - "base64", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.2.3", - "serde", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93634eb5f75a2323b16de4748022ac4297f9e76b6dced2be287a099f41b5e788" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.48", -] - [[package]] name = "serde_yaml" version = "0.9.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fd075d994154d4a774f95b51fb96bdc2832b0ea48425c92546073816cda1f2f" dependencies = [ - "indexmap 2.2.3", + "indexmap", "itoa", "ryu", "serde", @@ -3878,12 +2388,6 @@ dependencies = [ "dirs", ] -[[package]] -name = "shlex" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" - [[package]] name = "signal-hook" version = "0.3.17" @@ -3914,22 +2418,6 @@ dependencies = [ "libc", ] -[[package]] -name = "signature" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" -dependencies = [ - "digest", - "rand_core 0.6.4", -] - -[[package]] -name = "simdutf8" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" - [[package]] name = "simple_asn1" version = "0.6.2" @@ -3942,12 +2430,6 @@ dependencies = [ "time", ] -[[package]] -name = "siphasher" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" - [[package]] name = "skootrs-bin" version = "0.1.0" @@ -3981,7 +2463,7 @@ dependencies = [ name = "skootrs-lib" version = "0.1.0" dependencies = [ - "ahash 0.8.7", + "ahash", "askama", "base64", "chrono", @@ -4046,7 +2528,6 @@ dependencies = [ "serde_json", "skootrs-lib", "skootrs-model", - "surrealdb", ] [[package]] @@ -4060,18 +2541,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "smol_str" -version = "0.2.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6845563ada680337a52d43bb0b29f396f2d911616f6573012645b9e3d048a49" -dependencies = [ - "serde", -] +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "snafu" @@ -4096,12 +2568,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "snap" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" - [[package]] name = "socket2" version = "0.4.10" @@ -4122,18 +2588,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "spade" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61addf9117b11d1f5b4bf6fe94242ba25f59d2d4b2080544b771bd647024fd00" -dependencies = [ - "hashbrown 0.14.3", - "num-traits", - "robust", - "smallvec", -] - [[package]] name = "spin" version = "0.5.2" @@ -4145,63 +2599,6 @@ name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] - -[[package]] -name = "spki" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" -dependencies = [ - "base64ct", - "der", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "stacker" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c886bd4480155fd3ef527d45e9ac8dd7118a898a46530b7b94c3e21866259fce" -dependencies = [ - "cc", - "cfg-if", - "libc", - "psm", - "winapi", -] - -[[package]] -name = "storekey" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43c42833834a5d23b344f71d87114e0cc9994766a5c42938f4b50e7b2aef85b2" -dependencies = [ - "byteorder", - "memchr", - "serde", - "thiserror", -] - -[[package]] -name = "string_cache" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" -dependencies = [ - "new_debug_unreachable", - "once_cell", - "parking_lot", - "phf_shared", - "precomputed-hash", -] [[package]] name = "strsim" @@ -4231,115 +2628,6 @@ dependencies = [ "syn 2.0.48", ] -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - -[[package]] -name = "surrealdb" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f295e08202d723ffd628b057fee207938804bccae60c49316197fed898d85536" -dependencies = [ - "addr", - "any_ascii", - "argon2", - "async-channel", - "async-executor", - "async-recursion", - "base64", - "bcrypt", - "bincode", - "bytes", - "cedar-policy", - "chrono", - "deunicode", - "dmp", - "flume", - "fst", - "futures", - "futures-concurrency", - "fuzzy-matcher", - "geo 0.27.0", - "hex", - "indexmap 2.2.3", - "ipnet", - "lexicmp", - "lru", - "md-5", - "nanoid", - "nom", - "num_cpus", - "object_store", - "once_cell", - "path-clean", - "pbkdf2", - "pharos", - "pin-project-lite", - "radix_trie", - "rand 0.8.5", - "regex", - "reqwest", - "revision", - "roaring", - "rocksdb", - "rust-stemmers", - "rust_decimal", - "rustls", - "scrypt", - "semver", - "serde", - "serde_json", - "sha1", - "sha2", - "snap", - "storekey", - "surrealdb-derive", - "surrealdb-jsonwebtoken", - "thiserror", - "tokio", - "tokio-tungstenite", - "tracing", - "trice", - "ulid", - "url", - "uuid", - "wasm-bindgen-futures", - "wasmtimer", - "ws_stream_wasm", -] - -[[package]] -name = "surrealdb-derive" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aacdb4c58b9ebef0291310afcd63af0012d85610d361f3785952c61b6f1dddf4" -dependencies = [ - "quote", - "syn 1.0.109", -] - -[[package]] -name = "surrealdb-jsonwebtoken" -version = "8.3.0-surreal.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d4f759c65df8a8cf2d83c99db7fdd3ae5b8fff05fa7fe69a8612f29dd5f99b" -dependencies = [ - "base64", - "getrandom", - "hmac", - "pem 2.0.1", - "rand 0.8.5", - "ring 0.16.20", - "rsa", - "serde", - "serde_json", - "sha2", - "simple_asn1", -] - [[package]] name = "syn" version = "1.0.109" @@ -4362,18 +2650,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "syn_derive" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.48", -] - [[package]] name = "sync_wrapper" version = "0.1.2" @@ -4401,12 +2677,6 @@ dependencies = [ "libc", ] -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - [[package]] name = "tempdir" version = "0.3.7" @@ -4430,17 +2700,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "term" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" -dependencies = [ - "dirs-next", - "rustversion", - "winapi", -] - [[package]] name = "thiserror" version = "1.0.50" @@ -4522,15 +2781,6 @@ dependencies = [ "time-core", ] -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -4618,21 +2868,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-tungstenite" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" -dependencies = [ - "futures-util", - "log", - "rustls", - "tokio", - "tokio-rustls", - "tungstenite", - "webpki-roots", -] - [[package]] name = "tokio-util" version = "0.7.10" @@ -4647,23 +2882,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "toml_datetime" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" - -[[package]] -name = "toml_edit" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" -dependencies = [ - "indexmap 2.2.3", - "toml_datetime", - "winnow", -] - [[package]] name = "tower" version = "0.4.13" @@ -4756,7 +2974,7 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5c266b9ac83dedf0e0385ad78514949e6d89491269e7065bee51d2bb8ec7373" dependencies = [ - "ahash 0.8.7", + "ahash", "gethostname", "log", "serde", @@ -4836,59 +3054,18 @@ dependencies = [ "tracing-log 0.2.0", ] -[[package]] -name = "trice" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3aaab10ae9fac0b10f392752bf56f0fd20845f39037fec931e8537b105b515a" -dependencies = [ - "js-sys", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "try-lock" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" -[[package]] -name = "tungstenite" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" -dependencies = [ - "byteorder", - "bytes", - "data-encoding", - "http", - "httparse", - "log", - "rand 0.8.5", - "rustls", - "sha1", - "thiserror", - "url", - "utf-8", -] - [[package]] name = "typenum" version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" -[[package]] -name = "ulid" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e37c4b6cbcc59a8dcd09a6429fbc7890286bcbb79215cea7b38a3c4c0921d93" -dependencies = [ - "rand 0.8.5", - "serde", -] - [[package]] name = "unicase" version = "2.7.0" @@ -4919,22 +3096,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-script" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d817255e1bed6dfd4ca47258685d14d2bdcfbc64fdc9e3819bd5848057b8ecc" - -[[package]] -name = "unicode-security" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ef5756b3097992b934b06608c69f48448a0fbe804bb1e72b982f6d7983e9e63" -dependencies = [ - "unicode-normalization", - "unicode-script", -] - [[package]] name = "unicode-segmentation" version = "1.10.1" @@ -4947,12 +3108,6 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - [[package]] name = "unsafe-libyaml" version = "0.2.10" @@ -4989,12 +3144,6 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" -[[package]] -name = "utf-8" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" - [[package]] name = "utf8parse" version = "0.2.1" @@ -5007,7 +3156,7 @@ version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "272ebdfbc99111033031d2f10e018836056e4d2c8e2acda76450ec7974269fa7" dependencies = [ - "indexmap 2.2.3", + "indexmap", "serde", "serde_json", "utoipa-gen", @@ -5072,10 +3221,7 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" dependencies = [ - "atomic", "getrandom", - "serde", - "wasm-bindgen", ] [[package]] @@ -5187,32 +3333,6 @@ version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" -[[package]] -name = "wasm-streams" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" -dependencies = [ - "futures-util", - "js-sys", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "wasmtimer" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f656cd8858a5164932d8a90f936700860976ec21eb00e0fe2aa8cab13f6b4cf" -dependencies = [ - "futures", - "js-sys", - "parking_lot", - "pin-utils", - "wasm-bindgen", -] - [[package]] name = "web-sys" version = "0.3.67" @@ -5233,12 +3353,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki-roots" -version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" - [[package]] name = "winapi" version = "0.3.9" @@ -5468,15 +3582,6 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" -[[package]] -name = "winnow" -version = "0.5.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" -dependencies = [ - "memchr", -] - [[package]] name = "winreg" version = "0.50.0" @@ -5487,34 +3592,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "ws_stream_wasm" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7999f5f4217fe3818726b66257a4475f71e74ffd190776ad053fa159e50737f5" -dependencies = [ - "async_io_stream", - "futures", - "js-sys", - "log", - "pharos", - "rustc_version", - "send_wrapper", - "thiserror", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - [[package]] name = "zerocopy" version = "0.7.32" diff --git a/Cargo.toml b/Cargo.toml index 0fe1137..0786dd3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,9 @@ [workspace] members = [ "skootrs-bin", - "skootrs-lib", "skootrs-model", - "skootrs-rest", + "skootrs-lib", + "skootrs-model", + # "skootrs-rest", "skootrs-statestore" ] diff --git a/skootrs-bin/src/helpers.rs b/skootrs-bin/src/helpers.rs index 43a552d..101383f 100644 --- a/skootrs-bin/src/helpers.rs +++ b/skootrs-bin/src/helpers.rs @@ -1,35 +1,55 @@ use base64::prelude::*; use inquire::Text; use octocrab::Page; -use skootrs_lib::service::{ - ecosystem::LocalEcosystemService, - facet::LocalFacetService, - project::{LocalProjectService, ProjectService}, - repo::LocalRepoService, - source::LocalSourceService, -}; +use serde::Serialize; +use skootrs_lib::service::{project::ProjectService, source::LocalSourceService}; use skootrs_model::{ security_insights::insights10::SecurityInsightsVersion100YamlSchema, skootrs::{ - Config, EcosystemInitializeParams, FacetGetParams, FacetMapKey, GithubRepoParams, - GithubUser, GoParams, InitializedProject, MavenParams, ProjectCreateParams, - ProjectGetParams, ProjectOutputParams, ProjectOutputType, RepoCreateParams, SkootError, - SourceInitializeParams, SupportedEcosystems, SUPPORTED_ECOSYSTEMS, + facet::InitializedFacet, Config, EcosystemInitializeParams, FacetGetParams, FacetMapKey, + GithubRepoParams, GithubUser, GoParams, InitializedProject, MavenParams, + ProjectCreateParams, ProjectGetParams, ProjectOutputParams, ProjectOutputReference, + ProjectOutputType, ProjectOutputsListParams, ProjectReleaseParam, RepoCreateParams, + SkootError, SourceInitializeParams, SupportedEcosystems, }, }; -use std::{ - collections::{HashMap, HashSet}, - str::FromStr, -}; +use std::{collections::HashSet, io::Write, str::FromStr}; use strum::VariantNames; use tracing::debug; -use skootrs_statestore::SurrealProjectStateStore; use skootrs_statestore::{ GitProjectStateStore, InMemoryProjectReferenceCache, ProjectReferenceCache, ProjectStateStore, }; -// TODO: This should have a project service member. +/// Helper trait that lets me inline writing the result of a Skootrs function to a writer. +pub trait HandleResponseOutput { + #[must_use] + fn handle_response_output(self, output_handler: W) -> Self; +} + +impl HandleResponseOutput for Result +where + T: Serialize, +{ + /// Handles a response that implements `Serialize`. + /// This is useful for functions that return a response that needs to be printed out, logged, etc. to the user. + /// + /// # Errors + /// + /// Returns an error if the response can't be serialized to JSON or if the output can't be written to the output handler. + /// Also returns an error if the function that returns the response returns an error. + fn handle_response_output(self, mut output_handler: W) -> Self { + match self { + Ok(result) => { + let serialized_result = serde_json::to_string_pretty(&result)?; + writeln!(output_handler, "{serialized_result}")?; + Ok(result) + } + Err(error) => Err(error), + } + } +} + pub struct Project; impl Project { @@ -48,7 +68,7 @@ impl Project { config: &Config, project_service: &'a T, project_params: Option, - ) -> Result<(), SkootError> { + ) -> Result { let project_params = match project_params { Some(p) => p, None => Project::prompt_create(config).await?, @@ -63,7 +83,7 @@ impl Project { let mut local_cache = InMemoryProjectReferenceCache::load_or_create("./skootcache")?; git_state_store.create(project.clone()).await?; local_cache.set(project.repo.full_url()).await?; - Ok(()) + Ok(project) } async fn prompt_create(config: &Config) -> Result { @@ -121,7 +141,7 @@ impl Project { }) } - /// Fetches and prints out the contents of an `InitializedProject` in JSON format. + /// Fetches the contents of an `InitializedProject` along with an interactive prompt. /// /// # Errors /// @@ -137,7 +157,6 @@ impl Project { None => Project::prompt_get(config).await?, }; let project = cache.get(project_get_params.project_url.clone()).await?; - println!("{}", serde_json::to_string(&project)?); Ok(project) } @@ -150,28 +169,22 @@ impl Project { }) } - async fn list() -> Result, SkootError> { - let cache = InMemoryProjectReferenceCache::load_or_create("./skootcache")?; - let projects: HashSet = cache.list().await?; - Ok(projects) - } - - /// Prints out the list of projects. + /// Returns the list of projects that are stored in the cache. /// /// # Errors /// - /// Returns an error if the list of Skootrs projects can't be fetched for some reason. - pub async fn print_list() -> Result<(), SkootError> { - let projects = Project::list().await?; - println!("{}", serde_json::to_string(&projects)?); - Ok(()) + /// Returns an error if the cache can't be loaded or if the list of projects can't be fetched. + pub async fn list() -> Result, SkootError> { + let cache = InMemoryProjectReferenceCache::load_or_create("./skootcache")?; + let projects: HashSet = cache.list().await?; + Ok(projects) } } pub struct Facet; impl Facet { - /// Prints out the content of a facet. This includes things like source files or API bundles. + /// Returns the contents of a facet. This includes things like source files or API bundles. /// /// # Errors /// @@ -180,7 +193,7 @@ impl Facet { config: &Config, project_service: &'a T, facet_get_params: Option, - ) -> Result<(), SkootError> { + ) -> Result { let facet_get_params = if let Some(p) = facet_get_params { p } else { @@ -201,9 +214,8 @@ impl Facet { .await?; debug!("{:?}", facet_with_content); - println!("{}", serde_json::to_string(&facet_with_content)?); - Ok(()) + Ok(facet_with_content) } fn prompt_get( @@ -215,30 +227,29 @@ impl Facet { Ok(facet_type) } - /// Prints out the list of facets for a project. This includes things like source files or API bundles. + /// Returns the list of facets for a project. This includes things like source files or API bundles. /// /// # Errors /// /// Returns an error if the project or list of facets can't be fetched for some reason. - pub async fn print_list<'a, T: ProjectService + ?Sized>( + pub async fn list<'a, T: ProjectService + ?Sized>( config: &Config, project_service: &'a T, project_get_params: Option, - ) -> Result<(), SkootError> { + ) -> Result, SkootError> { let project_get_params = match project_get_params { Some(p) => p, None => Project::prompt_get(config).await?, }; let facet_map_keys = project_service.list_facets(project_get_params).await?; - println!("{}", serde_json::to_string(&facet_map_keys)?); - Ok(()) + Ok(facet_map_keys) } } pub struct Output; impl Output { - /// Prints out the content of a project output. This includes things like SBOMs or SLSA attestations. + /// Returns the content of a project output. This includes things like SBOMs or SLSA attestations. /// /// # Errors /// @@ -247,7 +258,7 @@ impl Output { config: &Config, _project_service: &'a T, project_output_params: Option, - ) -> Result<(), SkootError> { + ) -> Result { let project_output_params = match project_output_params { Some(p) => p, None => Output::prompt_project_output(config).await?, @@ -258,9 +269,30 @@ impl Output { .text() .await?; - println!("{output}"); + Ok(output) + } - Ok(()) + /// Returns the list of project outputs for a project. This includes things like SBOMs or SLSA attestations. + /// + /// # Errors + /// + /// Returns an error if the project output list can't be fetched. + pub async fn list<'a, T: ProjectService + ?Sized>( + config: &Config, + project_service: &'a T, + project_outputs_list_params: Option, + ) -> Result, SkootError> { + let project_outputs_list_params = match project_outputs_list_params { + Some(p) => p, + None => ProjectOutputsListParams { + initialized_project: Project::get(config, project_service, None).await?, + release: ProjectReleaseParam::Latest, + }, + }; + let output_list = project_service + .outputs_list(project_outputs_list_params) + .await?; + Ok(output_list) } async fn prompt_project_output(_config: &Config) -> Result { @@ -331,273 +363,3 @@ impl Output { }) } } - -/// Returns `Ok(())` if the project creation is successful, otherwise returns an error. -/// -/// Creates a new skootrs project by prompting the user for repository details and language selection. -/// The project can be created for either Go or Maven ecosystems right now. -/// The project is created in Github, cloned down, and then initialized along with any other security supporting -/// tasks. -/// -/// # Errors -/// -/// Returns an error if the user is not authenticated with Github, or if the project can't be created -/// for any other reason. -pub async fn create() -> std::result::Result<(), SkootError> { - let name = Text::new("The name of the repository").prompt()?; - let description = Text::new("The description of the repository").prompt()?; - let user = octocrab::instance().current().user().await?.login; - let Page { items, .. } = octocrab::instance() - .current() - .list_org_memberships_for_authenticated_user() - .send() - .await?; - let organization = inquire::Select::new( - "Select an organization", - items - .iter() - .map(|i| i.organization.login.as_str()) - .chain(vec![user.as_str()]) - .collect(), - ) - .prompt()?; - - let language = inquire::Select::new("Select a language", SUPPORTED_ECOSYSTEMS.to_vec()); - - let gh_org = match organization { - x if x == user => GithubUser::User(x.to_string()), - x => GithubUser::Organization(x.to_string()), - }; - - let initialized_project: InitializedProject = match language.prompt()? { - "Go" => { - // TODO: support more than just github - let go_params = GoParams { - name: name.clone(), - host: format!("github.com/{organization}"), - }; - let project_params = ProjectCreateParams { - name: name.clone(), - repo_params: RepoCreateParams::Github(GithubRepoParams { - name, - description, - organization: gh_org, - }), - ecosystem_params: EcosystemInitializeParams::Go(go_params), - source_params: SourceInitializeParams { - parent_path: "/tmp".to_string(), // FIXME: This should be configurable - }, - }; - let local_project_service = LocalProjectService { - repo_service: LocalRepoService {}, - ecosystem_service: LocalEcosystemService {}, - source_service: LocalSourceService {}, - facet_service: LocalFacetService {}, - }; - - local_project_service.initialize(project_params).await? - } - - "Maven" => { - let maven_params = MavenParams { - group_id: format!("com.{organization}.{name}"), - artifact_id: name.clone(), - }; - - let project_params = ProjectCreateParams { - name: name.clone(), - repo_params: RepoCreateParams::Github(GithubRepoParams { - name, - description, - organization: gh_org, - }), - ecosystem_params: EcosystemInitializeParams::Maven(maven_params), - source_params: SourceInitializeParams { - parent_path: "/tmp".to_string(), // FIXME: This should be configurable - }, - }; - let local_project_service = LocalProjectService { - repo_service: LocalRepoService {}, - ecosystem_service: LocalEcosystemService {}, - source_service: LocalSourceService {}, - facet_service: LocalFacetService {}, - }; - - local_project_service.initialize(project_params).await? - } - - _ => { - unreachable!("Unsupported language") - } - }; - - let state_store = SurrealProjectStateStore::new().await?; - state_store.create(initialized_project).await?; - - Ok(()) -} - -/// Returns `Ok(())` if the able to print out the content of the facet, otherwise returns an error. -/// -/// This function prompts the user to select a project and then a facet of that project to fetch from the state store. -/// It then prints out the content of the facet. -/// -/// # Errors -/// -/// Returns an error if the state store is not able to be accessed or if the selected project or facet -/// is not found. -/*pub async fn get_facet() -> std::result::Result<(), SkootError> { - let project = prompt_project().await?; - - let facet_to_project: HashMap = project - .facets - .iter() - .map(|f| match f { - InitializedFacet::SourceFile(f) => ( - f.facet_type.to_string(), - InitializedFacet::SourceFile(f.clone()), - ), - InitializedFacet::SourceBundle(f) => ( - f.facet_type.to_string(), - InitializedFacet::SourceBundle(f.clone()), - ), - InitializedFacet::APIBundle(f) => ( - f.facet_type.to_string(), - InitializedFacet::APIBundle(f.clone()), - ), - }) - .collect::>(); - - let selected_facet = inquire::Select::new( - "Select a facet", - facet_to_project.keys().collect::>(), - ) - .prompt()?; - - let facet = facet_to_project - .get(selected_facet) - .ok_or_else(|| SkootError::from("Failed to get selected facet"))?; - - let facet_content = get_facet_content(facet, &project)?; - - println!("{facet_content}"); - - Ok(()) -}*/ - -/// Returns `Ok(())` if the able to print out a dump of the statestore. -/// -/// This function prints out the content of the state store in a pretty printed JSON format. -/// # Errors -/// -/// Returns an error if the state store is not able to be accessed. -pub async fn dump() -> std::result::Result<(), SkootError> { - let projects = get_all().await?; - println!("{}", serde_json::to_string_pretty(&projects)?); - Ok(()) -} - -async fn get_all() -> std::result::Result, SkootError> { - let state_store = SurrealProjectStateStore::new().await?; - let projects = state_store.select_all().await?; - Ok(projects) -} -/* -fn get_facet_content( - facet: &InitializedFacet, - project: &InitializedProject, -) -> std::result::Result { - match facet { - InitializedFacet::SourceFile(f) => { - let source_service = LocalSourceService {}; - let content = source_service.read_file(&project.source, &f.path, f.name.clone())?; - Ok(content) - } - InitializedFacet::SourceBundle(f) => { - let source_service = LocalSourceService {}; - let content = f - .source_files - .iter() - .map(|f| source_service.read_file(&project.source, &f.path, f.name.clone())) - .collect::, _>>()?; - Ok(content.join("\n")) - } - InitializedFacet::APIBundle(f) => { - // TODO: This can make it unclear which API was used - let content = f.apis.iter().map(|a| format!("{a:?}")).collect::>(); - Ok(content.join("\n")) - } - } -}*/ - -/// This function is for prompting the user to get outputs from a Skootrs project -/// -/// # Errors -/// -/// This return an error if it can't get an intended output for some reason. This -/// includes issues like unable to get or parse SECURITY-INSIGHTS.yml or unable -/// to get the intended output. -pub async fn get_output() -> std::result::Result<(), SkootError> { - let project = prompt_project().await?; - - let skootrs_model::skootrs::InitializedRepo::Github(repo) = &project.repo; - - let sec_ins_content_items = octocrab::instance() - .repos(repo.organization.get_name(), &repo.name) - .get_content() - .path("SECURITY-INSIGHTS.yml") - .r#ref("main") - .send() - .await?; - - let sec_ins = sec_ins_content_items - .items - .first() - .ok_or_else(|| SkootError::from("Failed to get security insights"))?; - - let content = sec_ins - .content - .as_ref() - .ok_or_else(|| SkootError::from("Failed to get content of security insights"))?; - let content_decoded = - base64::engine::general_purpose::STANDARD.decode(content.replace('\n', ""))?; - let content_str = std::str::from_utf8(&content_decoded)?; - let insights: SecurityInsightsVersion100YamlSchema = - serde_yaml::from_str::(content_str)?; - let sbom_vec = insights - .dependencies - .ok_or_else(|| SkootError::from("Failed to get dependencies value from security insights"))? - .sbom - .ok_or_else(|| SkootError::from("Failed to get sbom value from security insights"))?; - - let sbom_url = inquire::Select::new( - "Select an SBOM", - sbom_vec.iter().flat_map(|s| &s.sbom_file).collect(), - ) - .prompt()?; - - let sbom = reqwest::get(sbom_url).await?.text().await?; - - println!("{sbom}"); - - Ok(()) -} - -async fn prompt_project() -> Result { - let projects = get_all().await?; - let repo_to_project: HashMap = projects - .iter() - .map(|p| (p.repo.full_url(), p)) - .collect::>(); - let selected_project = inquire::Select::new( - "Select a project", - repo_to_project.keys().collect::>(), - ) - .prompt()?; - - let project = *repo_to_project - .get(selected_project) - .ok_or_else(|| SkootError::from("Failed to get selected project"))?; - - Ok(project.clone()) -} diff --git a/skootrs-bin/src/main.rs b/skootrs-bin/src/main.rs index f424724..257fa34 100644 --- a/skootrs-bin/src/main.rs +++ b/skootrs-bin/src/main.rs @@ -28,16 +28,19 @@ pub mod helpers; +use std::io::stdout; + use clap::{Parser, Subcommand}; use clio::Input; use skootrs_lib::service::ecosystem::LocalEcosystemService; use skootrs_lib::service::facet::LocalFacetService; +use skootrs_lib::service::output::LocalOutputService; use skootrs_lib::service::project::LocalProjectService; use skootrs_lib::service::repo::LocalRepoService; use skootrs_lib::service::source::LocalSourceService; use skootrs_model::skootrs::SkootError; -use helpers::{get_output, Facet, Output}; +use helpers::{Facet, HandleResponseOutput, Output}; use opentelemetry::global; use opentelemetry_sdk::propagation::TraceContextPropagator; use serde::de::DeserializeOwned; @@ -144,7 +147,12 @@ enum OutputCommands { }, /// List all the release outputs that belong to a particular project. #[command(name = "list")] - List, + List { + /// This is an optional input parameter that can be used to pass in a file, pipe, url, or stdin. + /// This is expected to be YAML or JSON. If it is not provided, the CLI will prompt the user for the input. + #[clap(value_parser)] + input: Option, + }, } /// This is the enum for what nouns the `daemon` command can take. @@ -189,12 +197,14 @@ fn init_project_service() -> LocalProjectService< LocalEcosystemService, LocalSourceService, LocalFacetService, + LocalOutputService, > { LocalProjectService { repo_service: LocalRepoService {}, ecosystem_service: LocalEcosystemService {}, source_service: LocalSourceService {}, facet_service: LocalFacetService {}, + output_service: LocalOutputService {}, } } @@ -232,7 +242,9 @@ async fn main() -> std::result::Result<(), SkootError> { ProjectCommands::Create { input } => { let project_create_params = parse_optional_input(input)?; if let Err(ref error) = - helpers::Project::create(&config, &project_service, project_create_params).await + helpers::Project::create(&config, &project_service, project_create_params) + .await + .handle_response_output(stdout()) { error!(error = error.as_ref(), "Failed to create project"); } @@ -240,13 +252,18 @@ async fn main() -> std::result::Result<(), SkootError> { ProjectCommands::Get { input } => { let project_get_params = parse_optional_input(input)?; if let Err(ref error) = - helpers::Project::get(&config, &project_service, project_get_params).await + helpers::Project::get(&config, &project_service, project_get_params) + .await + .handle_response_output(stdout()) { error!(error = error.as_ref(), "Failed to get project info"); } } ProjectCommands::List => { - if let Err(ref error) = helpers::Project::print_list().await { + if let Err(ref error) = helpers::Project::list() + .await + .handle_response_output(stdout()) + { error!(error = error.as_ref(), "Failed to list projects"); } } @@ -254,16 +271,18 @@ async fn main() -> std::result::Result<(), SkootError> { SkootrsCli::Facet { facet } => match facet { FacetCommands::Get { input } => { let facet_get_params = parse_optional_input(input)?; - if let Err(ref error) = - Facet::get(&config, &project_service, facet_get_params).await + if let Err(ref error) = Facet::get(&config, &project_service, facet_get_params) + .await + .handle_response_output(stdout()) { error!(error = error.as_ref(), "Failed to get facet"); } } FacetCommands::List { input } => { let project_get_params = parse_optional_input(input)?; - if let Err(ref error) = - Facet::print_list(&config, &project_service, project_get_params).await + if let Err(ref error) = Facet::list(&config, &project_service, project_get_params) + .await + .handle_response_output(stdout()) { error!(error = error.as_ref(), "Failed to list facets for project"); } @@ -272,14 +291,19 @@ async fn main() -> std::result::Result<(), SkootError> { SkootrsCli::Output { output } => match output { OutputCommands::Get { input } => { let output_get_params = parse_optional_input(input)?; - if let Err(ref error) = - Output::get(&config, &project_service, output_get_params).await + if let Err(ref error) = Output::get(&config, &project_service, output_get_params) + .await + .handle_response_output(stdout()) { error!(error = error.as_ref(), "Failed to get output"); } } - OutputCommands::List => { - if let Err(ref error) = get_output().await { + OutputCommands::List { input } => { + let output_list_params = parse_optional_input(input)?; + if let Err(ref error) = Output::list(&config, &project_service, output_list_params) + .await + .handle_response_output(stdout()) + { error!(error = error.as_ref(), "Failed to list outputs for project"); } } diff --git a/skootrs-lib/src/service/mod.rs b/skootrs-lib/src/service/mod.rs index 9622ab4..9315937 100644 --- a/skootrs-lib/src/service/mod.rs +++ b/skootrs-lib/src/service/mod.rs @@ -1,4 +1,3 @@ - // // Copyright 2024 The Skootrs Authors. // @@ -14,8 +13,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +pub mod ecosystem; +pub mod facet; +pub mod output; pub mod project; pub mod repo; pub mod source; -pub mod ecosystem; -pub mod facet; \ No newline at end of file diff --git a/skootrs-lib/src/service/output.rs b/skootrs-lib/src/service/output.rs new file mode 100644 index 0000000..b0b0839 --- /dev/null +++ b/skootrs-lib/src/service/output.rs @@ -0,0 +1,105 @@ +// +// Copyright 2024 The Skootrs Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#![allow(clippy::module_name_repetitions)] + +use octocrab::models::repos::{Asset, Release}; +use skootrs_model::skootrs::{ + ProjectOutputReference, ProjectOutputType, ProjectOutputsListParams, SkootError, +}; + +pub trait OutputService { + fn outputs_list( + &self, + params: ProjectOutputsListParams, + ) -> impl std::future::Future, SkootError>> + Send; +} + +pub struct LocalOutputService; + +impl OutputService for LocalOutputService { + fn outputs_list( + &self, + params: ProjectOutputsListParams, + ) -> impl std::future::Future, SkootError>> + Send + { + match params.initialized_project.repo { + skootrs_model::skootrs::InitializedRepo::Github(g) => { + let github_params = GithubReleaseParams { + owner: g.organization.get_name(), + repo: g.name, + tag: params.release.tag(), + }; + GithubReleaseHandler::outputs_list(github_params) + } + } + } +} + +struct GithubReleaseHandler; +impl GithubReleaseHandler { + async fn outputs_list( + params: GithubReleaseParams, + ) -> Result, SkootError> { + let release = Self::get_release(params).await?; + + let assets = release.assets; + let references = assets + .iter() + .map(|asset| ProjectOutputReference { + name: asset.name.clone(), + output_type: Self::get_type(asset), + }) + .collect(); + + Ok(references) + } + + async fn get_release(params: GithubReleaseParams) -> Result { + match params.tag { + Some(tag) => { + octocrab::instance() + .repos(params.owner, params.repo) + .releases() + .get_by_tag(tag.as_str()) + .await + } + None => { + octocrab::instance() + .repos(params.owner, params.repo) + .releases() + .get_latest() + .await + } + } + } + + fn get_type(asset: &Asset) -> ProjectOutputType { + // TODO: This matching probably isn't GitHub specific and can live somewhere more generalized. + match asset.url { + // Follows: https://github.com/ossf/sbom-everywhere/blob/main/reference/sbom_naming.md + _ if asset.name.contains(".spdx.") => ProjectOutputType::SBOM, + _ if asset.name.contains(".cdx.") => ProjectOutputType::SBOM, + // TODO: Add more types + _ => ProjectOutputType::Custom("Unknown".to_string()), + } + } +} + +struct GithubReleaseParams { + owner: String, + repo: String, + tag: Option, +} diff --git a/skootrs-lib/src/service/project.rs b/skootrs-lib/src/service/project.rs index b72cccf..752e896 100644 --- a/skootrs-lib/src/service/project.rs +++ b/skootrs-lib/src/service/project.rs @@ -22,10 +22,12 @@ use crate::service::facet::{FacetSetParamsGenerator, RootFacetService}; use skootrs_model::skootrs::{ facet::{CommonFacetCreateParams, InitializedFacet, SourceFile}, FacetGetParams, FacetMapKey, InitializedProject, InitializedSource, ProjectCreateParams, - ProjectGetParams, SkootError, + ProjectGetParams, ProjectOutputReference, ProjectOutputsListParams, SkootError, }; -use super::{ecosystem::EcosystemService, repo::RepoService, source::SourceService}; +use super::{ + ecosystem::EcosystemService, output::OutputService, repo::RepoService, source::SourceService, +}; use tracing::{debug, error, info}; /// The `ProjectService` trait provides an interface for initializing and managing a Skootrs project. @@ -69,6 +71,11 @@ pub trait ProjectService { &self, params: ProjectGetParams, ) -> impl std::future::Future, SkootError>> + Send; + + fn outputs_list( + &self, + params: ProjectOutputsListParams, + ) -> impl std::future::Future, SkootError>> + Send; } /// The `LocalProjectService` struct provides an implementation of the `ProjectService` trait for initializing @@ -79,19 +86,22 @@ pub struct LocalProjectService< ES: EcosystemService, SS: SourceService, FS: RootFacetService, + OS: OutputService, > { pub repo_service: RS, pub ecosystem_service: ES, pub source_service: SS, pub facet_service: FS, + pub output_service: OS, } -impl ProjectService for LocalProjectService +impl ProjectService for LocalProjectService where RS: RepoService + Send + Sync, ES: EcosystemService + Send + Sync, SS: SourceService + Send + Sync, FS: RootFacetService + Send + Sync, + OS: OutputService + Send + Sync, { async fn initialize( &self, @@ -225,6 +235,13 @@ where } } + async fn outputs_list( + &self, + params: ProjectOutputsListParams, + ) -> Result, SkootError> { + self.output_service.outputs_list(params).await + } + async fn list_facets(&self, params: ProjectGetParams) -> Result, SkootError> { Ok(self.get(params).await?.facets.keys().cloned().collect()) } @@ -240,8 +257,8 @@ mod tests { SupportedFacetType, }, EcosystemInitializeParams, GithubRepoParams, GithubUser, GoParams, InitializedEcosystem, - InitializedGithubRepo, InitializedGo, InitializedMaven, InitializedRepo, RepoCreateParams, - SourceInitializeParams, + InitializedGithubRepo, InitializedGo, InitializedMaven, InitializedRepo, ProjectOutputType, + RepoCreateParams, SourceInitializeParams, }; use super::*; @@ -249,6 +266,7 @@ mod tests { struct MockEcosystemService; struct MockSourceService; struct MockFacetService; + struct MockOutputService; impl RepoService for MockRepoService { async fn initialize( @@ -494,6 +512,18 @@ mod tests { } } + impl OutputService for MockOutputService { + async fn outputs_list( + &self, + _params: ProjectOutputsListParams, + ) -> Result, SkootError> { + Ok(vec![ProjectOutputReference { + name: "test".into(), + output_type: ProjectOutputType::SBOM, + }]) + } + } + #[tokio::test] async fn test_initialize_project() { let project_params = ProjectCreateParams { @@ -517,6 +547,7 @@ mod tests { ecosystem_service: MockEcosystemService, source_service: MockSourceService, facet_service: MockFacetService, + output_service: MockOutputService, }; let result = local_project_service.initialize(project_params).await; diff --git a/skootrs-model/src/skootrs/mod.rs b/skootrs-model/src/skootrs/mod.rs index 8127306..820364a 100644 --- a/skootrs-model/src/skootrs/mod.rs +++ b/skootrs-model/src/skootrs/mod.rs @@ -150,6 +150,37 @@ pub struct ProjectGetParams { pub project_url: String, } +/// The parameters for listing all the outputs for a Skootrs project. +#[derive(Serialize, Deserialize, Clone, Debug)] +#[cfg_attr(feature = "openapi", derive(ToSchema))] +pub struct ProjectOutputsListParams { + /// The initialized project to list the outputs for. + pub initialized_project: InitializedProject, + /// The release to get the outputs for. + pub release: ProjectReleaseParam, +} + +/// The parameters for getting a release from a project. +#[derive(Serialize, Deserialize, Clone, Debug)] +#[cfg_attr(feature = "openapi", derive(ToSchema))] +pub enum ProjectReleaseParam { + /// A release based on a tag. + Tag(String), + /// The latest release. + Latest, +} + +impl ProjectReleaseParam { + /// Returns the tag of the release. + #[must_use] + pub fn tag(&self) -> Option { + match self { + Self::Tag(x) => Some(x.to_string()), + Self::Latest => None, + } + } +} + /// The paramaters for getting the output of a project, e.g. an SBOM from a release #[derive(Serialize, Deserialize, Clone, Debug)] #[cfg_attr(feature = "openapi", derive(ToSchema))] @@ -173,6 +204,26 @@ pub enum ProjectOutputType { Custom(String), } +/// The output of a project. +#[derive(Serialize, Deserialize, Clone, Debug)] +#[cfg_attr(feature = "openapi", derive(ToSchema))] +pub struct ProjectOutput { + /// The reference to the project output. + pub reference: ProjectOutputReference, + /// The output to get from the project. + pub output: String, +} + +/// A reference to the output of a project. +#[derive(Serialize, Deserialize, Clone, Debug)] +#[cfg_attr(feature = "openapi", derive(ToSchema))] +pub struct ProjectOutputReference { + /// The type of output to get from the project. + pub output_type: ProjectOutputType, + /// The name of the output to get from the project. + pub name: String, +} + /// The parameters for getting a facet from a project. #[derive(Serialize, Deserialize, Clone, Debug)] #[cfg_attr(feature = "openapi", derive(ToSchema))] diff --git a/skootrs-rest/src/server/project.rs b/skootrs-rest/src/server/project.rs index 0617315..9e86abc 100644 --- a/skootrs-rest/src/server/project.rs +++ b/skootrs-rest/src/server/project.rs @@ -15,11 +15,12 @@ use actix_web::{Responder, web::{ServiceConfig, Data, Json, self}, HttpResponse}; use serde::{Serialize, Deserialize}; -use skootrs_statestore::SurrealProjectStateStore; +use skootrs_statestore::{InMemoryProjectReferenceCache, ProjectReferenceCache}; +use tokio::sync::Mutex; use utoipa::ToSchema; use skootrs_model::skootrs::ProjectCreateParams; -use skootrs_lib::service::{ecosystem::LocalEcosystemService, facet::LocalFacetService, project::{LocalProjectService, ProjectService}, repo::LocalRepoService, source::LocalSourceService}; +use skootrs_lib::service::{ecosystem::LocalEcosystemService, facet::LocalFacetService, output::LocalOutputService, project::{LocalProjectService, ProjectService}, repo::LocalRepoService, source::LocalSourceService}; /// An Error response for the REST API #[derive(Serialize, Deserialize, Clone, ToSchema)] @@ -33,7 +34,7 @@ pub(super) enum ErrorResponse { } /// Configures the services and routes for the Skootrs REST API -pub(super) fn configure(store: Data) -> impl FnOnce(&mut ServiceConfig) { +pub(super) fn configure(store: Data>) -> impl FnOnce(&mut ServiceConfig) { |config: &mut ServiceConfig| { config .app_data(store) @@ -69,18 +70,21 @@ pub(super) fn configure(store: Data) -> impl FnOnce(&m (status = 409, description = "Project unable to be created", body = ErrorResponse, example = json!(ErrorResponse::InitializationError("Unable to create repo".into()))) ) )] -pub(super) async fn create_project(params: Json, project_store: Data) -> Result { +pub(super) async fn create_project(params: Json, project_store: Data>) -> Result { // TODO: This should be initialized elsewhere let project_service = LocalProjectService { repo_service: LocalRepoService {}, ecosystem_service: LocalEcosystemService {}, source_service: LocalSourceService {}, facet_service: LocalFacetService {}, + output_service: LocalOutputService {}, }; let initialized_project = project_service.initialize(params.into_inner()).await .map_err(|err| actix_web::error::ErrorInternalServerError(err.to_string()))?; - project_store.create(initialized_project.clone()).await.map_err(|err| actix_web::error::ErrorInternalServerError(err.to_string()))?; + project_store.lock().await.set(initialized_project.repo.full_url()).await.map_err(|err| actix_web::error::ErrorInternalServerError(err.to_string()))?; + // TODO: Should this return an internal server error if it can't save the cache? + project_store.lock().await.save().map_err(|err| actix_web::error::ErrorInternalServerError(err.to_string()))?; Ok(HttpResponse::Ok().json(initialized_project)) } @@ -93,7 +97,7 @@ pub(super) async fn create_project(params: Json, project_st (status = 500, description = "Internal server error", body = ErrorResponse, example = json!(ErrorResponse::InitializationError("Unable to list repos".into()))), ) )] -pub(super) async fn list_projects(project_store: Data) -> Result { - let projects = project_store.select_all().await.map_err(|err| actix_web::error::ErrorInternalServerError(err.to_string()))?; +pub(super) async fn list_projects(project_store: Data) -> Result { + let projects = project_store.list().await.map_err(|err| actix_web::error::ErrorInternalServerError(err.to_string()))?; Ok(HttpResponse::Ok().json(projects)) } diff --git a/skootrs-rest/src/server/rest.rs b/skootrs-rest/src/server/rest.rs index 32f49fb..301187c 100644 --- a/skootrs-rest/src/server/rest.rs +++ b/skootrs-rest/src/server/rest.rs @@ -16,7 +16,8 @@ use std::net::Ipv4Addr; use actix_web::{App, HttpServer, web::Data}; -use skootrs_statestore::SurrealProjectStateStore; +use skootrs_statestore::InMemoryProjectReferenceCache; +use tokio::sync::Mutex; use tracing_actix_web::TracingLogger; use utoipa::{OpenApi, Modify, openapi::security::{SecurityScheme, ApiKey, ApiKeyValue}}; use utoipa_rapidoc::RapiDoc; @@ -134,7 +135,7 @@ pub async fn run_server() -> std::io::Result<()> { } } - let store: Data = Data::new(SurrealProjectStateStore::new().await.map_err(|err| std::io::Error::new(std::io::ErrorKind::Other, err))?); + let store: Data> = Data::new(Mutex::new(InMemoryProjectReferenceCache::new("/tmp/cache.json".into()))); // Make instance variable of ApiDoc so all worker threads gets the same instance. let openapi = ApiDoc::openapi(); diff --git a/skootrs-statestore/Cargo.toml b/skootrs-statestore/Cargo.toml index 5d7b6df..3511d3c 100644 --- a/skootrs-statestore/Cargo.toml +++ b/skootrs-statestore/Cargo.toml @@ -6,7 +6,6 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -surrealdb = { version = "1.1.1", features = ["kv-rocksdb"] } skootrs-lib = { path = "../skootrs-lib" } skootrs-model = { path = "../skootrs-model" } serde_json = "1.0.114" diff --git a/skootrs-statestore/src/lib.rs b/skootrs-statestore/src/lib.rs index 01f601b..0863f26 100644 --- a/skootrs-statestore/src/lib.rs +++ b/skootrs-statestore/src/lib.rs @@ -22,70 +22,9 @@ use skootrs_lib::service::{ repo::{LocalRepoService, RepoService}, source::{LocalSourceService, SourceService}, }; -use surrealdb::{ - engine::local::{Db, RocksDb}, - Surreal, -}; use skootrs_model::skootrs::{InitializedProject, InitializedRepo, InitializedSource, SkootError}; -/// The `SurrealDB` state store for Skootrs projects. -#[derive(Debug)] -pub struct SurrealProjectStateStore { - pub db: Surreal, -} - -/// The functionality for the `SurrealDB` state store for Skootrs projects. -impl SurrealProjectStateStore { - /// Create a new `SurrealDB` state store for Skootrs projects if `state.db` does not exist, otherwise open it. - /// - /// # Errors - /// - /// Returns an error if the state store can't be created or opened. - pub async fn new() -> Result { - let db = Surreal::new::("state.db").await?; - db.use_ns("kusaridev").use_db("skootrs").await?; - Ok(Self { db }) - } - - /// Store a new project in the state store. - /// - /// # Errors - /// - /// Returns an error if the project can't be stored in the state store. - pub async fn create( - &self, - project: InitializedProject, - ) -> Result, SkootError> { - let created = self - .db - .create(("project", project.repo.full_url())) - .content(project) - .await?; - Ok(created) - } - - /// Fetch a project from the state store. - /// - /// # Errors - /// - /// Returns an error if the project can't be fetched from the state store. - pub async fn select(&self, repo_url: String) -> Result, SkootError> { - let record = self.db.select(("project", repo_url)).await?; - Ok(record) - } - - /// Fetch all projects from the state store. - /// - /// # Errors - /// - /// Returns an error if all the projects can't be dumped from the state store. - pub async fn select_all(&self) -> Result, SkootError> { - let records = self.db.select("project").await?; - Ok(records) - } -} - pub trait ProjectStateStore { fn create( &self,