config syntax for accounts

This commit is contained in:
Florian Dold 2020-01-19 18:48:14 +01:00
parent c1dc7cc28b
commit 6074790867
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
26 changed files with 45 additions and 48 deletions

View File

@ -77,7 +77,7 @@ lookahead_provide = 4 weeks 1 day
[taler] [taler]
CURRENCY = TESTKUDOS CURRENCY = TESTKUDOS
[account-1] [exchange-account-1]
WIRE_RESPONSE = ${TALER_DATA_HOME}/exchange/account-1.json WIRE_RESPONSE = ${TALER_DATA_HOME}/exchange/account-1.json
PAYTO_URI = payto://x-taler-bank/localhost/Exchange PAYTO_URI = payto://x-taler-bank/localhost/Exchange
METHOD = x-taler-bank METHOD = x-taler-bank
@ -88,7 +88,7 @@ WIRE_GATEWAY_AUTH_METHOD = basic
USERNAME = Exchange USERNAME = Exchange
PASSWORD = x PASSWORD = x
[account-merchant] [merchant-account-merchant]
PAYTO_URI = payto://x-taler-bank/localhost/42 PAYTO_URI = payto://x-taler-bank/localhost/42
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/merchant/account-3.json WIRE_RESPONSE = ${TALER_CONFIG_HOME}/merchant/account-3.json
METHOD = x-taler-bank METHOD = x-taler-bank

View File

@ -2,7 +2,7 @@
DB = postgres DB = postgres
TINY_AMOUNT = TESTKUDOS:0.01 TINY_AMOUNT = TESTKUDOS:0.01
[account-1] [exchange-account-1]
WIRE_RESPONSE = ${TALER_DATA_HOME}/exchange/account-1.json WIRE_RESPONSE = ${TALER_DATA_HOME}/exchange/account-1.json
PAYTO_URI = payto://x-taler-bank/localhost/Exchange PAYTO_URI = payto://x-taler-bank/localhost/Exchange
METHOD = x-taler-bank METHOD = x-taler-bank

View File

@ -43,7 +43,7 @@ dir = $HOME/repos/taler/exchange/src/benchmark
[benchmark] [benchmark]
USER_PAYTO_URI = payto://x-taler-bank/localhost:8082/42 USER_PAYTO_URI = payto://x-taler-bank/localhost:8082/42
[account-2] [exchange-account-2]
# What is the payto://-URL of the exchange (to generate wire response) # What is the payto://-URL of the exchange (to generate wire response)
PAYTO_URI = "payto://x-taler-bank/localhost:8082/2" PAYTO_URI = "payto://x-taler-bank/localhost:8082/2"
# What is the bank account (with the "Taler Bank" demo system)? Must end with "/". # What is the bank account (with the "Taler Bank" demo system)? Must end with "/".

View File

@ -205,9 +205,9 @@ static void
pick_exchange_account_cb (void *cls, pick_exchange_account_cb (void *cls,
const char *section) const char *section)
{ {
if (0 == strncasecmp ("account-", if (0 == strncasecmp ("exchange-account-",
section, section,
strlen ("account-"))) strlen ("exchange-account-")))
{ {
const char **s = cls; const char **s = cls;

View File

@ -46,7 +46,7 @@ IDLE_RESERVE_EXPIRATION_TIME = 4 weeks
[exchangedb-postgres] [exchangedb-postgres]
CONFIG = "postgres:///talercheck" CONFIG = "postgres:///talercheck"
[account-1] [exchange-account-1]
PAYTO_URI = "payto://x-taler-bank/localhost:8082/3" PAYTO_URI = "payto://x-taler-bank/localhost:8082/3"
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-1.json WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-1.json
METHOD = "x-taler-bank" METHOD = "x-taler-bank"
@ -55,7 +55,7 @@ ENABLE_CREDIT = YES
TALER_BANK_AUTH_METHOD = NONE TALER_BANK_AUTH_METHOD = NONE
# Wire fees are specified by wire method, NOT by wire plugin. # Wire fees are specified by wire method
[fees-x-taler-bank] [fees-x-taler-bank]
# Fees for the forseeable future... # Fees for the forseeable future...
# If you see this after 2018, update to match the next 10 years... # If you see this after 2018, update to match the next 10 years...

View File

@ -50,9 +50,6 @@ struct FindAccountContext
* true, call the callback from the context with the * true, call the callback from the context with the
* rest of the section name. * rest of the section name.
* *
* FIXME(dold): This comment is inaccurate! Also, why
* is the prefix "account-" and not "exchange-account-"?
*
* @param cls our `struct FindEnabledWireContext` * @param cls our `struct FindEnabledWireContext`
* @param section name of a section in the configuration * @param section name of a section in the configuration
*/ */
@ -67,8 +64,8 @@ check_for_account (void *cls,
struct TALER_EXCHANGEDB_AccountInfo ai; struct TALER_EXCHANGEDB_AccountInfo ai;
if (0 != strncasecmp (section, if (0 != strncasecmp (section,
"account-", "exchange-account-",
strlen ("account-"))) strlen ("exchange-account-")))
return; return;
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (ctx->cfg, GNUNET_CONFIGURATION_get_value_string (ctx->cfg,

View File

@ -1533,7 +1533,7 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != FAILIF (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
plugin->get_latest_reserve_in_reference (plugin->cls, plugin->get_latest_reserve_in_reference (plugin->cls,
session, session,
"account-1", "exchange-account-1",
&rr)); &rr));
now = GNUNET_TIME_absolute_get (); now = GNUNET_TIME_absolute_get ();
(void) GNUNET_TIME_round_abs (&now); (void) GNUNET_TIME_round_abs (&now);
@ -1544,12 +1544,12 @@ run (void *cls)
&value, &value,
now, now,
sndr, sndr,
"account-1", "exchange-account-1",
4)); 4));
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->get_latest_reserve_in_reference (plugin->cls, plugin->get_latest_reserve_in_reference (plugin->cls,
session, session,
"account-1", "exchange-account-1",
&rr)); &rr));
FAILIF (4 != rr); FAILIF (4 != rr);
FAILIF (GNUNET_OK != FAILIF (GNUNET_OK !=
@ -1567,17 +1567,17 @@ run (void *cls)
&value, &value,
now, now,
sndr, sndr,
"account-1", "exchange-account-1",
5)); 5));
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->get_latest_reserve_in_reference (plugin->cls, plugin->get_latest_reserve_in_reference (plugin->cls,
session, session,
"account-1", "exchange-account-1",
&rr)); &rr));
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->get_latest_reserve_in_reference (plugin->cls, plugin->get_latest_reserve_in_reference (plugin->cls,
session, session,
"account-1", "exchange-account-1",
&rr)); &rr));
FAILIF (5 != rr); FAILIF (5 != rr);
FAILIF (GNUNET_OK != FAILIF (GNUNET_OK !=

View File

@ -389,7 +389,7 @@ struct TALER_EXCHANGEDB_AccountInfo
{ {
/** /**
* Section in the configuration file that specifies the * Section in the configuration file that specifies the
* account. Must start with "account-". * account. Must start with "exchange-account-".
*/ */
const char *section_name; const char *section_name;

View File

@ -54,7 +54,7 @@ IDLE_RESERVE_EXPIRATION_TIME = 4 weeks
# the legal expiration timeframe of withdrawn coins. # the legal expiration timeframe of withdrawn coins.
LEGAL_RESERVE_EXPIRATION_TIME = 7 years LEGAL_RESERVE_EXPIRATION_TIME = 7 years
[account-1] [exchange-account-1]
# What is the account URL? # What is the account URL?
PAYTO_URI = "payto://x-taler-bank/localhost/2" PAYTO_URI = "payto://x-taler-bank/localhost/2"

View File

@ -43,7 +43,7 @@ BASE_URL = "http://localhost:8083/"
# HTTP port the auditor listens to # HTTP port the auditor listens to
PORT = 8083 PORT = 8083
[account-1] [exchange-account-1]
# What is the account URL? # What is the account URL?
PAYTO_URI = "payto://x-taler-bank/localhost/2" PAYTO_URI = "payto://x-taler-bank/localhost/2"

View File

@ -673,7 +673,7 @@ main (int argc,
/* Check fakebank port is available and get configuration data. */ /* Check fakebank port is available and get configuration data. */
if (GNUNET_OK != if (GNUNET_OK !=
TALER_TESTING_prepare_fakebank (CONFIG_FILE, TALER_TESTING_prepare_fakebank (CONFIG_FILE,
"account-2", "exchange-account-2",
&bc)) &bc))
return 77; return 77;
TALER_TESTING_cleanup_files (CONFIG_FILE); TALER_TESTING_cleanup_files (CONFIG_FILE);

View File

@ -51,13 +51,13 @@ CONFIG = "postgres:///talercheck"
[auditordb-postgres] [auditordb-postgres]
CONFIG = "postgres:///talercheck" CONFIG = "postgres:///talercheck"
# Sections starting with "account-" configure the bank accounts # Sections starting with "exchange-account-" configure the bank accounts
# of the exchange. The "URL" specifies the account in # of the exchange. The "URL" specifies the account in
# payto://-format, while the WIRE_JSON specifies the # payto://-format, while the WIRE_JSON specifies the
# (possibly offline) signed version to be returned in /wire. # (possibly offline) signed version to be returned in /wire.
# WIRE_JSON is optional, as not all accounts must be # WIRE_JSON is optional, as not all accounts must be
# advertised in /wire. # advertised in /wire.
[account-1] [exchange-account-1]
# What is the URL of our account? # What is the URL of our account?
PAYTO_URI = "payto://x-taler-bank/localhost/42" PAYTO_URI = "payto://x-taler-bank/localhost/42"
WIRE_GATEWAY_URL = "http://localhost:8082/42/" WIRE_GATEWAY_URL = "http://localhost:8082/42/"
@ -73,7 +73,7 @@ HTTP_PORT = 8082
# ENABLE_CREDIT = YES # ENABLE_CREDIT = YES
[account-2] [exchange-account-2]
# What is the bank account (with the "Taler Bank" demo system)? # What is the bank account (with the "Taler Bank" demo system)?
WIRE_GATEWAY_URL = "http://localhost:8082/2/" WIRE_GATEWAY_URL = "http://localhost:8082/2/"
PAYTO_URI = "payto://x-taler-bank/localhost/2" PAYTO_URI = "payto://x-taler-bank/localhost/2"

View File

@ -137,7 +137,7 @@ main (int argc,
cfgfilename = CONFIG_FILE_FAKEBANK; cfgfilename = CONFIG_FILE_FAKEBANK;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_TESTING_prepare_fakebank (CONFIG_FILE_FAKEBANK, TALER_TESTING_prepare_fakebank (CONFIG_FILE_FAKEBANK,
"account-2", "exchange-account-2",
&bc)) &bc))
{ {
GNUNET_break (0); GNUNET_break (0);
@ -150,7 +150,7 @@ main (int argc,
cfgfilename = CONFIG_FILE_PYBANK; cfgfilename = CONFIG_FILE_PYBANK;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_TESTING_prepare_bank (CONFIG_FILE_PYBANK, TALER_TESTING_prepare_bank (CONFIG_FILE_PYBANK,
"account-2", "exchange-account-2",
&bc)) &bc))
{ {
GNUNET_break (0); GNUNET_break (0);

View File

@ -3,7 +3,7 @@
[taler] [taler]
currency = KUDOS currency = KUDOS
[account-2] [exchange-account-2]
PAYTO_URI = payto://x-taler-bank/localhost/2 PAYTO_URI = payto://x-taler-bank/localhost/2
METHOD = x-taler-bank METHOD = x-taler-bank
WIRE_GATEWAY_URL = "http://localhost:8081/2/" WIRE_GATEWAY_URL = "http://localhost:8081/2/"

View File

@ -27,8 +27,8 @@ serve = http
http_port = 8081 http_port = 8081
database = postgres:///talercheck database = postgres:///talercheck
[account-1] [exchange-account-1]
PAYTO_URI = payto://x-taler-bank/localhost:8081/1 PAYTO_URI = payto://x-taler-bank/localhost:8081/1
[account-2] [exchange-account-2]
PAYTO_URI = payto://x-taler-bank/localhost:8081/2 PAYTO_URI = payto://x-taler-bank/localhost:8081/2

View File

@ -3,7 +3,7 @@
[taler] [taler]
currency = KUDOS currency = KUDOS
[account-2] [exchange-account-2]
PAYTO_URI = payto://x-taler-bank/localhost/Exchange PAYTO_URI = payto://x-taler-bank/localhost/Exchange
METHOD = x-taler-bank METHOD = x-taler-bank
WIRE_GATEWAY_URL = "http://localhost:8081/taler-wire-gateway/Exchange/" WIRE_GATEWAY_URL = "http://localhost:8081/taler-wire-gateway/Exchange/"

View File

@ -29,11 +29,11 @@ http_port = 8081
database = postgres:///talercheck database = postgres:///talercheck
[account-1] [exchange-account-1]
PAYTO_URI = payto://x-taler-bank/localhost/1 PAYTO_URI = payto://x-taler-bank/localhost/1
[account-2] [exchange-account-2]
PAYTO_URI = payto://x-taler-bank/localhost/Exchange PAYTO_URI = payto://x-taler-bank/localhost/Exchange
METHOD = x-taler-bank METHOD = x-taler-bank
WIRE_GATEWAY_URL = "http://localhost:8888/taler-wire-gateway/Exchange/" WIRE_GATEWAY_URL = "http://localhost:8888/taler-wire-gateway/Exchange/"

View File

@ -164,7 +164,7 @@ main (int argc,
TALER_LOG_DEBUG ("Running against the Fakebank.\n"); TALER_LOG_DEBUG ("Running against the Fakebank.\n");
if (GNUNET_OK != if (GNUNET_OK !=
TALER_TESTING_prepare_fakebank (cfgfilename, TALER_TESTING_prepare_fakebank (cfgfilename,
"account-2", "exchange-account-2",
&bc)) &bc))
{ {
GNUNET_break (0); GNUNET_break (0);
@ -177,7 +177,7 @@ main (int argc,
TALER_LOG_DEBUG ("Running against the Pybank.\n"); TALER_LOG_DEBUG ("Running against the Pybank.\n");
if (GNUNET_OK != if (GNUNET_OK !=
TALER_TESTING_prepare_bank (cfgfilename, TALER_TESTING_prepare_bank (cfgfilename,
"account-2", "exchange-account-2",
&bc)) &bc))
{ {
GNUNET_break (0); GNUNET_break (0);

View File

@ -795,7 +795,7 @@ main (int argc,
/* Check fakebank port is available and get config */ /* Check fakebank port is available and get config */
if (GNUNET_OK != if (GNUNET_OK !=
TALER_TESTING_prepare_fakebank (CONFIG_FILE, TALER_TESTING_prepare_fakebank (CONFIG_FILE,
"account-2", "exchange-account-2",
&bc)) &bc))
return 77; return 77;
TALER_TESTING_cleanup_files (CONFIG_FILE); TALER_TESTING_cleanup_files (CONFIG_FILE);

View File

@ -52,13 +52,13 @@ CONFIG = "postgres:///talercheck"
[auditordb-postgres] [auditordb-postgres]
CONFIG = "postgres:///talercheck" CONFIG = "postgres:///talercheck"
# Sections starting with "account-" configure the bank accounts # Sections starting with "exchange-account-" configure the bank accounts
# of the exchange. The "URL" specifies the account in # of the exchange. The "URL" specifies the account in
# payto://-format, while the WIRE_JSON specifies the # payto://-format, while the WIRE_JSON specifies the
# (possibly offline) signed version to be returned in /wire. # (possibly offline) signed version to be returned in /wire.
# WIRE_JSON is optional, as not all accounts must be # WIRE_JSON is optional, as not all accounts must be
# advertised in /wire. # advertised in /wire.
[account-1] [exchange-account-1]
# What is the URL of our account? # What is the URL of our account?
PAYTO_URI = "payto://x-taler-bank/localhost/42" PAYTO_URI = "payto://x-taler-bank/localhost/42"
# This is the response we give out for the /wire request. It provides # This is the response we give out for the /wire request. It provides
@ -72,7 +72,7 @@ WIRE_GATEWAY_URL = "http://localhost:9081/42/"
# ENABLE_CREDIT = YES # ENABLE_CREDIT = YES
[account-2] [exchange-account-2]
# What is the bank account (with the "Taler Bank" demo system)? # What is the bank account (with the "Taler Bank" demo system)?
PAYTO_URI = "payto://x-taler-bank/localhost/2" PAYTO_URI = "payto://x-taler-bank/localhost/2"

View File

@ -65,7 +65,7 @@ CONFIG = "postgres:///talercheck"
CONFIG = "postgres:///talercheck" CONFIG = "postgres:///talercheck"
[account-1] [exchange-account-1]
# This is the response we give out for the /wire request. It provides # This is the response we give out for the /wire request. It provides
# wallets with the bank information for transfers to the exchange. # wallets with the bank information for transfers to the exchange.
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/iban.json WIRE_RESPONSE = ${TALER_CONFIG_HOME}/iban.json
@ -78,7 +78,7 @@ METHOD = "x-taler-bank"
WIRE_GATEWAY_URL = "http://localhost:9082/42/" WIRE_GATEWAY_URL = "http://localhost:9082/42/"
[account-2] [exchange-account-2]
# This is the response we give out for the /wire request. It provides # This is the response we give out for the /wire request. It provides
# wallets with the bank information for transfers to the exchange. # wallets with the bank information for transfers to the exchange.
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/x-taler-bank.json WIRE_RESPONSE = ${TALER_CONFIG_HOME}/x-taler-bank.json

View File

@ -194,7 +194,7 @@ main (int argc,
/* Check fakebank port is available and get config */ /* Check fakebank port is available and get config */
if (GNUNET_OK != if (GNUNET_OK !=
TALER_TESTING_prepare_fakebank (CONFIG_FILE, TALER_TESTING_prepare_fakebank (CONFIG_FILE,
"account-2", "exchange-account-2",
&bc)) &bc))
return 77; return 77;
TALER_TESTING_cleanup_files (CONFIG_FILE); TALER_TESTING_cleanup_files (CONFIG_FILE);

View File

@ -288,7 +288,7 @@ main (int argc,
if (GNUNET_OK != if (GNUNET_OK !=
TALER_TESTING_prepare_fakebank (CONFIG_FILE, TALER_TESTING_prepare_fakebank (CONFIG_FILE,
"account-2", "exchange-account-2",
&bc)) &bc))
return 77; return 77;

View File

@ -56,7 +56,7 @@ PORT = 8083
[auditordb-postgres] [auditordb-postgres]
CONFIG = "postgres:///talercheck" CONFIG = "postgres:///talercheck"
[account-1] [exchange-account-1]
# What is the URL of our account? # What is the URL of our account?
PAYTO_URI = "payto://x-taler-bank/localhost/42" PAYTO_URI = "payto://x-taler-bank/localhost/42"
# This is the response we give out for the /wire request. It provides # This is the response we give out for the /wire request. It provides
@ -68,7 +68,7 @@ WIRE_GATEWAY_URL = "http://localhost:9081/42/"
WIRE_GATEWAY_AUTH_METHOD = NONE WIRE_GATEWAY_AUTH_METHOD = NONE
[account-2] [exchange-account-2]
PAYTO_URI = payto://x-taler-bank/localhost/2 PAYTO_URI = payto://x-taler-bank/localhost/2
WIRE_GATEWAY_URL = "http://localhost:8082/2/" WIRE_GATEWAY_URL = "http://localhost:8082/2/"
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-2.json WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-2.json

View File

@ -492,7 +492,7 @@ main (int argc,
} }
if (GNUNET_OK != TALER_TESTING_prepare_fakebank (config_filename, if (GNUNET_OK != TALER_TESTING_prepare_fakebank (config_filename,
"account-1", "exchange-account-1",
&bc)) &bc))
{ {
TALER_LOG_WARNING ("Could not prepare the fakebank\n"); TALER_LOG_WARNING ("Could not prepare the fakebank\n");

View File

@ -168,7 +168,7 @@ main (int argc,
if (GNUNET_OK != if (GNUNET_OK !=
TALER_TESTING_prepare_fakebank (config_filename, TALER_TESTING_prepare_fakebank (config_filename,
"account-1", "exchange-account-1",
&bc)) &bc))
return 77; return 77;