From 01ccbda67da39532bba24822887cd00ff15bf4e0 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 10 Nov 2023 11:38:45 +0100 Subject: add admin credentials for /admin/add/incoming, makes tests pass with latest libeufin-bank --- .../test-taler-exchange-aggregator-postgres.conf | 6 ++++++ src/testing/test-taler-exchange-wirewatch-postgres.conf | 6 ++++++ src/testing/test_bank_api.c | 6 +++--- src/testing/test_bank_api_fakebank.conf | 7 +++++++ src/testing/test_bank_api_nexus.conf | 7 +++++++ src/testing/test_exchange_api.conf | 11 +++++++++++ src/testing/test_exchange_api_age_restriction.conf | 10 ++++++++++ src/testing/test_exchange_api_keys_cherry_picking.conf | 9 +++++++++ src/testing/testing_api_misc.c | 17 +++++++++++++++++ 9 files changed, 76 insertions(+), 3 deletions(-) (limited to 'src/testing') diff --git a/src/testing/test-taler-exchange-aggregator-postgres.conf b/src/testing/test-taler-exchange-aggregator-postgres.conf index c9dcbf436..8c3ee4ba5 100644 --- a/src/testing/test-taler-exchange-aggregator-postgres.conf +++ b/src/testing/test-taler-exchange-aggregator-postgres.conf @@ -49,6 +49,12 @@ WIRE_GATEWAY_AUTH_METHOD = basic USERNAME = Exchange PASSWORD = x +[admin-accountcredentials-1] +WIRE_GATEWAY_URL = "http://localhost:8082/accounts/2/taler-wire-gateway/" +WIRE_GATEWAY_AUTH_METHOD = basic +USERNAME = Exchange +PASSWORD = x + [bank] HTTP_PORT = 8082 diff --git a/src/testing/test-taler-exchange-wirewatch-postgres.conf b/src/testing/test-taler-exchange-wirewatch-postgres.conf index 81c96e240..4f13077ac 100644 --- a/src/testing/test-taler-exchange-wirewatch-postgres.conf +++ b/src/testing/test-taler-exchange-wirewatch-postgres.conf @@ -48,6 +48,12 @@ WIRE_GATEWAY_AUTH_METHOD = basic USERNAME = Exchange PASSWORD = x +[admin-accountcredentials-1] +WIRE_GATEWAY_URL = "http://localhost:8082/accounts/2/taler-wire-gateway/" +WIRE_GATEWAY_AUTH_METHOD = basic +USERNAME = Exchange +PASSWORD = x + [bank] HTTP_PORT = 8082 diff --git a/src/testing/test_bank_api.c b/src/testing/test_bank_api.c index 0dea6026d..8cbc86bbd 100644 --- a/src/testing/test_bank_api.c +++ b/src/testing/test_bank_api.c @@ -98,7 +98,7 @@ run (void *cls, 1), TALER_TESTING_cmd_admin_add_incoming ("credit-1", "EUR:5.01", - &cred.ba, + &cred.ba_admin, cred.user42_payto), /** * This CMD doesn't care about the HTTP response code; that's @@ -108,7 +108,7 @@ run (void *cls, */ TALER_TESTING_cmd_admin_add_incoming_with_ref ("credit-1-fail", "EUR:2.01", - &cred.ba, + &cred.ba_admin, cred.user42_payto, "credit-1", -1), @@ -126,7 +126,7 @@ run (void *cls, 5), TALER_TESTING_cmd_admin_add_incoming ("credit-2", "EUR:3.21", - &cred.ba, + &cred.ba_admin, cred.user42_payto), TALER_TESTING_cmd_transfer ("debit-1", "EUR:3.22", diff --git a/src/testing/test_bank_api_fakebank.conf b/src/testing/test_bank_api_fakebank.conf index cd056c663..62fa4cd4c 100644 --- a/src/testing/test_bank_api_fakebank.conf +++ b/src/testing/test_bank_api_fakebank.conf @@ -12,3 +12,10 @@ WIRE_GATEWAY_URL = "http://localhost:8082/accounts/2/taler-wire-gateway/" WIRE_GATEWAY_AUTH_METHOD = basic USERNAME = Exchange PASSWORD = x + +[admin-accountcredentials-2] +WIRE_GATEWAY_URL = "http://localhost:8082/accounts/2/taler-wire-gateway/" +WIRE_GATEWAY_AUTH_METHOD = basic +# For now, fakebank still checks against the Exchange account... +USERNAME = Exchange +PASSWORD = x diff --git a/src/testing/test_bank_api_nexus.conf b/src/testing/test_bank_api_nexus.conf index 6fc97ee37..605c7b00e 100644 --- a/src/testing/test_bank_api_nexus.conf +++ b/src/testing/test_bank_api_nexus.conf @@ -10,6 +10,13 @@ WIRE_GATEWAY_AUTH_METHOD = basic USERNAME = exchange PASSWORD = x +[admin-accountcredentials-2] +WIRE_GATEWAY_URL = http://localhost:8082/accounts/exchange/taler-wire-gateway/ +WIRE_GATEWAY_AUTH_METHOD = basic +USERNAME = admin +# 'secret' is from taler-unified-setup.sh +PASSWORD = secret + [libeufin-bankdb-postgres] CONFIG="postgresql:///talercheck" diff --git a/src/testing/test_exchange_api.conf b/src/testing/test_exchange_api.conf index 0d69773d5..45c1fa89a 100644 --- a/src/testing/test_exchange_api.conf +++ b/src/testing/test_exchange_api.conf @@ -68,6 +68,10 @@ ENABLE_CREDIT = YES WIRE_GATEWAY_AUTH_METHOD = none WIRE_GATEWAY_URL = "http://localhost:8082/accounts/2/taler-wire-gateway/" +[admin-accountcredentials-1] +WIRE_GATEWAY_AUTH_METHOD = none +WIRE_GATEWAY_URL = "http://localhost:8082/accounts/2/taler-wire-gateway/" + [exchange-account-2] PAYTO_URI = "payto://x-taler-bank/localhost/2?receiver-name=2" ENABLE_DEBIT = YES @@ -79,6 +83,13 @@ USERNAME = Exchange PASSWORD = x WIRE_GATEWAY_URL = "http://localhost:8082/accounts/2/taler-wire-gateway/" +[admin-accountcredentials-2] +WIRE_GATEWAY_AUTH_METHOD = basic +# For now, fakebank still checks against the Exchange account... +USERNAME = Exchange +PASSWORD = x +WIRE_GATEWAY_URL = "http://localhost:8082/accounts/2/taler-wire-gateway/" + [kyc-provider-test-oauth2] COST = 0 diff --git a/src/testing/test_exchange_api_age_restriction.conf b/src/testing/test_exchange_api_age_restriction.conf index a14d39989..1345fcb1a 100644 --- a/src/testing/test_exchange_api_age_restriction.conf +++ b/src/testing/test_exchange_api_age_restriction.conf @@ -54,6 +54,10 @@ ENABLE_CREDIT = YES WIRE_GATEWAY_AUTH_METHOD = none WIRE_GATEWAY_URL = "http://localhost:8082/accounts/42/taler-wire-gateway/" +[admin-accountcredentials-1] +WIRE_GATEWAY_AUTH_METHOD = none +WIRE_GATEWAY_URL = "http://localhost:8082/accounts/42/taler-wire-gateway/" + [exchange-account-2] PAYTO_URI = "payto://x-taler-bank/localhost/2?receiver-name=2" ENABLE_DEBIT = YES @@ -65,6 +69,12 @@ USERNAME = Exchange PASSWORD = x WIRE_GATEWAY_URL = "http://localhost:8082/accounts/2/taler-wire-gateway/" +[admin-accountcredentials-2] +WIRE_GATEWAY_AUTH_METHOD = basic +USERNAME = Exchange +PASSWORD = x +WIRE_GATEWAY_URL = "http://localhost:8082/accounts/2/taler-wire-gateway/" + [kyc-provider-test-oauth2] COST = 0 diff --git a/src/testing/test_exchange_api_keys_cherry_picking.conf b/src/testing/test_exchange_api_keys_cherry_picking.conf index 56951c16c..142242424 100644 --- a/src/testing/test_exchange_api_keys_cherry_picking.conf +++ b/src/testing/test_exchange_api_keys_cherry_picking.conf @@ -34,6 +34,9 @@ ENABLE_CREDIT = YES [exchange-accountcredentials-1] WIRE_GATEWAY_URL = "http://localhost:9082/accounts/42/taler-wire-gateway/" +[admin-accountcredentials-1] +WIRE_GATEWAY_URL = "http://localhost:9082/accounts/42/taler-wire-gateway/" + [exchange-account-2] PAYTO_URI = "payto://x-taler-bank/localhost/2?receiver-name=2" ENABLE_DEBIT = YES @@ -45,5 +48,11 @@ WIRE_GATEWAY_AUTH_METHOD = basic USERNAME = Exchange PASSWORD = x +[admin-accountcredentials-2] +WIRE_GATEWAY_URL = "http://localhost:9082/accounts/2/taler-wire-gateway/" +WIRE_GATEWAY_AUTH_METHOD = basic +USERNAME = Exchange +PASSWORD = x + [bank] HTTP_PORT=8082 diff --git a/src/testing/testing_api_misc.c b/src/testing/testing_api_misc.c index 665402fdd..80ff0b6c8 100644 --- a/src/testing/testing_api_misc.c +++ b/src/testing/testing_api_misc.c @@ -118,6 +118,23 @@ TALER_TESTING_get_credentials ( } GNUNET_free (csn); } + { + char *csn; + + GNUNET_asprintf (&csn, + "admin-accountcredentials-%s", + &exchange_account_section[strlen ("exchange-account-")]); + if (GNUNET_OK != + TALER_BANK_auth_parse_cfg (ua->cfg, + csn, + &ua->ba_admin)) + { + GNUNET_break (0); + GNUNET_free (csn); + return GNUNET_SYSERR; + } + GNUNET_free (csn); + } if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (ua->cfg, "exchange", -- cgit v1.2.3