summaryrefslogtreecommitdiff
path: root/src/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh
diff options
context:
space:
mode:
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