Skip to content

Commit 4e7936f

Browse files
authored
Update and roundtrip test (#550)
1 parent 4524aa6 commit 4e7936f

File tree

25 files changed

+402
-133
lines changed

25 files changed

+402
-133
lines changed

Cargo.lock

+334-85
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ resolver = "2"
7878
askama = { version = "0.12.1", default-features = false, features = [
7979
"with-axum",
8080
] }
81-
clap = { version = "4.5.6", features = ["derive", "wrap_help"] }
82-
diesel = { version = "2.2.0", default-features = false, features = [
81+
clap = { version = "4.5.7", features = ["derive", "wrap_help"] }
82+
diesel = { version = "2.2.1", default-features = false, features = [
8383
"32-column-tables",
8484
"with-deprecated",
8585
] }
@@ -96,7 +96,7 @@ fred = { version = "9.0.3", features = [
9696
"i-scripts",
9797
"sha-1",
9898
] }
99-
garde = { version = "0.19.0", features = [
99+
garde = { version = "0.19.1", features = [
100100
"derive",
101101
"email",
102102
"email-idna",
@@ -106,7 +106,7 @@ garde = { version = "0.19.0", features = [
106106
itertools = { version = "0.13.0", default-features = false }
107107
moka = { version = "0.12.7", features = ["sync"] }
108108
simdutf8 = { version = "0.1.4", features = ["aarch64_neon"] }
109-
sonic-rs = "0.3.6"
109+
sonic-rs = "0.3.7"
110110
triomphe = { version = "0.1.12", default-features = false, features = [
111111
"unsize",
112112
] }
@@ -213,7 +213,7 @@ scraper = { git = "https://github.com/causal-agent/scraper.git", rev = "d67111f5
213213
tokio-postgres-rustls = { git = "https://github.com/jbg/tokio-postgres-rustls.git", rev = "b16c1bc0f5d4f91324174fd1bd839d743a70f86a" }
214214

215215
# SIMD runtime detection
216-
sonic-rs = { git = "https://github.com/aumetra/sonic-rs.git", rev = "a5ac253f8389a34257dae2da79db3f535311ed65" }
216+
sonic-rs = { git = "https://github.com/aumetra/sonic-rs.git", rev = "317ff37a8ab88e653ee01bbc00a974d41f3b151a" }
217217

218218
# TCP nodelay for `axum::serve`
219219
axum = { git = "https://github.com/tokio-rs/axum.git", rev = "8d0c5c05eb75eb779591c8000705e785123868a0" }

crates/kitsune-activitypub/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ speedy-uuid = { workspace = true }
3838
tracing = "0.1.40"
3939
triomphe = { workspace = true }
4040
typed-builder = "0.18.2"
41-
url = "2.5.0"
41+
url = "2.5.1"
4242

4343
[target.'cfg(not(target_env = "msvc"))'.dependencies]
4444
sha2 = { version = "0.10.8", features = ["asm"] }
4545

4646
[dev-dependencies]
47-
http-body-util = "0.1.1"
47+
http-body-util = "0.1.2"
4848
hyper = "1.3.1"
4949
kitsune-config = { workspace = true }
5050
kitsune-test = { workspace = true }

crates/kitsune-db/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ kitsune-language = { workspace = true }
2222
kitsune-type = { workspace = true }
2323
num-derive = "0.4.2"
2424
num-traits = "0.2.19"
25-
rustls = { version = "0.23.9", default-features = false, features = [
25+
rustls = { version = "0.23.10", default-features = false, features = [
2626
"logging",
2727
"ring",
2828
"std",

crates/kitsune-email/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ lettre = { version = "0.11.7", default-features = false, features = [
2626
"tokio1-rustls-tls",
2727
"tracing",
2828
] }
29-
mrml = { version = "3.1.5", default-features = false, features = [
30-
"orderedmap",
29+
mrml = { version = "4.0.0", default-features = false, features = [
3130
"parse",
3231
"render",
3332
] }

crates/kitsune-federation-filter/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ kitsune-config = { workspace = true }
1111
kitsune-derive = { workspace = true }
1212
kitsune-error = { workspace = true }
1313
kitsune-type = { workspace = true }
14-
url = "2.5.0"
14+
url = "2.5.1"
1515

1616
[lints]
1717
workspace = true

crates/kitsune-http-client/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ futures-util = { version = "0.3.30", default-features = false, features = [
1212
"alloc",
1313
] }
1414
http-body = "1.0.0"
15-
http-body-util = "0.1.1"
15+
http-body-util = "0.1.2"
1616
http-signatures = { workspace = true }
1717
hyper = "1.3.1"
1818
hyper-util = { version = "0.1.5", features = [

crates/kitsune-observability/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license.workspace = true
88
[dependencies]
99
async-trait = "0.1.80"
1010
eyre = "0.6.12"
11-
http-body-util = "0.1.1"
11+
http-body-util = "0.1.2"
1212
hyper = { version = "1.3.1", default-features = false }
1313
kitsune-config = { workspace = true }
1414
kitsune-http-client = { workspace = true }

crates/kitsune-oidc/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ license.workspace = true
99
enum_dispatch = "0.3.13"
1010
fred = { workspace = true }
1111
http = "1.1.0"
12-
http-body-util = "0.1.1"
12+
http-body-util = "0.1.2"
1313
kitsune-config = { workspace = true }
1414
kitsune-derive = { workspace = true }
1515
kitsune-error = { workspace = true }
@@ -25,7 +25,7 @@ openidconnect = { version = "4.0.0-alpha.2", default-features = false, features
2525
serde = { version = "1.0.203", features = ["derive"] }
2626
sonic-rs = { workspace = true }
2727
speedy-uuid = { workspace = true }
28-
url = "2.5.0"
28+
url = "2.5.1"
2929

3030
[lints]
3131
workspace = true

crates/kitsune-s3/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ futures-util = { version = "0.3.30", default-features = false }
1111
http = "1.1.0"
1212
kitsune-error = { workspace = true }
1313
kitsune-http-client = { workspace = true }
14-
quick-xml = { version = "0.31.0", features = ["serialize"] }
14+
quick-xml = { version = "0.32.0", features = ["serialize"] }
1515
rusty-s3 = "0.5.0"
1616
serde = { version = "1.0.203", features = ["derive"] }
1717
typed-builder = "0.18.2"

crates/kitsune-service/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ tokio = { version = "1.38.0", features = ["macros", "sync"] }
5252
tracing = "0.1.40"
5353
triomphe = { workspace = true }
5454
typed-builder = "0.18.2"
55-
url = "2.5.0"
55+
url = "2.5.1"
5656
zxcvbn = { version = "3.0.1", default-features = false }
5757

5858
[dev-dependencies]
5959
hex-simd = "0.8.0"
60-
http-body-util = "0.1.1"
60+
http-body-util = "0.1.2"
6161
hyper = "1.3.1"
6262
kitsune-activitypub = { workspace = true }
6363
kitsune-config = { workspace = true }

crates/kitsune-test/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ diesel-async = { workspace = true }
1111
fred = { workspace = true }
1212
futures-util = "0.3.30"
1313
http = "1.1.0"
14-
http-body-util = "0.1.1"
14+
http-body-util = "0.1.2"
1515
isolang = "2.4.0"
1616
kitsune-config = { workspace = true }
1717
kitsune-db = { workspace = true }
@@ -21,7 +21,7 @@ rand = "0.8.5"
2121
rusty-s3 = { version = "0.5.0", default-features = false }
2222
tokio = { version = "1.38.0", features = ["time"] }
2323
triomphe = { workspace = true }
24-
url = "2.5.0"
24+
url = "2.5.1"
2525
uuid = { version = "1.8.0", features = ["fast-rng", "v4"] }
2626

2727
[lints]

crates/kitsune-wasm-mrf/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ wasmtime-wasi = { version = "21.0.1", default-features = false }
4444
tempfile = "3.10.1"
4545
tokio = { version = "1.38.0", features = ["macros", "rt"] }
4646
tracing-subscriber = "0.3.18"
47-
wat = "1.209.1"
47+
wat = "1.210.0"
4848

4949
[lints]
5050
workspace = true

crates/kitsune-webfinger/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ triomphe = { workspace = true }
2121
urlencoding = "2.1.3"
2222

2323
[dev-dependencies]
24-
http-body-util = "0.1.1"
24+
http-body-util = "0.1.2"
2525
hyper = "1.3.1"
2626
pretty_assertions = "1.4.0"
2727
sonic-rs = { workspace = true }

kitsune/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ diesel-async = { workspace = true }
3939
futures-util = "0.3.30"
4040
headers = "0.4.0"
4141
http = "1.1.0"
42-
http-body-util = "0.1.1"
42+
http-body-util = "0.1.2"
4343
http-signatures = { workspace = true }
4444
iso8601-timestamp = "0.2.17"
4545
itertools = { workspace = true }
@@ -101,7 +101,7 @@ tracing = "0.1.40"
101101
trials = { workspace = true }
102102
triomphe = { workspace = true }
103103
typed-builder = "0.18.2"
104-
url = "2.5.0"
104+
url = "2.5.1"
105105

106106
# --- Optional dependencies ---
107107

lib/athena/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ redis = ["dep:either", "dep:fred", "dep:once_cell", "dep:rand", "dep:sonic-rs"]
3737

3838
[dev-dependencies]
3939
kitsune-test = { workspace = true }
40+
postcard = { version = "1.0.8", default-features = false, features = ["alloc"] }
4041
tracing-subscriber = "0.3.18"
4142

4243
[lints]

lib/athena/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub trait Keepable: Any + Send + Sync + 'static {}
5353
#[inline]
5454
fn downcast_to<T>(obj: &dyn Keepable) -> Option<&T>
5555
where
56-
T: 'static,
56+
T: Keepable + 'static,
5757
{
5858
if obj.type_id() == TypeId::of::<T>() {
5959
#[allow(unsafe_code)]
@@ -94,7 +94,7 @@ impl KeeperOfTheSecrets {
9494
#[must_use]
9595
pub fn get<T>(&self) -> Option<&T>
9696
where
97-
T: 'static,
97+
T: Keepable + 'static,
9898
{
9999
self.inner
100100
.as_ref()

lib/athena/tests/keeper.rs

+22-4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ struct CustomStruct {
99
#[typetag::serde]
1010
impl Keepable for CustomStruct {}
1111

12+
#[derive(Deserialize, Serialize)]
13+
struct OtherCustomStruct {
14+
other: u32,
15+
}
16+
17+
#[typetag::serde]
18+
impl Keepable for OtherCustomStruct {}
19+
1220
#[test]
1321
fn roundtrip() {
1422
let original = CustomStruct { number: 1312 };
@@ -19,14 +27,24 @@ fn roundtrip() {
1927
assert_eq!(original, *value);
2028
}
2129

30+
#[test]
31+
fn serialize_roundtrip() {
32+
let original = CustomStruct { number: 1312 };
33+
34+
let keeper: KeeperOfTheSecrets = {
35+
let keeper = KeeperOfTheSecrets::new(original.clone());
36+
postcard::from_bytes(&postcard::to_allocvec(&keeper).unwrap()).unwrap()
37+
};
38+
let value = keeper.get::<CustomStruct>().unwrap();
39+
40+
assert_eq!(original, *value);
41+
}
42+
2243
#[test]
2344
fn downcasting_into_other() {
2445
let value = CustomStruct { number: 161 };
2546
let keeper = KeeperOfTheSecrets::new(value.clone());
2647

48+
assert!(keeper.get::<OtherCustomStruct>().is_none());
2749
assert_eq!(keeper.get::<CustomStruct>(), Some(&value));
28-
29-
assert!(keeper.get::<()>().is_none());
30-
assert!(keeper.get::<u32>().is_none());
31-
assert!(keeper.get::<String>().is_none());
3250
}

lib/http-signatures/benches/build_cavage_signature_string.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
use divan::Bencher;
1+
use divan::{black_box, Bencher};
22
use http::{Method, Request, Uri};
3-
use std::hint::black_box;
43

54
#[global_allocator]
65
static GLOBAL: divan::AllocProfiler = divan::AllocProfiler::system();

lib/masto-id-convert/benches/process.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#![allow(clippy::unreadable_literal)]
22

3-
use divan::black_box_drop;
3+
use uuid::Uuid;
44

55
#[global_allocator]
66
static GLOBAL: divan::AllocProfiler = divan::AllocProfiler::system();
77

88
#[divan::bench(name = "process integer", args = [110368129515784116])]
9-
fn process_u64(id: u64) {
10-
black_box_drop(masto_id_convert::process_u64(id));
9+
fn process_u64(id: u64) -> Uuid {
10+
masto_id_convert::process_u64(id)
1111
}
1212

1313
#[divan::bench(name = "process ASCII", args = ["110368129515784116"])]
14-
fn process_ascii(id: &str) {
15-
black_box_drop(masto_id_convert::process(id));
14+
fn process_ascii(id: &str) -> Result<Uuid, masto_id_convert::Error> {
15+
masto_id_convert::process(id)
1616
}
1717

1818
fn main() {

lib/mrf-manifest/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ semver = { version = "1.0.23", features = ["serde"] }
1313
serde = { version = "1.0.203", features = ["derive"] }
1414
serde_json = { version = "1.0.117", optional = true }
1515
thiserror = { version = "1.0.61", optional = true }
16-
wasm-encoder = { version = "0.209.1", optional = true }
17-
wasmparser = { version = "0.209.1", optional = true }
16+
wasm-encoder = { version = "0.210.0", optional = true }
17+
wasmparser = { version = "0.210.0", optional = true }
1818

1919
[dev-dependencies]
2020
serde_json = "1.0.117"
2121
insta = { version = "1.39.0", default-features = false, features = ["json"] }
22-
wat = "1.209.1"
22+
wat = "1.210.0"
2323

2424
[features]
2525
decode = ["dep:leb128", "dep:serde_json", "dep:thiserror", "dep:wasmparser"]

lib/mrf-tool/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ mrf-manifest = { workspace = true, features = [
1515
"serialise",
1616
] }
1717
serde_json = "1.0.117"
18-
wasmparser = "0.209.1"
18+
wasmparser = "0.210.0"
1919

2020
[lints]
2121
workspace = true
2222

2323
[dev-dependencies]
2424
serde_json = "1.0.117"
25-
wat = "1.209.1"
25+
wat = "1.210.0"

lib/speedy-uuid/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
77

88
[dependencies]
99
async-graphql = { version = "7.0.6", default-features = false, optional = true }
10-
diesel = { version = "2.2.0", default-features = false, features = [
10+
diesel = { version = "2.2.1", default-features = false, features = [
1111
"postgres_backend",
1212
"uuid",
1313
], optional = true }

lib/tower-http-digest/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ bytes = "1.6.0"
1111
either = { version = "1.12.0", default-features = false }
1212
http = "1.1.0"
1313
http-body = "1.0.0"
14-
memchr = "2.7.2"
14+
memchr = "2.7.4"
1515
pin-project-lite = "0.2.14"
1616
sha2 = "0.10.8"
1717
subtle = "2.5.0"
@@ -22,7 +22,7 @@ tracing = { version = "0.1.40", default-features = false }
2222
[dev-dependencies]
2323
bytes = "1.6.0"
2424
futures-test = "0.3.30"
25-
http-body-util = "0.1.1"
25+
http-body-util = "0.1.2"
2626
tower = { version = "0.4.13", default-features = false, features = ["util"] }
2727

2828
[lints]

lib/tower-stop-using-brave/src/lib.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
use either::Either;
2-
use http::{header::USER_AGENT, HeaderValue, Request, Response, StatusCode};
2+
use http::{
3+
header::{LOCATION, USER_AGENT},
4+
HeaderValue, Request, Response, StatusCode,
5+
};
36
use once_cell::sync::Lazy;
47
use regex::Regex;
58
use std::{
@@ -43,8 +46,8 @@ where
4346
if USER_AGENT_REGEX.is_match(user_agent) {
4447
let response = Response::builder()
4548
.status(StatusCode::FOUND)
46-
.header("Location", REDIRECT_URL)
47-
.body(Default::default())
49+
.header(LOCATION, REDIRECT_URL)
50+
.body(ResBody::default())
4851
.unwrap();
4952

5053
return Either::Right(future::ready(Ok(response)));

0 commit comments

Comments
 (0)