gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: fix test by adding now required


From: gnunet
Subject: [taler-merchant] branch master updated: fix test by adding now required secret-token: prefix
Date: Thu, 12 Jan 2023 17:13:26 +0100

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

grothoff pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 1037add3 fix test by adding now required secret-token: prefix
1037add3 is described below

commit 1037add35d361c5b0bf60041496f8d2a23bd1722
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Thu Jan 12 17:13:21 2023 +0100

    fix test by adding now required secret-token: prefix
---
 src/testing/test_merchant_instance_auth.sh | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/src/testing/test_merchant_instance_auth.sh 
b/src/testing/test_merchant_instance_auth.sh
index 7dec5de9..f4534b9a 100755
--- a/src/testing/test_merchant_instance_auth.sh
+++ b/src/testing/test_merchant_instance_auth.sh
@@ -17,6 +17,12 @@
 # <http://www.gnu.org/licenses/>
 #
 
+# Exit, with status code "skip" (no 'real' failure)
+function exit_skip() {
+    echo $1
+    exit 77
+}
+
 . initialize_taler_system.sh
 
 
@@ -39,7 +45,7 @@ echo " OK"
 kill $MERCHANT_HTTPD_PID
 wait $MERCHANT_HTTPD_PID
 
-NEW_SECRET=different_value
+NEW_SECRET=secret-token:different_value
 
 taler-merchant-httpd -a "${NEW_SECRET}" -c "${CONF}" -L DEBUG 2> 
taler-merchant-httpd.log &
 MERCHANT_HTTPD_PID=$!
@@ -58,10 +64,15 @@ do
     break
 done
 
+if [ "x$OK" != "x1" ]
+then 
+    exit_skip "Failed to start merchant backend"
+fi
+
 echo -n "Creating order to test auth is ok..."
 STATUS=$(curl -H "Content-Type: application/json" -X POST \
     'http://localhost:9966/instances/default/private/orders' \
-    -H 'Authorization: Bearer secret-token:'$NEW_SECRET \
+    -H 'Authorization: Bearer '$NEW_SECRET \
     -d '{"order":{"amount":"TESTKUDOS:1","summary":"payme"}}' \
     -w "%{http_code}" -s -o $LAST_RESPONSE)
 
@@ -75,7 +86,7 @@ ORDER_ID=`jq -e -r .order_id < $LAST_RESPONSE`
 TOKEN=`jq -e -r .token < $LAST_RESPONSE`
 
 STATUS=$(curl 
"http://localhost:9966/instances/default/private/orders/${ORDER_ID}"; \
-     -H 'Authorization: Bearer secret-token:'$NEW_SECRET \
+     -H 'Authorization: Bearer '$NEW_SECRET \
      -w "%{http_code}" -s -o $LAST_RESPONSE)
 
 if [ "$STATUS" != "200" ]
@@ -91,7 +102,7 @@ echo OK order $ORDER_ID with $TOKEN
 echo -n "Configuring 'second' instance ..."
 
 STATUS=$(curl -H "Content-Type: application/json" -X POST \
-    -H 'Authorization: Bearer secret-token:'$NEW_SECRET \
+    -H 'Authorization: Bearer '$NEW_SECRET \
     http://localhost:9966/management/instances \
     -d 
'{"auth":{"method":"token","token":"secret-token:second"},"payto_uris":["payto://x-taler-bank/localhost/43"],"id":"second","name":"second","address":{},"jurisdiction":{},"default_max_wire_fee":"TESTKUDOS:1",
 
"default_max_deposit_fee":"TESTKUDOS:1","default_wire_fee_amortization":1,"default_wire_transfer_delay":{"d_us"
 : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' \
     -w "%{http_code}" -s -o /dev/null)
@@ -107,7 +118,7 @@ echo "OK"
 echo -n "Updating 'second' instance token using the 'default' auth token..."
 
 STATUS=$(curl -H "Content-Type: application/json" -X POST \
-    -H 'Authorization: Bearer secret-token:'$NEW_SECRET \
+    -H 'Authorization: Bearer '$NEW_SECRET \
     http://localhost:9966/management/instances/second/auth \
     -d '{"method":"token","token":"secret-token:new_one"}' \
     -w "%{http_code}" -s -o /dev/null)

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