exchange

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

commit b4e83b60834fe65c9575964b7036039b961351ef
parent 6ff121c0031c6e4fda95803f3af193a829e870fd
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Fri,  3 Oct 2025 14:38:06 +0200

add disable_direct_deposit config field for #10465

Diffstat:
Msrc/exchange/exchange.conf | 3+++
Msrc/exchange/taler-exchange-httpd.c | 26+++++++++++++++++++++++---
Msrc/exchange/taler-exchange-httpd.h | 5+++++
Msrc/exchange/taler-exchange-httpd_keys.c | 2++
Msrc/testing/test_exchange_api.conf | 1+
5 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/src/exchange/exchange.conf b/src/exchange/exchange.conf @@ -23,6 +23,9 @@ ATTRIBUTE_ENCRYPTION_KEY = SET_ME_PLEASE # Set to YES to enable AML/KYC. ENABLE_KYC = NO +# Set to YES to disable direct deposits. +DISABLE_DIRECT_DEPOSIT = NO + # How long do we allow /keys to be cached at most? The actual # limit is the minimum of this value and the first expected # significant change in /keys based on the expiration times. diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2014-2024 Taler Systems SA + Copyright (C) 2014-2025 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 @@ -250,6 +250,11 @@ char *TEH_aml_spa_dialect; int TEH_enable_kyc; /** + * Option set to #GNUNET_YES to disable direct deposits. + */ +int TEH_disable_direct_deposit; + +/** * -I command-line flag given? */ int TEH_check_invariants_flag; @@ -2127,6 +2132,19 @@ handle_mhd_request (void *cls, static enum GNUNET_GenericReturnValue exchange_serve_process_config (const char *cfg_fn) { + TEH_disable_direct_deposit + = GNUNET_CONFIGURATION_get_value_yesno ( + TEH_cfg, + "exchange", + "DISABLE_DIRECT_DEPOSIT"); + if (GNUNET_SYSERR == TEH_disable_direct_deposit) + { + GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, + "exchange", + "DISABLE_DIRECT_DEPOSIT", + "Need YES or NO\n"); + return GNUNET_SYSERR; + } TEH_enable_kyc = GNUNET_CONFIGURATION_get_value_yesno ( TEH_cfg, @@ -2134,8 +2152,10 @@ exchange_serve_process_config (const char *cfg_fn) "ENABLE_KYC"); if (GNUNET_SYSERR == TEH_enable_kyc) { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Need YES or NO in section `exchange' under `ENABLE_KYC'\n"); + GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, + "exchange", + "ENABLE_KYC", + "Need YES or NO\n"); return GNUNET_SYSERR; } if (GNUNET_OK != diff --git a/src/exchange/taler-exchange-httpd.h b/src/exchange/taler-exchange-httpd.h @@ -75,6 +75,11 @@ extern int TEH_allow_keys_timetravel; extern int TEH_enable_kyc; /** + * Option set to #GNUNET_YES to disable direct deposits. + */ +extern int TEH_disable_direct_deposit; + +/** * Main directory with revocation data. */ extern char *TEH_revocation_directory; diff --git a/src/exchange/taler-exchange-httpd_keys.c b/src/exchange/taler-exchange-httpd_keys.c @@ -2430,6 +2430,8 @@ create_krd (struct TEH_KeyStateHandle *ksh, asset_type), GNUNET_JSON_pack_bool ("kyc_enabled", GNUNET_YES == TEH_enable_kyc), + GNUNET_JSON_pack_bool ("disable_direct_deposit", + GNUNET_YES == TEH_disable_direct_deposit), GNUNET_JSON_pack_bool ("rewards_allowed", false), GNUNET_JSON_pack_data_auto ("master_public_key", diff --git a/src/testing/test_exchange_api.conf b/src/testing/test_exchange_api.conf @@ -63,6 +63,7 @@ EXPIRE_IDLE_SLEEP_INTERVAL ="1 s" STEFAN_ABS = EUR:0 STEFAN_LOG = EUR:0.005 ENABLE_KYC = YES +DISABLE_DIRECT_DEPOSIT = NO DB = postgres BASE_URL = http://localhost:8081/