From 20b0866d8d72c37bf4d8711492496eca7204555f Mon Sep 17 00:00:00 2001 From: "Dotan J. Nahum" Date: Tue, 22 Oct 2024 17:19:10 +0300 Subject: [PATCH] tidy: move extras to loco-org (#894) * tidy: move extras to loco-org --- Cargo.toml | 2 +- examples/demo/Cargo.lock | 1037 +---------------- examples/demo/Cargo.toml | 1 - examples/demo/src/app.rs | 8 - examples/demo/tests/requests/ping.rs | 2 - loco-extras/Cargo.toml | 70 -- loco-extras/README.md | 10 - loco-extras/src/initializers/extra_db.rs | 30 - loco-extras/src/initializers/mod.rs | 73 -- .../src/initializers/mongodb/README.md | 106 -- loco-extras/src/initializers/mongodb/mod.rs | 110 -- loco-extras/src/initializers/multi_db.rs | 28 - .../src/initializers/normalize_path.rs | 36 - .../src/initializers/opentelemetry/README.md | 11 - .../src/initializers/opentelemetry/mod.rs | 32 - loco-extras/src/initializers/prometheus.rs | 21 - loco-extras/src/lib.rs | 14 - 17 files changed, 55 insertions(+), 1536 deletions(-) delete mode 100644 loco-extras/Cargo.toml delete mode 100644 loco-extras/README.md delete mode 100644 loco-extras/src/initializers/extra_db.rs delete mode 100644 loco-extras/src/initializers/mod.rs delete mode 100644 loco-extras/src/initializers/mongodb/README.md delete mode 100644 loco-extras/src/initializers/mongodb/mod.rs delete mode 100644 loco-extras/src/initializers/multi_db.rs delete mode 100644 loco-extras/src/initializers/normalize_path.rs delete mode 100644 loco-extras/src/initializers/opentelemetry/README.md delete mode 100644 loco-extras/src/initializers/opentelemetry/mod.rs delete mode 100644 loco-extras/src/initializers/prometheus.rs delete mode 100644 loco-extras/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index 00ce87c4d..774f4c958 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = ["xtask", "loco-extras", "loco-gen"] +members = ["xtask", "loco-gen"] exclude = ["starters"] [workspace.package] diff --git a/examples/demo/Cargo.lock b/examples/demo/Cargo.lock index e3862cde8..579deb61b 100644 --- a/examples/demo/Cargo.lock +++ b/examples/demo/Cargo.lock @@ -70,7 +70,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", - "getrandom", "once_cell", "version_check", "zerocopy", @@ -446,34 +445,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" -[[package]] -name = "axum" -version = "0.6.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" -dependencies = [ - "async-trait", - "axum-core 0.3.4", - "bitflags 1.3.2", - "bytes", - "futures-util", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.29", - "itoa", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "sync_wrapper 0.1.2", - "tower 0.4.13", - "tower-layer", - "tower-service", -] - [[package]] name = "axum" version = "0.7.7" @@ -481,14 +452,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "504e3947307ac8326a5437504c517c4b56716c9d98fac0028c2acc7ca47d70ae" dependencies = [ "async-trait", - "axum-core 0.4.5", + "axum-core", "axum-macros", "bytes", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body", "http-body-util", - "hyper 1.4.1", + "hyper", "hyper-util", "itoa", "matchit", @@ -510,23 +481,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "axum-core" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http 0.2.12", - "http-body 0.4.6", - "mime", - "rustversion", - "tower-layer", - "tower-service", -] - [[package]] name = "axum-core" version = "0.4.5" @@ -537,7 +491,7 @@ dependencies = [ "bytes", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body", "http-body-util", "mime", "pin-project-lite", @@ -554,13 +508,13 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0be6ea09c9b96cb5076af0de2e383bd2bc0c18f827cf1967bdd353e0b910d733" dependencies = [ - "axum 0.7.7", - "axum-core 0.4.5", + "axum", + "axum-core", "bytes", "cookie", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body", "http-body-util", "mime", "pin-project-lite", @@ -582,28 +536,6 @@ dependencies = [ "syn 2.0.66", ] -[[package]] -name = "axum-prometheus" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b683cbc43010e9a3d72c2f31ca464155ff4f95819e88a32924b0f47a43898978" -dependencies = [ - "axum 0.7.7", - "bytes", - "futures", - "futures-core", - "http 1.1.0", - "http-body 1.0.0", - "matchit", - "metrics", - "metrics-exporter-prometheus", - "once_cell", - "pin-project", - "tokio", - "tower 0.4.13", - "tower-http 0.5.2", -] - [[package]] name = "axum-test" version = "16.1.0" @@ -613,12 +545,12 @@ dependencies = [ "anyhow", "assert-json-diff", "auto-future", - "axum 0.7.7", + "axum", "bytes", "cookie", "http 1.1.0", "http-body-util", - "hyper 1.4.1", + "hyper", "hyper-util", "mime", "pretty_assertions", @@ -633,24 +565,6 @@ dependencies = [ "url", ] -[[package]] -name = "axum-tracing-opentelemetry" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26965dca35be1ca4a128177b9302c4c04f0661443621171adb09d002dcdf1d5" -dependencies = [ - "axum 0.7.7", - "futures-core", - "futures-util", - "http 1.1.0", - "opentelemetry", - "pin-project-lite", - "tower 0.4.13", - "tracing", - "tracing-opentelemetry", - "tracing-opentelemetry-instrumentation-sdk", -] - [[package]] name = "axum_session" version = "0.10.1" @@ -659,7 +573,7 @@ checksum = "d98669d6e652c4688e12f5d9f9a6a0077f5be101a1bfaa169062d3df70ad4e38" dependencies = [ "aes-gcm", "async-trait", - "axum-core 0.4.5", + "axum-core", "base64 0.21.7", "bytes", "chrono", @@ -667,7 +581,7 @@ dependencies = [ "dashmap", "futures", "http 1.1.0", - "http-body 1.0.0", + "http-body", "rand", "serde", "serde_json", @@ -706,12 +620,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.7" @@ -859,27 +767,6 @@ dependencies = [ "alloc-stdlib", ] -[[package]] -name = "bson" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a88e82b9106923b5c4d6edfca9e7db958d4e98a478ec115022e81b9b38e2c8" -dependencies = [ - "ahash 0.8.11", - "base64 0.13.1", - "bitvec", - "hex", - "indexmap 2.2.6", - "js-sys", - "once_cell", - "rand", - "serde", - "serde_bytes", - "serde_json", - "time", - "uuid", -] - [[package]] name = "bstr" version = "1.9.1" @@ -1045,7 +932,7 @@ dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.1", + "strsim", ] [[package]] @@ -1133,12 +1020,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - [[package]] name = "convert_case" version = "0.6.0" @@ -1297,38 +1178,14 @@ dependencies = [ "cipher", ] -[[package]] -name = "darling" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" -dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", -] - [[package]] name = "darling" version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", -] - -[[package]] -name = "darling_core" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -1341,28 +1198,17 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.66", ] -[[package]] -name = "darling_macro" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" -dependencies = [ - "darling_core 0.13.4", - "quote", - "syn 1.0.109", -] - [[package]] name = "darling_macro" version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.20.10", + "darling_core", "quote", "syn 2.0.66", ] @@ -1380,18 +1226,12 @@ dependencies = [ "parking_lot_core", ] -[[package]] -name = "data-encoding" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" - [[package]] name = "demo_app" version = "0.1.0" dependencies = [ "async-trait", - "axum 0.7.7", + "axum", "axum-extra", "axum-test", "axum_session", @@ -1400,7 +1240,6 @@ dependencies = [ "futures-util", "include_dir", "insta", - "loco-extras", "loco-rs", "migration", "rstest", @@ -1441,30 +1280,6 @@ dependencies = [ "serde", ] -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_more" -version = "0.99.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" -dependencies = [ - "convert_case 0.4.0", - "proc-macro2", - "quote", - "rustc_version 0.4.0", - "syn 2.0.66", -] - [[package]] name = "deunicode" version = "1.6.0" @@ -1623,18 +1438,6 @@ dependencies = [ "regex", ] -[[package]] -name = "enum-as-inner" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "equivalent" version = "1.0.1" @@ -2085,25 +1888,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap 2.2.6", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -2189,17 +1973,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "hostname" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" -dependencies = [ - "libc", - "match_cfg", - "winapi", -] - [[package]] name = "hostname" version = "0.4.0" @@ -2233,17 +2006,6 @@ dependencies = [ "itoa", ] -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http 0.2.12", - "pin-project-lite", -] - [[package]] name = "http-body" version = "1.0.0" @@ -2263,7 +2025,7 @@ dependencies = [ "bytes", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body", "pin-project-lite", ] @@ -2310,30 +2072,6 @@ dependencies = [ "serde", ] -[[package]] -name = "hyper" -version = "0.14.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http 0.2.12", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2 0.5.7", - "tokio", - "tower-service", - "tracing", - "want", -] - [[package]] name = "hyper" version = "1.4.1" @@ -2344,7 +2082,7 @@ dependencies = [ "futures-channel", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body", "httparse", "httpdate", "itoa", @@ -2354,18 +2092,6 @@ dependencies = [ "want", ] -[[package]] -name = "hyper-timeout" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" -dependencies = [ - "hyper 0.14.29", - "pin-project-lite", - "tokio", - "tokio-io-timeout", -] - [[package]] name = "hyper-util" version = "0.1.5" @@ -2376,8 +2102,8 @@ dependencies = [ "futures-channel", "futures-util", "http 1.1.0", - "http-body 1.0.0", - "hyper 1.4.1", + "http-body", + "hyper", "pin-project-lite", "socket2 0.5.7", "tokio", @@ -2533,17 +2259,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "0.5.0" @@ -2601,16 +2316,6 @@ dependencies = [ "quote", ] -[[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", -] - [[package]] name = "indexmap" version = "2.2.6" @@ -2633,22 +2338,6 @@ dependencies = [ "syn 2.0.66", ] -[[package]] -name = "init-tracing-opentelemetry" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "754367a7e7f9314afe3ee9780ba8b8ea2cab487cdc8017c9794793051242f878" -dependencies = [ - "opentelemetry", - "opentelemetry-otlp", - "opentelemetry-semantic-conventions", - "opentelemetry_sdk", - "thiserror", - "tracing", - "tracing-opentelemetry", - "tracing-subscriber", -] - [[package]] name = "inout" version = "0.1.3" @@ -2713,24 +2402,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "ipconfig" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" -dependencies = [ - "socket2 0.5.7", - "widestring", - "windows-sys 0.48.0", - "winreg", -] - -[[package]] -name = "ipnet" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" - [[package]] name = "ipnetwork" version = "0.20.0" @@ -2846,20 +2517,20 @@ dependencies = [ "fastrand 2.1.0", "futures-io", "futures-util", - "hostname 0.4.0", + "hostname", "httpdate", "idna 0.5.0", "mime", "nom", "percent-encoding", "quoted_printable", - "rustls 0.23.15", - "rustls-pemfile 2.1.2", + "rustls", + "rustls-pemfile", "socket2 0.5.7", "tokio", - "tokio-rustls 0.26.0", + "tokio-rustls", "url", - "webpki-roots 0.26.2", + "webpki-roots", ] [[package]] @@ -2929,31 +2600,9 @@ dependencies = [ "scopeguard", ] -[[package]] -name = "loco-extras" -version = "0.4.0" -dependencies = [ - "async-trait", - "axum 0.7.7", - "axum-prometheus", - "axum-tracing-opentelemetry", - "init-tracing-opentelemetry", - "loco-rs", - "mongodb", - "opentelemetry", - "opentelemetry-otlp", - "serde", - "serde_json", - "tower 0.4.13", - "tower-http 0.6.1", - "tracing", - "tracing-opentelemetry-instrumentation-sdk", - "tracing-subscriber", -] - [[package]] name = "loco-gen" -version = "0.11.0" +version = "0.11.1" dependencies = [ "chrono", "clap", @@ -2970,11 +2619,11 @@ dependencies = [ [[package]] name = "loco-rs" -version = "0.11.0" +version = "0.11.1" dependencies = [ "argon2", "async-trait", - "axum 0.7.7", + "axum", "axum-extra", "axum-test", "backtrace_printer", @@ -2991,7 +2640,7 @@ dependencies = [ "fs-err", "futures-util", "heck 0.4.1", - "hyper 1.4.1", + "hyper", "include_dir", "ipnetwork", "jsonwebtoken", @@ -3006,7 +2655,7 @@ dependencies = [ "rusty-sidekiq", "sea-orm", "sea-orm-migration", - "semver 1.0.23", + "semver", "serde", "serde_json", "serde_variant", @@ -3017,7 +2666,7 @@ dependencies = [ "tokio", "tokio-cron-scheduler", "tower 0.4.13", - "tower-http 0.6.1", + "tower-http", "tracing", "tracing-appender", "tracing-subscriber", @@ -3035,21 +2684,6 @@ dependencies = [ "value-bag", ] -[[package]] -name = "lru-cache" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" -dependencies = [ - "linked-hash-map", -] - -[[package]] -name = "match_cfg" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" - [[package]] name = "matchers" version = "0.1.0" @@ -3059,12 +2693,6 @@ dependencies = [ "regex-automata 0.1.10", ] -[[package]] -name = "matches" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" - [[package]] name = "matchit" version = "0.7.3" @@ -3087,48 +2715,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "metrics" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2be3cbd384d4e955b231c895ce10685e3d8260c5ccffae898c96c723b0772835" -dependencies = [ - "ahash 0.8.11", - "portable-atomic", -] - -[[package]] -name = "metrics-exporter-prometheus" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bf4e7146e30ad172c42c39b3246864bd2d3c6396780711a1baf749cfe423e21" -dependencies = [ - "base64 0.21.7", - "hyper 0.14.29", - "indexmap 2.2.6", - "ipnet", - "metrics", - "metrics-util", - "quanta", - "thiserror", - "tokio", -] - -[[package]] -name = "metrics-util" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b07a5eb561b8cbc16be2d216faf7757f9baf3bfb94dbb0fae3df8387a5bb47f" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", - "hashbrown 0.14.5", - "metrics", - "num_cpus", - "quanta", - "sketches-ddsketch", -] - [[package]] name = "migration" version = "0.1.0" @@ -3193,7 +2779,7 @@ dependencies = [ "once_cell", "parking_lot", "quanta", - "rustc_version 0.4.0", + "rustc_version", "smallvec", "tagptr", "thiserror", @@ -3201,53 +2787,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "mongodb" -version = "2.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef206acb1b72389b49bc9985efe7eb1f8a9bb18e5680d262fac26c07f44025f1" -dependencies = [ - "async-trait", - "base64 0.13.1", - "bitflags 1.3.2", - "bson", - "chrono", - "derivative", - "derive_more", - "futures-core", - "futures-executor", - "futures-io", - "futures-util", - "hex", - "hmac", - "lazy_static", - "md-5", - "pbkdf2", - "percent-encoding", - "rand", - "rustc_version_runtime", - "rustls 0.21.12", - "rustls-pemfile 1.0.4", - "serde", - "serde_bytes", - "serde_with", - "sha-1", - "sha2", - "socket2 0.4.10", - "stringprep", - "strsim 0.10.0", - "take_mut", - "thiserror", - "tokio", - "tokio-rustls 0.24.1", - "tokio-util", - "trust-dns-proto", - "trust-dns-resolver", - "typed-builder", - "uuid", - "webpki-roots 0.25.4", -] - [[package]] name = "multer" version = "3.1.0" @@ -3417,93 +2956,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" -[[package]] -name = "opentelemetry" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900d57987be3f2aeb70d385fff9b27fb74c5723cc9a52d904d4f9c807a0667bf" -dependencies = [ - "futures-core", - "futures-sink", - "js-sys", - "once_cell", - "pin-project-lite", - "thiserror", - "urlencoding", -] - -[[package]] -name = "opentelemetry-http" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7690dc77bf776713848c4faa6501157469017eaf332baccd4eb1cea928743d94" -dependencies = [ - "async-trait", - "bytes", - "http 0.2.12", - "opentelemetry", -] - -[[package]] -name = "opentelemetry-otlp" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a016b8d9495c639af2145ac22387dcb88e44118e45320d9238fbf4e7889abcb" -dependencies = [ - "async-trait", - "futures-core", - "http 0.2.12", - "opentelemetry", - "opentelemetry-http", - "opentelemetry-proto", - "opentelemetry-semantic-conventions", - "opentelemetry_sdk", - "prost", - "thiserror", - "tokio", - "tonic", -] - -[[package]] -name = "opentelemetry-proto" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8fddc9b68f5b80dae9d6f510b88e02396f006ad48cac349411fbecc80caae4" -dependencies = [ - "opentelemetry", - "opentelemetry_sdk", - "prost", - "tonic", -] - -[[package]] -name = "opentelemetry-semantic-conventions" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9ab5bd6c42fb9349dcf28af2ba9a0667f697f9bdcca045d39f2cec5543e2910" - -[[package]] -name = "opentelemetry_sdk" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e90c7113be649e31e9a0f8b5ee24ed7a16923b322c3c5ab6367469c049d6b7e" -dependencies = [ - "async-trait", - "crossbeam-channel", - "futures-channel", - "futures-executor", - "futures-util", - "glob", - "once_cell", - "opentelemetry", - "ordered-float 4.2.0", - "percent-encoding", - "rand", - "thiserror", - "tokio", - "tokio-stream", -] - [[package]] name = "ordered-float" version = "3.9.2" @@ -3513,15 +2965,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "ordered-float" -version = "4.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76df7075c7d4d01fdcb46c912dd17fba5b60c78ea480b475f2b6ab6f666584e" -dependencies = [ - "num-traits", -] - [[package]] name = "os_pipe" version = "1.2.0" @@ -3618,15 +3061,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "pbkdf2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" -dependencies = [ - "digest", -] - [[package]] name = "pem" version = "3.0.4" @@ -3844,15 +3278,9 @@ checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" dependencies = [ "cfg-if", "cpufeatures", - "opaque-debug", - "universal-hash", -] - -[[package]] -name = "portable-atomic" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + "opaque-debug", + "universal-hash", +] [[package]] name = "powerfmt" @@ -3937,29 +3365,6 @@ dependencies = [ "yansi 1.0.1", ] -[[package]] -name = "prost" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-derive" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" -dependencies = [ - "anyhow", - "itertools 0.12.1", - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "psm" version = "0.1.21" @@ -4004,12 +3409,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - [[package]] name = "quote" version = "1.0.36" @@ -4208,16 +3607,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "resolv-conf" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" -dependencies = [ - "hostname 0.3.1", - "quick-error", -] - [[package]] name = "ring" version = "0.17.8" @@ -4310,7 +3699,7 @@ dependencies = [ "futures", "futures-timer", "rstest_macros", - "rustc_version 0.4.0", + "rustc_version", ] [[package]] @@ -4326,7 +3715,7 @@ dependencies = [ "quote", "regex", "relative-path", - "rustc_version 0.4.0", + "rustc_version", "syn 2.0.66", "unicode-ident", ] @@ -4375,32 +3764,13 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - [[package]] name = "rustc_version" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.23", -] - -[[package]] -name = "rustc_version_runtime" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d31b7153270ebf48bf91c65ae5b0c00e749c4cfad505f66530ac74950249582f" -dependencies = [ - "rustc_version 0.2.3", - "semver 0.9.0", + "semver", ] [[package]] @@ -4430,18 +3800,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "rustls" -version = "0.21.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" -dependencies = [ - "log", - "ring", - "rustls-webpki 0.101.7", - "sct", -] - [[package]] name = "rustls" version = "0.23.15" @@ -4452,20 +3810,11 @@ dependencies = [ "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.102.8", + "rustls-webpki", "subtle", "zeroize", ] -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64 0.21.7", -] - [[package]] name = "rustls-pemfile" version = "2.1.2" @@ -4482,16 +3831,6 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" -[[package]] -name = "rustls-webpki" -version = "0.101.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "rustls-webpki" version = "0.102.8" @@ -4518,7 +3857,7 @@ dependencies = [ "async-trait", "bb8", "chrono", - "convert_case 0.6.0", + "convert_case", "cron_clock", "gethostname", "hex", @@ -4567,16 +3906,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "sdd" version = "1.7.0" @@ -4681,7 +4010,7 @@ dependencies = [ "bigdecimal", "chrono", "inherent", - "ordered-float 3.9.2", + "ordered-float", "rust_decimal", "sea-query-derive", "serde_json", @@ -4711,7 +4040,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9834af2c4bd8c5162f00c89f1701fb6886119a88062cf76fe842ea9e232b9839" dependencies = [ - "darling 0.20.10", + "darling", "heck 0.4.1", "proc-macro2", "quote", @@ -4763,27 +4092,12 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - [[package]] name = "semver" version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "serde" version = "1.0.203" @@ -4793,15 +4107,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde_bytes" -version = "0.11.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" -dependencies = [ - "serde", -] - [[package]] name = "serde_derive" version = "1.0.203" @@ -4819,7 +4124,6 @@ version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ - "indexmap 2.2.6", "itoa", "ryu", "serde", @@ -4875,35 +4179,13 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_with" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" -dependencies = [ - "serde", - "serde_with_macros", -] - -[[package]] -name = "serde_with_macros" -version = "1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" -dependencies = [ - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "serde_yaml" version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.2.6", + "indexmap", "itoa", "ryu", "serde", @@ -4935,17 +4217,6 @@ dependencies = [ "syn 2.0.66", ] -[[package]] -name = "sha-1" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - [[package]] name = "sha1" version = "0.10.6" @@ -5054,12 +4325,6 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" -[[package]] -name = "sketches-ddsketch" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85636c14b73d81f541e525f585c0a2109e6744e1565b5c1668e31c70c10ed65c" - [[package]] name = "slab" version = "0.4.9" @@ -5266,15 +4531,15 @@ dependencies = [ "hashbrown 0.14.5", "hashlink", "hex", - "indexmap 2.2.6", + "indexmap", "log", "memchr", "once_cell", "paste", "percent-encoding", "rust_decimal", - "rustls 0.23.15", - "rustls-pemfile 2.1.2", + "rustls", + "rustls-pemfile", "serde", "serde_json", "sha2", @@ -5287,7 +4552,7 @@ dependencies = [ "tracing", "url", "uuid", - "webpki-roots 0.26.2", + "webpki-roots", ] [[package]] @@ -5482,12 +4747,6 @@ dependencies = [ "unicode-properties", ] -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "strsim" version = "0.11.1" @@ -5569,12 +4828,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" -[[package]] -name = "take_mut" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" - [[package]] name = "tap" version = "1.0.1" @@ -5745,16 +4998,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "tokio-io-timeout" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" -dependencies = [ - "pin-project-lite", - "tokio", -] - [[package]] name = "tokio-macros" version = "2.4.0" @@ -5766,23 +5009,13 @@ dependencies = [ "syn 2.0.66", ] -[[package]] -name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls 0.21.12", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.15", + "rustls", "rustls-pki-types", "tokio", ] @@ -5806,7 +5039,6 @@ checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", - "futures-io", "futures-sink", "pin-project-lite", "tokio", @@ -5827,7 +5059,7 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.2.6", + "indexmap", "toml_datetime", "winnow 0.5.40", ] @@ -5838,40 +5070,13 @@ version = "0.22.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" dependencies = [ - "indexmap 2.2.6", + "indexmap", "serde", "serde_spanned", "toml_datetime", "winnow 0.6.13", ] -[[package]] -name = "tonic" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" -dependencies = [ - "async-stream", - "async-trait", - "axum 0.6.20", - "base64 0.21.7", - "bytes", - "h2", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.29", - "hyper-timeout", - "percent-encoding", - "pin-project", - "prost", - "tokio", - "tokio-stream", - "tower 0.4.13", - "tower-layer", - "tower-service", - "tracing", -] - [[package]] name = "tower" version = "0.4.13" @@ -5880,13 +5085,9 @@ checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ "futures-core", "futures-util", - "indexmap 1.9.3", "pin-project", "pin-project-lite", - "rand", - "slab", "tokio", - "tokio-util", "tower-layer", "tower-service", "tracing", @@ -5908,22 +5109,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "tower-http" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" -dependencies = [ - "bitflags 2.5.0", - "bytes", - "http 1.1.0", - "http-body 1.0.0", - "http-body-util", - "pin-project-lite", - "tower-layer", - "tower-service", -] - [[package]] name = "tower-http" version = "0.6.1" @@ -5936,7 +5121,7 @@ dependencies = [ "futures-core", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body", "http-body-util", "http-range-header", "httpdate", @@ -6019,36 +5204,6 @@ dependencies = [ "tracing-core", ] -[[package]] -name = "tracing-opentelemetry" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9be14ba1bbe4ab79e9229f7f89fab8d120b865859f10527f31c033e599d2284" -dependencies = [ - "js-sys", - "once_cell", - "opentelemetry", - "opentelemetry_sdk", - "smallvec", - "tracing", - "tracing-core", - "tracing-log", - "tracing-subscriber", - "web-time", -] - -[[package]] -name = "tracing-opentelemetry-instrumentation-sdk" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a276058193f1b03d8279356215ec4c8c1bb21e40e5554bb239aa94fb2d8e189" -dependencies = [ - "http 1.1.0", - "opentelemetry", - "tracing", - "tracing-opentelemetry", -] - [[package]] name = "tracing-serde" version = "0.1.3" @@ -6086,51 +5241,6 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b2cb4fbb9995eeb36ac86fadf24031ccd58f99d6b4b2d7b911db70bddb80d90" -[[package]] -name = "trust-dns-proto" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c31f240f59877c3d4bb3b3ea0ec5a6a0cff07323580ff8c7a605cd7d08b255d" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.2.3", - "ipnet", - "lazy_static", - "log", - "rand", - "smallvec", - "thiserror", - "tinyvec", - "tokio", - "url", -] - -[[package]] -name = "trust-dns-resolver" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ba72c2ea84515690c9fcef4c6c660bb9df3036ed1051686de84605b74fd558" -dependencies = [ - "cfg-if", - "futures-util", - "ipconfig", - "lazy_static", - "log", - "lru-cache", - "parking_lot", - "resolv-conf", - "smallvec", - "thiserror", - "tokio", - "trust-dns-proto", -] - [[package]] name = "try-lock" version = "0.2.5" @@ -6162,17 +5272,6 @@ dependencies = [ "rustc-hash", ] -[[package]] -name = "typed-builder" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89851716b67b937e393b3daa8423e67ddfc4bbbf1654bcf05488e95e0828db0c" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "typenum" version = "1.17.0" @@ -6376,12 +5475,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "urlencoding" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" - [[package]] name = "utf16_iter" version = "1.0.5" @@ -6412,7 +5505,7 @@ version = "4.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5afb1a60e207dca502682537fefcfd9921e71d0b83e9576060f09abc6efab23" dependencies = [ - "indexmap 2.2.6", + "indexmap", "serde", "serde_json", "utoipa-gen", @@ -6463,7 +5556,7 @@ version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df0bcf92720c40105ac4b2dda2a4ea3aa717d4d6a862cc217da653a4bd5c6b10" dependencies = [ - "darling 0.20.10", + "darling", "once_cell", "proc-macro-error", "proc-macro2", @@ -6627,12 +5720,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki-roots" -version = "0.25.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" - [[package]] name = "webpki-roots" version = "0.26.2" @@ -6652,12 +5739,6 @@ dependencies = [ "wasite", ] -[[package]] -name = "widestring" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" - [[package]] name = "winapi" version = "0.3.9" @@ -6865,16 +5946,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "write16" version = "1.0.0" diff --git a/examples/demo/Cargo.toml b/examples/demo/Cargo.toml index 71aa9b99b..d76d1f640 100644 --- a/examples/demo/Cargo.toml +++ b/examples/demo/Cargo.toml @@ -12,7 +12,6 @@ default-run = "demo_app-cli" [dependencies] loco-rs = { path = "../../", version = "*" } -loco-extras = { version = "*", path = "../../loco-extras", features = ["full"] } migration = { path = "migration" } serde = { version = "1", features = ["derive"] } diff --git a/examples/demo/src/app.rs b/examples/demo/src/app.rs index f625e6902..b2ba52f48 100644 --- a/examples/demo/src/app.rs +++ b/examples/demo/src/app.rs @@ -1,7 +1,6 @@ use std::path::Path; use async_trait::async_trait; -use loco_extras; use loco_rs::{ app::{AppContext, Hooks, Initializer}, boot::{create_app, BootResult, StartMode}, @@ -48,15 +47,8 @@ impl Hooks for App { Box::new(initializers::axum_session::AxumSessionInitializer), Box::new(initializers::view_engine::ViewEngineInitializer), Box::new(initializers::hello_view_engine::HelloViewEngineInitializer), - Box::new(loco_extras::initializers::normalize_path::NormalizePathInitializer), ]; - if ctx.environment != Environment::Test { - initializers.push(Box::new( - loco_extras::initializers::prometheus::AxumPrometheusInitializer, - )); - } - Ok(initializers) } // diff --git a/examples/demo/tests/requests/ping.rs b/examples/demo/tests/requests/ping.rs index 1be7243f0..1303301de 100644 --- a/examples/demo/tests/requests/ping.rs +++ b/examples/demo/tests/requests/ping.rs @@ -18,8 +18,6 @@ macro_rules! configure_insta { // removes trailing slashes from the request path. #[rstest] #[case("ping", "/_ping")] -#[case("ping_with_trailing_slash", "/_ping/")] -#[case("ping_with_multiple_trailing_slashes", "/_ping////")] #[tokio::test] async fn ping(#[case] test_name: &str, #[case] path: &str) { configure_insta!(); diff --git a/loco-extras/Cargo.toml b/loco-extras/Cargo.toml deleted file mode 100644 index 350c13cb8..000000000 --- a/loco-extras/Cargo.toml +++ /dev/null @@ -1,70 +0,0 @@ -[package] -name = "loco-extras" -version = "0.4.0" -description = "Common loco components" -license.workspace = true -edition.workspace = true -rust-version.workspace = true - -[lib] -path = "src/lib.rs" - -[dependencies] -async-trait = { workspace = true } -axum = { workspace = true } -# initializer -axum-prometheus = { version = "0.6.1", optional = true } -serde = { version = "1", optional = true } -serde_json = { version = "1", optional = true } -tower = { workspace = true, optional = true } -tower-http = { workspace = true, optional = true, features = [ - "normalize-path", -] } -opentelemetry = { version = "0.22", optional = true } -opentelemetry-otlp = { version = "0.15", optional = true, features = [ - "grpc-tonic", -] } -axum-tracing-opentelemetry = { version = "0.18", optional = true } -init-tracing-opentelemetry = { version = "0.18", optional = true, features = [ - "otlp", - "tracing_subscriber_ext", -] } -tracing-opentelemetry-instrumentation-sdk = { version = "0.18", optional = true } -tracing-subscriber = { version = "0.3.18", optional = true, features = [ - "env-filter", - "json", -] } -tracing = { version = "0.1.40", optional = true } -mongodb = { version = "2.8.0", optional = true } - -[dependencies.loco-rs] -path = "../" -version = "*" -default-features = true -features = ["with-db", "auth_jwt"] - -[features] -default = ["full"] -full = [ - "initializer-prometheus", - "initializer-extra-db", - "initializer-multi-db", - "initializer-normalize-path", - "initializer-opentelemetry", - "initializer-mongodb", -] - -initializer-prometheus = ["dep:axum-prometheus"] -initializer-extra-db = [] -initializer-multi-db = ["dep:serde_json"] -initializer-normalize-path = ["dep:tower", "dep:tower-http"] -initializer-opentelemetry = [ - "dep:opentelemetry", - "dep:opentelemetry-otlp", - "dep:axum-tracing-opentelemetry", - "dep:init-tracing-opentelemetry", - "dep:tracing-opentelemetry-instrumentation-sdk", - "dep:tracing-subscriber", - "dep:tracing", -] -initializer-mongodb = ["dep:mongodb", "dep:serde", "dep:serde_json"] diff --git a/loco-extras/README.md b/loco-extras/README.md deleted file mode 100644 index 5cd87b3d9..000000000 --- a/loco-extras/README.md +++ /dev/null @@ -1,10 +0,0 @@ - -![Loco.rs](https://github.com/loco-rs/loco/assets/83390/992d215a-3cd3-42ee-a1c7-de9fd25a5bac) - -# Loco Extras - -https://loco.rs - - -Loco extras contains a list of common implementation that are generally useful when working with [Loco](https://loco.rs/). - diff --git a/loco-extras/src/initializers/extra_db.rs b/loco-extras/src/initializers/extra_db.rs deleted file mode 100644 index 95c67cf7c..000000000 --- a/loco-extras/src/initializers/extra_db.rs +++ /dev/null @@ -1,30 +0,0 @@ -use async_trait::async_trait; -use axum::{Extension, Router as AxumRouter}; -use loco_rs::{db, prelude::*}; - -#[allow(clippy::module_name_repetitions)] -pub struct ExtraDbInitializer; - -#[async_trait] -impl Initializer for ExtraDbInitializer { - fn name(&self) -> String { - "extra-db".to_string() - } - - async fn after_routes(&self, router: AxumRouter, ctx: &AppContext) -> Result { - let extra_db_config = ctx - .config - .initializers - .clone() - .ok_or_else(|| Error::Message("initializers config not configured".to_string()))?; - - let extra_db_value = extra_db_config - .get("extra_db") - .ok_or_else(|| Error::Message("initializers config not configured".to_string()))?; - - let extra_db = serde_json::from_value(extra_db_value.clone())?; - - let db = db::connect(&extra_db).await?; - Ok(router.layer(Extension(db))) - } -} diff --git a/loco-extras/src/initializers/mod.rs b/loco-extras/src/initializers/mod.rs deleted file mode 100644 index 91d28a4ac..000000000 --- a/loco-extras/src/initializers/mod.rs +++ /dev/null @@ -1,73 +0,0 @@ -//! Initializers -//! -//! Initializers are a way to encapsulate a piece of infrastructure "wiring" -//! that you need to do in your app. read more [here](https://loco.rs/docs/the-app/initializers/) -//! -//! ### How To Use -//! -//! To integrate `loco-extras` into your project, add the following line to your -//! `Cargo.toml` file: -//! -//! ```toml -//! loco-extras = { version = "*", features = ["FEATURE"] } -//! ``` -//! -//! After adding the crate to your project, navigate to the application hooks in -//! `app.rs` and include the `loco_extras` crate: -//! -//! ```rust -//! use loco_extras; -//! ``` -//! -//! Once the `loco_extras` crate is included, proceed to the `initializers` hook -//! function and add your initializations. Here's an example: -//! -//! ```rust,ignore -//! impl Hooks for App { -//! . -//! . -//! . -//! async fn initializers(_ctx: &AppContext) -> Result>> { -//! Ok(vec![ -//! Box::new(loco_extras::initializers::[MODULE_NAME]), -//! ]) -//! } -//! } -//! ``` -//! -//! ### Customization -//! -//! The extras initializers are intentionally not designed for extensive -//! modifications. The concept is to use them as-is without complexity. If you -//! need to customize the initializers, copy the relevant file from the -//! `loco_extras` project into your app, adapt it to your requirements, and -//! update the hook to reference the new source. -//! -//! ### Prometheus: -//!```rust -#![doc = include_str!("././prometheus.rs")] -//!```` -//! ### Extra Database connection: -//! ```rust -#![doc = include_str!("././extra_db.rs")] -//!```` -//! ### Extra Multiple Database Connections: -//! ```rust -#![doc = include_str!("././multi_db.rs")] -//!```` -//! ### Normalize path: -//! ```rust -#![doc = include_str!("././normalize_path.rs")] -//!```` -#[cfg(feature = "initializer-extra-db")] -pub mod extra_db; -#[cfg(feature = "initializer-mongodb")] -pub mod mongodb; -#[cfg(feature = "initializer-multi-db")] -pub mod multi_db; -#[cfg(feature = "initializer-normalize-path")] -pub mod normalize_path; -#[cfg(feature = "initializer-opentelemetry")] -pub mod opentelemetry; -#[cfg(feature = "initializer-prometheus")] -pub mod prometheus; diff --git a/loco-extras/src/initializers/mongodb/README.md b/loco-extras/src/initializers/mongodb/README.md deleted file mode 100644 index f5eaa7add..000000000 --- a/loco-extras/src/initializers/mongodb/README.md +++ /dev/null @@ -1,106 +0,0 @@ -# This Initializer adds support for connection to a MongoDB database - -There is extra functionality that loco supports through the `loco_extras` crate. Each extra can be pulled in optionally and is intgerated into your loco app by adding them as intializers. - -This initializer adds support for using a MongoDB database. Choosing to use Mongo would mean sacrificing a lot of the features that loco provides out of the box, such as user authentication, but it can still be used quite effectively as loco will help with a lot of the boilerplate code. - -This initializer is recommended to be used with the base starter that does not come with a database connection (as those all use SQL), but it can be used with any other starter as well. - -## Steps - -To add this initializer to your project, follow these steps: - -### Add Dependencies - -Add the `mongodb` crate and mongodb initializer to your loco project. - -```toml -# Cargo.toml -[dependencies] -loco-extras = { version = "*", features = ["mongodb"] } -mongodb = { version = "2.8.0"} -``` - -### Add to the Config - -Add a mongodb connection section to you config.yaml file. - -```yaml -# config/[development/test/production...].yaml -initializers: - mongodb: - uri: {{ get_env(name="MONGODB_URI", default="mongodb://localhost:27017/") }} - db_name: "db_name" - client_options: - connectTimeout: - secs: 2 - nanos: 0 - serverSelectionTimeout: - secs: 2 - nanos: 0 -``` - -Although untested, the `client_options` should be able to take any options that the mongodb driver supports. The options are passed as a `serde_json::Value`, so however that type is serialized/deserialized should work here. Example above shows how `Duration` is serialized. - - -### Add the Initializer - -Add the initializer to your `src/app.rs` file. - -```rust -// src/app.rs -pub struct App; -#[async_trait] -impl Hooks for App { - // Other code... - async fn initializers(ctx: &AppContext) -> Result>> { - let mut initializers: Vec> = vec![ - Box::new(loco_extras::initializers::mongodb::MongoDbInitializer), - ]; - - Ok(initializers) - } - // Other code... -} -``` - -### Using the Connection - -Now you can use the connection in your handler code. - -```rust -// src/controllers/mongo.rs -use axum::Extension; -use loco_rs::prelude::*; -use serde_json::Value; -use mongodb::{bson::doc, Database}; - -pub async fn fetch(Extension(mongodb): Extension) -> Result { - let user: Option = mongodb.collection("users").find_one(doc!{}, None).await.map_err(|_| Error::NotFound)?; - format::json(user.ok_or_else(|| Error::NotFound)?) -} - -pub fn routes() -> Routes { - Routes::new() - .prefix("mongo") - .add("/", get(fetch)) -} -``` - -If you are adding a new file, don't forget to add it to the `src/controllers/mod.rs` file. - -### Adding to the Router - -If you created a new controller, you need to register the routes in your `src/app.rs` file. - -```rust -// src/app.rs - -fn routes(ctx: &AppContext) -> AppRoutes { - AppRoutes::with_default_routes() - // Other routes... - .add_route(controllers::mongodb::routes()) -} -``` - -Now you can run the server with the config information set OR set the `MONGODB_URI` environment variable. diff --git a/loco-extras/src/initializers/mongodb/mod.rs b/loco-extras/src/initializers/mongodb/mod.rs deleted file mode 100644 index 0c9176565..000000000 --- a/loco-extras/src/initializers/mongodb/mod.rs +++ /dev/null @@ -1,110 +0,0 @@ -use async_trait::async_trait; -use axum::{Extension, Router as AxumRouter}; -use loco_rs::prelude::*; -use mongodb::{bson::doc, options::ClientOptions, Client, Database}; - -#[allow(clippy::module_name_repetitions)] -pub struct MongoDbInitializer; - -#[async_trait] -impl Initializer for MongoDbInitializer { - fn name(&self) -> String { - "mongodb".to_string() - } - - async fn after_routes(&self, router: AxumRouter, ctx: &AppContext) -> Result { - let mongo_db_config = ctx - .config - .initializers - .clone() - .ok_or_else(|| Error::Message("initializers config not configured".to_string()))?; - - let mongo_db_value = mongo_db_config - .get("mongodb") - .ok_or_else(|| Error::Message("mongo not configured as initializer".to_string()))?; - - let mongo_db: MongoDbConfig = serde_json::from_value(mongo_db_value.clone()) - .map_err(|e| Error::Message(e.to_string()))?; - - let db = connect_to_db(mongo_db).await?; - - Ok(router.layer(Extension(db))) - } -} - -#[derive(Debug, Clone, serde::Deserialize)] -struct MongoDbConfig { - uri: String, - db_name: String, - client_options: Option, -} - -async fn connect_to_db(config: MongoDbConfig) -> Result { - let mut client_options = ClientOptions::parse_async(&config.uri) - .await - .map_err(|e| Error::Message(e.to_string()))?; - - let client_options = merge_config_with_client(&mut client_options, config.clone()); - - let client = Client::with_options(client_options).map_err(|e| Error::Message(e.to_string()))?; - - let db = client.database(config.db_name.as_ref()); - - // Ping the Database to make sure a connection has been made - db.run_command(doc! { "ping": 1 }, None) - .await - .map_err(|e| Error::Message(e.to_string()))?; - - Ok(db) -} - -fn merge_config_with_client(co: &mut ClientOptions, config: MongoDbConfig) -> ClientOptions { - match config.client_options { - None => co.clone(), - Some(client_options) => { - co.app_name = client_options.app_name.or(co.app_name.clone()); - co.compressors = client_options.compressors.or(co.compressors.clone()); - co.cmap_event_handler = client_options - .cmap_event_handler - .or(co.cmap_event_handler.clone()); - co.command_event_handler = client_options - .command_event_handler - .or(co.command_event_handler.clone()); - co.connect_timeout = client_options.connect_timeout.or(co.connect_timeout); - co.credential = client_options.credential.or(co.credential.clone()); - co.direct_connection = client_options.direct_connection.or(co.direct_connection); - co.driver_info = client_options.driver_info.or(co.driver_info.clone()); - co.heartbeat_freq = client_options.heartbeat_freq.or(co.heartbeat_freq); - co.load_balanced = client_options.load_balanced.or(co.load_balanced); - co.local_threshold = client_options.local_threshold.or(co.local_threshold); - co.max_idle_time = client_options.max_idle_time.or(co.max_idle_time); - co.max_pool_size = client_options.max_pool_size.or(co.max_pool_size); - co.min_pool_size = client_options.min_pool_size.or(co.min_pool_size); - co.max_connecting = client_options.max_connecting.or(co.max_connecting); - co.read_concern = client_options.read_concern.or(co.read_concern.clone()); - co.repl_set_name = client_options.repl_set_name.or(co.repl_set_name.clone()); - co.retry_reads = client_options.retry_reads.or(co.retry_reads); - co.retry_writes = client_options.retry_writes.or(co.retry_writes); - co.sdam_event_handler = client_options - .sdam_event_handler - .or(co.sdam_event_handler.clone()); - co.selection_criteria = client_options - .selection_criteria - .or(co.selection_criteria.clone()); - co.server_api = client_options.server_api.or(co.server_api.clone()); - co.server_selection_timeout = client_options - .server_selection_timeout - .or(co.server_selection_timeout); - co.default_database = client_options - .default_database - .or(co.default_database.clone()); - co.tls = client_options.tls.or(co.tls.clone()); - // co.tracing_max_document_length_bytes = - // client_options.tracing_max_document_length_bytes; - co.write_concern = client_options.write_concern.or(co.write_concern.clone()); - co.srv_max_hosts = client_options.srv_max_hosts.or(co.srv_max_hosts); - - co.clone() - } - } -} diff --git a/loco-extras/src/initializers/multi_db.rs b/loco-extras/src/initializers/multi_db.rs deleted file mode 100644 index 6c4cffbe3..000000000 --- a/loco-extras/src/initializers/multi_db.rs +++ /dev/null @@ -1,28 +0,0 @@ -use async_trait::async_trait; -use axum::{Extension, Router as AxumRouter}; -use loco_rs::{db, errors::Error, prelude::*}; - -#[allow(clippy::module_name_repetitions)] -pub struct MultiDbInitializer; - -#[async_trait] -impl Initializer for MultiDbInitializer { - fn name(&self) -> String { - "multi-db".to_string() - } - - async fn after_routes(&self, router: AxumRouter, ctx: &AppContext) -> Result { - let settings = ctx - .config - .initializers - .clone() - .ok_or_else(|| Error::Message("settings config not configured".to_string()))?; - - let multi_db = settings - .get("multi_db") - .ok_or_else(|| Error::Message("multi_db not configured".to_string()))?; - - let multi_db = db::MultiDb::new(serde_json::from_value(multi_db.clone())?).await?; - Ok(router.layer(Extension(multi_db))) - } -} diff --git a/loco-extras/src/initializers/normalize_path.rs b/loco-extras/src/initializers/normalize_path.rs deleted file mode 100644 index 2c2ebd012..000000000 --- a/loco-extras/src/initializers/normalize_path.rs +++ /dev/null @@ -1,36 +0,0 @@ -//! [Initializer] to add a [NormalizePathLayer] middleware to handle a trailing -//! `/` at the end of URIs. -//! -//! See the [layer's docs][normalize-docs] for more details. -//! -//! Note that the normal approach to adding middleware via [Router::layer] -//! results in the middleware running after routing has already occurred. This -//! means that any middleware that re-writes the request URI, including -//! [NormalizePathLayer], will not work as expected if added using -//! [Router::layer]. As a workaround, the middleware can be added by wrapping -//! the entire router. See [axum's docs][axum-docs] for more details and an -//! example. -//! -//! [normalize-docs]: https://docs.rs/tower-http/latest/tower_http/normalize_path/index.html -//! [axum-docs]: https://docs.rs/axum/latest/axum/middleware/index.html#rewriting-request-uri-in-middleware -use async_trait::async_trait; -use axum::Router; -use loco_rs::prelude::*; -use tower::Layer; -use tower_http::normalize_path::NormalizePathLayer; - -#[allow(clippy::module_name_repetitions)] -pub struct NormalizePathInitializer; - -#[async_trait] -impl Initializer for NormalizePathInitializer { - fn name(&self) -> String { - "normalize-path".to_string() - } - - async fn after_routes(&self, router: Router, _ctx: &AppContext) -> Result { - let router = NormalizePathLayer::trim_trailing_slash().layer(router); - let router = Router::new().nest_service("", router); - Ok(router) - } -} diff --git a/loco-extras/src/initializers/opentelemetry/README.md b/loco-extras/src/initializers/opentelemetry/README.md deleted file mode 100644 index 5d43d1084..000000000 --- a/loco-extras/src/initializers/opentelemetry/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Opentelemetry Initializer - -This initializer is responsible for initializing tracing with opentelemetry and adding it as a middleware in axum. - -Because opentelemetry tracing initializer is not compatible with loco's default tracing initialization we must turn off the default logging. - -```` -fn init_logger(_config: &config::Config, _env: &Environment) -> Result { - Ok(true) -} -```` \ No newline at end of file diff --git a/loco-extras/src/initializers/opentelemetry/mod.rs b/loco-extras/src/initializers/opentelemetry/mod.rs deleted file mode 100644 index 03cedc657..000000000 --- a/loco-extras/src/initializers/opentelemetry/mod.rs +++ /dev/null @@ -1,32 +0,0 @@ -use axum::{async_trait, Router as AxumRouter}; -use axum_tracing_opentelemetry::middleware::{OtelAxumLayer, OtelInResponseLayer}; -use loco_rs::{ - app::{AppContext, Initializer}, - Error, Result, -}; - -pub struct OpenTelemetryInitializer; - -#[async_trait] -impl Initializer for OpenTelemetryInitializer { - fn name(&self) -> String { - "opentelemetry".to_string() - } - - async fn before_run(&self, _app_context: &AppContext) -> Result<()> { - match init_tracing_opentelemetry::tracing_subscriber_ext::init_subscribers() { - Ok(_) => Ok(()), - Err(e) => { - tracing::error!("Failed to initialize opentelemetry subscriber: {:?}", e); - Err(Error::Message(e.to_string())) - } - } - } - - async fn after_routes(&self, router: AxumRouter, _ctx: &AppContext) -> Result { - let router = router - .layer(OtelInResponseLayer) - .layer(OtelAxumLayer::default()); - Ok(router) - } -} diff --git a/loco-extras/src/initializers/prometheus.rs b/loco-extras/src/initializers/prometheus.rs deleted file mode 100644 index c071752a4..000000000 --- a/loco-extras/src/initializers/prometheus.rs +++ /dev/null @@ -1,21 +0,0 @@ -use async_trait::async_trait; -use axum::Router as AxumRouter; -use axum_prometheus::PrometheusMetricLayer; -use loco_rs::prelude::*; - -pub struct AxumPrometheusInitializer; - -#[async_trait] -impl Initializer for AxumPrometheusInitializer { - fn name(&self) -> String { - "axum-prometheus".to_string() - } - - async fn after_routes(&self, router: AxumRouter, _ctx: &AppContext) -> Result { - let (prometheus_layer, metric_handle) = PrometheusMetricLayer::pair(); - let router = router - .route("/metrics", get(|| async move { metric_handle.render() })) - .layer(prometheus_layer); - Ok(router) - } -} diff --git a/loco-extras/src/lib.rs b/loco-extras/src/lib.rs deleted file mode 100644 index faa88bced..000000000 --- a/loco-extras/src/lib.rs +++ /dev/null @@ -1,14 +0,0 @@ -//! # Loco Extras -//! -//! Loco Extras provides a collection of common implementations that prove to be generally useful when working with [Loco](https://loco.rs/). -//! -//! ## Features -//! -//! ### Initializers -//! * `initializer-prometheus` For adding prometheus collection metrics -//! endpoint. -//! * `initializer-extra-db` Adding extra DB connection -//! * `initializer-multi-db` Adding extra DB's connection -//! * `initializer-normalize-path` Normalize the request path -//! * `initializer-opentelemetry` For adding opentelemetry tracing -pub mod initializers;