diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-02-02 12:20:43 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-02-02 12:20:43 +0100 |
commit | 96726fd5ab6dc067af4957c3d1826f9fd2745c95 (patch) | |
tree | 0aceccf83f16d0f1bde0b2dd0bfd41a795b9c1a0 /src/testing | |
parent | 0232c377c39611f4c476ec9464356f0ae40497d9 (diff) | |
download | merchant-96726fd5ab6dc067af4957c3d1826f9fd2745c95.tar.gz merchant-96726fd5ab6dc067af4957c3d1826f9fd2745c95.tar.bz2 merchant-96726fd5ab6dc067af4957c3d1826f9fd2745c95.zip |
extend client and testing libs to support setting authentication tokens (#6731)
Diffstat (limited to 'src/testing')
-rw-r--r-- | src/testing/test_merchant_api.c | 3 | ||||
-rw-r--r-- | src/testing/testing_api_cmd_patch_instance.c | 8 | ||||
-rw-r--r-- | src/testing/testing_api_cmd_post_instances.c | 9 |
3 files changed, 20 insertions, 0 deletions
diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c index 57241524..9a69f121 100644 --- a/src/testing/test_merchant_api.c +++ b/src/testing/test_merchant_api.c @@ -1181,6 +1181,7 @@ run (void *cls, "USD:0.5", GNUNET_TIME_UNIT_MINUTES, GNUNET_TIME_UNIT_MINUTES, + NULL, MHD_HTTP_CONFLICT), TALER_TESTING_cmd_merchant_patch_instance ("instance-patch-i1", merchant_url, @@ -1199,6 +1200,7 @@ run (void *cls, "EUR:0.5", GNUNET_TIME_UNIT_MINUTES, GNUNET_TIME_UNIT_MINUTES, + NULL, MHD_HTTP_NO_CONTENT), TALER_TESTING_cmd_merchant_get_instance2 ("instances-get-i1-2", merchant_url, @@ -1227,6 +1229,7 @@ run (void *cls, "EUR:0.5", GNUNET_TIME_UNIT_MINUTES, GNUNET_TIME_UNIT_MINUTES, + NULL, MHD_HTTP_NO_CONTENT), TALER_TESTING_cmd_merchant_get_instance2 ("instances-get-i1-3", merchant_url, diff --git a/src/testing/testing_api_cmd_patch_instance.c b/src/testing/testing_api_cmd_patch_instance.c index 3a93b543..2248c1ac 100644 --- a/src/testing/testing_api_cmd_patch_instance.c +++ b/src/testing/testing_api_cmd_patch_instance.c @@ -80,6 +80,11 @@ struct PatchInstanceState json_t *jurisdiction; /** + * Authentication token to require, can be NULL. + */ + const char *auth_token; + + /** * Wire fee to use. */ struct TALER_Amount default_max_wire_fee; @@ -177,6 +182,7 @@ patch_instance_run (void *cls, &pis->default_max_deposit_fee, pis->default_wire_transfer_delay, pis->default_pay_delay, + pis->auth_token, &patch_instance_cb, pis); GNUNET_assert (NULL != pis->iph); @@ -279,6 +285,7 @@ TALER_TESTING_cmd_merchant_patch_instance ( const char *default_max_deposit_fee, struct GNUNET_TIME_Relative default_wire_transfer_delay, struct GNUNET_TIME_Relative default_pay_delay, + const char *auth_token, unsigned int http_status) { struct PatchInstanceState *pis; @@ -305,6 +312,7 @@ TALER_TESTING_cmd_merchant_patch_instance ( &pis->default_max_deposit_fee)); pis->default_wire_transfer_delay = default_wire_transfer_delay; pis->default_pay_delay = default_pay_delay; + pis->auth_token = auth_token; { struct TALER_TESTING_Command cmd = { .cls = pis, diff --git a/src/testing/testing_api_cmd_post_instances.c b/src/testing/testing_api_cmd_post_instances.c index 17b654f2..acd623b6 100644 --- a/src/testing/testing_api_cmd_post_instances.c +++ b/src/testing/testing_api_cmd_post_instances.c @@ -80,6 +80,11 @@ struct PostInstancesState json_t *jurisdiction; /** + * Authentication token to require for this instance. + */ + const char *auth_token; + + /** * Wire fee to use. */ struct TALER_Amount default_max_wire_fee; @@ -180,6 +185,7 @@ post_instances_run (void *cls, &pis->default_max_deposit_fee, pis->default_wire_transfer_delay, pis->default_pay_delay, + pis->auth_token, &post_instances_cb, pis); GNUNET_assert (NULL != pis->iph); @@ -282,6 +288,7 @@ TALER_TESTING_cmd_merchant_post_instances2 ( const char *default_max_deposit_fee, struct GNUNET_TIME_Relative default_wire_transfer_delay, struct GNUNET_TIME_Relative default_pay_delay, + const char *auth_token, unsigned int http_status) { struct PostInstancesState *pis; @@ -308,6 +315,7 @@ TALER_TESTING_cmd_merchant_post_instances2 ( &pis->default_max_deposit_fee)); pis->default_wire_transfer_delay = default_wire_transfer_delay; pis->default_pay_delay = default_pay_delay; + pis->auth_token = auth_token; { struct TALER_TESTING_Command cmd = { .cls = pis, @@ -356,6 +364,7 @@ TALER_TESTING_cmd_merchant_post_instances (const char *label, default_max_fee_s, GNUNET_TIME_UNIT_ZERO, /* no wire transfer delay */ GNUNET_TIME_UNIT_MINUTES, + NULL, http_status); } |