summaryrefslogtreecommitdiff
path: root/src/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-11-03 14:44:25 +0100
committerChristian Grothoff <christian@grothoff.org>2023-11-03 14:44:25 +0100
commitee57a5f9c481555d0462012439a99778a2dbcbcb (patch)
tree223b26d17fdeecc19194ca661ac1b15fcf067f36 /src/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh
parent082728f839e909453b60ba76396a9ae30f86a58f (diff)
downloadexchange-ee57a5f9c481555d0462012439a99778a2dbcbcb.tar.gz
exchange-ee57a5f9c481555d0462012439a99778a2dbcbcb.tar.bz2
exchange-ee57a5f9c481555d0462012439a99778a2dbcbcb.zip
add external converter logic for oauth2 plugin
Diffstat (limited to 'src/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh')
-rwxr-xr-xsrc/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh b/src/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh
new file mode 100755
index 000000000..06b8ed1ab
--- /dev/null
+++ b/src/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+# This file is in the public domain.
+#
+# This code converts (some of) the JSON output from
+# Challenger into the GNU Taler
+# specific KYC attribute data (again in JSON format).
+#
+
+# Die if anything goes wrong.
+set -eu
+
+
+# First, extract everything from stdin.
+J=$(jq '{"first":.first_name,"last".last_name"}')
+
+# Next, combine some fields into larger values.
+FULLNAME=$(echo "$J" | jq -r '[.first,.last]|join(" ")')
+
+jq \
+ --arg full_name "${FULLNAME}" \
+ '{$full_name}'
+
+exit 0