Skip to content

Commit

Permalink
Upgrade axum to v0.8, upgrade JS deps (#625)
Browse files Browse the repository at this point in the history
* Upgrade axum to v0.8

* Update all NodeJS deps
  • Loading branch information
aumetra authored Jan 1, 2025
1 parent 276f865 commit ff17d20
Show file tree
Hide file tree
Showing 19 changed files with 1,635 additions and 2,331 deletions.
760 changes: 404 additions & 356 deletions Cargo.lock

Large diffs are not rendered by default.

63 changes: 35 additions & 28 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ resolver = "2"
ahash = "0.8.11"
aliri_braid = "0.4.0"
arc-swap = "1.7.1"
argh = "0.1.12"
argh = "0.1.13"
argon2 = { version = "0.5.3", features = ["std"] }
async-graphql = { version = "7.0.13", default-features = false, features = [
"graphiql",
Expand All @@ -94,9 +94,9 @@ async-graphql = { version = "7.0.13", default-features = false, features = [
async-graphql-axum = "7.0.13"
async-trait = "0.1.83"
asynk-strim = "0.1.2"
axum = { version = "0.7.9", features = ["macros", "multipart"] }
axum-core = "0.4.5"
axum-extra = { version = "0.9.6", features = [
axum = { version = "0.8.1", features = ["macros", "multipart"] }
axum-core = "0.5.0"
axum-extra = { version = "0.10.0", features = [
"cookie",
"cookie-signed",
"query",
Expand Down Expand Up @@ -136,7 +136,7 @@ either = { version = "1.13.0", default-features = false }
enum_dispatch = "0.3.13"
envy = "0.4.2"
eyre = "0.6.12"
fred = { version = "10.0.1", features = [
fred = { version = "10.0.3", features = [
"enable-rustls-ring",
"full-tracing",
"i-scripts",
Expand All @@ -148,7 +148,7 @@ futures-test = "0.3.31"
futures-util = { version = "0.3.31", default-features = false, features = [
"alloc",
] }
garde = { version = "0.20.0", features = [
garde = { version = "0.21.0", features = [
"derive",
"email",
"email-idna",
Expand All @@ -169,14 +169,14 @@ http-body = "1.0.1"
http-body-util = "0.1.2"
httpdate = "1.0.3"
human-size = { version = "0.4.3", features = ["serde"] }
hyper = "1.5.1"
hyper = "1.5.2"
hyper-util = { version = "0.1.10", features = [
"client-legacy",
"http1",
"http2",
"tokio",
] }
hyper-rustls = { version = "0.27.3", default-features = false, features = [
hyper-rustls = { version = "0.27.5", default-features = false, features = [
"http1",
"http2",
"logging",
Expand All @@ -185,18 +185,18 @@ hyper-rustls = { version = "0.27.3", default-features = false, features = [
"tls12",
] }
icu_normalizer = "1.5.0"
img-parts = "0.3.1"
img-parts = "0.3.2"
insta = { version = "1.41.1", default-features = false, features = [
"glob",
"json",
] }
iso8601-timestamp = { version = "0.3.2", features = ["diesel-pg"] }
iso8601-timestamp = { version = "0.3.3", features = ["diesel-pg"] }
isolang = { version = "2.4.0", features = [
"english_names",
"list_languages",
"serde",
] }
itertools = { version = "0.13.0", default-features = false }
itertools = { version = "0.14.0", default-features = false }
lantern-client-sdk = { package = "client-sdk", git = "https://github.com/Lantern-chat/client-sdk-rs.git", rev = "efb4288d9b107b48609802193d57b29f7ae395a1", default-features = false }
leb128 = "0.2.5"
lettre = { version = "0.11.11", default-features = false, features = [
Expand Down Expand Up @@ -264,17 +264,17 @@ pulldown-cmark = { version = "0.12.2", default-features = false, features = [
"html",
"simd",
] }
quick-xml = { version = "0.37.1", features = ["serialize"] }
quote = "1.0.37"
quick-xml = { version = "0.37.2", features = ["serialize"] }
quote = "1.0.38"
rand = "0.8.5"
rand_xorshift = "0.3.0"
rayon = "1.10.0"
redb = { version = "2.3.0", features = ["logging"] }
redb = { version = "2.4.0", features = ["logging"] }
regex = "1.11.1"
retry-policies = "0.4.0"
ring = { version = "0.17.8", features = ["std"] }
rsa = "0.9.7"
rstest = { version = "0.23.0", default-features = false }
rstest = { version = "0.24.0", default-features = false }
rust-embed = { version = "8.5.0", features = ["include-exclude"] }
rustc-hash = "2.1.0"
rustls = { version = "0.23.20", default-features = false, features = [
Expand All @@ -284,19 +284,19 @@ rustls = { version = "0.23.20", default-features = false, features = [
"tls12",
] }
rustls-native-certs = "0.8.1"
rusty-s3 = "0.5.0"
rusty-s3 = "0.7.0"
sailfish = { version = "0.9.0", default-features = false, features = [
"derive",
"perf-inline",
] }
schemars = { version = "1.0.0-alpha.17", features = ["semver1"] }
scoped-futures = { version = "0.1.4", default-features = false }
semver = { version = "1.0.23", features = ["serde"] }
serde = { version = "1.0.216", features = ["derive"] }
serde_json = "1.0.133"
semver = { version = "1.0.24", features = ["serde"] }
serde = { version = "1.0.217", features = ["derive"] }
serde_json = "1.0.134"
serde_test = "1.0.177"
serde_urlencoded = "0.7.1"
serde_with = { version = "3.11.0", default-features = false, features = [
serde_with = { version = "3.12.0", default-features = false, features = [
"alloc",
"macros",
] }
Expand All @@ -307,10 +307,10 @@ smol_str = { version = "0.3.2", features = ["serde"] }
sonic-rs = "=0.3.14"
strum = { version = "0.26.3", features = ["derive"] }
subtle = "2.6.1"
syn = { version = "2.0.90", features = ["full"] }
syn = { version = "2.0.94", features = ["full"] }
sync_wrapper = "1.0.2"
tempfile = "3.14.0"
thiserror = "2.0.6"
thiserror = "2.0.9"
time = "0.3.37"
tokio = { version = "1.42.0", features = ["full"] }
tokio-postgres = "0.7.12"
Expand Down Expand Up @@ -344,17 +344,17 @@ triomphe = { version = "0.1.14", default-features = false, features = [
"unsize",
] }
typed-builder = "0.20.0"
typetag = "0.2.18"
typetag = "0.2.19"
unsize = "1.1.0"
ureq = "2.12.1"
url = "2.5.4"
urlencoding = "2.1.3"
uuid = { version = "1.11.0", features = ["fast-rng", "v7"] }
uuid-simd = { version = "0.8.0", features = ["uuid"] }
walkdir = "2.5.0"
wasm-encoder = "0.221.2"
wasmparser = "0.221.2"
wasmtime = { version = "27.0.0", default-features = false, features = [
wasm-encoder = "0.222.0"
wasmparser = "0.222.0"
wasmtime = { version = "28.0.0", default-features = false, features = [
"addr2line",
"async",
"component-model",
Expand All @@ -363,8 +363,8 @@ wasmtime = { version = "27.0.0", default-features = false, features = [
"pooling-allocator",
"runtime",
] }
wasmtime-wasi = { version = "27.0.0", default-features = false }
wat = "1.221.2"
wasmtime-wasi = { version = "28.0.0", default-features = false }
wat = "1.222.0"
whatlang = "0.16.4"
whichlang = "0.1.0"
wit-bindgen = "0.36.0"
Expand Down Expand Up @@ -457,6 +457,13 @@ version = "0.0.1-pre.6"
license = "AGPL-3.0-or-later"

[patch.crates-io]
# axum upgrade
async-graphql = { git = "https://github.com/aumetra/async-graphql.git", branch = "axum-0.8" }
async-graphql-axum = { git = "https://github.com/aumetra/async-graphql.git", branch = "axum-0.8" }
axum-flash = { git = "https://github.com/aumetra/axum-flash.git", branch = "main" }
oxide-auth = { git = "https://github.com/aumetra/oxide-auth.git", branch = "axum-0.8" }
oxide-auth-axum = { git = "https://github.com/aumetra/oxide-auth.git", branch = "axum-0.8" }

# Fix unmaintained advisory
notify-types = { git = "https://github.com/notify-rs/notify.git", rev = "aacd41642345cb66b327d4eb2cdc15ba4016daaa" }
# SIMD runtime detection and generic I/O wrapper
Expand Down
36 changes: 18 additions & 18 deletions kitsune-fe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,33 @@
"test:unit": "vitest"
},
"devDependencies": {
"@iconify-json/eos-icons": "^1.2.1",
"@sveltejs/adapter-static": "^3.0.6",
"@sveltejs/kit": "^2.9.0",
"@sveltejs/vite-plugin-svelte": "5.0.1",
"@iconify-json/eos-icons": "^1.2.2",
"@sveltejs/adapter-static": "^3.0.8",
"@sveltejs/kit": "^2.15.1",
"@sveltejs/vite-plugin-svelte": "5.0.3",
"@tailwindcss/forms": "^0.5.9",
"@tailwindcss/typography": "^0.5.15",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@trivago/prettier-plugin-sort-imports": "^5.2.0",
"@types/eslint": "^9.6.1",
"autoprefixer": "^10.4.20",
"eslint": "^9.16.0",
"eslint": "^9.17.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.46.1",
"globals": "^15.13.0",
"houdini": "1.3.1",
"houdini-svelte": "2.0.1",
"prettier": "^3.4.1",
"globals": "^15.14.0",
"houdini": "1.4.0",
"houdini-svelte": "2.1.0",
"prettier": "^3.4.2",
"prettier-plugin-css-order": "^2.1.2",
"prettier-plugin-svelte": "^3.3.2",
"prettier-plugin-tailwindcss": "^0.6.9",
"svelte": "^5.3.0",
"svelte-check": "^4.1.0",
"tailwindcss": "^3.4.15",
"svelte": "^5.16.0",
"svelte-check": "^4.1.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.2",
"typescript-eslint": "^8.16.0",
"unplugin-icons": "^0.20.2",
"vite": "^6.0.1",
"vitest": "^2.1.6",
"zod": "^3.23.8"
"typescript-eslint": "^8.19.0",
"unplugin-icons": "^0.22.0",
"vite": "^6.0.6",
"vitest": "^2.1.8",
"zod": "^3.24.1"
}
}
5 changes: 3 additions & 2 deletions kitsune-fe/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<script lang="ts">
import type { Snippet } from 'svelte';
import type { PageData } from './$houdini';
import { version as frontendVersion } from '$app/environment';
import type { Snippet } from 'svelte';
import '../app.css';
import type { PageData } from './$houdini';
const { children, data }: { children: Snippet; data: PageData } = $props();
Expand Down
3 changes: 2 additions & 1 deletion kitsune-fe/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
import { RegisterUserStore } from '$houdini';
import Button from '$lib/components/Button.svelte';
import Dialog from '$lib/components/Dialog.svelte';
import type { PageData } from './$houdini';
import IconThreeDotsLoading from '~icons/eos-icons/three-dots-loading?raw&width=2em&height=2em';
import { _registerSchema } from './+page';
import IconThreeDotsLoading from '~icons/eos-icons/three-dots-loading?raw&width=2em&height=2em';
const { data }: { data: PageData } = $props();
Expand Down
6 changes: 3 additions & 3 deletions kitsune/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"devDependencies": {
"@tailwindcss/forms": "^0.5.9",
"@tailwindcss/typography": "^0.5.15",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"prettier": "^3.4.1",
"@trivago/prettier-plugin-sort-imports": "^5.2.0",
"prettier": "^3.4.2",
"prettier-plugin-jinja-template": "^2.0.0",
"prettier-plugin-tailwindcss": "^0.6.9",
"tailwindcss": "^3.4.15"
"tailwindcss": "^3.4.17"
}
}
27 changes: 24 additions & 3 deletions kitsune/src/http/extractor/auth.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::state::Zustand;
use async_trait::async_trait;
use axum::{
extract::FromRequestParts,
extract::{FromRequestParts, OptionalFromRequestParts},
response::{IntoResponse, Response},
RequestPartsExt,
};
Expand Down Expand Up @@ -38,7 +37,6 @@ pub struct UserData {
/// This is needed for compatibility with the Mastodon API, more information in the docs of the [`MastodonAuthExtractor`] type alias.
pub struct AuthExtractor<const ENFORCE_EXPIRATION: bool>(pub UserData);

#[async_trait]
impl<const ENFORCE_EXPIRATION: bool> FromRequestParts<Zustand>
for AuthExtractor<ENFORCE_EXPIRATION>
{
Expand Down Expand Up @@ -79,3 +77,26 @@ impl<const ENFORCE_EXPIRATION: bool> FromRequestParts<Zustand>
Ok(Self(UserData { account, user }))
}
}

impl<const ENFORCE_EXPIRATION: bool> OptionalFromRequestParts<Zustand>
for AuthExtractor<ENFORCE_EXPIRATION>
{
type Rejection = Response;

#[inline]
async fn from_request_parts(
parts: &mut Parts,
state: &Zustand,
) -> Result<Option<Self>, Self::Rejection> {
// just silently swallow any auth errors
let value = if let Ok(value) =
<Self as FromRequestParts<_>>::from_request_parts(parts, state).await
{
Some(value)
} else {
None
};

Ok(value)
}
}
2 changes: 0 additions & 2 deletions kitsune/src/http/extractor/json.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use async_trait::async_trait;
use axum::response::IntoResponse;
use axum::{body::Body, extract::FromRequest, response::Response};
use bytes::{BufMut, Bytes, BytesMut};
Expand All @@ -10,7 +9,6 @@ use std::ops::{Deref, DerefMut};
#[must_use]
pub struct Json<T>(pub T);

#[async_trait]
impl<T, S> FromRequest<S> for Json<T>
where
T: DeserializeOwned,
Expand Down
26 changes: 23 additions & 3 deletions kitsune/src/http/extractor/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use async_trait::async_trait;
use axum::{
body::Body,
extract::FromRequest,
extract::{FromRequest, OptionalFromRequest},
response::{IntoResponse, Response},
Form, RequestExt,
};
Expand All @@ -27,7 +26,6 @@ mod signed_activity;

pub struct AgnosticForm<T>(pub T);

#[async_trait]
impl<S, T> FromRequest<S> for AgnosticForm<T>
where
S: Send + Sync,
Expand Down Expand Up @@ -63,3 +61,25 @@ where
Ok(Self(content))
}
}

impl<S, T> OptionalFromRequest<S> for AgnosticForm<T>
where
S: Send + Sync,
T: DeserializeOwned + Send + 'static,
{
type Rejection = Response;

async fn from_request(
req: axum::extract::Request,
state: &S,
) -> Result<Option<Self>, Self::Rejection> {
// just silently swallow the error
let value = if let Ok(value) = <Self as FromRequest<_>>::from_request(req, state).await {
Some(value)
} else {
None
};

Ok(value)
}
}
2 changes: 0 additions & 2 deletions kitsune/src/http/extractor/signed_activity.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::state::Zustand;
use async_trait::async_trait;
use axum::{
body::Body,
extract::{FromRequest, OriginalUri},
Expand All @@ -23,7 +22,6 @@ use scoped_futures::ScopedFutureExt;
/// but not that the activity matches the object, so beware of that.
pub struct SignedActivity(pub Account, pub Activity);

#[async_trait]
impl FromRequest<Zustand, Body> for SignedActivity {
type Rejection = Response;

Expand Down
Loading

0 comments on commit ff17d20

Please sign in to comment.