gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] 02/02: add admin credentials for /admin/add/incoming, m


From: gnunet
Subject: [taler-exchange] 02/02: add admin credentials for /admin/add/incoming, makes tests pass with latest libeufin-bank
Date: Fri, 10 Nov 2023 13:48:40 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

commit 01ccbda67da39532bba24822887cd00ff15bf4e0
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Fri Nov 10 11:38:45 2023 +0100

    add admin credentials for /admin/add/incoming, makes tests pass with latest 
libeufin-bank
---
 src/include/taler_testing_lib.h                         |  6 ++++++
 .../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 +++++++++++++++++
 10 files changed, 82 insertions(+), 3 deletions(-)

diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h
index 2d002abe..a0a25832 100644
--- a/src/include/taler_testing_lib.h
+++ b/src/include/taler_testing_lib.h
@@ -125,6 +125,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.
    */
diff --git a/src/testing/test-taler-exchange-aggregator-postgres.conf 
b/src/testing/test-taler-exchange-aggregator-postgres.conf
index c9dcbf43..8c3ee4ba 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 81c96e24..4f13077a 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 0dea6026..8cbc86bb 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 cd056c66..62fa4cd4 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 6fc97ee3..605c7b00 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 0d69773d..45c1fa89 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 a14d3998..1345fcb1 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 56951c16..14224242 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 665402fd..80ff0b6c 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",

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]