taler-rust

GNU Taler code in Rust. Largely core banking integrations.
Log | Files | Refs | Submodules | README | LICENSE

commit 517e6d3e02180b4f9a58fc74716fa96c96c9b9fb
parent 2ffb96e46570d0bd5272e7f927f09bb07bb8f663
Author: Antoine A <>
Date:   Tue,  7 Jan 2025 16:23:46 +0100

common: update axum

Diffstat:
MCargo.lock | 30+++++++++---------------------
MCargo.toml | 2+-
Mcommon/taler-api/src/lib.rs | 6++----
Mcommon/test-utils/Cargo.toml | 2+-
4 files changed, 13 insertions(+), 27 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock @@ -76,17 +76,6 @@ dependencies = [ ] [[package]] -name = "async-trait" -version = "0.1.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] name = "atoi" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -109,13 +98,13 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "axum" -version = "0.7.9" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" +checksum = "6d6fd624c75e18b3b4c6b9caf42b1afe24437daaee904069137d8bab077be8b8" dependencies = [ - "async-trait", "axum-core", "bytes", + "form_urlencoded", "futures-util", "http 1.2.0", "http-body", @@ -143,11 +132,10 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.4.5" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +checksum = "df1362f362fd16024ae199c1970ce98f9661bf5ef94b9808fee734bc3698b733" dependencies = [ - "async-trait", "bytes", "futures-util", "http 1.2.0", @@ -164,9 +152,9 @@ dependencies = [ [[package]] name = "axum-test" -version = "16.4.1" +version = "17.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63e3a443d2608936a02a222da7b746eb412fede7225b3030b64fe9be99eab8dc" +checksum = "53f1009889890a439cbf67a4071a2593d027c65209da4faeac5582f28ca9e6c3" dependencies = [ "anyhow", "assert-json-diff", @@ -1356,9 +1344,9 @@ dependencies = [ [[package]] name = "matchit" -version = "0.7.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" [[package]] name = "md-5" diff --git a/Cargo.toml b/Cargo.toml @@ -10,7 +10,7 @@ thiserror = "2.0.4" serde_json = "1.0" serde = "1.0" tokio = { version = "1.42", features = ["macros"] } -axum = "0.7.9" +axum = "0.8.1" sqlx = { version = "0.8", default-features = false } url = { version = "2.2", features = ["serde"] } criterion = { version = "0.5" } diff --git a/common/taler-api/src/lib.rs b/common/taler-api/src/lib.rs @@ -24,7 +24,6 @@ use std::{ use auth::{auth_middleware, AuthMethod}; use axum::{ - async_trait, body::Bytes, extract::{FromRequest, Path, Query, Request, State}, http::{header, StatusCode}, @@ -61,7 +60,6 @@ pub mod subject; #[must_use] pub struct Req<T>(pub T); -#[async_trait] impl<T, S> FromRequest<S> for Req<T> where T: DeserializeOwned, @@ -169,7 +167,7 @@ where }; match serde_json::de::from_slice(&bytes) { Ok(it) => Ok(Req(it)), - Err(err) => return Err(failure(ErrorCode::GENERIC_JSON_INVALID, format!("{err}"))), + Err(err) => Err(failure(ErrorCode::GENERIC_JSON_INVALID, format!("{err}"))), } } } @@ -368,7 +366,7 @@ pub fn wire_gateway_api<I: WireGatewayImpl + 'static>(wg: Arc<I>) -> Router { ), ) .route( - "/transfers/:id", + "/transfers/{id}", get( |State(state): State<Arc<I>>, Path(id): Path<u64>| async move { match state.transfer_by_id(id).await? { diff --git a/common/test-utils/Cargo.toml b/common/test-utils/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -axum-test = "16.2" +axum-test = "17.0" axum.workspace = true tokio.workspace = true serde_json.workspace = true