summaryrefslogtreecommitdiff
path: root/src/kyclogic
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/kyclogic
parent4232c60124dcf72845160b06042389f4cfc5ce49 (diff)
downloadexchange-6c0d0dc2cc45f447c05ff50cd425fba21065fe54.tar.gz
exchange-6c0d0dc2cc45f447c05ff50cd425fba21065fe54.tar.bz2
exchange-6c0d0dc2cc45f447c05ff50cd425fba21065fe54.zip
fix oauth2 test converter
Diffstat (limited to 'src/kyclogic')
-rwxr-xr-xsrc/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh12
1 files changed, 9 insertions, 3 deletions
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