gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: fix oauth2 test converter


From: gnunet
Subject: [taler-exchange] branch master updated: fix oauth2 test converter
Date: Fri, 03 Nov 2023 23:06:24 +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 6c0d0dc2 fix oauth2 test converter
6c0d0dc2 is described below

commit 6c0d0dc2cc45f447c05ff50cd425fba21065fe54
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Nov 3 23:06:21 2023 +0100

    fix oauth2 test converter
---
 src/exchangedb/pg_get_extension_manifest.c               |  9 ++++-----
 src/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh | 12 +++++++++---
 src/testing/test_exchange_api.conf                       |  2 +-
 src/testing/test_exchange_api_age_restriction.conf       |  2 +-
 4 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/src/exchangedb/pg_get_extension_manifest.c 
b/src/exchangedb/pg_get_extension_manifest.c
index 5e95897d..c6b5948c 100644
--- a/src/exchangedb/pg_get_extension_manifest.c
+++ b/src/exchangedb/pg_get_extension_manifest.c
@@ -54,13 +54,12 @@ TEH_PG_get_extension_manifest (void *cls,
   };
 
   *manifest = NULL;
-  /* Used in #postgres_get_extension_manifest */
   PREPARE (pg,
            "get_extension_manifest",
-           "SELECT "
-           " manifest "
-           "FROM extensions"
-           "   WHERE name=$1;");
+           "SELECT"
+           " manifest"
+           " FROM extensions"
+           " WHERE name=$1;");
   return GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
                                                    "get_extension_manifest",
                                                    params,
diff --git a/src/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh 
b/src/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh
index 06b8ed1a..3f7ff793 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
diff --git a/src/testing/test_exchange_api.conf 
b/src/testing/test_exchange_api.conf
index 1fc87230..0d69773d 100644
--- a/src/testing/test_exchange_api.conf
+++ b/src/testing/test_exchange_api.conf
@@ -92,7 +92,7 @@ KYC_OAUTH2_INFO_URL = http://localhost:6666/api/user/me
 KYC_OAUTH2_CLIENT_ID = taler-exchange
 KYC_OAUTH2_CLIENT_SECRET = exchange-secret
 KYC_OAUTH2_POST_URL = http://example.com/
-KYC_OAUTH2_ATTRIBUTE_TEMPLATE = "{"full_name":"{{last_name}}, {{first_name}}"}"
+KYC_OAUTH2_CONVERTER_HELPER = taler-exchange-kyc-oauth2-test-converter.sh
 
 [kyc-legitimization-close]
 OPERATION_TYPE = CLOSE
diff --git a/src/testing/test_exchange_api_age_restriction.conf 
b/src/testing/test_exchange_api_age_restriction.conf
index cd60781d..a14d3998 100644
--- a/src/testing/test_exchange_api_age_restriction.conf
+++ b/src/testing/test_exchange_api_age_restriction.conf
@@ -78,7 +78,7 @@ KYC_OAUTH2_INFO_URL = http://localhost:6666/api/user/me
 KYC_OAUTH2_CLIENT_ID = taler-exchange
 KYC_OAUTH2_CLIENT_SECRET = exchange-secret
 KYC_OAUTH2_POST_URL = http://example.com/
-KYC_OAUTH2_ATTRIBUTE_TEMPLATE = "{"full_name":"{{last_name}}, 
{{first_name}}","birthdate":"{{birthdate}}"}"
+KYC_OAUTH2_CONVERTER_HELPER = taler-exchange-kyc-oauth2-test-converter.sh
 
 [kyc-legitimization-balance-high]
 OPERATION_TYPE = BALANCE

-- 
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]