From 92df1cb1da3a3bee661437911356f5f47c23a41a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 13 May 2023 20:22:16 +0200 Subject: -move AML_THRESHOLD option to exchange --- src/exchange/exchange.conf | 7 +++++++ src/exchange/taler-exchange-httpd.c | 21 ++++++++++++++++++--- src/exchange/test_taler_exchange_httpd.conf | 3 ++- .../test-taler-exchange-aggregator-postgres.conf | 3 ++- .../test-taler-exchange-wirewatch-postgres.conf | 3 ++- src/testing/test_auditor_api-cs.conf | 2 +- src/testing/test_auditor_api-rsa.conf | 2 +- src/testing/test_exchange_api.conf | 3 ++- .../test_exchange_api_keys_cherry_picking.conf | 4 +++- src/testing/test_kyc_api.conf | 2 +- 10 files changed, 39 insertions(+), 11 deletions(-) diff --git a/src/exchange/exchange.conf b/src/exchange/exchange.conf index 38e5816ff..efa0287e0 100644 --- a/src/exchange/exchange.conf +++ b/src/exchange/exchange.conf @@ -6,10 +6,17 @@ # This must be adjusted to your actual installation. # MASTER_PUBLIC_KEY = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG +# Must be set to the threshold above which transactions +# are flagged for AML review. +# AML_THRESHOLD = + # Attribute encryption key for storing attributes encrypted # in the database. Should be a high-entropy nonce. ATTRIBUTE_ENCRYPTION_KEY = SET_ME_PLEASE +# Set to NO to disable tipping. +ENABLE_TIPPING = YES + # 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 index 7e11655c1..93cf9b996 100644 --- a/src/exchange/taler-exchange-httpd.c +++ b/src/exchange/taler-exchange-httpd.c @@ -153,6 +153,11 @@ struct TALER_EXCHANGEDB_Plugin *TEH_plugin; */ char *TEH_currency; +/** + * Option set to #GNUNET_YES if tipping is enabled. + */ +int TEH_enable_tipping; + /** * What is the largest amount we allow a peer to * merge into a reserve before always triggering @@ -1853,14 +1858,24 @@ exchange_serve_process_config (void) "CURRENCY"); return GNUNET_SYSERR; } + if (GNUNET_OK != + GNUNET_config_get_amount (TEH_cfg, + "exchange", + "AML_THRESHOLD", + &TEH_aml_threshold)) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Need amount in section `exchange' under `AML_THRESHOLD'\n"); + return GNUNET_SYSERR; + } if (GNUNET_OK != TALER_config_get_amount (TEH_cfg, - "taler", - "AML_THRESHOLD", + "exchange", + "ENABLE_TIPPING", &TEH_aml_threshold)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Need amount in section `TALER' under `AML_THRESHOLD'\n"); + "Need YES or NO in section `exchange' under `ENABLE_TIPPING'\n"); return GNUNET_SYSERR; } if (0 != strcmp (TEH_currency, diff --git a/src/exchange/test_taler_exchange_httpd.conf b/src/exchange/test_taler_exchange_httpd.conf index 0af23b9df..80cf62308 100644 --- a/src/exchange/test_taler_exchange_httpd.conf +++ b/src/exchange/test_taler_exchange_httpd.conf @@ -7,13 +7,14 @@ TALER_RUNTIME_DIR = ${TMPDIR:-${TMP:-/tmp}}/${USER:-}/taler-system-runtime/ # Currency supported by the exchange (can only be one) CURRENCY = EUR CURRENCY_ROUND_UNIT = EUR:0.01 -AML_THRESHOLD = EUR:1000000 [auditor] TINY_AMOUNT = EUR:0.01 [exchange] +AML_THRESHOLD = EUR:1000000 + # Directory with our terms of service. TERMS_DIR = ../../contrib/tos diff --git a/src/testing/test-taler-exchange-aggregator-postgres.conf b/src/testing/test-taler-exchange-aggregator-postgres.conf index eb641a265..7cb2fba52 100644 --- a/src/testing/test-taler-exchange-aggregator-postgres.conf +++ b/src/testing/test-taler-exchange-aggregator-postgres.conf @@ -17,9 +17,10 @@ DURATION = 14 days # Currency supported by the exchange (can only be one) CURRENCY = EUR CURRENCY_ROUND_UNIT = EUR:0.01 -AML_THRESHOLD = EUR:1000000 [exchange] +AML_THRESHOLD = EUR:1000000 + # The DB plugin to use DB = postgres diff --git a/src/testing/test-taler-exchange-wirewatch-postgres.conf b/src/testing/test-taler-exchange-wirewatch-postgres.conf index 079de5ab9..9c755c6e0 100644 --- a/src/testing/test-taler-exchange-wirewatch-postgres.conf +++ b/src/testing/test-taler-exchange-wirewatch-postgres.conf @@ -17,9 +17,10 @@ DURATION = 14 days # Currency supported by the exchange (can only be one) CURRENCY = EUR CURRENCY_ROUND_UNIT = EUR:0.01 -AML_THRESHOLD = EUR:1000000 [exchange] +AML_THRESHOLD = EUR:1000000 + # The DB plugin to use DB = postgres diff --git a/src/testing/test_auditor_api-cs.conf b/src/testing/test_auditor_api-cs.conf index 6c9a1e648..f0095e383 100644 --- a/src/testing/test_auditor_api-cs.conf +++ b/src/testing/test_auditor_api-cs.conf @@ -21,7 +21,6 @@ DURATION = 14 days # Currency supported by the exchange (can only be one) CURRENCY = EUR CURRENCY_ROUND_UNIT = EUR:0.01 -AML_THRESHOLD = EUR:1000000 [auditor] BASE_URL = "http://localhost:8083/" @@ -32,6 +31,7 @@ PUBLIC_KEY = XNYZPJJ6YPSQ4C6QPW120ACG9B5E5GBTTSYWXDMDB6G4X74TDBPG TINY_AMOUNT = EUR:0.01 [exchange] +AML_THRESHOLD = EUR:1000000 # HTTP port the exchange listens to PORT = 8081 diff --git a/src/testing/test_auditor_api-rsa.conf b/src/testing/test_auditor_api-rsa.conf index f3e66763b..dddbf0918 100644 --- a/src/testing/test_auditor_api-rsa.conf +++ b/src/testing/test_auditor_api-rsa.conf @@ -21,7 +21,6 @@ DURATION = 14 days # Currency supported by the exchange (can only be one) CURRENCY = EUR CURRENCY_ROUND_UNIT = EUR:0.01 -AML_THRESHOLD = EUR:1000000 [auditor] BASE_URL = "http://localhost:8083/" @@ -33,6 +32,7 @@ PUBLIC_KEY = XNYZPJJ6YPSQ4C6QPW120ACG9B5E5GBTTSYWXDMDB6G4X74TDBPG TINY_AMOUNT = EUR:0.01 [exchange] +AML_THRESHOLD = EUR:1000000 # HTTP port the exchange listens to PORT = 8081 diff --git a/src/testing/test_exchange_api.conf b/src/testing/test_exchange_api.conf index 2224afd91..e9d8cf6f9 100644 --- a/src/testing/test_exchange_api.conf +++ b/src/testing/test_exchange_api.conf @@ -20,7 +20,6 @@ DURATION = 14 days # Currency supported by the exchange (can only be one) CURRENCY = EUR CURRENCY_ROUND_UNIT = EUR:0.01 -AML_THRESHOLD = EUR:1000000 [auditor] BASE_URL = "http://localhost:8083/" @@ -54,6 +53,8 @@ TIMEFRAME = 1d TERMS_ETAG = 0 PRIVACY_ETAG = 0 +AML_THRESHOLD = EUR:1000000 + # HTTP port the exchange listens to PORT = 8081 diff --git a/src/testing/test_exchange_api_keys_cherry_picking.conf b/src/testing/test_exchange_api_keys_cherry_picking.conf index 55e0c625f..5637bb66f 100644 --- a/src/testing/test_exchange_api_keys_cherry_picking.conf +++ b/src/testing/test_exchange_api_keys_cherry_picking.conf @@ -17,7 +17,6 @@ TALER_CACHE_HOME = $TALER_HOME/.cache/taler/ [taler] # Currency supported by the exchange (can only be one) CURRENCY = EUR -AML_THRESHOLD = EUR:1000000 [taler-exchange-secmod-eddsa] OVERLAP_DURATION = 1 s @@ -32,6 +31,9 @@ BASE_URL = "http://localhost:8083/" PORT = 8083 [exchange] + +AML_THRESHOLD = EUR:1000000 + # HTTP port the exchange listens to PORT = 8081 diff --git a/src/testing/test_kyc_api.conf b/src/testing/test_kyc_api.conf index 1e5753208..abc7f3e4e 100644 --- a/src/testing/test_kyc_api.conf +++ b/src/testing/test_kyc_api.conf @@ -21,7 +21,6 @@ DURATION = 14 days # Currency supported by the exchange (can only be one) CURRENCY = EUR CURRENCY_ROUND_UNIT = EUR:0.01 -AML_THRESHOLD = EUR:1000000 [auditor] BASE_URL = "http://localhost:8083/" @@ -32,6 +31,7 @@ PORT = 8083 TINY_AMOUNT = EUR:0.01 [exchange] +AML_THRESHOLD = EUR:1000000 # HTTP port the exchange listens to PORT = 8081 -- cgit v1.2.3