fix test_kyc_api: adapt test logic to improved OAuth2.0 kyc API:
This commit is contained in:
parent
6231c365fd
commit
d5619de525
@ -3600,8 +3600,7 @@ struct TALER_EXCHANGE_KycProofHandle;
|
|||||||
* @param h_payto hash of payto URI identifying the target account
|
* @param h_payto hash of payto URI identifying the target account
|
||||||
* @param logic name of the KYC logic to run
|
* @param logic name of the KYC logic to run
|
||||||
* @param args additional args to pass, can be NULL
|
* @param args additional args to pass, can be NULL
|
||||||
* or a string to append to the URL. Must
|
* or a string to append to the URL. Must then begin with '&'.
|
||||||
* then begin with '/' or '?'.
|
|
||||||
* @param cb function to call with the result
|
* @param cb function to call with the result
|
||||||
* @param cb_cls closure for @a cb
|
* @param cb_cls closure for @a cb
|
||||||
* @return NULL on error
|
* @return NULL on error
|
||||||
|
@ -2535,7 +2535,6 @@ TALER_TESTING_cmd_check_kyc_get (const char *label,
|
|||||||
* @param logic_section name of the KYC provider section
|
* @param logic_section name of the KYC provider section
|
||||||
* in the exchange configuration for this proof
|
* in the exchange configuration for this proof
|
||||||
* @param code OAuth 2.0 code to use
|
* @param code OAuth 2.0 code to use
|
||||||
* @param state OAuth 2.0 state to use
|
|
||||||
* @param expected_response_code expected HTTP status
|
* @param expected_response_code expected HTTP status
|
||||||
* @return the command
|
* @return the command
|
||||||
*/
|
*/
|
||||||
@ -2545,7 +2544,6 @@ TALER_TESTING_cmd_proof_kyc_oauth2 (
|
|||||||
const char *payment_target_reference,
|
const char *payment_target_reference,
|
||||||
const char *logic_section,
|
const char *logic_section,
|
||||||
const char *code,
|
const char *code,
|
||||||
const char *state,
|
|
||||||
unsigned int expected_response_code);
|
unsigned int expected_response_code);
|
||||||
|
|
||||||
|
|
||||||
|
@ -154,8 +154,7 @@ TALER_EXCHANGE_kyc_proof (struct TALER_EXCHANGE_Handle *exchange,
|
|||||||
if (NULL == args)
|
if (NULL == args)
|
||||||
args = "";
|
args = "";
|
||||||
else
|
else
|
||||||
GNUNET_assert ( (args[0] == '?') ||
|
GNUNET_assert (args[0] == '&');
|
||||||
(args[0] == '/') );
|
|
||||||
if (GNUNET_YES !=
|
if (GNUNET_YES !=
|
||||||
TEAH_handle_is_ready (exchange))
|
TEAH_handle_is_ready (exchange))
|
||||||
{
|
{
|
||||||
@ -172,9 +171,9 @@ TALER_EXCHANGE_kyc_proof (struct TALER_EXCHANGE_Handle *exchange,
|
|||||||
sizeof (hstr));
|
sizeof (hstr));
|
||||||
*end = '\0';
|
*end = '\0';
|
||||||
GNUNET_asprintf (&arg_str,
|
GNUNET_asprintf (&arg_str,
|
||||||
"/kyc-proof/%s/%s%s",
|
"/kyc-proof/%s?state=%s%s",
|
||||||
hstr,
|
|
||||||
logic,
|
logic,
|
||||||
|
hstr,
|
||||||
args);
|
args);
|
||||||
}
|
}
|
||||||
kph = GNUNET_new (struct TALER_EXCHANGE_KycProofHandle);
|
kph = GNUNET_new (struct TALER_EXCHANGE_KycProofHandle);
|
||||||
|
@ -131,7 +131,6 @@ run (void *cls,
|
|||||||
"withdraw-coin-1-lacking-kyc",
|
"withdraw-coin-1-lacking-kyc",
|
||||||
"kyc-provider-test-oauth2",
|
"kyc-provider-test-oauth2",
|
||||||
"pass",
|
"pass",
|
||||||
"state",
|
|
||||||
MHD_HTTP_SEE_OTHER),
|
MHD_HTTP_SEE_OTHER),
|
||||||
TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-1-with-kyc",
|
TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-1-with-kyc",
|
||||||
"create-reserve-1",
|
"create-reserve-1",
|
||||||
@ -175,7 +174,6 @@ run (void *cls,
|
|||||||
"track-deposit-kyc-ready",
|
"track-deposit-kyc-ready",
|
||||||
"kyc-provider-test-oauth2",
|
"kyc-provider-test-oauth2",
|
||||||
"bad",
|
"bad",
|
||||||
"state",
|
|
||||||
MHD_HTTP_BAD_GATEWAY),
|
MHD_HTTP_BAD_GATEWAY),
|
||||||
TALER_TESTING_cmd_oauth ("start-oauth-service",
|
TALER_TESTING_cmd_oauth ("start-oauth-service",
|
||||||
6666),
|
6666),
|
||||||
@ -183,13 +181,11 @@ run (void *cls,
|
|||||||
"track-deposit-kyc-ready",
|
"track-deposit-kyc-ready",
|
||||||
"kyc-provider-test-oauth2",
|
"kyc-provider-test-oauth2",
|
||||||
"bad",
|
"bad",
|
||||||
"state",
|
|
||||||
MHD_HTTP_FORBIDDEN),
|
MHD_HTTP_FORBIDDEN),
|
||||||
TALER_TESTING_cmd_proof_kyc_oauth2 ("proof-kyc-fail",
|
TALER_TESTING_cmd_proof_kyc_oauth2 ("proof-kyc-fail",
|
||||||
"track-deposit-kyc-ready",
|
"track-deposit-kyc-ready",
|
||||||
"kyc-provider-test-oauth2",
|
"kyc-provider-test-oauth2",
|
||||||
"pass",
|
"pass",
|
||||||
"state",
|
|
||||||
MHD_HTTP_SEE_OTHER),
|
MHD_HTTP_SEE_OTHER),
|
||||||
CMD_EXEC_AGGREGATOR ("run-aggregator-after-kyc"),
|
CMD_EXEC_AGGREGATOR ("run-aggregator-after-kyc"),
|
||||||
TALER_TESTING_cmd_check_bank_transfer (
|
TALER_TESTING_cmd_check_bank_transfer (
|
||||||
@ -216,7 +212,6 @@ run (void *cls,
|
|||||||
"wallet-kyc-fail",
|
"wallet-kyc-fail",
|
||||||
"kyc-provider-test-oauth2",
|
"kyc-provider-test-oauth2",
|
||||||
"pass",
|
"pass",
|
||||||
"state",
|
|
||||||
MHD_HTTP_SEE_OTHER),
|
MHD_HTTP_SEE_OTHER),
|
||||||
TALER_TESTING_cmd_check_kyc_get ("wallet-kyc-check",
|
TALER_TESTING_cmd_check_kyc_get ("wallet-kyc-check",
|
||||||
"wallet-kyc-fail",
|
"wallet-kyc-fail",
|
||||||
@ -311,7 +306,6 @@ run (void *cls,
|
|||||||
"purse-merge-into-reserve",
|
"purse-merge-into-reserve",
|
||||||
"kyc-provider-test-oauth2",
|
"kyc-provider-test-oauth2",
|
||||||
"pass",
|
"pass",
|
||||||
"state",
|
|
||||||
MHD_HTTP_SEE_OTHER),
|
MHD_HTTP_SEE_OTHER),
|
||||||
TALER_TESTING_cmd_purse_merge (
|
TALER_TESTING_cmd_purse_merge (
|
||||||
"purse-merge-into-reserve",
|
"purse-merge-into-reserve",
|
||||||
@ -353,7 +347,6 @@ run (void *cls,
|
|||||||
"purse-create-with-reserve",
|
"purse-create-with-reserve",
|
||||||
"kyc-provider-test-oauth2",
|
"kyc-provider-test-oauth2",
|
||||||
"pass",
|
"pass",
|
||||||
"state",
|
|
||||||
MHD_HTTP_SEE_OTHER),
|
MHD_HTTP_SEE_OTHER),
|
||||||
TALER_TESTING_cmd_purse_create_with_reserve (
|
TALER_TESTING_cmd_purse_create_with_reserve (
|
||||||
"purse-create-with-reserve",
|
"purse-create-with-reserve",
|
||||||
|
@ -43,11 +43,6 @@ struct KycProofGetState
|
|||||||
*/
|
*/
|
||||||
const char *code;
|
const char *code;
|
||||||
|
|
||||||
/**
|
|
||||||
* State to pass.
|
|
||||||
*/
|
|
||||||
const char *state;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logic section name to pass to `/kyc-proof/` handler.
|
* Logic section name to pass to `/kyc-proof/` handler.
|
||||||
*/
|
*/
|
||||||
@ -158,10 +153,12 @@ proof_kyc_run (void *cls,
|
|||||||
TALER_TESTING_interpreter_fail (kps->is);
|
TALER_TESTING_interpreter_fail (kps->is);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GNUNET_asprintf (&uargs,
|
if (NULL == kps->code)
|
||||||
"?code=%s&state=%s",
|
uargs = NULL;
|
||||||
kps->code,
|
else
|
||||||
kps->state);
|
GNUNET_asprintf (&uargs,
|
||||||
|
"&code=%s",
|
||||||
|
kps->code);
|
||||||
kps->kph = TALER_EXCHANGE_kyc_proof (is->exchange,
|
kps->kph = TALER_EXCHANGE_kyc_proof (is->exchange,
|
||||||
h_payto,
|
h_payto,
|
||||||
kps->logic,
|
kps->logic,
|
||||||
@ -235,14 +232,12 @@ TALER_TESTING_cmd_proof_kyc_oauth2 (
|
|||||||
const char *payment_target_reference,
|
const char *payment_target_reference,
|
||||||
const char *logic_section,
|
const char *logic_section,
|
||||||
const char *code,
|
const char *code,
|
||||||
const char *state,
|
|
||||||
unsigned int expected_response_code)
|
unsigned int expected_response_code)
|
||||||
{
|
{
|
||||||
struct KycProofGetState *kps;
|
struct KycProofGetState *kps;
|
||||||
|
|
||||||
kps = GNUNET_new (struct KycProofGetState);
|
kps = GNUNET_new (struct KycProofGetState);
|
||||||
kps->code = code;
|
kps->code = code;
|
||||||
kps->state = state;
|
|
||||||
kps->logic = logic_section;
|
kps->logic = logic_section;
|
||||||
kps->payment_target_reference = payment_target_reference;
|
kps->payment_target_reference = payment_target_reference;
|
||||||
kps->expected_response_code = expected_response_code;
|
kps->expected_response_code = expected_response_code;
|
||||||
|
Loading…
Reference in New Issue
Block a user