gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: updating instance token using ma


From: gnunet
Subject: [taler-merchant] branch master updated: updating instance token using management API
Date: Thu, 21 Jul 2022 18:30:02 +0200

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

sebasjm pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 41cb0eee updating instance token using management API
41cb0eee is described below

commit 41cb0eeea7a6ca9eab617d061c9a9bc3ead162b7
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Thu Jul 21 11:58:53 2022 -0300

    updating instance token using management API
---
 src/testing/test_merchant_instance_auth.sh | 37 ++++++++++++++++++++++++++++--
 1 file changed, 35 insertions(+), 2 deletions(-)

diff --git a/src/testing/test_merchant_instance_auth.sh 
b/src/testing/test_merchant_instance_auth.sh
index b918352b..7dec5de9 100755
--- a/src/testing/test_merchant_instance_auth.sh
+++ b/src/testing/test_merchant_instance_auth.sh
@@ -59,7 +59,7 @@ do
 done
 
 echo -n "Creating order to test auth is ok..."
-STATUS=$(curl -v -H "Content-Type: application/json" -X POST \
+STATUS=$(curl -H "Content-Type: application/json" -X POST \
     'http://localhost:9966/instances/default/private/orders' \
     -H 'Authorization: Bearer secret-token:'$NEW_SECRET \
     -d '{"order":{"amount":"TESTKUDOS:1","summary":"payme"}}' \
@@ -86,6 +86,39 @@ fi
 
 PAY_URL=`jq -e -r .taler_pay_uri < $LAST_RESPONSE`
 
-echo OK order $ORDER_ID with $TOKEN can be paid using $PAY_URL
+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 \
+    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)
+
+if [ "$STATUS" != "204" ]
+then
+    echo 'should respond ok, instance created. got:' $STATUS
+    exit 1
+fi
+
+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 \
+    http://localhost:9966/management/instances/second/auth \
+    -d '{"method":"token","token":"secret-token:new_one"}' \
+    -w "%{http_code}" -s -o /dev/null)
+
+if [ "$STATUS" != "204" ]
+then
+    echo 'should respond ok, instance auth token changed. got:' $STATUS
+    exit 1
+fi
+
+echo " OK"
+
 
 exit 0

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