aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2023-11-10 11:38:45 +0100
committerChristian Grothoff <grothoff@gnunet.org>2023-11-10 11:38:45 +0100
commit01ccbda67da39532bba24822887cd00ff15bf4e0 (patch)
tree97ee1439c764b72420098cee8075a3bad0ac8ac5 /src
parent67f06263a370a92002540c9fd56c5c0ca646d34a (diff)
add admin credentials for /admin/add/incoming, makes tests pass with latest libeufin-bank
Diffstat (limited to 'src')
-rw-r--r--src/include/taler_testing_lib.h6
-rw-r--r--src/testing/test-taler-exchange-aggregator-postgres.conf6
-rw-r--r--src/testing/test-taler-exchange-wirewatch-postgres.conf6
-rw-r--r--src/testing/test_bank_api.c6
-rw-r--r--src/testing/test_bank_api_fakebank.conf7
-rw-r--r--src/testing/test_bank_api_nexus.conf7
-rw-r--r--src/testing/test_exchange_api.conf11
-rw-r--r--src/testing/test_exchange_api_age_restriction.conf10
-rw-r--r--src/testing/test_exchange_api_keys_cherry_picking.conf9
-rw-r--r--src/testing/testing_api_misc.c17
10 files changed, 82 insertions, 3 deletions
diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h
index 2d002abe2..a0a25832b 100644
--- a/src/include/taler_testing_lib.h
+++ b/src/include/taler_testing_lib.h
@@ -126,6 +126,12 @@ struct TALER_TESTING_Credentials
struct TALER_BANK_AuthenticationData ba;
/**
+ * Bank authentication details for the admin bank
+ * account.
+ */
+ struct TALER_BANK_AuthenticationData ba_admin;
+
+ /**
* Configuration file data.
*/
struct GNUNET_CONFIGURATION_Handle *cfg;
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",