gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: -fix kycaid converter


From: gnunet
Subject: [taler-exchange] branch master updated: -fix kycaid converter
Date: Sun, 12 Nov 2023 16:04:33 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 622eb624 -fix kycaid converter
622eb624 is described below

commit 622eb624b350a89918f92fc1084b67273e5e9eb4
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Nov 12 16:04:30 2023 +0100

    -fix kycaid converter
---
 src/kyclogic/taler-exchange-kyc-kycaid-converter.sh   | 19 ++++++++++++-------
 src/kyclogic/taler-exchange-kyc-oauth2-nda.sh         |  9 ++++++---
 .../taler-exchange-kyc-oauth2-test-converter.sh       | 10 ++++++----
 src/kyclogic/taler-exchange-kyc-persona-converter.sh  | 15 +++++++++------
 4 files changed, 33 insertions(+), 20 deletions(-)

diff --git a/src/kyclogic/taler-exchange-kyc-kycaid-converter.sh 
b/src/kyclogic/taler-exchange-kyc-kycaid-converter.sh
index f77ad9bf..68a1b6a0 100755
--- a/src/kyclogic/taler-exchange-kyc-kycaid-converter.sh
+++ b/src/kyclogic/taler-exchange-kyc-kycaid-converter.sh
@@ -70,16 +70,21 @@ then
 #  CITY=$(echo $J | jq -r '[.postcode,.city,."address-subdivision,.cc"]|join(" 
")')
 
   # Combine into final result for individual.
-  # FIXME: does jq tolerate 'pep = NULL' here?
-  echo "$J" | jq \
-    --arg full_name "${FULLNAME}" \
-    
'{$full_name,"birthdate":.dob,"pep":.pep,"phone":."phone","email",.email,"residences":.residence_country}'
+  echo "$J" \
+      | jq \
+            --arg full_name "${FULLNAME}" \
+            
'{$full_name,"birthdate":.dob,"pep":.pep,"phone":.phone,"email":.email,"residences":.residence_country}'
 \
+      | jq \
+            'del(..|select(.==null))'
 
 else
   # Combine into final result for business.
-  echo "$J" | jq \
-    $DOCS_RAW \
-    
"{\"company_name\":.company_name,\"phone\":.phone,\"email\":.email,\"registration_country\":.registration_country,\"documents\":[${DOCS_JSON}]}"
+    echo "$J" \
+        | jq \
+              $DOCS_RAW \
+              
"{\"company_name\":.company_name,\"phone\":.phone,\"email\":.email,\"registration_country\":.registration_country,\"documents\":[${DOCS_JSON}]}"
 \
+        | jq \
+              'del(..|select(.==null))'
 fi
 
 exit 0
diff --git a/src/kyclogic/taler-exchange-kyc-oauth2-nda.sh 
b/src/kyclogic/taler-exchange-kyc-oauth2-nda.sh
index 61c743c8..5af785f1 100755
--- a/src/kyclogic/taler-exchange-kyc-oauth2-nda.sh
+++ b/src/kyclogic/taler-exchange-kyc-oauth2-nda.sh
@@ -20,8 +20,11 @@ fi
 # Next, combine some fields into larger values.
 FULLNAME=$(echo "$J" | jq -r '[.first_name,.last_name]|join(" ")')
 
-echo "$J" | jq \
-  --arg full_name "${FULLNAME}" \
-  '{$full_name,"phone":.phone,"id":.id}'
+echo "$J" \
+    | jq \
+          --arg full_name "${FULLNAME}" \
+          '{$full_name,"phone":.phone,"id":.id}' \
+    | jq \
+          'del(..|select(.==null))'
 
 exit 0
diff --git a/src/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh 
b/src/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh
index 51ec80dc..76f9f16c 100755
--- a/src/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh
+++ b/src/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh
@@ -22,8 +22,10 @@ fi
 
 FULLNAME=$(echo "$J" | jq -r '[.first,.last]|join(" ")')
 
-echo $J | jq \
-   --arg full_name "${FULLNAME}" \
-  '{$full_name,"birthdate":.birthdate,"id":.id}'
-
+echo $J \
+    | jq \
+          --arg full_name "${FULLNAME}" \
+          '{$full_name,"birthdate":.birthdate,"id":.id}' \
+    | jq \
+          'del(..|select(.==null))'
 exit 0
diff --git a/src/kyclogic/taler-exchange-kyc-persona-converter.sh 
b/src/kyclogic/taler-exchange-kyc-persona-converter.sh
index a5d4d03a..13142d0e 100755
--- a/src/kyclogic/taler-exchange-kyc-persona-converter.sh
+++ b/src/kyclogic/taler-exchange-kyc-persona-converter.sh
@@ -44,11 +44,14 @@ else
 fi
 
 # Combine into final result.
-echo "$J" | jq \
-   --arg full_name "${FULLNAME}" \
-   --arg street "${STREET}" \
-   --arg city "${CITY}" \
-   --rawfile photo "${PHOTO_FILE}" \
-   
'{$full_name,$street,$city,"birthdate":.birthdate,"residences":.cc,"identification_number":."identification-number",$photo}'
+echo "$J" \
+    | jq \
+          --arg full_name "${FULLNAME}" \
+          --arg street "${STREET}" \
+          --arg city "${CITY}" \
+          --rawfile photo "${PHOTO_FILE}" \
+          
'{$full_name,$street,$city,"birthdate":.birthdate,"residences":.cc,"identification_number":."identification-number",$photo}'
 \
+    | jq \
+          'del(..|select(.==null))'
 
 exit 0

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]