merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 5b1a083c64aeb4ce5484028041026ee534fe6396
parent aff8be479312c5fa08ccfab0d10ac603fb1ee05f
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date:   Thu, 19 Jun 2025 15:28:20 +0200

fixup tests

Diffstat:
Msrc/backend/taler-merchant-httpd_helper.c | 7+------
Msrc/lib/merchant_api_post_instance_auth.c | 2+-
Msrc/lib/merchant_api_post_instances.c | 2+-
Msrc/testing/test_merchant_accounts.sh | 2+-
Msrc/testing/test_merchant_instance_auth.sh | 12++++++------
Msrc/testing/test_merchant_instance_creation.sh | 4++--
Msrc/testing/test_merchant_instance_purge.sh | 2+-
Msrc/testing/test_merchant_instance_response.sh | 4++--
8 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_helper.c b/src/backend/taler-merchant-httpd_helper.c @@ -629,7 +629,7 @@ TMH_check_auth_config (struct MHD_Connection *connection, else { *auth_password = json_string_value (pw_value); - if ((NULL != auth_password)) + if (NULL != auth_password) { if (0 == strncasecmp (RFC_8959_PREFIX, *auth_password, @@ -639,11 +639,6 @@ TMH_check_auth_config (struct MHD_Connection *connection, } auth_wellformed = true; } - else - { - auth_wellformed = false; - GNUNET_break_op (0); - } } } diff --git a/src/lib/merchant_api_post_instance_auth.c b/src/lib/merchant_api_post_instance_auth.c @@ -177,7 +177,7 @@ TALER_MERCHANT_instance_auth_post ( { req_obj = GNUNET_JSON_PACK ( GNUNET_JSON_pack_string ("method", - "password"), + "token"), GNUNET_JSON_pack_string ("password", auth_password)); } diff --git a/src/lib/merchant_api_post_instances.c b/src/lib/merchant_api_post_instances.c @@ -182,7 +182,7 @@ TALER_MERCHANT_instances_post ( { auth_obj = GNUNET_JSON_PACK ( GNUNET_JSON_pack_string ("method", - "password"), + "token"), GNUNET_JSON_pack_string ("password", auth_password)); } diff --git a/src/testing/test_merchant_accounts.sh b/src/testing/test_merchant_accounts.sh @@ -41,7 +41,7 @@ echo -n "Configuring 'admin' instance ..." >&2 STATUS=$(curl -H "Content-Type: application/json" -X POST \ http://localhost:9966/management/instances \ - -d '{"auth":{"method":"password","password":"secret-token:new_value"},"id":"admin","name":"default","user_type":"business","address":{},"jurisdiction":{},"use_stefan":true,"default_wire_transfer_delay":{"d_us" : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' \ + -d '{"auth":{"method":"token","password":"secret-token:new_value"},"id":"admin","name":"default","user_type":"business","address":{},"jurisdiction":{},"use_stefan":true,"default_wire_transfer_delay":{"d_us" : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' \ -w "%{http_code}" -s -o /dev/null) if [ "$STATUS" != "204" ] diff --git a/src/testing/test_merchant_instance_auth.sh b/src/testing/test_merchant_instance_auth.sh @@ -41,7 +41,7 @@ echo -n "Configuring 'admin' instance ..." >&2 STATUS=$(curl -H "Content-Type: application/json" -X POST \ http://localhost:9966/management/instances \ - -d '{"auth":{"method":"password","password":"new_pw"},"id":"admin","name":"default","user_type":"business","address":{},"jurisdiction":{},"use_stefan":true,"default_wire_transfer_delay":{"d_us" : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' \ + -d '{"auth":{"method":"token","password":"new_pw"},"id":"admin","name":"default","user_type":"business","address":{},"jurisdiction":{},"use_stefan":true,"default_wire_transfer_delay":{"d_us" : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' \ -w "%{http_code}" -s -o /dev/null) if [ "$STATUS" != "204" ] @@ -182,7 +182,7 @@ echo -n "Configuring 'second' instance ..." >&2 STATUS=$(curl -H "Content-Type: application/json" -X POST \ -H 'Authorization: Bearer '"$TOKEN" \ http://localhost:9966/management/instances \ - -d '{"auth":{"method":"password","password":"second"},"id":"second","name":"second","address":{},"jurisdiction":{},"use_stefan":true,"default_wire_transfer_delay":{"d_us" : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' \ + -d '{"auth":{"method":"token","password":"second"},"id":"second","name":"second","address":{},"jurisdiction":{},"use_stefan":true,"default_wire_transfer_delay":{"d_us" : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' \ -w "%{http_code}" -s -o /dev/null) if [ "$STATUS" != "204" ] @@ -197,7 +197,7 @@ echo -n "Configuring 'third' instance ..." >&2 STATUS=$(curl -H "Content-Type: application/json" -X POST \ -H 'Authorization: Bearer '"$TOKEN" \ http://localhost:9966/management/instances \ - -d '{"auth":{"method":"password","password":"third"},"id":"third","name":"third","address":{},"jurisdiction":{},"use_stefan":true,"default_wire_transfer_delay":{"d_us" : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' \ + -d '{"auth":{"method":"token","password":"third"},"id":"third","name":"third","address":{},"jurisdiction":{},"use_stefan":true,"default_wire_transfer_delay":{"d_us" : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' \ -w "%{http_code}" -s -o /dev/null) if [ "$STATUS" != "204" ] @@ -212,7 +212,7 @@ echo -n "Updating 'second' instance token using the 'new_one' auth token..." >&2 STATUS=$(curl -H "Content-Type: application/json" -X POST \ -H 'Authorization: Bearer '"$TOKEN" \ http://localhost:9966/management/instances/second/auth \ - -d '{"method":"password","password":"new_one"}' \ + -d '{"method":"token","password":"new_one"}' \ -w "%{http_code}" -s -o /dev/null) if [ "$STATUS" != "204" ] @@ -279,7 +279,7 @@ echo -n "Updating 'second' instance token using the 'second' auth token..." >&2 STATUS=$(curl -H "Content-Type: application/json" -X POST \ -H 'Authorization: Bearer '"$RWTOKEN" \ http://localhost:9966/instances/second/private/auth \ - -d '{"method":"password","password":"again"}' \ + -d '{"method":"token","password":"again"}' \ -w "%{http_code}" -s -o "$LAST_RESPONSE") if [ "$STATUS" != "204" ] @@ -295,7 +295,7 @@ echo -n "Updating 'third' instance token using the 'second' auth token..." >&2 STATUS=$(curl -H "Content-Type: application/json" -X POST \ -H 'Authorization: Bearer '"$RWTOKEN" \ http://localhost:9966/management/instances/third/auth \ - -d '{"method":"password","password":"new_one"}' \ + -d '{"method":"token","password":"new_one"}' \ -w "%{http_code}" -s -o /dev/null) if [ "$STATUS" != "401" ] diff --git a/src/testing/test_merchant_instance_creation.sh b/src/testing/test_merchant_instance_creation.sh @@ -27,7 +27,7 @@ echo -n "Configuring a merchant instance before configuring the admin instance . STATUS=$(curl -H "Content-Type: application/json" -X POST \ http://localhost:9966/management/instances \ - -d '{"auth":{"method":"password","password":"secret-token:other_secret"},"id":"first","name":"test","address":{},"jurisdiction":{},"use_stefan":true,"default_wire_transfer_delay":{"d_us" : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' \ + -d '{"auth":{"method":"token","password":"secret-token:other_secret"},"id":"first","name":"test","address":{},"jurisdiction":{},"use_stefan":true,"default_wire_transfer_delay":{"d_us" : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' \ -w "%{http_code}" -s -o /dev/null) if [ "$STATUS" != "204" ] @@ -58,7 +58,7 @@ echo -n "Configuring a second merchant instance ..." STATUS=$(curl -H "Content-Type: application/json" -X POST \ http://localhost:9966/management/instances \ - -d '{"auth":{"method":"password","password":"secret-token:other_secret"},"id":"second","name":"test","address":{},"jurisdiction":{},"use_stefan":true,"default_wire_transfer_delay":{"d_us" : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' \ + -d '{"auth":{"method":"token","password":"secret-token:other_secret"},"id":"second","name":"test","address":{},"jurisdiction":{},"use_stefan":true,"default_wire_transfer_delay":{"d_us" : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' \ -w "%{http_code}" -s -o /dev/null) if [ "$STATUS" != "401" ] diff --git a/src/testing/test_merchant_instance_purge.sh b/src/testing/test_merchant_instance_purge.sh @@ -42,7 +42,7 @@ echo -n "Configuring merchant instance ..." >&2 STATUS=$(curl -H "Content-Type: application/json" -X POST \ http://localhost:9966/management/instances \ - -d '{"auth":{"method":"password","password":"secret-token:other_secret"},"id":"test","name":"test","address":{},"jurisdiction":{},"use_stefan":true,"default_wire_transfer_delay":{"d_us" : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' \ + -d '{"auth":{"method":"token","password":"secret-token:other_secret"},"id":"test","name":"test","address":{},"jurisdiction":{},"use_stefan":true,"default_wire_transfer_delay":{"d_us" : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' \ -w "%{http_code}" -s -o /dev/null) if [ "$STATUS" != "204" ] diff --git a/src/testing/test_merchant_instance_response.sh b/src/testing/test_merchant_instance_response.sh @@ -44,7 +44,7 @@ fi STATUS=$(curl -H "Content-Type: application/json" -X POST \ http://localhost:9966/management/instances \ - -d '{"auth":{"method":"password","password":"other_secret"},"id":"admin","name":"default","user_type":"business","address":{},"jurisdiction":{},"use_stefan":true,"default_wire_transfer_delay":{"d_us" : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' \ + -d '{"auth":{"method":"token","password":"other_secret"},"id":"admin","name":"default","user_type":"business","address":{},"jurisdiction":{},"use_stefan":true,"default_wire_transfer_delay":{"d_us" : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' \ -w "%{http_code}" -s -o /dev/null) if [ "$STATUS" != "204" ] @@ -90,7 +90,7 @@ fi STATUS=$(curl -H "Content-Type: application/json" -X POST \ -H "Authorization: Bearer $TOKEN" \ http://localhost:9966/private/auth \ - -d '{"method":"password","password":"zxc"}' \ + -d '{"method":"token","password":"zxc"}' \ -w "%{http_code}" -s -o /dev/null) if [ "$STATUS" != "204" ]