taler-rust

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

commit f56f65eed7b2e7d83602ddafd78f707b9e137b68
parent 14f571a7e85caf215a7e9995914026f064f488fe
Author: Antoine A <>
Date:   Fri,  4 Sep 2026 16:31:41 +0200

common: fix auth and spec compliance

Diffstat:
Mcommon/taler-api/src/auth.rs | 6+++---
Mcommon/taler-api/src/constants.rs | 2+-
Mcommon/taler-api/src/db.rs | 2+-
Mcommon/taler-common/src/api/params.rs | 2+-
4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/common/taler-api/src/auth.rs b/common/taler-api/src/auth.rs @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2024-2025 Taler Systems SA + Copyright (C) 2024-2026 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software @@ -102,7 +102,7 @@ pub async fn auth_middleware( htoken.as_bytes(), token.as_bytes(), ) - .is_ok() + .is_err() { return failure_code(ErrorCode::GENERIC_UNAUTHORIZED).into_response(); } @@ -115,7 +115,7 @@ pub async fn auth_middleware( htoken.as_bytes(), token.as_bytes(), ) - .is_ok() + .is_err() { return failure_code(ErrorCode::GENERIC_TOKEN_UNKNOWN).into_response(); } diff --git a/common/taler-api/src/constants.rs b/common/taler-api/src/constants.rs @@ -18,5 +18,5 @@ use taler_common::api::LibtoolVersion; pub const WIRE_GATEWAY_API_VERSION: LibtoolVersion = LibtoolVersion::new(5, 0, 0); pub const PREPARED_TRANSFER_API_VERSION: LibtoolVersion = LibtoolVersion::new(1, 0, 0); -pub const REVENUE_API_VERSION: LibtoolVersion = LibtoolVersion::new(1, 0, 0); +pub const REVENUE_API_VERSION: LibtoolVersion = LibtoolVersion::new(1, 1, 1); pub const MAX_BODY_LENGTH: usize = 4 * 1024; // 4kB diff --git a/common/taler-api/src/db.rs b/common/taler-api/src/db.rs @@ -185,7 +185,7 @@ pub async fn history<T: Send + Unpin>( pooling( poll, listen, - |id| params.page.offset.is_none_or(|offset| *id > offset), + |id| *id > params.page.offset.unwrap_or_default(), load, |init| !init.is_empty(), ) diff --git a/common/taler-common/src/api/params.rs b/common/taler-common/src/api/params.rs @@ -115,7 +115,7 @@ pub struct Pooling { } impl PoolingParams { - pub const MAX_TIMEOUT_MS: u64 = 60 * 60 * 10; // 1H + pub const MAX_TIMEOUT_MS: u64 = 60 * 60 * 1000; // 1H pub fn check(self) -> Result<Pooling, ParamsErr> { Self::check_custom(self, Self::MAX_TIMEOUT_MS)