diff options
| author | Ellie Huxtable <ellie@elliehuxtable.com> | 2026-03-09 15:23:15 -0700 |
|---|---|---|
| committer | Ellie Huxtable <ellie@elliehuxtable.com> | 2026-03-09 16:10:21 -0700 |
| commit | 84f1867a21ef229b9eaa671be3775fae3b69ac4b (patch) | |
| tree | 7b15ed5db03a156fe2a313e60e7e2f60cb6d561b /crates | |
| parent | chore: upgrade thiserror 1.x to 2.x to deduplicate dependency (diff) | |
| download | atuin-84f1867a21ef229b9eaa671be3775fae3b69ac4b.zip | |
chore: upgrade axum 0.7 to 0.8 to deduplicate with tonic's axum
atuin-server used axum 0.7 while tonic already pulled in axum 0.8,
resulting in both versions compiled into the binary. Migrates to
axum 0.8: path params use {param} syntax, FromRequestParts uses
native async traits (dropping async-trait dep from atuin-server).
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/atuin-server/Cargo.toml | 3 | ||||
| -rw-r--r-- | crates/atuin-server/src/router.rs | 6 |
2 files changed, 3 insertions, 6 deletions
diff --git a/crates/atuin-server/Cargo.toml b/crates/atuin-server/Cargo.toml index 9627cb7a..b7779899 100644 --- a/crates/atuin-server/Cargo.toml +++ b/crates/atuin-server/Cargo.toml @@ -32,8 +32,7 @@ serde = { workspace = true } serde_json = { workspace = true } rand = { workspace = true } tokio = { workspace = true } -async-trait = { workspace = true } -axum = "0.7" +axum = "0.8" fs-err = { workspace = true } tower = { workspace = true } tower-http = { version = "0.6", features = ["trace"] } diff --git a/crates/atuin-server/src/router.rs b/crates/atuin-server/src/router.rs index 0c41d5e6..2d679759 100644 --- a/crates/atuin-server/src/router.rs +++ b/crates/atuin-server/src/router.rs @@ -1,4 +1,3 @@ -use async_trait::async_trait; use atuin_common::api::{ATUIN_CARGO_VERSION, ATUIN_HEADER_VERSION, ErrorResponse}; use axum::{ Router, @@ -22,7 +21,6 @@ use atuin_server_database::{Database, DbError, models::User}; pub struct UserAuth(pub User); -#[async_trait] impl<DB: Send + Sync> FromRequestParts<AppState<DB>> for UserAuth where DB: Database, @@ -118,14 +116,14 @@ pub fn router<DB: Database>(database: DB, settings: Settings) -> Router { routes = routes .route("/sync/count", get(handlers::history::count)) .route("/sync/history", get(handlers::history::list)) - .route("/sync/calendar/:focus", get(handlers::history::calendar)) + .route("/sync/calendar/{focus}", get(handlers::history::calendar)) .route("/sync/status", get(handlers::status::status)) .route("/history", post(handlers::history::add)) .route("/history", delete(handlers::history::delete)); } let routes = routes - .route("/user/:username", get(handlers::user::get)) + .route("/user/{username}", get(handlers::user::get)) .route("/account", delete(handlers::user::delete)) .route("/account/password", patch(handlers::user::change_password)) .route("/register", post(handlers::user::register)) |
