exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit c40ab311edfc574ed48284dfb82d2904697baf3f
parent b0348f83a30bbc8578c76ca9e157bf556705d3e6
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue,  4 Aug 2026 19:22:04 +0200

enable '~' in slugs, for compatibility with libeufin

Diffstat:
Msrc/bank-lib/fakebank_bank_testing_register.c | 5+++--
Msrc/include/taler/taler_util.h | 1+
Msrc/util/util.c | 5+++--
3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/bank-lib/fakebank_bank_testing_register.c b/src/bank-lib/fakebank_bank_testing_register.c @@ -23,6 +23,7 @@ */ #include "taler/taler_fakebank_lib.h" #include "taler/taler_bank_service.h" +#include "taler/taler_json_lib.h" #include "taler/taler_mhd_lib.h" #include <gnunet/gnunet_mhd_compat.h> #include <gnunet/gnunet_mhd_lib.h> @@ -76,8 +77,8 @@ TALER_FAKEBANK_bank_testing_register_ ( const char *username; const char *password; struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_string ("username", - &username), + TALER_JSON_spec_slug ("username", + &username), GNUNET_JSON_spec_string ("password", &password), GNUNET_JSON_spec_end () diff --git a/src/include/taler/taler_util.h b/src/include/taler/taler_util.h @@ -486,6 +486,7 @@ TALER_url_is_reserved (char c); * - Period: . * - Colon: : * - Equals: = (needed for base64-encoded identifiers) + * - Tilde: ~ (needed for core banking account usernames) * * Additional restrictions: * - must not be empty diff --git a/src/util/util.c b/src/util/util.c @@ -501,10 +501,11 @@ TALER_is_slug (const char *slug) case '.': case ':': case '=': + case '~': /* Note: '=' is needed as base64-encoded identifiers (such as the Paivana IDs used as merchant session IDs) may end in - padding. Note: could also allow '~' in principle, is on - safe list! */ + padding. '~' is needed as libeufin-bank allows it in account + usernames, which the core banking API exposes as slugs. */ continue; default: return false;