diff --git a/Cargo.lock b/Cargo.lock index 6bf897990..460716615 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1301,9 +1301,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca741a962e1b0bff6d724a1a0958b686406e853bb14061f218562e1896f95e6" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] @@ -4052,6 +4052,7 @@ dependencies = [ "enum_dispatch", "fred", "futures-util", + "http", "http-body-util", "kitsune-config", "kitsune-derive", @@ -5872,9 +5873,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.17" +version = "0.23.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f1a745511c54ba6d4465e8d5dfbd81b45791756de28d4981af70d6dca128f1e" +checksum = "9c9cc1d47e243d655ace55ed38201c19ae02c148ae56412ab8750e8f0166ab7f" dependencies = [ "log", "once_cell", @@ -7526,9 +7527,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.3" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna 1.0.3", diff --git a/crates/kitsune-activitypub/Cargo.toml b/crates/kitsune-activitypub/Cargo.toml index 80702aec0..4ccf9cd09 100644 --- a/crates/kitsune-activitypub/Cargo.toml +++ b/crates/kitsune-activitypub/Cargo.toml @@ -38,7 +38,7 @@ speedy-uuid = { workspace = true } tracing = "0.1.40" triomphe = { workspace = true } typed-builder = "0.20.0" -url = "2.5.3" +url = "2.5.4" [target.'cfg(not(target_env = "msvc"))'.dependencies] sha2 = { version = "0.10.8", features = ["asm"] } diff --git a/crates/kitsune-db/Cargo.toml b/crates/kitsune-db/Cargo.toml index 8fe4af73a..8a39c36ff 100644 --- a/crates/kitsune-db/Cargo.toml +++ b/crates/kitsune-db/Cargo.toml @@ -22,7 +22,7 @@ kitsune-language = { workspace = true } kitsune-type = { workspace = true } num-derive = "0.4.2" num-traits = "0.2.19" -rustls = { version = "0.23.17", default-features = false, features = [ +rustls = { version = "0.23.18", default-features = false, features = [ "logging", "ring", "std", diff --git a/crates/kitsune-federation-filter/Cargo.toml b/crates/kitsune-federation-filter/Cargo.toml index 98715c8f9..7d02040bf 100644 --- a/crates/kitsune-federation-filter/Cargo.toml +++ b/crates/kitsune-federation-filter/Cargo.toml @@ -11,7 +11,7 @@ kitsune-config = { workspace = true } kitsune-derive = { workspace = true } kitsune-error = { workspace = true } kitsune-type = { workspace = true } -url = "2.5.3" +url = "2.5.4" [lints] workspace = true diff --git a/crates/kitsune-http-client/src/lib.rs b/crates/kitsune-http-client/src/lib.rs index 2af8315b8..b862af154 100644 --- a/crates/kitsune-http-client/src/lib.rs +++ b/crates/kitsune-http-client/src/lib.rs @@ -45,8 +45,6 @@ pub use self::body::Body; /// Response body type pub type ResponseBody = BoxBody; -pub use ::http; - /// Client error type pub struct Error { inner: BoxError, diff --git a/crates/kitsune-oidc/Cargo.toml b/crates/kitsune-oidc/Cargo.toml index cd0892609..b0348c533 100644 --- a/crates/kitsune-oidc/Cargo.toml +++ b/crates/kitsune-oidc/Cargo.toml @@ -25,7 +25,7 @@ serde = { version = "1.0.215", features = ["derive"] } sonic-rs = { workspace = true } speedy-uuid = { workspace = true } thiserror = "2.0.3" -url = "2.5.3" +url = "2.5.4" [dev-dependencies] tokio = { version = "1.41.1", features = ["macros", "rt"] } diff --git a/crates/kitsune-service/Cargo.toml b/crates/kitsune-service/Cargo.toml index d4eff7d9f..bfe65158c 100644 --- a/crates/kitsune-service/Cargo.toml +++ b/crates/kitsune-service/Cargo.toml @@ -52,7 +52,7 @@ tokio = { workspace = true, features = ["macros", "sync"] } tracing = "0.1.40" triomphe = { workspace = true } typed-builder = "0.20.0" -url = "2.5.3" +url = "2.5.4" zxcvbn = { version = "3.1.0", default-features = false } [dev-dependencies] diff --git a/crates/kitsune-test/Cargo.toml b/crates/kitsune-test/Cargo.toml index 9b9ed0019..d394a87a6 100644 --- a/crates/kitsune-test/Cargo.toml +++ b/crates/kitsune-test/Cargo.toml @@ -21,7 +21,7 @@ rand = "0.8.5" rusty-s3 = { version = "0.5.0", default-features = false } tokio = { workspace = true, features = ["time"] } triomphe = { workspace = true } -url = "2.5.3" +url = "2.5.4" uuid = { version = "1.11.0", features = ["fast-rng", "v4"] } [lints] diff --git a/crates/kitsune-wasm-mrf/Cargo.toml b/crates/kitsune-wasm-mrf/Cargo.toml index 2cefdf3f3..8fc855aae 100644 --- a/crates/kitsune-wasm-mrf/Cargo.toml +++ b/crates/kitsune-wasm-mrf/Cargo.toml @@ -16,6 +16,7 @@ fred = { workspace = true } futures-util = { version = "0.3.31", default-features = false, features = [ "alloc", ] } +http = "1.1.0" http-body-util = "0.1.2" kitsune-config = { workspace = true } kitsune-derive = { workspace = true } diff --git a/crates/kitsune-wasm-mrf/src/ctx.rs b/crates/kitsune-wasm-mrf/src/ctx.rs index 518f3ab82..edc6d306a 100644 --- a/crates/kitsune-wasm-mrf/src/ctx.rs +++ b/crates/kitsune-wasm-mrf/src/ctx.rs @@ -1,6 +1,6 @@ use crate::{ kv_storage, - mrf_wit::v1::fep::mrf::{http, keyvalue}, + mrf_wit::v1::fep::mrf::{http_client, keyvalue}, }; use slab::Slab; use triomphe::Arc; @@ -28,12 +28,15 @@ impl KvContext { pub struct HttpContext { pub client: kitsune_http_client::Client, - pub bodies: Slab, + pub bodies: Slab, } impl HttpContext { #[inline] - pub fn get_body(&mut self, rep: &Resource) -> &mut crate::http::Body { + pub fn get_body( + &mut self, + rep: &Resource, + ) -> &mut crate::http_client::Body { &mut self.bodies[rep.rep() as usize] } } @@ -80,7 +83,7 @@ pub fn construct_store( buckets: Slab::new(), }, resource_limiter: StoreLimitsBuilder::new() - .memory_size(100 * 1024 * 1024) + .memory_size(15 * 1024 * 1024) .build(), resource_table: ResourceTable::new(), wasi_ctx, diff --git a/crates/kitsune-wasm-mrf/src/http.rs b/crates/kitsune-wasm-mrf/src/http_client.rs similarity index 85% rename from crates/kitsune-wasm-mrf/src/http.rs rename to crates/kitsune-wasm-mrf/src/http_client.rs index 8128b20a0..f07a6509a 100644 --- a/crates/kitsune-wasm-mrf/src/http.rs +++ b/crates/kitsune-wasm-mrf/src/http_client.rs @@ -1,6 +1,6 @@ use crate::{ ctx::Context, - mrf_wit::v1::fep::mrf::http::{self, Error, Request, Response, ResponseBody}, + mrf_wit::v1::fep::mrf::http_client::{self, Error, Request, Response, ResponseBody}, }; use async_trait::async_trait; use futures_util::TryStreamExt; @@ -10,12 +10,12 @@ use wasmtime::component::Resource; pub type Body = BodyDataStream; #[async_trait] -impl http::Host for Context { +impl http_client::Host for Context { async fn do_request(&mut self, request: Request) -> Result> { - let method = kitsune_http_client::http::Method::from_bytes(request.method.as_bytes()) + let method = http::Method::from_bytes(request.method.as_bytes()) .map_err(|_| Resource::new_own(0))?; - let request = kitsune_http_client::http::Request::builder() + let request = http::Request::builder() .uri(request.url) .method(method) .body(request.body.map_or_else(Default::default, Into::into)) @@ -51,7 +51,7 @@ impl http::Host for Context { } #[async_trait] -impl http::HostResponseBody for Context { +impl http_client::HostResponseBody for Context { async fn next( &mut self, rep: Resource, @@ -72,7 +72,7 @@ impl http::HostResponseBody for Context { } #[async_trait] -impl http::HostError for Context { +impl http_client::HostError for Context { async fn drop(&mut self, _rep: Resource) -> wasmtime::Result<()> { Ok(()) } diff --git a/crates/kitsune-wasm-mrf/src/lib.rs b/crates/kitsune-wasm-mrf/src/lib.rs index 98b96c3aa..6d9b73b59 100644 --- a/crates/kitsune-wasm-mrf/src/lib.rs +++ b/crates/kitsune-wasm-mrf/src/lib.rs @@ -35,7 +35,7 @@ use wasmtime::{ mod cache; mod ctx; -mod http; +mod http_client; mod logging; mod mrf_wit; diff --git a/crates/kitsune-wasm-mrf/wit/mrf.wit b/crates/kitsune-wasm-mrf/wit/mrf.wit index e0ec26a68..4eac5a803 100644 --- a/crates/kitsune-wasm-mrf/wit/mrf.wit +++ b/crates/kitsune-wasm-mrf/wit/mrf.wit @@ -1,7 +1,7 @@ -package fep:mrf@1.0.0; +package fep:mrf@0.1.0; /// Home-grown version of an interface for doing HTTP requests -interface http { +interface http-client { /// Opaque representation of some error resource error {} @@ -101,7 +101,7 @@ interface types { world mrf { use types.{direction, error}; - import http; + import http-client; import keyvalue; import wasi:logging/logging; diff --git a/kitsune/Cargo.toml b/kitsune/Cargo.toml index c8b1640c2..5611ec0f7 100644 --- a/kitsune/Cargo.toml +++ b/kitsune/Cargo.toml @@ -102,7 +102,7 @@ tracing = "0.1.40" trials = { workspace = true } triomphe = { workspace = true } typed-builder = "0.20.0" -url = "2.5.3" +url = "2.5.4" # --- Optional dependencies ---