diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-01-29 13:58:56 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-01-29 13:58:56 +0100 |
commit | ff202ef296527083b7b0c879bfc8363eb429b642 (patch) | |
tree | 83d281ca52b92917e6c7637760fca8eb25c04e57 /src/testing | |
parent | 99753a5d31868af36285418ed317eeef50921b67 (diff) | |
download | exchange-ff202ef296527083b7b0c879bfc8363eb429b642.tar.xz |
KYC: misc. fixes to attribute attestation logic
Diffstat (limited to 'src/testing')
-rw-r--r-- | src/testing/test_kyc_api.c | 24 | ||||
-rw-r--r-- | src/testing/test_kyc_api.conf | 1 | ||||
-rw-r--r-- | src/testing/testing_api_cmd_oauth.c | 7 | ||||
-rw-r--r-- | src/testing/testing_api_cmd_reserve_get_attestable.c | 10 |
4 files changed, 32 insertions, 10 deletions
diff --git a/src/testing/test_kyc_api.c b/src/testing/test_kyc_api.c index dc302f3a4..8de5ee7bd 100644 --- a/src/testing/test_kyc_api.c +++ b/src/testing/test_kyc_api.c @@ -23,6 +23,7 @@ */ #include "platform.h" #include "taler_util.h" +#include "taler_attributes.h" #include "taler_signatures.h" #include "taler_exchange_service.h" #include "taler_json_lib.h" @@ -91,15 +92,14 @@ static void run (void *cls, struct TALER_TESTING_Interpreter *is) { - /** - * Test withdraw. - */ struct TALER_TESTING_Command withdraw[] = { CMD_TRANSFER_TO_EXCHANGE ("create-reserve-1", "EUR:15.02"), TALER_TESTING_cmd_check_bank_admin_transfer ( "check-create-reserve-1", - "EUR:15.02", bc.user42_payto, bc.exchange_payto, + "EUR:15.02", + bc.user42_payto, + bc.exchange_payto, "create-reserve-1"), CMD_EXEC_WIREWATCH ("wirewatch-1"), TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-1-no-kyc", @@ -137,6 +137,12 @@ run (void *cls, "EUR:5", 0, /* age restriction off */ MHD_HTTP_OK), + /* Attestations above are bound to the originating *bank* account, + not to the reserve (!). Hence, they are NOT found here! */ + TALER_TESTING_cmd_reserve_get_attestable ("reserve-get-attestable", + "create-reserve-1", + MHD_HTTP_NOT_FOUND, + NULL), TALER_TESTING_cmd_end () }; struct TALER_TESTING_Command spend[] = { @@ -216,6 +222,16 @@ run (void *cls, TALER_TESTING_cmd_check_kyc_get ("wallet-kyc-check", "wallet-kyc-fail", MHD_HTTP_NO_CONTENT), + TALER_TESTING_cmd_reserve_get_attestable ("wallet-get-attestable", + "wallet-kyc-fail", + MHD_HTTP_OK, + TALER_ATTRIBUTE_FULL_NAME, + NULL), + TALER_TESTING_cmd_reserve_attest ("wallet-get-attestable", + "wallet-kyc-fail", + MHD_HTTP_OK, + TALER_ATTRIBUTE_FULL_NAME, + NULL), TALER_TESTING_cmd_end () }; diff --git a/src/testing/test_kyc_api.conf b/src/testing/test_kyc_api.conf index ba706116f..bf6f9e292 100644 --- a/src/testing/test_kyc_api.conf +++ b/src/testing/test_kyc_api.conf @@ -58,6 +58,7 @@ KYC_OAUTH2_INFO_URL = http://localhost:6666/api/user/me KYC_OAUTH2_CLIENT_ID = taler-exchange KYC_OAUTH2_CLIENT_SECRET = exchange-secret KYC_OAUTH2_POST_URL = http://example.com/ +KYC_OAUTH2_ATTRIBUTE_TEMPLATE = "{"fullname":"{{last_name}}, {{first_name}}"}" [kyc-legitimization-balance-high] OPERATION_TYPE = BALANCE diff --git a/src/testing/testing_api_cmd_oauth.c b/src/testing/testing_api_cmd_oauth.c index 045b5eefa..514b4ac8c 100644 --- a/src/testing/testing_api_cmd_oauth.c +++ b/src/testing/testing_api_cmd_oauth.c @@ -188,7 +188,12 @@ handler_cb (void *cls, "data", GNUNET_JSON_PACK ( GNUNET_JSON_pack_string ("id", - "XXXID12345678")))); + "XXXID12345678"), + GNUNET_JSON_pack_string ("first_name", + "Bob"), + GNUNET_JSON_pack_string ("last_name", + "Builder") + ))); return TALER_MHD_reply_json_steal (connection, body, MHD_HTTP_OK); diff --git a/src/testing/testing_api_cmd_reserve_get_attestable.c b/src/testing/testing_api_cmd_reserve_get_attestable.c index 29c8f6a3a..3b400a36c 100644 --- a/src/testing/testing_api_cmd_reserve_get_attestable.c +++ b/src/testing/testing_api_cmd_reserve_get_attestable.c @@ -122,23 +122,23 @@ get_attestable_run (void *cls, struct TALER_TESTING_Interpreter *is) { struct GetAttestableState *ss = cls; - const struct TALER_TESTING_Command *create_reserve; + const struct TALER_TESTING_Command *ref_reserve; const struct TALER_ReservePrivateKeyP *reserve_priv; const struct TALER_ReservePublicKeyP *reserve_pub; ss->is = is; - create_reserve + ref_reserve = TALER_TESTING_interpreter_lookup_command (is, ss->reserve_reference); - if (NULL == create_reserve) + if (NULL == ref_reserve) { GNUNET_break (0); TALER_TESTING_interpreter_fail (is); return; } if (GNUNET_OK == - TALER_TESTING_get_trait_reserve_priv (create_reserve, + TALER_TESTING_get_trait_reserve_priv (ref_reserve, &reserve_priv)) { GNUNET_CRYPTO_eddsa_key_get_public (&reserve_priv->eddsa_priv, @@ -147,7 +147,7 @@ get_attestable_run (void *cls, else { if (GNUNET_OK != - TALER_TESTING_get_trait_reserve_pub (create_reserve, + TALER_TESTING_get_trait_reserve_pub (ref_reserve, &reserve_pub)) { GNUNET_break (0); |