kych

OAuth 2.0 API for Swiyu to enable Taler integration of Swiyu for KYC (experimental)
Log | Files | Refs | README | LICENSE

commit 53d7cd990c3ee4a53598a46e696c1cb39e9bb311
parent 528615e2d4155cb56037f48deb9a72eca7cce44b
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue, 11 Aug 2026 11:22:42 +0200

logging fixes

Diffstat:
Mtaler-config/README | 23+++++++++++++++++++----
Mtaler-config/src/config.rs | 6+++++-
Mtaler-config/src/serve.rs | 15++++-----------
3 files changed, 28 insertions(+), 16 deletions(-)

diff --git a/taler-config/README b/taler-config/README @@ -7,7 +7,10 @@ taken so that KyCH reads its configuration, writes its logs and binds its listening socket exactly the way every other Taler component does. Upstream: https://git.taler.net/taler-rust.git -Vendored: commit 48c40c365ac671cbbe1ac2fb359e1a5cf7e165a3 (2026-08-04) +Vendored: commit 48c40c365ac671cbbe1ac2fb359e1a5cf7e165a3 (2026-08-04), + plus the Section::map double-wrapping fix and the map_config! + $crate fix, both of which are still unlanded upstream -- record + their commit here once they are, and drop this note. Fix bugs upstream first, then re-vendor. Local changes here are a maintenance cost paid on every sync, so the list below is meant to stay short. @@ -44,12 +47,20 @@ config.rs * The `currency`, `amount` and `payto` accessors are gone; they need `taler_common::types`. The `amount` test went with them. * The `regex` accessor is gone, so the regex crate is not a dependency. - * `map_config!` expands to `$crate::config::MapErr` rather than the - hard-coded `::taler_common::config::MapErr`, which also makes the macro - usable from inside this crate. * A `unix_mode` test was added, since KyCH is the first component where a wrong UNIXPATH_MODE is a likely operator mistake. + Two further changes here are *not* divergences but fixes carried ahead of + upstream, and will diff clean once the patches land there: + + * `Section::map` goes through `inner` rather than `value`, so a `map_config!` + error is no longer wrapped into a second `ValueErr::Invalid` that repeats + its own prefix. + * `map_config!` expands to `$crate::config::MapErr` rather than the + hard-coded `::taler_common::config::MapErr`, which also makes the macro + usable from inside its defining crate -- needed there to write a + regression test for the first fix. + Each removal is marked with a comment where the code used to be, so a diff against upstream stays readable. @@ -84,3 +95,7 @@ Notes The `#[cfg(test)] mod test` blocks came along with the code; `cargo test` from this directory runs them, and they are the fastest way to tell whether a re-vendored file still behaves. + +jiff is built with the `tz-system` feature, which upstream's workspace does not +enable. Without it `TalerFmt` cannot resolve the machine's time zone, prints a +complaint on every start and stamps every log line UTC. diff --git a/taler-config/src/config.rs b/taler-config/src/config.rs @@ -837,7 +837,11 @@ impl<'cfg, 'arg> Section<'cfg, 'arg> { option: &'arg str, transform: impl FnOnce(&'cfg str) -> Result<T, MapErr>, ) -> Value<'arg, T> { - self.value(ty, option, |v| { + // Goes through inner() rather than value(): both arms below already + // produce a finished ValueErr, and value() would wrap whatever it is + // given into a second ValueErr::Invalid, repeating the "Invalid <ty> + // option <OPTION> in section [<section>]" prefix inside its own err. + self.inner(ty, option, |v| { transform(v).map_err(|e| match e { MapErr::Invalid(keys) => { let mut buf = "expected '".to_owned(); diff --git a/taler-config/src/serve.rs b/taler-config/src/serve.rs @@ -273,26 +273,19 @@ mod test { "Missing serve option SERVE in section [test]", parse("[test]\nPORT=8080").unwrap_err() ); - // The prefix really is repeated: Section::map builds a complete - // ValueErr, then hands it to Section::value, which wraps any Display - // error into a second ValueErr::Invalid. That is an upstream bug in - // taler-common; the message is asserted as it is so that re-vendoring - // a fixed config.rs fails here instead of going unnoticed. assert_eq!( "Invalid serve option SERVE in section [test]: \ - Invalid serve option SERVE in section [test]: \ expected 'tcp', 'unix' or 'systemd' got 'http'", parse("[test]\nSERVE=http").unwrap_err() ); - // Same double wrapping as above for an option the chosen mode needs. + // An option the chosen mode needs but does not have is reported on its + // own terms, without a "SERVE is invalid" prefix in front of it. assert_eq!( - "Invalid serve option SERVE in section [test]: \ - Missing path option UNIXPATH in section [test]", + "Missing path option UNIXPATH in section [test]", parse("[test]\nSERVE=unix").unwrap_err() ); assert_eq!( - "Invalid serve option SERVE in section [test]: \ - Missing IP addr option BIND_TO in section [test]", + "Missing IP addr option BIND_TO in section [test]", parse("[test]\nSERVE=tcp\nPORT=8080").unwrap_err() ); }