taler-rust

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

commit 463d24d76e4a0ed5369e30b3ebd9de269f83b69c
parent 14d99474e131e33f86cbe1ead7ce68bd9f33c07a
Author: Antoine A <>
Date:   Thu, 24 Sep 2026 11:56:43 +0200

common: fixes

Diffstat:
Mcommon/http-client/src/builder.rs | 8++++----
Mcommon/http-client/src/lib.rs | 2+-
Mcommon/taler-api/db/versioning.sql | 5-----
Mcommon/taler-common/db/versioning.sql | 5-----
Mdebian/rules | 2+-
5 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/common/http-client/src/builder.rs b/common/http-client/src/builder.rs @@ -23,7 +23,7 @@ use http::{ HeaderMap, HeaderName, HeaderValue, StatusCode, header::{self}, }; -use http_body_util::{BodyDataStream, BodyExt, Full}; +use http_body_util::{BodyDataStream, BodyExt, Full, Limited}; use hyper::{Method, body::Bytes}; use serde::{Serialize, de::DeserializeOwned}; use taler_common::encoding::base64; @@ -267,12 +267,12 @@ impl Res { } async fn full_body(self) -> Result<Bytes, ClientErr> { - // TODO body size limit ? - self.body + // Max 1 mb + Limited::new(self.body, 1 * 1024 * 1024) .collect() .await .map(|it| it.to_bytes()) - .map_err(|e| ClientErr::ResTransport(e.into())) + .map_err(|e| ClientErr::ResTransport(e.to_string())) } /** Parse request body into a JSON type */ diff --git a/common/http-client/src/lib.rs b/common/http-client/src/lib.rs @@ -55,7 +55,7 @@ pub enum ClientErr { #[error("response headers: {0}")] Headers(#[from] HeaderError), #[error("response: {0}")] - ResTransport(FmtSource<hyper::Error>), + ResTransport(String), } pub fn client() -> Client { diff --git a/common/taler-api/db/versioning.sql b/common/taler-api/db/versioning.sql @@ -144,9 +144,6 @@ -- If ```current_user``` is not listed as one of arguments - function will raise -- exception and break the transaction. -BEGIN; - - -- This file adds versioning support to database it will be loaded to. -- It requires that PL/pgSQL is already loaded - will raise exception otherwise. -- All versioning "stuff" (tables, functions) is in "_v" schema. @@ -290,5 +287,3 @@ BEGIN END; $$ language plpgsql; COMMENT ON FUNCTION _v.assert_user_is_one_of(TEXT[]) IS 'Function that can be used to make sure that patch is being applied by one of defined users.'; - -COMMIT; diff --git a/common/taler-common/db/versioning.sql b/common/taler-common/db/versioning.sql @@ -144,9 +144,6 @@ -- If ```current_user``` is not listed as one of arguments - function will raise -- exception and break the transaction. -BEGIN; - - -- This file adds versioning support to database it will be loaded to. -- It requires that PL/pgSQL is already loaded - will raise exception otherwise. -- All versioning "stuff" (tables, functions) is in "_v" schema. @@ -290,5 +287,3 @@ BEGIN END; $$ language plpgsql; COMMENT ON FUNCTION _v.assert_user_is_one_of(TEXT[]) IS 'Function that can be used to make sure that patch is being applied by one of defined users.'; - -COMMIT; diff --git a/debian/rules b/debian/rules @@ -32,4 +32,4 @@ override_dh_installsystemd: dh_installsystemd --no-enable --no-start --no-stop-on-upgrade --name taler-apns-relay-httpd dh_installsystemd --no-enable --no-start --no-stop-on-upgrade --name taler-apns-relay-worker dh_installsystemd --no-enable --no-start --no-stop-on-upgrade --name taler-apns-relay - dh_installsystemd --no-start --no-enable --no-stop-on-upgrade + dh_installsystemd --no-enable --no-start --no-stop-on-upgrade