summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-11-03 23:06:21 +0100
committerChristian Grothoff <christian@grothoff.org>2023-11-03 23:06:21 +0100
commit6c0d0dc2cc45f447c05ff50cd425fba21065fe54 (patch)
tree9b338e0b9fc76cc79cc43fdf72a09d9c4d70cb63 /src
parent4232c60124dcf72845160b06042389f4cfc5ce49 (diff)
downloadexchange-6c0d0dc2cc45f447c05ff50cd425fba21065fe54.tar.gz
exchange-6c0d0dc2cc45f447c05ff50cd425fba21065fe54.tar.bz2
exchange-6c0d0dc2cc45f447c05ff50cd425fba21065fe54.zip
fix oauth2 test converter
Diffstat (limited to 'src')
-rw-r--r--src/exchangedb/pg_get_extension_manifest.c9
-rwxr-xr-xsrc/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh12
-rw-r--r--src/testing/test_exchange_api.conf2
-rw-r--r--src/testing/test_exchange_api_age_restriction.conf2
4 files changed, 15 insertions, 10 deletions
diff --git a/src/exchangedb/pg_get_extension_manifest.c b/src/exchangedb/pg_get_extension_manifest.c
index 5e95897d3..c6b5948cf 100644
--- a/src/exchangedb/pg_get_extension_manifest.c
+++ b/src/exchangedb/pg_get_extension_manifest.c
@@ -54,13 +54,12 @@ TEH_PG_get_extension_manifest (void *cls,
};
*manifest = NULL;
- /* Used in #postgres_get_extension_manifest */
PREPARE (pg,
"get_extension_manifest",
- "SELECT "
- " manifest "
- "FROM extensions"
- " WHERE name=$1;");
+ "SELECT"
+ " manifest"
+ " FROM extensions"
+ " WHERE name=$1;");
return GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
"get_extension_manifest",
params,
diff --git a/src/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh b/src/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh
index 06b8ed1ab..3f7ff793d 100755
--- a/src/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh
+++ b/src/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh
@@ -11,13 +11,19 @@ set -eu
# First, extract everything from stdin.
-J=$(jq '{"first":.first_name,"last".last_name"}')
+J=$(jq '{"id":.data.id,"first":.data.first_name,"last":.data.last_name,"birthdate":.data.birthdate,"status":.status}')
# Next, combine some fields into larger values.
+STATUS=$(echo "$J" | jq -r '.status')
+if [ "$STATUS" != "success" ]
+then
+ return 1
+fi
+
FULLNAME=$(echo "$J" | jq -r '[.first,.last]|join(" ")')
-jq \
+echo $J | jq \
--arg full_name "${FULLNAME}" \
- '{$full_name}'
+ '{$full_name,"birthdate":.birthdate,"id":.id}'
exit 0
diff --git a/src/testing/test_exchange_api.conf b/src/testing/test_exchange_api.conf
index 1fc87230e..0d69773d5 100644
--- a/src/testing/test_exchange_api.conf
+++ b/src/testing/test_exchange_api.conf
@@ -92,7 +92,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 = "{"full_name":"{{last_name}}, {{first_name}}"}"
+KYC_OAUTH2_CONVERTER_HELPER = taler-exchange-kyc-oauth2-test-converter.sh
[kyc-legitimization-close]
OPERATION_TYPE = CLOSE
diff --git a/src/testing/test_exchange_api_age_restriction.conf b/src/testing/test_exchange_api_age_restriction.conf
index cd60781d4..a14d39989 100644
--- a/src/testing/test_exchange_api_age_restriction.conf
+++ b/src/testing/test_exchange_api_age_restriction.conf
@@ -78,7 +78,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 = "{"full_name":"{{last_name}}, {{first_name}}","birthdate":"{{birthdate}}"}"
+KYC_OAUTH2_CONVERTER_HELPER = taler-exchange-kyc-oauth2-test-converter.sh
[kyc-legitimization-balance-high]
OPERATION_TYPE = BALANCE