commit f7c3931d2c898cfd782296aed412b3ec34937a14
parent 1bacad49058dc7fa860492a22485ae919ff226b0
Author: Florian Dold <florian@dold.me>
Date: Thu, 12 Jun 2025 22:04:25 +0200
adjust attribute names to match GANA, eliminate dead code/helper/defines
Diffstat:
10 files changed, 14 insertions(+), 173 deletions(-)
diff --git a/debian/taler-exchange.install b/debian/taler-exchange.install
@@ -10,7 +10,6 @@ usr/bin/taler-exchange-dbconfig
usr/bin/taler-exchange-dbinit
usr/bin/taler-exchange-drain
usr/bin/taler-exchange-expire
-usr/bin/taler-exchange-helper-converter-oauth2-test-full_name
usr/bin/taler-exchange-helper-measure-*
usr/bin/taler-exchange-httpd
usr/bin/taler-exchange-kyc-aml-pep-trigger.sh
diff --git a/src/include/taler_attributes.h b/src/include/taler_attributes.h
@@ -22,7 +22,8 @@
*/
/**
* @file src/include/taler_attributes.h
- * @brief GNU Taler database event types, TO BE generated via https://gana.gnunet.org/
+ * @brief GNU Taler form attribute names (gnu-taler-form-attributes),
+ * TO BE generated via https://gana.gnunet.org/
*/
#ifndef GNU_TALER_ATTRIBUTES_H
#define GNU_TALER_ATTRIBUTES_H
@@ -35,59 +36,13 @@ extern "C" {
#endif
/**
- * Legal name of the business/company.
- */
-#define TALER_ATTRIBUTE_COMPANY_NAME "company_name"
-
-/**
- * Legal country of registration of the business/company,
- * 2-letter country code using ISO 3166-2.
- */
-#define TALER_ATTRIBUTE_REGISTRATION_COUNTRY "registration_country"
-
-/**
* Full name, when known/possible using "Lastname, Firstname(s)" format,
* but "Firstname(s) Lastname" or "Firstname M. Lastname" should also be
* tolerated (as is "Name", especially if the person only has one name).
* If the person has no name, an empty string must be given.
* NULL for not collected.
*/
-#define TALER_ATTRIBUTE_FULL_NAME "full_name"
-
-/**
- * True/false indicator if the individual is a politically
- * exposed person.
- */
-#define TALER_ATTRIBUTE_PEP "pep"
-
-/**
- * Street-level address. Usually includes the street and the house number. May
- * consist of multiple lines (separated by '\n'). Identifies a house in a city. The city is not
- * part of the street.
- */
-#define TALER_ATTRIBUTE_ADDRESS_STREET "street"
-
-/**
- * City including postal code. If available, a 2-letter country-code prefixes
- * the postal code, which is before the city (e.g. "DE-42289 Wuppertal"). If
- * the country code is unknown, the "CC-" prefix is missing. If the ZIP code
- * is unknown, the hyphen is followed by a space ("DE- Wuppertal"). If only
- * the city name is known, it is prefixed by a space (" ").
- * If the city name is unknown, a space is at the end of the value.
- */
-#define TALER_ATTRIBUTE_ADDRESS_CITY "city"
-
-/**
- * Phone number (of business or individual). Should come with the "+CC"
- * prefix including the country code.
- */
-#define TALER_ATTRIBUTE_PHONE "phone"
-
-/**
- * Email address (of business or individual). Should be
- * in the format "user@hostname".
- */
-#define TALER_ATTRIBUTE_EMAIL "email"
+#define TALER_ATTRIBUTE_FULL_NAME "FULL_NAME"
/**
* Birthdate of the person, as far as known. YYYY-MM-DD, a value
@@ -98,26 +53,7 @@ extern "C" {
* some other date instead, that day may also be specified.
* NULL for not collected.
*/
-#define TALER_ATTRIBUTE_BIRTHDATE "birthdate"
-
-/**
- * Citizenship(s) of the person using 2-letter country codes ("US", "DE",
- * "FR", "IT", etc.) separated by commas if multiple citizenships are
- * confirmed ("EN,US,DE"). Note that in the latter case it is not guaranteed
- * that all nationalities were necessarily recorded. Empty string for
- * stateless persons. NULL for not collected.
- */
-#define TALER_ATTRIBUTE_NATIONALITIES "nationalities"
-
-/**
- * Residence countries(s) of the person using 2-letter country codes ("US",
- * "DE", "FR", "IT", etc.) separated by commas if multiple residences are
- * confirmed ("EN,US,DE"). Note that in the latter case it is not guaranteed
- * that all residences were necessarily recorded. Empty string for
- * international nomads. NULL for not collected.
- */
-#define TALER_ATTRIBUTE_RESIDENCES "residences"
-
+#define TALER_ATTRIBUTE_BIRTHDATE "DATE_OF_BIRTH"
#if 0 /* keep Emacsens' auto-indent happy */
{
diff --git a/src/kyclogic/Makefile.am b/src/kyclogic/Makefile.am
@@ -15,7 +15,6 @@ pkgcfg_DATA = \
kyclogic-persona.conf
bin_SCRIPTS = \
- taler-exchange-helper-converter-oauth2-test-full_name \
taler-exchange-helper-measure-challenger-email-context-check \
taler-exchange-helper-measure-challenger-postal-context-check \
taler-exchange-helper-measure-challenger-sms-context-check \
diff --git a/src/kyclogic/taler-exchange-helper-converter-oauth2-test-full_name b/src/kyclogic/taler-exchange-helper-converter-oauth2-test-full_name
@@ -1,92 +0,0 @@
-#!/bin/sh
-#
-# This file is part of TALER
-# Copyright (C) 2014-2024 Taler Systems SA
-#
-# TALER is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 3, or (at your option) any later version.
-#
-# TALER is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along with
-# TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/license>
-#
-
-# This is a converter that takes the output of an
-# OAuth2 service which is expected to yield a full_name
-# and a birthdate.
-#
-# The converter doesn't actually do anything, it
-# just restricts the output to exactly these values.
-
-
-# Hard error reporting on.
-set -eu
-
-echo "Running $0" 1>&2
-
-# Exit, with error message (hard failure)
-function exit_fail() {
- echo " FAIL: " "$@" >&2
- EXIT_STATUS=1
- exit "$EXIT_STATUS"
-}
-
-CONF="$HOME/.config/taler-exchange.conf"
-VERBOSE=0
-
-while getopts 'c:hovV' OPTION;
-do
- case "$OPTION" in
- c)
- # shellcheck disable=SC2034
- CONF="$OPTARG"
- ;;
- h)
- echo "This is a KYC measure program that freezes the account and flags it for manual investigation. This is the ultimate fallback measure."
- echo 'Supported options:'
- echo ' -a -- show required attributes'
- # shellcheck disable=SC2016
- echo ' -c $CONF -- set configuration'
- echo ' -h -- print this help'
- echo ' -i -- show required inputs'
- echo ' -r -- show required context'
- echo ' -v -- show version'
- echo ' -V -- be verbose'
- exit 0
- ;;
- o)
- # This converter produces a full name and birthdate.
- echo "full_name"
- echo "birthdate"
- exit 0
- ;;
- v)
- echo "$0 v0.0.0"
- exit 0
- ;;
- V)
- VERBOSE=1
- ;;
- ?)
- exit_fail "Unrecognized command line option"
- ;;
- esac
-done
-
-# First, check everything we expect is in stdin.
-J=$(jq -r 'def get($k):
- if has($k)
- then .[$k]
- else error("attribute missing")
- end;
- {"full_name":get("full_name"),
- "birthdate":get("birthdate")}')
-
-# Return the restricted values.
-echo "$J"
-
-exit 0
diff --git a/src/kyclogic/taler-exchange-helper-measure-test-oauth b/src/kyclogic/taler-exchange-helper-measure-test-oauth
@@ -32,10 +32,9 @@ while getopts 'ac:hirvV' OPTION;
do
case "$OPTION" in
a)
- # This AML program expects as inputs a full_name
- # and a birthdate.
- echo "full_name"
- echo "birthdate"
+ # This AML program expects the following inputs
+ echo "FULL_NAME"
+ echo "DATE_OF_BIRTH"
exit 0
;;
c)
@@ -89,8 +88,8 @@ J=$(echo "$A" | jq -r 'def get($k):
then .[$k]
else error("attribute missing")
end;
- {"full_name":get("full_name"),
- "birthdate":get("birthdate")}')
+ {"FULL_NAME":get("FULL_NAME"),
+ "DATE_OF_BIRTH":get("DATE_OF_BIRTH")}')
# Here we could use those values...
echo "$J" >> /dev/null
diff --git a/src/kyclogic/taler-exchange-kyc-oauth2-nda.sh b/src/kyclogic/taler-exchange-kyc-oauth2-nda.sh
@@ -23,7 +23,7 @@ FULLNAME=$(echo "$J" | jq -r '[.first_name,.last_name]|join(" ")')
echo "$J" \
| jq \
--arg full_name "${FULLNAME}" \
- '{$full_name,"phone":.phone,"id":.id}' \
+ '{FULL_NAME: $full_name, "phone": .phone, "id": .id}' \
| jq \
'del(..|select(.==null))'
diff --git a/src/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh b/src/kyclogic/taler-exchange-kyc-oauth2-test-converter.sh
@@ -26,7 +26,7 @@ FULLNAME=$(echo "$J" | jq -r '[.first,.last]|join(" ")')
echo "$J" \
| jq \
--arg full_name "${FULLNAME}" \
- '{$full_name,"birthdate":.birthdate,"id":.id}' \
+ '{FULL_NAME: $full_name,"DATE_OF_BIRTH":.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
@@ -50,7 +50,7 @@ echo "$J" \
--arg street "${STREET}" \
--arg city "${CITY}" \
--rawfile photo "${PHOTO_FILE}" \
- '{$full_name,$street,$city,"birthdate":.birthdate,"residences":.cc,"identification_number":."identification-number",$photo}' \
+ '{FULL_NAME: $full_name, $street, $city, DATE_OF_BIRTH: .birthdate, "residences":.cc, "identification_number": ."identification-number", $photo}' \
| jq \
'del(..|select(.==null))'
diff --git a/src/testing/test_exchange_api.conf b/src/testing/test_exchange_api.conf
@@ -237,7 +237,7 @@ FALLBACK = manual-freeze
# This check runs on oauth2
PROVIDER_ID = test-oauth2
# Outputs from this check
-OUTPUTS = full_name birthdate
+OUTPUTS = FULL_NAME DATE_OF_BIRTH
[kyc-check-test-form]
diff --git a/src/testing/test_exchange_api_age_restriction.conf b/src/testing/test_exchange_api_age_restriction.conf
@@ -103,7 +103,7 @@ FALLBACK = manual-freeze
# This check runs on oauth2
PROVIDER_ID = test-oauth2
# Outputs from this check
-OUTPUTS = full_name birthdate
+OUTPUTS = FULL_NAME DATE_OF_BIRTH
# This is the "default" setting for an account if
# it has not yet triggered anything.