diff --git a/.github/workflows/cargo-machete.yml b/.github/workflows/cargo-machete.yml new file mode 100644 index 000000000..ad0e6a054 --- /dev/null +++ b/.github/workflows/cargo-machete.yml @@ -0,0 +1,17 @@ +name: Rust unused dependencies + +on: + pull_request: + push: + paths: + - "**/Cargo.toml" + - "**/Cargo.lock" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Machete + uses: bnjbvr/cargo-machete@main diff --git a/Cargo.lock b/Cargo.lock index f742ccf50..d1a766774 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -260,9 +260,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb42b2197bf15ccb092b62c74515dbd8b86d0effd934795f6687c93b6e679a2c" +checksum = "f658e2baef915ba0f26f1f7c42bfb8e12f532a01f449a090ded75ae7a07e9ba2" dependencies = [ "brotli", "flate2", @@ -419,9 +419,9 @@ checksum = "b9441c6b2fe128a7c2bf680a44c34d0df31ce09e5b7e401fcca3faa483dbc921" [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", @@ -499,306 +499,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "aws-credential-types" -version = "0.56.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a66ac8ef5fa9cf01c2d999f39d16812e90ec1467bd382cbbb74ba23ea86201" -dependencies = [ - "aws-smithy-async", - "aws-smithy-types", - "fastrand 2.0.1", - "tokio", - "tracing", - "zeroize", -] - -[[package]] -name = "aws-http" -version = "0.56.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e626370f9ba806ae4c439e49675fd871f5767b093075cdf4fef16cac42ba900" -dependencies = [ - "aws-credential-types", - "aws-smithy-http", - "aws-smithy-types", - "aws-types", - "bytes", - "http", - "http-body", - "lazy_static", - "percent-encoding", - "pin-project-lite", - "tracing", -] - -[[package]] -name = "aws-runtime" -version = "0.56.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07ac5cf0ff19c1bca0cea7932e11b239d1025a45696a4f44f72ea86e2b8bdd07" -dependencies = [ - "aws-credential-types", - "aws-http", - "aws-sigv4", - "aws-smithy-async", - "aws-smithy-eventstream", - "aws-smithy-http", - "aws-smithy-runtime-api", - "aws-smithy-types", - "aws-types", - "fastrand 2.0.1", - "http", - "percent-encoding", - "tracing", - "uuid", -] - -[[package]] -name = "aws-sdk-s3" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73018483d9cb78e1a0d4dcbc94327b01d532e7cb28f26c5bceff97f8f0e4c6eb" -dependencies = [ - "aws-credential-types", - "aws-http", - "aws-runtime", - "aws-sigv4", - "aws-smithy-async", - "aws-smithy-checksums", - "aws-smithy-client", - "aws-smithy-eventstream", - "aws-smithy-http", - "aws-smithy-json", - "aws-smithy-runtime", - "aws-smithy-runtime-api", - "aws-smithy-types", - "aws-smithy-xml", - "aws-types", - "bytes", - "http", - "http-body", - "once_cell", - "percent-encoding", - "regex", - "tokio-stream", - "tracing", - "url", -] - -[[package]] -name = "aws-sigv4" -version = "0.56.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7b28f4910bb956b7ab320b62e98096402354eca976c587d1eeccd523d9bac03" -dependencies = [ - "aws-smithy-eventstream", - "aws-smithy-http", - "bytes", - "form_urlencoded", - "hex", - "hmac", - "http", - "once_cell", - "percent-encoding", - "regex", - "sha2", - "time", - "tracing", -] - -[[package]] -name = "aws-smithy-async" -version = "0.56.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cdb73f85528b9d19c23a496034ac53703955a59323d581c06aa27b4e4e247af" -dependencies = [ - "futures-util", - "pin-project-lite", - "tokio", - "tokio-stream", -] - -[[package]] -name = "aws-smithy-checksums" -version = "0.56.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb15946af1b8d3beeff53ad991d9bff68ac22426b6d40372b958a75fa61eaed" -dependencies = [ - "aws-smithy-http", - "aws-smithy-types", - "bytes", - "crc32c", - "crc32fast", - "hex", - "http", - "http-body", - "md-5", - "pin-project-lite", - "sha1", - "sha2", - "tracing", -] - -[[package]] -name = "aws-smithy-client" -version = "0.56.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c27b2756264c82f830a91cb4d2d485b2d19ad5bea476d9a966e03d27f27ba59a" -dependencies = [ - "aws-smithy-async", - "aws-smithy-http", - "aws-smithy-http-tower", - "aws-smithy-types", - "bytes", - "fastrand 2.0.1", - "http", - "http-body", - "hyper", - "hyper-rustls", - "lazy_static", - "pin-project-lite", - "rustls", - "tokio", - "tower", - "tracing", -] - -[[package]] -name = "aws-smithy-eventstream" -version = "0.56.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "850233feab37b591b7377fd52063aa37af615687f5896807abe7f49bd4e1d25b" -dependencies = [ - "aws-smithy-types", - "bytes", - "crc32fast", -] - -[[package]] -name = "aws-smithy-http" -version = "0.56.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54cdcf365d8eee60686885f750a34c190e513677db58bbc466c44c588abf4199" -dependencies = [ - "aws-smithy-eventstream", - "aws-smithy-types", - "bytes", - "bytes-utils", - "futures-core", - "http", - "http-body", - "hyper", - "once_cell", - "percent-encoding", - "pin-project-lite", - "pin-utils", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "aws-smithy-http-tower" -version = "0.56.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "822de399d0ce62829a69dfa8c5cd08efdbe61a7426b953e2268f8b8b52a607bd" -dependencies = [ - "aws-smithy-http", - "aws-smithy-types", - "bytes", - "http", - "http-body", - "pin-project-lite", - "tower", - "tracing", -] - -[[package]] -name = "aws-smithy-json" -version = "0.56.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb1e7ab8fa7ad10c193af7ae56d2420989e9f4758bf03601a342573333ea34f" -dependencies = [ - "aws-smithy-types", -] - -[[package]] -name = "aws-smithy-runtime" -version = "0.56.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "745e096b3553e7e0f40622aa04971ce52765af82bebdeeac53aa6fc82fe801e6" -dependencies = [ - "aws-smithy-async", - "aws-smithy-client", - "aws-smithy-http", - "aws-smithy-runtime-api", - "aws-smithy-types", - "bytes", - "fastrand 2.0.1", - "http", - "http-body", - "once_cell", - "pin-project-lite", - "pin-utils", - "tokio", - "tracing", -] - -[[package]] -name = "aws-smithy-runtime-api" -version = "0.56.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d0ae0c9cfd57944e9711ea610b48a963fb174a53aabacc08c5794a594b1d02" -dependencies = [ - "aws-smithy-async", - "aws-smithy-http", - "aws-smithy-types", - "bytes", - "http", - "tokio", - "tracing", -] - -[[package]] -name = "aws-smithy-types" -version = "0.56.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d90dbc8da2f6be461fa3c1906b20af8f79d14968fe47f2b7d29d086f62a51728" -dependencies = [ - "base64-simd", - "itoa", - "num-integer", - "ryu", - "serde", - "time", -] - -[[package]] -name = "aws-smithy-xml" -version = "0.56.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01d2dedcdd8023043716cfeeb3c6c59f2d447fce365d8e194838891794b23b6" -dependencies = [ - "xmlparser", -] - -[[package]] -name = "aws-types" -version = "0.56.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85aa0451bf8af1bf22a4f028d5d28054507a14be43cb8ac0597a8471fba9edfe" -dependencies = [ - "aws-credential-types", - "aws-smithy-async", - "aws-smithy-client", - "aws-smithy-http", - "aws-smithy-types", - "http", - "rustc_version", - "tracing", -] - [[package]] name = "axum" version = "0.6.20" @@ -1156,16 +856,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bytes-utils" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e47d3a8076e283f3acd27400535992edb3ba4b5bb72f8891ad8fbe7932a7d4b9" -dependencies = [ - "bytes", - "either", -] - [[package]] name = "camino" version = "1.1.6" @@ -1420,18 +1110,18 @@ checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] name = "const_format" -version = "0.2.31" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c990efc7a285731f9a4378d81aff2f0e85a2c8781a05ef0f8baa8dac54d0ff48" +checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673" dependencies = [ "const_format_proc_macros", ] [[package]] name = "const_format_proc_macros" -version = "0.2.31" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e026b6ce194a874cb9cf32cd5772d1ef9767cc8fcb5765948d74f37a9d8b2bf6" +checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500" dependencies = [ "proc-macro2", "quote", @@ -1494,15 +1184,6 @@ dependencies = [ "libc", ] -[[package]] -name = "crc32c" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f48d60e5b4d2c53d5c2b1d8a58c849a70ae5e5509b08a48d047e3b65714a74" -dependencies = [ - "rustc_version", -] - [[package]] name = "crc32fast" version = "1.3.2" @@ -1667,6 +1348,34 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "curve25519-dalek" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "platforms", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + [[package]] name = "darling" version = "0.14.4" @@ -1813,10 +1522,11 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" dependencies = [ + "powerfmt", "serde", ] @@ -2011,6 +1721,29 @@ dependencies = [ "spki", ] +[[package]] +name = "ed25519" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" +dependencies = [ + "pkcs8", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" +dependencies = [ + "curve25519-dalek", + "ed25519", + "serde", + "sha2", + "zeroize", +] + [[package]] name = "ego-tree" version = "0.6.2" @@ -2220,6 +1953,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d" + [[package]] name = "finl_unicode" version = "1.2.0" @@ -2228,9 +1967,9 @@ checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" [[package]] name = "flate2" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide 0.7.1", @@ -3013,9 +2752,6 @@ dependencies = [ "async-graphql-axum", "async-trait", "athena", - "autometrics", - "aws-credential-types", - "aws-sdk-s3", "axum", "axum-extra 0.8.0", "axum-flash", @@ -3025,7 +2761,6 @@ dependencies = [ "clap", "color-eyre", "const-oid", - "deadpool-redis", "der", "diesel", "diesel-async", @@ -3040,13 +2775,11 @@ dependencies = [ "kitsune-captcha", "kitsune-core", "kitsune-db", - "kitsune-email", "kitsune-embed", "kitsune-http-client", "kitsune-http-signatures", "kitsune-job-runner", "kitsune-language", - "kitsune-messaging", "kitsune-search", "kitsune-storage", "kitsune-test", @@ -3064,7 +2797,6 @@ dependencies = [ "oxide-auth-axum", "pkcs8", "pretty_assertions", - "redis", "scoped-futures", "serde", "serde_urlencoded", @@ -3117,7 +2849,6 @@ dependencies = [ "serde_urlencoded", "simd-json", "strum", - "strum_macros", "thiserror", "typed-builder", ] @@ -3135,7 +2866,6 @@ dependencies = [ "kitsune-db", "serde", "speedy-uuid", - "time", "tokio", "tracing-subscriber", "vergen", @@ -3152,8 +2882,6 @@ dependencies = [ "async-trait", "athena", "autometrics", - "aws-credential-types", - "aws-sdk-s3", "base64-simd", "bytes", "const_format", @@ -3194,6 +2922,7 @@ dependencies = [ "rayon", "redis", "rsa", + "rusty-s3", "scoped-futures", "serde", "serial_test", @@ -3201,7 +2930,6 @@ dependencies = [ "simd-json", "smol_str", "speedy-uuid", - "strum", "tempfile", "thiserror", "time", @@ -3272,7 +3000,6 @@ name = "kitsune-http-client" version = "0.0.1-pre.3" dependencies = [ "bytes", - "derive_builder", "futures-core", "headers", "http-body", @@ -3383,16 +3110,13 @@ name = "kitsune-storage" version = "0.0.1-pre.3" dependencies = [ "async-trait", - "aws-credential-types", - "aws-sdk-s3", - "aws-smithy-http", "bytes", "enum_dispatch", "futures-util", "http", - "http-body", - "pin-project-lite", - "sync_wrapper", + "hyper", + "kitsune-http-client", + "rusty-s3", "tempfile", "tokio", "tokio-util", @@ -4162,13 +3886,14 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "openidconnect" -version = "3.3.1" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9bcb11cef8c32242e1ab8ff0b11bc7f763dea4d83c103dc75beb743a528932" +checksum = "62d6050f6a84b81f23c569f5607ad883293e57491036e318fafe6fc4895fadb1" dependencies = [ "base64 0.13.1", "chrono", "dyn-clone", + "ed25519-dalek", "hmac", "http", "itertools", @@ -4572,6 +4297,12 @@ version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +[[package]] +name = "platforms" +version = "3.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" + [[package]] name = "polling" version = "2.8.0" @@ -4634,6 +4365,12 @@ dependencies = [ "postgres-protocol", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -4889,25 +4626,25 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d119d7c7ca818f8a53c300863d4f87566aac09943aef5b355bb83969dae75d87" +checksum = "aaac441002f822bc9705a681810a4dd2963094b9ca0ddc41cb963a4c189189ea" dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.8.1", + "regex-syntax 0.8.2", ] [[package]] name = "regex-automata" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465c6fc0621e4abc4187a2bda0937bfd4f722c2730b29562e19689ea796c9a4b" +checksum = "5011c7e263a695dc8ca064cddb722af1be54e517a280b12a5356f98366899e5d" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.1", + "regex-syntax 0.8.2", ] [[package]] @@ -4918,9 +4655,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56d84fdd47036b038fc80dd333d10b6aab10d5d31f4a366e20014def75328d33" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "retain_mut" @@ -5162,6 +4899,20 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +[[package]] +name = "rusty-s3" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31aa883f1b986a5249641e574ca0e11ac4fb9970b009c6fbb96fedaf4fa78db8" +dependencies = [ + "hmac", + "percent-encoding", + "sha2", + "time", + "url", + "zeroize", +] + [[package]] name = "ryu" version = "1.0.15" @@ -5295,9 +5046,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.188" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" dependencies = [ "serde_derive", ] @@ -5314,9 +5065,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" dependencies = [ "proc-macro2", "quote", @@ -5487,6 +5238,16 @@ dependencies = [ "cfg-if", "cpufeatures", "digest", + "sha2-asm", +] + +[[package]] +name = "sha2-asm" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27ba7066011e3fb30d808b51affff34f0a66d3a03a58edd787c6e420e40e44e" +dependencies = [ + "cc", ] [[package]] @@ -5528,9 +5289,9 @@ dependencies = [ [[package]] name = "simd-json" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "474b451aaac1828ed12f6454a80fe58b940ae2998d10389d41533940a6f641bf" +checksum = "f0f07a84c7456b901b8dd2c1d44caca8b0fd2c2616206ee5acc9d9da61e8d9ec" dependencies = [ "getrandom", "halfbrown", @@ -5873,14 +5634,15 @@ dependencies = [ [[package]] name = "time" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ "deranged", "itoa", "libc", "num_threads", + "powerfmt", "serde", "time-core", "time-macros", @@ -6159,11 +5921,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "ee2ef2af84856a50c1d430afce2fdded0a4ec7eda868db86409b4543df0797f9" dependencies = [ - "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -6172,9 +5933,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", @@ -6183,9 +5944,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -6807,9 +6568,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.16" +version = "0.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037711d82167854aff2018dfd193aa0fef5370f456732f0d5a0c59b0f1b4b907" +checksum = "a3b801d0e0a6726477cc207f60162da452f3a95adb368399bef20a946e06f65c" dependencies = [ "memchr", ] @@ -6865,20 +6626,19 @@ dependencies = [ [[package]] name = "zstd" -version = "0.12.4" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" +checksum = "bffb3309596d527cfcba7dfc6ed6052f1d39dfbd7c867aa2e865e4a449c10110" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "6.0.6" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" +checksum = "43747c7422e2924c11144d5229878b98180ef8b06cca4ab5af37afc8a8d8ea3e" dependencies = [ - "libc", "zstd-sys", ] diff --git a/crates/kitsune-cache/Cargo.toml b/crates/kitsune-cache/Cargo.toml index b79c3a903..186277f34 100644 --- a/crates/kitsune-cache/Cargo.toml +++ b/crates/kitsune-cache/Cargo.toml @@ -10,10 +10,10 @@ derive_builder = "0.12.0" enum_dispatch = "0.3.12" moka = { version = "0.12.1", features = ["sync"] } redis = "0.23.3" -serde = "1.0.188" -simd-json = "0.11.1" +serde = "1.0.189" +simd-json = "0.12.0" thiserror = "1.0.49" -tracing = "0.1.37" +tracing = "0.1.39" [dev-dependencies] tokio = { version = "1.33.0", features = ["macros", "rt"] } diff --git a/crates/kitsune-captcha/Cargo.toml b/crates/kitsune-captcha/Cargo.toml index 9e4b60b5f..d99209d63 100644 --- a/crates/kitsune-captcha/Cargo.toml +++ b/crates/kitsune-captcha/Cargo.toml @@ -8,10 +8,9 @@ async-trait = "0.1.73" enum_dispatch = "0.3.12" http = "0.2.9" kitsune-http-client = { path = "../kitsune-http-client" } -serde = { version = "1.0.188", features = ["derive"] } +serde = { version = "1.0.189", features = ["derive"] } serde_urlencoded = "0.7.1" -simd-json = "0.11.1" +simd-json = "0.12.0" strum = { version = "0.25.0", features = ["derive"] } -strum_macros = "0.25.2" thiserror = "1.0.49" typed-builder = "0.16.2" diff --git a/crates/kitsune-captcha/src/error.rs b/crates/kitsune-captcha/src/error.rs index 566839c1a..2518b8f96 100644 --- a/crates/kitsune-captcha/src/error.rs +++ b/crates/kitsune-captcha/src/error.rs @@ -1,5 +1,5 @@ use serde::{Deserialize, Serialize}; -use strum_macros::{Display, EnumString}; +use strum::{Display, EnumString}; use thiserror::Error; #[derive(Debug, PartialEq, Display, Serialize, Deserialize, EnumString, Error)] diff --git a/crates/kitsune-core/Cargo.toml b/crates/kitsune-core/Cargo.toml index 65ca00e15..5d0ae8be1 100644 --- a/crates/kitsune-core/Cargo.toml +++ b/crates/kitsune-core/Cargo.toml @@ -11,13 +11,9 @@ async-stream = "0.3.5" async-trait = "0.1.73" athena = { path = "../../lib/athena" } autometrics = { version = "0.6.0", default-features = false } -aws-credential-types = { version = "0.56.1", features = [ - "hardcoded-credentials", -] } -aws-sdk-s3 = "0.33.0" base64-simd = "0.8.0" bytes = "1.5.0" -const_format = "0.2.31" +const_format = "0.2.32" deadpool-redis = { version = "0.13.0", default-features = false } derive_builder = "0.12.0" diesel = "2.1.3" @@ -59,18 +55,18 @@ pulldown-cmark = { version = "0.9.3", default-features = false, features = [ rand = "0.8.5" rayon = "1.8.0" rsa = "0.9.2" +rusty-s3 = { version = "0.5.0", default-features = false } scoped-futures = "0.1.3" -serde = { version = "1.0.188", features = ["derive"] } -sha2 = "0.10.8" -simd-json = "0.11.1" +serde = { version = "1.0.189", features = ["derive"] } +sha2 = { version = "0.10.8", features = ["asm"] } +simd-json = "0.12.0" smol_str = "0.2.0" speedy-uuid = { path = "../../lib/speedy-uuid", features = ["diesel"] } -strum = { version = "0.25.0", features = ["derive", "phf"] } thiserror = "1.0.49" -time = "0.3.29" +time = "0.3.30" tokio = { version = "1.33.0", features = ["macros", "rt"] } toml = { version = "0.8.2", default-features = false, features = ["parse"] } -tracing = "0.1.37" +tracing = "0.1.39" typed-builder = "0.16.2" url = "2.4.1" zxcvbn = { version = "2.2.2", default-features = false } @@ -79,6 +75,7 @@ zxcvbn = { version = "2.2.2", default-features = false } default = [] mastodon-api = [] meilisearch = ["kitsune-search/meilisearch"] +metrics = ["autometrics/metrics"] [build-dependencies] vergen = { version = "8.2.5", features = ["build", "git", "gitcl"] } diff --git a/crates/kitsune-core/src/lib.rs b/crates/kitsune-core/src/lib.rs index d1f4113ca..a4b49c94e 100644 --- a/crates/kitsune-core/src/lib.rs +++ b/crates/kitsune-core/src/lib.rs @@ -45,8 +45,6 @@ use self::{ webfinger::Webfinger, }; use athena::JobQueue; -use aws_credential_types::Credentials; -use aws_sdk_s3::config::Region; use eyre::Context; use kitsune_cache::{ArcCache, InMemoryCache, NoopCache, RedisCache}; use kitsune_captcha::{hcaptcha::Captcha as HCaptcha, mcaptcha::Captcha as MCaptcha, Captcha}; @@ -61,6 +59,7 @@ use kitsune_messaging::{ }; use kitsune_search::{NoopSearchService, SearchService, SqlSearchService}; use kitsune_storage::{fs::Storage as FsStorage, s3::Storage as S3Storage, Storage}; +use rusty_s3::{Bucket as S3Bucket, Credentials as S3Credentials}; use serde::{de::DeserializeOwned, Serialize}; use std::{ fmt::Display, @@ -121,26 +120,34 @@ fn prepare_captcha(config: &CaptchaConfiguration) -> Captcha { } } -fn prepare_storage(config: &Configuration) -> Storage { - match config.storage { +fn prepare_storage(config: &Configuration) -> eyre::Result { + let storage = match config.storage { StorageConfiguration::Fs(ref fs_config) => { FsStorage::new(fs_config.upload_dir.as_str().into()).into() } StorageConfiguration::S3(ref s3_config) => { - let s3_client_config = aws_sdk_s3::Config::builder() - .region(Region::new(s3_config.region.to_string())) - .endpoint_url(s3_config.endpoint_url.as_str()) - .force_path_style(s3_config.force_path_style) - .credentials_provider(Credentials::from_keys( - s3_config.access_key.as_str(), - s3_config.secret_access_key.as_str(), - None, - )) - .build(); - - S3Storage::new(s3_config.bucket_name.to_string(), s3_client_config).into() + let path_style = if s3_config.force_path_style { + rusty_s3::UrlStyle::Path + } else { + rusty_s3::UrlStyle::VirtualHost + }; + + let s3_credentials = S3Credentials::new( + s3_config.access_key.as_str(), + s3_config.secret_access_key.as_str(), + ); + let s3_bucket = S3Bucket::new( + s3_config.endpoint_url.parse()?, + path_style, + s3_config.bucket_name.to_string(), + s3_config.region.to_string(), + )?; + + S3Storage::new(s3_bucket, s3_credentials).into() } - } + }; + + Ok(storage) } fn prepare_mail_sender( @@ -248,7 +255,7 @@ pub async fn prepare_state( let attachment_service = AttachmentService::builder() .db_pool(db_pool.clone()) .media_proxy_enabled(config.server.media_proxy_enabled) - .storage_backend(prepare_storage(config)) + .storage_backend(prepare_storage(config)?) .url_service(url_service.clone()) .build(); diff --git a/crates/kitsune-db/Cargo.toml b/crates/kitsune-db/Cargo.toml index 840aa0714..bdb223515 100644 --- a/crates/kitsune-db/Cargo.toml +++ b/crates/kitsune-db/Cargo.toml @@ -19,8 +19,8 @@ kitsune-language = { path = "../kitsune-language" } kitsune-type = { path = "../kitsune-type" } num-derive = "0.4.1" num-traits = "0.2.17" -serde = { version = "1.0.188", features = ["derive"] } -simd-json = "0.11.1" +serde = { version = "1.0.189", features = ["derive"] } +simd-json = "0.12.0" speedy-uuid = { path = "../../lib/speedy-uuid", features = ["diesel"] } thiserror = "1.0.49" tokio = { version = "1.33.0", features = ["rt"] } diff --git a/crates/kitsune-email/Cargo.toml b/crates/kitsune-email/Cargo.toml index 3104094a9..54d4a5951 100644 --- a/crates/kitsune-email/Cargo.toml +++ b/crates/kitsune-email/Cargo.toml @@ -3,6 +3,9 @@ name = "kitsune-email" edition.workspace = true version.workspace = true +[package.metadata.cargo-machete] +ignored = ["askama_axum"] # See reason below. + [dependencies] askama = "0.12.1" askama_axum = "0.3.0" # Damn it, cargo. Because "kitsune" uses "askama" with the axum feature, we have to have the crate available here as well.. diff --git a/crates/kitsune-http-client/Cargo.toml b/crates/kitsune-http-client/Cargo.toml index a653a6743..66a8b6e6a 100644 --- a/crates/kitsune-http-client/Cargo.toml +++ b/crates/kitsune-http-client/Cargo.toml @@ -5,7 +5,6 @@ edition.workspace = true [dependencies] bytes = "1.5.0" -derive_builder = "0.12.0" futures-core = "0.3.28" headers = "0.3.9" http-body = "0.4.5" @@ -20,8 +19,8 @@ hyper-rustls = { version = "0.24.1", features = ["http2"] } kitsune-http-signatures = { path = "../kitsune-http-signatures" } kitsune-type = { path = "../kitsune-type" } pin-project-lite = "0.2.13" -serde = "1.0.188" -simd-json = "0.11.1" +serde = "1.0.189" +simd-json = "0.12.0" tower = { version = "0.4.13", features = ["util"] } tower-http = { version = "0.4.4", features = [ "decompression-full", diff --git a/crates/kitsune-http-signatures/Cargo.toml b/crates/kitsune-http-signatures/Cargo.toml index f31863fd5..194e5c66a 100644 --- a/crates/kitsune-http-signatures/Cargo.toml +++ b/crates/kitsune-http-signatures/Cargo.toml @@ -9,7 +9,7 @@ derive_builder = "0.12.0" http = "0.2.9" rayon = "1.8.0" ring = { version = "0.17.3", features = ["std"] } -time = { version = "0.3.29", features = ["formatting", "parsing"] } +time = { version = "0.3.30", features = ["formatting", "parsing"] } thiserror = "1.0.49" tokio = { version = "1.33.0", features = ["sync"] } diff --git a/crates/kitsune-messaging/Cargo.toml b/crates/kitsune-messaging/Cargo.toml index 86ac83754..c41fc8726 100644 --- a/crates/kitsune-messaging/Cargo.toml +++ b/crates/kitsune-messaging/Cargo.toml @@ -14,8 +14,8 @@ redis = { version = "0.23.3", features = [ "connection-manager", "tokio-rustls-comp", ] } -serde = "1.0.188" -simd-json = "0.11.1" +serde = "1.0.189" +simd-json = "0.12.0" tokio = { version = "1.33.0", features = ["macros", "rt", "sync"] } tokio-stream = { version = "0.1.14", features = ["sync"] } -tracing = "0.1.37" +tracing = "0.1.39" diff --git a/crates/kitsune-search/Cargo.toml b/crates/kitsune-search/Cargo.toml index 60391e21c..d0808fb73 100644 --- a/crates/kitsune-search/Cargo.toml +++ b/crates/kitsune-search/Cargo.toml @@ -12,11 +12,11 @@ enum_dispatch = "0.3.12" futures-util = "0.3.28" kitsune-db = { path = "../kitsune-db" } kitsune-language = { path = "../kitsune-language" } -serde = { version = "1.0.188", features = ["derive"] } +serde = { version = "1.0.189", features = ["derive"] } speedy-uuid = { path = "../../lib/speedy-uuid" } strum = { version = "0.25.0", features = ["derive"] } thiserror = "1.0.49" -tracing = "0.1.37" +tracing = "0.1.39" # "meilisearch" feature meilisearch-sdk = { version = "0.24.2", optional = true } diff --git a/crates/kitsune-storage/Cargo.toml b/crates/kitsune-storage/Cargo.toml index 2418c4db3..750101fe7 100644 --- a/crates/kitsune-storage/Cargo.toml +++ b/crates/kitsune-storage/Cargo.toml @@ -5,21 +5,16 @@ edition.workspace = true [dependencies] async-trait = "0.1.73" -aws-sdk-s3 = "0.33.0" -aws-smithy-http = "0.56.1" bytes = "1.5.0" enum_dispatch = "0.3.12" futures-util = "0.3.28" http = "0.2.9" -http-body = "0.4.5" -pin-project-lite = "0.2.13" -sync_wrapper = "0.1.2" +hyper = { version = "0.14.27", features = ["stream"] } +kitsune-http-client = { path = "../kitsune-http-client" } +rusty-s3 = { version = "0.5.0", default-features = false } tokio = { version = "1.33.0", features = ["fs", "io-util"] } tokio-util = { version = "0.7.9", features = ["io"] } [dev-dependencies] -aws-credential-types = { version = "0.56.1", features = [ - "hardcoded-credentials", -] } tempfile = "3.8.0" tokio = { version = "1.33.0", features = ["macros", "rt"] } diff --git a/crates/kitsune-storage/examples/s3.rs b/crates/kitsune-storage/examples/s3.rs index ec9a042e1..eae2f5719 100644 --- a/crates/kitsune-storage/examples/s3.rs +++ b/crates/kitsune-storage/examples/s3.rs @@ -1,8 +1,7 @@ -use aws_credential_types::Credentials; -use aws_sdk_s3::{config::Region, Config}; use bytes::{BufMut, BytesMut}; use futures_util::{future, stream, StreamExt, TryStreamExt}; use kitsune_storage::{s3::Storage, StorageBackend}; +use rusty_s3::{Bucket, Credentials, UrlStyle}; use std::{env, str}; const TEST_DATA: &str = r#" @@ -65,14 +64,15 @@ async fn main() { let endpoint_url = env::var("ENDPOINT_URL").unwrap(); let region = env::var("REGION").unwrap(); - let credentials = Credentials::from_keys(access_key, secret_access_key, None); - let config = Config::builder() - .region(Region::new(region)) - .force_path_style(true) - .credentials_provider(credentials) - .endpoint_url(endpoint_url) - .build(); - let backend = Storage::new(bucket_name, config); + let credentials = Credentials::new(access_key, secret_access_key); + let bucket = Bucket::new( + endpoint_url.parse().unwrap(), + UrlStyle::VirtualHost, + bucket_name, + region, + ) + .unwrap(); + let backend = Storage::new(bucket, credentials); let operation = env::args().nth(1).unwrap(); diff --git a/crates/kitsune-storage/src/s3.rs b/crates/kitsune-storage/src/s3.rs index 474f60195..b8cd271e5 100644 --- a/crates/kitsune-storage/src/s3.rs +++ b/crates/kitsune-storage/src/s3.rs @@ -2,68 +2,99 @@ //! An S3 backed implementation of the [`StorageBackend`] trait //! -use crate::{BoxError, Result, StorageBackend}; +use crate::{Result, StorageBackend}; use async_trait::async_trait; -use aws_sdk_s3::{Client, Config}; -use aws_smithy_http::{ - body::{BoxBody, SdkBody}, - byte_stream::ByteStream, -}; use bytes::Bytes; use futures_util::{stream::BoxStream, Stream, StreamExt, TryStreamExt}; -use http::HeaderMap; -use http_body::Body; -use pin_project_lite::pin_project; -use std::{ - pin::Pin, - task::{self, Poll}, +use http::Request; +use hyper::Body; +use kitsune_http_client::Client as HttpClient; +use rusty_s3::{ + actions::{DeleteObject, GetObject, PutObject}, + Bucket, Credentials, S3Action, }; -use sync_wrapper::SyncWrapper; +use std::{sync::Arc, time::Duration}; + +const FIVE_MINUTES: Duration = Duration::from_secs(5 * 60); -pin_project! { - struct StreamBody { - #[pin] - inner: SyncWrapper, +const fn s3_method_to_http(method: rusty_s3::Method) -> http::Method { + match method { + rusty_s3::Method::Head => http::Method::HEAD, + rusty_s3::Method::Get => http::Method::GET, + rusty_s3::Method::Post => http::Method::POST, + rusty_s3::Method::Put => http::Method::PUT, + rusty_s3::Method::Delete => http::Method::DELETE, } } -impl Body for StreamBody -where - S: Stream>, -{ - type Data = Bytes; - type Error = BoxError; - - fn poll_data( - self: Pin<&mut Self>, - cx: &mut task::Context<'_>, - ) -> Poll>> { - let this = self.project(); - this.inner.get_pin_mut().poll_next(cx) +struct S3Client { + bucket: Bucket, + credentials: Credentials, + http_client: HttpClient, +} + +impl S3Client { + pub async fn delete_object(&self, path: &str) -> Result<()> { + let delete_action = self.bucket.delete_object(Some(&self.credentials), path); + + let request = Request::builder() + .uri(String::from(delete_action.sign(FIVE_MINUTES))) + .method(s3_method_to_http(DeleteObject::METHOD)) + .body(Body::empty())?; + + self.http_client.execute(request).await?; + + Ok(()) + } + + pub async fn get_object(&self, path: &str) -> Result>> { + let get_action = self.bucket.get_object(Some(&self.credentials), path); + + let request = Request::builder() + .uri(String::from(get_action.sign(FIVE_MINUTES))) + .method(s3_method_to_http(GetObject::METHOD)) + .body(Body::empty())?; + + let response = self.http_client.execute(request).await?; + + Ok(response.stream().map_err(Into::into)) } - fn poll_trailers( - self: Pin<&mut Self>, - _cx: &mut task::Context<'_>, - ) -> Poll, Self::Error>> { - Poll::Ready(Ok(None)) + pub async fn put_object(&self, path: &str, stream: S) -> Result<()> + where + S: Stream> + Send + 'static, + { + let put_action = self.bucket.put_object(Some(&self.credentials), path); + + let request = Request::builder() + .uri(String::from(put_action.sign(FIVE_MINUTES))) + .method(s3_method_to_http(PutObject::METHOD)) + .body(Body::wrap_stream(stream))?; + + self.http_client.execute(request).await?; + + Ok(()) } } #[derive(Clone)] /// S3-backed storage pub struct Storage { - bucket_name: String, - client: Client, + client: Arc, } impl Storage { /// Create a new storage instance #[must_use] - pub fn new(bucket_name: String, config: Config) -> Self { + pub fn new(bucket: Bucket, credentials: Credentials) -> Self { + let http_client = HttpClient::builder().content_length_limit(None).build(); + Self { - bucket_name, - client: Client::from_conf(config), + client: Arc::new(S3Client { + bucket, + credentials, + http_client, + }), } } } @@ -71,44 +102,18 @@ impl Storage { #[async_trait] impl StorageBackend for Storage { async fn delete(&self, path: &str) -> Result<()> { - self.client - .delete_object() - .bucket(&self.bucket_name) - .key(path) - .send() - .await?; - - Ok(()) + self.client.delete_object(path).await } async fn get(&self, path: &str) -> Result>> { - let response = self - .client - .get_object() - .bucket(&self.bucket_name) - .key(path) - .send() - .await?; - - Ok(response.body.map_err(Into::into).boxed()) + let stream = self.client.get_object(path).await?.boxed(); + Ok(stream) } - async fn put(&self, path: &str, input_stream: T) -> Result<()> + async fn put(&self, path: &str, input_stream: S) -> Result<()> where - T: Stream> + Send + 'static, + S: Stream> + Send + 'static, { - let body = BoxBody::new(StreamBody { - inner: SyncWrapper::new(input_stream), - }); - - self.client - .put_object() - .bucket(&self.bucket_name) - .key(path) - .body(ByteStream::new(SdkBody::from_dyn(body))) - .send() - .await?; - - Ok(()) + self.client.put_object(path, input_stream).await } } diff --git a/crates/kitsune-type/Cargo.toml b/crates/kitsune-type/Cargo.toml index 6090e8156..cdb4034e4 100644 --- a/crates/kitsune-type/Cargo.toml +++ b/crates/kitsune-type/Cargo.toml @@ -5,8 +5,8 @@ edition.workspace = true [dependencies] iso8601-timestamp = "0.2.12" -serde = { version = "1.0.188", features = ["derive"] } -simd-json = "0.11.1" +serde = { version = "1.0.189", features = ["derive"] } +simd-json = "0.12.0" smol_str = { version = "0.2.0", features = ["serde"] } speedy-uuid = { path = "../../lib/speedy-uuid", features = ["serde"] } utoipa = { version = "4.0.0", features = ["chrono", "uuid"] } diff --git a/flake.lock b/flake.lock index bad1ae033..ab7d3adbb 100644 --- a/flake.lock +++ b/flake.lock @@ -140,11 +140,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1696879762, - "narHash": "sha256-Ud6bH4DMcYHUDKavNMxAhcIpDGgHMyL/yaDEAVSImQY=", + "lastModified": 1697059129, + "narHash": "sha256-9NJcFF9CEYPvHJ5ckE8kvINvI84SZZ87PvqMbH6pro0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "f99e5f03cc0aa231ab5950a15ed02afec45ed51a", + "rev": "5e4c2ada4fcd54b99d56d7bd62f384511a7e2593", "type": "github" }, "original": { @@ -232,11 +232,11 @@ ] }, "locked": { - "lastModified": 1697076655, - "narHash": "sha256-NcCtVUOd0X81srZkrdP8qoA1BMsPdO2tGtlZpsGijeU=", + "lastModified": 1697249410, + "narHash": "sha256-OmsnxNsjBB1DJlUuJyzDJJ7psbm4/VzokNT+o0ajzFQ=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "aa7584f5bbf5947716ad8ec14eccc0334f0d28f0", + "rev": "dce60ca7fca201014868c08a612edb73a998310f", "type": "github" }, "original": { diff --git a/kitsune-cli/Cargo.toml b/kitsune-cli/Cargo.toml index f7dfecdd4..2dbbb57d2 100644 --- a/kitsune-cli/Cargo.toml +++ b/kitsune-cli/Cargo.toml @@ -12,9 +12,8 @@ diesel-async = "0.4.1" dotenvy = "0.15.7" envy = "0.4.2" kitsune-db = { path = "../crates/kitsune-db" } -serde = { version = "1.0.188", features = ["derive"] } +serde = { version = "1.0.189", features = ["derive"] } speedy-uuid = { path = "../lib/speedy-uuid" } -time = "0.3.29" tokio = { version = "1.33.0", features = ["full"] } tracing-subscriber = "0.3.17" diff --git a/kitsune-job-runner/Cargo.toml b/kitsune-job-runner/Cargo.toml index 94ec47e50..e6be3b506 100644 --- a/kitsune-job-runner/Cargo.toml +++ b/kitsune-job-runner/Cargo.toml @@ -14,6 +14,6 @@ kitsune-retry-policies = { path = "../crates/kitsune-retry-policies" } mimalloc = "0.1.39" tokio = { version = "1.33.0", features = ["full"] } toml = "0.8.2" -tracing = "0.1.37" +tracing = "0.1.39" [features] diff --git a/kitsune/Cargo.toml b/kitsune/Cargo.toml index 1c8de8615..627f38226 100644 --- a/kitsune/Cargo.toml +++ b/kitsune/Cargo.toml @@ -7,18 +7,13 @@ homepage = "https://joinkitsune.org" build = "build.rs" [dependencies] -athena = { version = "0.0.1-pre.3", path = "../lib/athena" } +athena = { path = "../lib/athena" } argon2 = { version = "0.5.2", features = ["std"] } -autometrics = { version = "0.6.0", default-features = false } askama = { version = "0.12.1", features = [ "with-axum", ], default-features = false } askama_axum = "0.3.0" async-trait = "0.1.73" -aws-credential-types = { version = "0.56.1", features = [ - "hardcoded-credentials", -] } -aws-sdk-s3 = "0.33.0" axum = { version = "0.6.20", features = ["headers", "macros", "multipart"] } axum-extra = { version = "0.8.0", features = [ "cookie", @@ -31,7 +26,6 @@ chrono = { version = "0.4.31", default-features = false } clap = { version = "4.4.6", features = ["derive"] } color-eyre = "0.6.2" const-oid = { version = "0.9.5", features = ["db"] } -deadpool-redis = "0.13.0" der = { version = "0.7.8", features = ["std"] } diesel = "2.1.3" diesel-async = "0.4.1" @@ -50,29 +44,26 @@ kitsune-cache = { path = "../crates/kitsune-cache" } kitsune-captcha = { path = "../crates/kitsune-captcha" } kitsune-core = { path = "../crates/kitsune-core" } kitsune-db = { path = "../crates/kitsune-db" } -kitsune-email = { path = "../crates/kitsune-email" } kitsune-embed = { path = "../crates/kitsune-embed" } kitsune-http-client = { path = "../crates/kitsune-http-client" } kitsune-http-signatures = { path = "../crates/kitsune-http-signatures" } kitsune-job-runner = { path = "../kitsune-job-runner" } -kitsune-language = { path = "../crates/kitsune-language", default-features = false } -kitsune-messaging = { path = "../crates/kitsune-messaging" } +kitsune-language = { path = "../crates/kitsune-language" } kitsune-search = { path = "../crates/kitsune-search" } kitsune-storage = { path = "../crates/kitsune-storage" } kitsune-type = { path = "../crates/kitsune-type" } oxide-auth = "0.5.4" oxide-auth-async = "0.1.1" oxide-auth-axum = "0.3.0" -redis = "0.23.3" scoped-futures = "0.1.3" -serde = { version = "1.0.188", features = ["derive"] } +serde = { version = "1.0.189", features = ["derive"] } serde_urlencoded = "0.7.1" -simd-json = "0.11.1" +simd-json = "0.12.0" speedy-uuid = { path = "../lib/speedy-uuid" } strum = { version = "0.25.0", features = ["derive", "phf"] } tempfile = "3.8.0" thiserror = "1.0.49" -time = "0.3.29" +time = "0.3.30" tokio = { version = "1.33.0", features = ["full"] } tokio-util = { version = "0.7.9", features = ["compat"] } tower-http = { version = "0.4.4", features = [ @@ -82,12 +73,12 @@ tower-http = { version = "0.4.4", features = [ "timeout", "trace", ] } -tracing = "0.1.37" +tracing = "0.1.39" tracing-error = "0.2.0" tracing-subscriber = "0.3.17" typed-builder = "0.16.2" url = "2.4.1" -utoipa = { version = "4.0.0", features = ["axum_extras", "time", "uuid"] } +utoipa = { version = "4.0.0", features = ["axum_extras", "uuid"] } utoipa-swagger-ui = { version = "4.0.0", features = ["axum"] } # --- Optional dependencies --- @@ -111,7 +102,7 @@ metrics-tracing-context = { version = "0.14.0", optional = true } metrics-util = { version = "0.15.1", optional = true } # "oidc" feature -openidconnect = { version = "3.3.1", default-features = false, optional = true } +openidconnect = { version = "3.4.0", default-features = false, optional = true } [dev-dependencies] kitsune-test = { path = "../crates/kitsune-test" } @@ -129,7 +120,7 @@ graphql-api = [ mastodon-api = ["kitsune-core/mastodon-api"] meilisearch = ["kitsune-core/meilisearch"] metrics = [ - "autometrics/metrics", + "kitsune-core/metrics", "dep:axum-prometheus", "dep:metrics", "dep:metrics-exporter-prometheus", diff --git a/kitsune/src/http/middleware.rs b/kitsune/src/http/middleware.rs index cf672f166..e12615976 100644 --- a/kitsune/src/http/middleware.rs +++ b/kitsune/src/http/middleware.rs @@ -22,7 +22,7 @@ pub async fn json_to_urlencoded(req: Request, next: Next) -> Respons }; let (parts, body) = req.into_parts(); - let json_value = match hyper::body::to_bytes(body) + let json_value = match hyper::body::aggregate(body) .await .map(|bytes| simd_json::from_reader::<_, OwnedValue>(bytes.reader())) { diff --git a/kitsune/src/http/openapi.rs b/kitsune/src/http/openapi.rs index 124df2c9c..4dd4d1ddc 100644 --- a/kitsune/src/http/openapi.rs +++ b/kitsune/src/http/openapi.rs @@ -115,7 +115,9 @@ struct CommonApiDocs; mastodon::api::v1::statuses::put, mastodon::api::v1::statuses::context::get, mastodon::api::v1::statuses::favourite::post, + mastodon::api::v1::statuses::favourited_by::get, mastodon::api::v1::statuses::reblog::post, + mastodon::api::v1::statuses::reblogged_by::get, mastodon::api::v1::statuses::source::get, mastodon::api::v1::statuses::unfavourite::post, mastodon::api::v1::statuses::unreblog::post, diff --git a/lib/athena/Cargo.toml b/lib/athena/Cargo.toml index d572ff9e1..141a2bafe 100644 --- a/lib/athena/Cargo.toml +++ b/lib/athena/Cargo.toml @@ -22,13 +22,13 @@ redis = { version = "0.23.3", default-features = false, features = [ "tokio-rustls-comp", ] } retry-policies = "0.2.1" -serde = { version = "1.0.188", features = ["derive"] } -simd-json = "0.11.1" +serde = { version = "1.0.189", features = ["derive"] } +simd-json = "0.12.0" smol_str = "0.2.0" speedy-uuid = { path = "../speedy-uuid", features = ["redis", "serde"] } thiserror = "1.0.49" tokio = { version = "1.33.0", features = ["macros", "rt", "sync"] } -tracing = "0.1.37" +tracing = "0.1.39" typed-builder = "0.16.2" [dev-dependencies] diff --git a/lib/speedy-uuid/Cargo.toml b/lib/speedy-uuid/Cargo.toml index d72275575..ceec43cd5 100644 --- a/lib/speedy-uuid/Cargo.toml +++ b/lib/speedy-uuid/Cargo.toml @@ -10,7 +10,7 @@ diesel = { version = "2.1.3", features = [ "uuid", ], optional = true } redis = { version = "0.23.3", default-features = false, optional = true } -serde = { version = "1.0.188", optional = true } +serde = { version = "1.0.189", optional = true } thiserror = "1.0.49" uuid = { version = "1.4.1", features = ["fast-rng", "v7"] } uuid-simd = { version = "0.8.0", features = ["uuid"] }