commit f936cc56585d55f73a63d598b437de3e91205cdd
parent 8613b596000e80c18addd174b84ee518261b0009
Author: Christian Grothoff <christian@grothoff.org>
Date: Mon, 2 Mar 2026 17:23:34 +0100
add new wire_transfer_gateway option
Diffstat:
3 files changed, 35 insertions(+), 66 deletions(-)
diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c
@@ -101,12 +101,6 @@
#define WARN_LATENCY GNUNET_TIME_relative_multiply ( \
GNUNET_TIME_UNIT_MILLISECONDS, 500)
-/**
- * Are clients allowed to request /keys for times other than the
- * current time? Allowing this could be abused in a DoS-attack
- * as building new /keys responses is expensive. Should only be
- * enabled for testcases, development and test systems.
- */
int TEH_allow_keys_timetravel;
/**
@@ -119,12 +113,8 @@ static int allow_address_reuse;
*/
const struct GNUNET_CONFIGURATION_Handle *TEH_cfg;
-/**
- * Configuration of age restriction
- *
- * Set after loading the library, enabled in database event handler.
- */
bool TEH_age_restriction_enabled = false;
+
struct TALER_AgeRestrictionConfig TEH_age_restriction_config = {0};
/**
@@ -132,98 +122,45 @@ struct TALER_AgeRestrictionConfig TEH_age_restriction_config = {0};
*/
static bool have_daemons;
-/**
- * How long is caching /keys allowed at most? (global)
- */
struct GNUNET_TIME_Relative TEH_max_keys_caching;
-/**
- * How long is the delay before we close reserves?
- */
struct GNUNET_TIME_Relative TEH_reserve_closing_delay;
-/**
- * How long do we allow AML programs to run?
- */
struct GNUNET_TIME_Relative TEH_aml_program_timeout;
-/**
- * Master public key (according to the
- * configuration in the exchange directory). (global)
- */
struct TALER_MasterPublicKeyP TEH_master_public_key;
-/**
- * Key used to encrypt KYC attribute data in our database.
- */
struct TALER_AttributeEncryptionKeyP TEH_attribute_key;
-/**
- * Our DB plugin. (global)
- */
struct TALER_EXCHANGEDB_Plugin *TEH_plugin;
-/**
- * Absolute STEFAN parameter.
- */
struct TALER_Amount TEH_stefan_abs;
-/**
- * Logarithmic STEFAN parameter.
- */
struct TALER_Amount TEH_stefan_log;
-/**
- * Smallest amount that can be transferred. Used for the
- * KYC auth transfers by default.
- */
struct TALER_Amount TEH_tiny_amount;
-/**
- * Linear STEFAN parameter.
- */
float TEH_stefan_lin;
-/**
- * JSON array with hard limits for /keys response.
- */
json_t *TEH_hard_limits;
-/**
- * JSON array with zero limits for /keys response.
- */
json_t *TEH_zero_limits;
-/**
- * URL where users can discover shops accepting digital cash
- * issued by this exchange. Can be NULL.
- */
char *TEH_shopping_url;
-/**
- * URL where wallets can find an open banking gateway API to
- * initiate wire transfers to withdraw money from this exchange. Can be NULL.
- */
char *TEH_obg_url;
+char *TEH_wire_transfer_gateway;
+
/**
* Where to redirect users from "/"?
*/
static char *toplevel_redirect_url;
-/**
- * Form data to inject into any Typst form generation.
- */
json_t *TEH_global_pdf_form_data;
-/**
- * Our currency.
- */
char *TEH_currency;
-/**
- * Our base URL.
- */
char *TEH_base_url;
/**
@@ -2394,6 +2331,26 @@ exchange_serve_process_config (const char *cfg_fn)
return GNUNET_SYSERR;
}
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_string (TEH_cfg,
+ "exchange",
+ "WIRE_TRANSFER_GATEWAY_URL",
+ &TEH_wire_transfer_gateway))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_INFO,
+ "exchange",
+ "WIRE_TRANSFER_GATEWAY_URL");
+ }
+ if ( (NULL != TEH_wire_transfer_gateway) &&
+ (! TALER_is_web_url (TEH_wire_transfer_gateway)) )
+ {
+ GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
+ "exchange",
+ "WIRE_TRANSFER_GATEWAY_URL",
+ "invalid URL");
+ return GNUNET_SYSERR;
+ }
+
{
char *master_public_key_str;
diff --git a/src/exchange/taler-exchange-httpd.h b/src/exchange/taler-exchange-httpd.h
@@ -154,6 +154,14 @@ extern struct TALER_Amount TEH_tiny_amount;
extern char *TEH_shopping_url;
/**
+ * URL where wallets and merchants can request short wire transfer
+ * subjects for sending funds to the exchange without having to
+ * encode the full public key in the subject. Can be NULL if not
+ * supported/available.
+ */
+extern char *TEH_wire_transfer_gateway;
+
+/**
* URL where wallets can find an open banking gateway API to
* initiate wire transfers to withdraw money from this exchange. Can be NULL.
*/
diff --git a/src/exchange/taler-exchange-httpd_keys.c b/src/exchange/taler-exchange-httpd_keys.c
@@ -2471,6 +2471,10 @@ create_krd (struct TEH_KeyStateHandle *ksh,
"open_banking_gateway",
TEH_obg_url)),
GNUNET_JSON_pack_allow_null (
+ GNUNET_JSON_pack_string (
+ "wire_transfer_gateway",
+ TEH_wire_transfer_gateway)),
+ GNUNET_JSON_pack_allow_null (
TALER_amount_is_zero (&TEH_tiny_amount)
? GNUNET_JSON_pack_string ("dummy",
NULL)