diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-11-03 23:06:21 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-11-03 23:06:21 +0100 |
commit | 6c0d0dc2cc45f447c05ff50cd425fba21065fe54 (patch) | |
tree | 9b338e0b9fc76cc79cc43fdf72a09d9c4d70cb63 /src/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh | |
parent | 4232c60124dcf72845160b06042389f4cfc5ce49 (diff) | |
download | exchange-6c0d0dc2cc45f447c05ff50cd425fba21065fe54.tar.gz exchange-6c0d0dc2cc45f447c05ff50cd425fba21065fe54.tar.bz2 exchange-6c0d0dc2cc45f447c05ff50cd425fba21065fe54.zip |
fix oauth2 test converter
Diffstat (limited to 'src/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh')
-rwxr-xr-x | src/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh | 12 |
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 |