gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated (9adbdbe5 -> a05943bd)


From: gnunet
Subject: [libeufin] branch master updated (9adbdbe5 -> a05943bd)
Date: Wed, 07 Jun 2023 12:13:25 +0200

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

ms pushed a change to branch master
in repository libeufin.

    from 9adbdbe5 PostFinance connection.
     new 09f8c063 /admin/add-incoming
     new a05943bd convenience scripts

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 cli/tests/add-incoming-client.sh                   |   7 ++
 cli/tests/launch_services_with_ebics.sh            | 106 +++++++++++++++++++++
 ...es.sh => launch_services_with_xlibeufinbank.sh} |   0
 nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt |  17 ++--
 4 files changed, 119 insertions(+), 11 deletions(-)
 create mode 100755 cli/tests/add-incoming-client.sh
 create mode 100755 cli/tests/launch_services_with_ebics.sh
 rename cli/tests/{launch_services.sh => launch_services_with_xlibeufinbank.sh} 
(100%)

diff --git a/cli/tests/add-incoming-client.sh b/cli/tests/add-incoming-client.sh
new file mode 100755
index 00000000..36314b74
--- /dev/null
+++ b/cli/tests/add-incoming-client.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+curl -v -s \
+  -XPOST \
+  -H "Content-Type: application/json" \
+  -d'{"amount": "MANA:3.00", "reservePub": "re:publica"}' \
+  
http://localhost:5001/facades/test-facade/taler-wire-gateway/admin/add-incoming
diff --git a/cli/tests/launch_services_with_ebics.sh 
b/cli/tests/launch_services_with_ebics.sh
new file mode 100755
index 00000000..fdd5a74d
--- /dev/null
+++ b/cli/tests/launch_services_with_ebics.sh
@@ -0,0 +1,106 @@
+#!/bin/bash
+
+# Convenience script to setup and run a Sandbox + Nexus
+# EBICS pair, in order to try CLI commands.
+set -eu
+
+function exit_cleanup()
+{
+  echo "Running exit-cleanup"
+  for n in `jobs -p`
+    do
+      kill $n 2> /dev/null || true
+    done
+    wait || true
+    echo "DONE"
+}
+
+trap "exit_cleanup" EXIT
+echo RUNNING SANDBOX-NEXUS EBICS PAIR
+jq --version &> /dev/null || (echo "'jq' command not found"; exit 77)
+curl --version &> /dev/null || (echo "'curl' command not found"; exit 77)
+
+DB_PATH=/tmp/libeufin-cli-test.sqlite3
+export LIBEUFIN_SANDBOX_DB_CONNECTION=jdbc:sqlite:$DB_PATH
+
+echo -n Delete previous data...
+rm -f $DB_PATH
+echo DONE
+echo -n Configure the default demobank with MANA...
+libeufin-sandbox config --with-signup-bonus --currency MANA default
+echo DONE
+echo -n Start the bank...
+export LIBEUFIN_SANDBOX_ADMIN_PASSWORD=foo
+libeufin-sandbox serve &> sandbox.log &
+SANDBOX_PID=$!
+echo DONE
+echo -n Wait for the bank...
+curl --max-time 2 --retry-connrefused --retry-delay 1 --retry 10 
http://localhost:5000/ &> /dev/null
+echo DONE
+echo -n Make one superuser at Nexus...
+export LIBEUFIN_NEXUS_DB_CONNECTION=jdbc:sqlite:$DB_PATH
+libeufin-nexus superuser test-user --password x
+echo DONE
+echo -n Launching Nexus...
+libeufin-nexus serve &> nexus.log &
+NEXUS_PID=$!
+echo DONE
+echo -n Waiting for Nexus...
+curl --max-time 2 --retry-connrefused --retry-delay 1 --retry 10 
http://localhost:5001/ &> /dev/null
+echo DONE
+
+echo -n "Register the 'www' Sandbox account..."
+export LIBEUFIN_SANDBOX_USERNAME=www
+export LIBEUFIN_SANDBOX_PASSWORD=foo
+libeufin-cli \
+  sandbox --sandbox-url http://localhost:5000/ \
+  demobank \
+  register
+echo DONE
+export LIBEUFIN_SANDBOX_USERNAME=admin
+export LIBEUFIN_SANDBOX_PASSWORD=foo
+echo -n "Create EBICS host at Sandbox..."
+libeufin-cli sandbox \
+  --sandbox-url http://localhost:5000 \
+  ebicshost create --host-id wwwebics
+echo OK
+echo -n "Create 'www' EBICS subscriber at Sandbox..."
+libeufin-cli sandbox \
+  --sandbox-url http://localhost:5000 \
+  demobank new-ebicssubscriber --host-id wwwebics \
+  --user-id wwwebics --partner-id wwwpartner \
+  --bank-account www # that's a username _and_ a bank account name
+echo OK
+export LIBEUFIN_NEXUS_USERNAME=test-user
+export LIBEUFIN_NEXUS_PASSWORD=x
+export LIBEUFIN_NEXUS_URL=http://localhost:5001
+echo -n Creating the EBICS connection at Nexus...
+libeufin-cli connections new-ebics-connection \
+  --ebics-url "http://localhost:5000/ebicsweb"; \
+  --host-id wwwebics \
+  --partner-id wwwpartner \
+  --ebics-user-id wwwebics \
+  wwwconn
+echo DONE
+echo -n Setup EBICS keying...
+libeufin-cli connections connect wwwconn > /dev/null
+echo OK
+echo -n Download bank account name from Sandbox...
+libeufin-cli connections download-bank-accounts wwwconn
+echo OK
+echo -n Importing bank account info into Nexus...
+libeufin-cli connections import-bank-account \
+  --offered-account-id www \
+  --nexus-bank-account-id www-nexus \
+  wwwconn
+echo OK
+echo -n Create the Taler facade at Nexus...
+libeufin-cli facades \
+  new-taler-wire-gateway-facade \
+  --currency TESTKUDOS --facade-name test-facade \
+  wwwconn www-nexus
+echo OK
+echo -n "Ticking, to let statements be generated..."
+libeufin-sandbox camt053tick
+echo OK
+read -p "Press Enter to terminate..."
diff --git a/cli/tests/launch_services.sh 
b/cli/tests/launch_services_with_xlibeufinbank.sh
similarity index 100%
rename from cli/tests/launch_services.sh
rename to cli/tests/launch_services_with_xlibeufinbank.sh
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt
index 2da8bb45..5a59401a 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt
@@ -568,7 +568,7 @@ private suspend fun historyIncoming(call: ApplicationCall) {
 
 /**
  * This call proxies /admin/add/incoming to the Sandbox,
- * which is the service keeping the transactions ledger.
+ * which is the service keeping the transaction ledger.
  * The credentials are ASSUMED to be exchange/x (user/pass).
  *
  * In the future, a dedicated "add-incoming" facade should
@@ -613,16 +613,11 @@ private suspend fun addIncoming(call: ApplicationCall) {
         )
     }
     val client = HttpClient { followRedirects = true }
-    try {
-        client.post(fromDb.first) {
-            setBody(currentBody)
-            basicAuth("exchange", "x")
-            contentType(ContentType.Application.Json)
-        }
-    } catch (e: ClientRequestException) {
-        logger.error("Proxying /admin/add/incoming to the Sandbox failed: $e")
-    } catch (e: Exception) {
-        logger.error("Could not proxy /admin/add/incoming to the Sandbox: $e")
+    client.post(fromDb.first) {
+        setBody(currentBody)
+        basicAuth("exchange", "x")
+        contentType(ContentType.Application.Json)
+        expectSuccess = true
     }
     /**
      * At this point, Sandbox booked the payment.  Now the "row_id"

-- 
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]