Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup #573

Merged
merged 3 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
293 changes: 115 additions & 178 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ askama = { version = "0.12.1", default-features = false, features = [
"with-axum",
] }
clap = { version = "4.5.16", features = ["derive", "wrap_help"] }
diesel = { version = "2.2.2", default-features = false, features = [
diesel = { version = "2.2.3", default-features = false, features = [
"32-column-tables",
"with-deprecated",
] }
Expand All @@ -93,7 +93,7 @@ diesel-async = { version = "0.5.0", features = [
"tokio",
] }
diesel_full_text_search = { version = "2.2.0", default-features = false }
fred = { version = "9.1.1", features = [
fred = { version = "9.1.2", features = [
"enable-rustls-ring",
"full-tracing",
"i-scripts",
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-activitypub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ kitsune-util = { workspace = true }
kitsune-wasm-mrf = { workspace = true }
mime = "0.3.17"
mime_guess = { version = "2.0.5", default-features = false }
serde = "1.0.208"
serde = "1.0.209"
sha2 = "0.10.8"
sonic-rs = { workspace = true }
speedy-uuid = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-cache/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ enum_dispatch = "0.3.13"
fred = { workspace = true }
kitsune-error = { workspace = true }
moka = { workspace = true }
serde = "1.0.208"
serde = "1.0.209"
sonic-rs = { workspace = true }
tracing = "0.1.40"
triomphe = { workspace = true }
Expand Down
5 changes: 3 additions & 2 deletions crates/kitsune-cache/src/redis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ where
let key = self.compute_key(key);

debug!(%key, "Deleting cache entry");
self.redis_conn.del(key).await?;
let () = self.redis_conn.del(key).await?;

Ok(())
}
Expand All @@ -78,7 +78,8 @@ where
let serialised = sonic_rs::to_string(value)?;

debug!(%key, ttl = ?self.ttl, "Setting cache entry");
self.redis_conn
let () = self
.redis_conn
.set(
key,
serialised,
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-captcha/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ enum_dispatch = "0.3.13"
http = "1.1.0"
kitsune-error = { workspace = true }
kitsune-http-client = { workspace = true }
serde = { version = "1.0.208", features = ["derive"] }
serde = { version = "1.0.209", features = ["derive"] }
serde_urlencoded = "0.7.1"
sonic-rs = { workspace = true }
strum = { version = "0.26.3", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license.workspace = true
eyre = "0.6.12"
human-size = { version = "0.4.3", features = ["serde"] }
isolang = { version = "2.4.0", features = ["serde"] }
serde = { version = "1.0.208", features = ["derive"] }
serde = { version = "1.0.209", features = ["derive"] }
smol_str = { version = "0.2.2", features = ["serde"] }
tokio = { version = "1.39.3", features = ["fs"] }
toml = { version = "0.8.19", default-features = false, features = ["parse"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const_format = "0.2.32"
kitsune-db = { workspace = true }
kitsune-error = { workspace = true }
paste = "1.0.15"
serde = { version = "1.0.208", features = ["derive"] }
serde = { version = "1.0.209", features = ["derive"] }
triomphe = { workspace = true }
typed-builder = "0.20.0"
unsize = "1.1.0"
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ rustls = { version = "0.23.12", default-features = false, features = [
"tls12",
] }
rustls-native-certs = "0.7.2"
serde = { version = "1.0.208", features = ["derive"] }
serde = { version = "1.0.209", features = ["derive"] }
sonic-rs = { workspace = true }
speedy-uuid = { workspace = true, features = ["diesel"] }
tokio = { version = "1.39.3", features = ["rt"] }
Expand Down
4 changes: 2 additions & 2 deletions crates/kitsune-derive/impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ proc-macro = true

[dependencies]
proc-macro2 = "1.0.86"
quote = "1.0.36"
syn = { version = "2.0.75", features = ["full"] }
quote = "1.0.37"
syn = { version = "2.0.76", features = ["full"] }

[lints]
workspace = true
4 changes: 2 additions & 2 deletions crates/kitsune-derive/impl/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
mod expand;
mod service;

#[proc_macro_attribute]
pub fn kitsune_service(
attrs: proc_macro::TokenStream,
input: proc_macro::TokenStream,
) -> proc_macro::TokenStream {
match self::expand::expand(attrs.into(), input.into()) {
match self::service::expand(attrs.into(), input.into()) {
Ok(out) => out.into(),
Err(error) => error.to_compile_error().into(),
}
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-http-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ hyper-rustls = { version = "0.27.2", default-features = false, features = [
] }
kitsune-type = { workspace = true }
pin-project = "1.1.5"
serde = "1.0.208"
serde = "1.0.209"
simdutf8 = { workspace = true }
sonic-rs = { workspace = true }
tower = { version = "0.5.0", features = ["util"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-jobs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ kitsune-core = { workspace = true }
kitsune-db = { workspace = true }
kitsune-email = { workspace = true }
kitsune-error = { workspace = true }
serde = { version = "1.0.208", features = ["derive"] }
serde = { version = "1.0.209", features = ["derive"] }
speedy-uuid = { workspace = true }
tracing = "0.1.40"
typed-builder = "0.20.0"
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-mastodon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ kitsune-type = { workspace = true }
kitsune-url = { workspace = true }
kitsune-util = { workspace = true }
mime = "0.3.17"
serde = "1.0.208"
serde = "1.0.209"
smol_str = "0.2.2"
sonic-rs = { workspace = true }
speedy-uuid = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-oidc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ openidconnect = { version = "4.0.0-alpha.2", default-features = false, features
"accept-rfc3339-timestamps",
"accept-string-booleans",
] }
serde = { version = "1.0.208", features = ["derive"] }
serde = { version = "1.0.209", features = ["derive"] }
sonic-rs = { workspace = true }
speedy-uuid = { workspace = true }
url = "2.5.2"
Expand Down
3 changes: 2 additions & 1 deletion crates/kitsune-oidc/src/state/store/redis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@

async fn set(&self, key: &str, value: LoginState) -> Result<()> {
let raw_value = sonic_rs::to_string(&value)?;
self.pool
let () = self
.pool

Check warning on line 33 in crates/kitsune-oidc/src/state/store/redis.rs

View check run for this annotation

Codecov / codecov/patch

crates/kitsune-oidc/src/state/store/redis.rs#L32-L33

Added lines #L32 - L33 were not covered by tests
.set(Self::format_key(key), raw_value, None, None, false)
.await?;

Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-s3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ kitsune-error = { workspace = true }
kitsune-http-client = { workspace = true }
quick-xml = { version = "0.36.1", features = ["serialize"] }
rusty-s3 = "0.5.0"
serde = { version = "1.0.208", features = ["derive"] }
serde = { version = "1.0.209", features = ["derive"] }
typed-builder = "0.20.0"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-search/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ kitsune-http-client = { workspace = true }
kitsune-language = { workspace = true }
meilisearch-sdk = { version = "0.27.1", default-features = false }
pin-project-lite = "0.2.14"
serde = { version = "1.0.208", features = ["derive"] }
serde = { version = "1.0.209", features = ["derive"] }
serde_urlencoded = "0.7.1"
speedy-uuid = { workspace = true }
strum = { version = "0.26.3", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ post-process = { workspace = true }
rand = "0.8.5"
rsa = "0.9.6"
rusty-s3 = { version = "0.5.0", default-features = false }
serde = "1.0.208"
serde = "1.0.209"
smol_str = "0.2.2"
speedy-uuid = { workspace = true }
tokio = { version = "1.39.3", features = ["macros", "sync"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-type/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license.workspace = true

[dependencies]
iso8601-timestamp = "0.2.17"
serde = { version = "1.0.208", features = ["derive"] }
serde = { version = "1.0.209", features = ["derive"] }
serde_with = "3.9.0"
smol_str = { version = "0.2.2", features = ["serde"] }
sonic-rs = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-wasm-mrf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ kitsune-derive = { workspace = true }
kitsune-error = { workspace = true }
kitsune-type = { workspace = true }
mrf-manifest = { workspace = true, features = ["decode"] }
redb = { version = "2.1.1", features = ["logging"] }
redb = { version = "2.1.2", features = ["logging"] }
slab = "0.4.9"
smol_str = "0.2.2"
sonic-rs = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion kitsune-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ kitsune-config = { workspace = true }
kitsune-core = { workspace = true }
kitsune-db = { workspace = true }
kitsune-error = { workspace = true }
serde = { version = "1.0.208", features = ["derive"] }
serde = { version = "1.0.209", features = ["derive"] }
speedy-uuid = { workspace = true }
tokio = { version = "1.39.3", features = ["full"] }
tracing-subscriber = "0.3.18"
Expand Down
2 changes: 1 addition & 1 deletion kitsune/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ oxide-auth-async = "0.2.1"
oxide-auth-axum = "0.5.0"
rust-embed = { version = "8.5.0", features = ["include-exclude"] }
scoped-futures = "0.1.3"
serde = { version = "1.0.208", features = ["derive"] }
serde = { version = "1.0.209", features = ["derive"] }
serde_urlencoded = "0.7.1"
sonic-rs = { workspace = true }
simdutf8 = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion lib/athena/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ iso8601-timestamp = "0.2.17"
fred = { workspace = true, optional = true }
just-retry = { workspace = true }
rand = { version = "0.8.5", optional = true }
serde = { version = "1.0.208", features = ["derive"] }
serde = { version = "1.0.209", features = ["derive"] }
smol_str = "0.2.2"
sonic-rs = { workspace = true, optional = true }
speedy-uuid = { workspace = true, features = ["redis"] }
Expand Down
13 changes: 7 additions & 6 deletions lib/athena/src/redis/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
.duration_since(Timestamp::UNIX_EPOCH)
.as_seconds_f64();

client
let () = client

Check warning on line 108 in lib/athena/src/redis/mod.rs

View check run for this annotation

Codecov / codecov/patch

lib/athena/src/redis/mod.rs#L108

Added line #L108 was not covered by tests
.zadd(
self.scheduled_queue_name.as_str(),
None,
Expand All @@ -116,7 +116,7 @@
)
.await?;
} else {
client
let () = client
.xadd(
self.queue_name.as_str(),
false,
Expand Down Expand Up @@ -241,14 +241,14 @@
let client = self.redis_pool.next();
let pipeline = client.pipeline();

pipeline
let () = pipeline
.xack(
self.queue_name.as_str(),
self.consumer_group.as_str(),
stream_id.as_str(),
)
.await?;
pipeline
let () = pipeline
.xdel(self.queue_name.as_str(), &[stream_id])
.await?;

Expand Down Expand Up @@ -279,7 +279,7 @@
Outcome::Success => true, // Execution succeeded, we don't need the context anymore
};

pipeline.last().await?;
let () = pipeline.last().await?;

if remove_context {
self.context_repository
Expand All @@ -297,7 +297,8 @@
.get::<String>()
.expect("[Bug] Not a string in the context");

self.redis_pool
let () = self
.redis_pool

Check warning on line 301 in lib/athena/src/redis/mod.rs

View check run for this annotation

Codecov / codecov/patch

lib/athena/src/redis/mod.rs#L300-L301

Added lines #L300 - L301 were not covered by tests
.xclaim(
self.queue_name.as_str(),
self.consumer_group.as_str(),
Expand Down
2 changes: 1 addition & 1 deletion lib/athena/src/redis/scheduled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct ScheduledJobActor {
impl ScheduledJobActor {
async fn run(&mut self) -> Result<()> {
let client = self.redis_pool.next();
SCHEDULE_SCRIPT
let () = SCHEDULE_SCRIPT
.evalsha_with_reload(
client,
(self.queue_name.as_str(), self.scheduled_queue_name.as_str()),
Expand Down
6 changes: 3 additions & 3 deletions lib/fast-cjson/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ harness = false
[dependencies]
icu_normalizer = "1.5.0"
memchr = "2.7.4"
serde = "1.0.208"
serde = "1.0.209"
sonic-rs = { workspace = true }

[dev-dependencies]
Expand All @@ -21,8 +21,8 @@ mimalloc = "0.1.43"
olpc-cjson = "0.1.3"
proptest = { version = "1.5.0", default-features = false, features = ["std"] }
proptest-derive = "0.5.0"
serde = { version = "1.0.208", features = ["derive"] }
serde_json = "1.0.125"
serde = { version = "1.0.209", features = ["derive"] }
serde_json = "1.0.127"

[lints]
workspace = true
12 changes: 6 additions & 6 deletions lib/fast-cjson/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ use std::{

mod util;

#[derive(Debug, Default)]
struct Object {
obj: BTreeMap<Vec<u8>, Vec<u8>>,
state: Collecting,
}

#[derive(Debug)]
enum Collecting {
Key(Vec<u8>),
Expand All @@ -33,6 +27,12 @@ impl Default for Collecting {
}
}

#[derive(Debug, Default)]
struct Object {
obj: BTreeMap<Vec<u8>, Vec<u8>>,
state: Collecting,
}

/// A [`Formatter`](sonic_rs::format::Formatter) that produces canonical JSON.
#[derive(Debug, Default)]
pub struct CanonicalFormatter {
Expand Down
10 changes: 5 additions & 5 deletions lib/fast-cjson/tests/test.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use fast_cjson::CanonicalFormatter;
use serde::Serialize;
use sonic_rs::Serializer;
use std::io::Result;
use std::io;

/// Small wrapper around the `sonic_rs` json! macro to encode the value as canonical JSON.
macro_rules! encode {
($($tt:tt)+) => {
(|v: sonic_rs::Value| -> Result<Vec<u8>> {
(|v: sonic_rs::Value| -> io::Result<Vec<u8>> {
let mut buf = Vec::new();
let mut ser = Serializer::with_formatter(&mut buf, CanonicalFormatter::new());
v.serialize(&mut ser)?;
Expand All @@ -20,7 +20,7 @@ macro_rules! encode {
///
/// `<https://github.com/secure-systems-lab/securesystemslib/blob/f466266014aff529510216b8c2f8c8f39de279ec/tests/test_formats.py#L354-L389>`
#[test]
fn securesystemslib_asserts() -> Result<()> {
fn securesystemslib_asserts() -> io::Result<()> {
assert_eq!(encode!([1, 2, 3])?, b"[1,2,3]");
assert_eq!(encode!([1, 2, 3])?, b"[1,2,3]");
assert_eq!(encode!([])?, b"[]");
Expand Down Expand Up @@ -61,7 +61,7 @@ fn securesystemslib_asserts() -> Result<()> {
/// True
/// ```
#[test]
fn ascii_control_characters() -> Result<()> {
fn ascii_control_characters() -> io::Result<()> {
assert_eq!(encode!("\x00")?, b"\"\x00\"");
assert_eq!(encode!("\x01")?, b"\"\x01\"");
assert_eq!(encode!("\x02")?, b"\"\x02\"");
Expand Down Expand Up @@ -105,7 +105,7 @@ fn ascii_control_characters() -> Result<()> {
/// A more involved test than any of the above for olpc-cjson's core competency: ordering
/// things.
#[test]
fn ordered_nested_object() -> Result<()> {
fn ordered_nested_object() -> io::Result<()> {
assert_eq!(
encode!({
"nested": {
Expand Down
Loading
Loading