summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--ChangeLog9
-rw-r--r--INSTALL6
-rw-r--r--README50
-rwxr-xr-xbootstrap10
-rw-r--r--configure.ac17
-rw-r--r--contrib/Makefile.am65
-rwxr-xr-xcontrib/anastasis-dbconfig150
-rw-r--r--contrib/anastasis-pp-v0.rst (renamed from contrib/pp/pp.rst)0
-rw-r--r--contrib/anastasis-tos-v0.rst (renamed from contrib/tos/tos.rst)0
-rwxr-xr-xcontrib/extract.sh23
m---------contrib/gana0
-rw-r--r--contrib/locale/de/LC_MESSAGES/anastasis-tos-v0.po229
-rwxr-xr-xcontrib/pogen.sh3
-rw-r--r--contrib/pp/.gitignore3
-rw-r--r--contrib/pp/Makefile109
-rw-r--r--contrib/pp/README58
-rw-r--r--contrib/pp/en/0.epubbin14822 -> 0 bytes
-rw-r--r--contrib/pp/en/0.html188
-rw-r--r--contrib/pp/en/0.pdfbin75235 -> 0 bytes
-rw-r--r--contrib/pp/en/0.txt219
-rw-r--r--contrib/pp/en/0.xml177
-rw-r--r--contrib/pp/locale/de/LC_MESSAGES/pp.po511
-rw-r--r--contrib/provider-list.json32
-rw-r--r--contrib/redux.al.json7
-rw-r--r--contrib/redux.be.json3
-rw-r--r--contrib/redux.ch.json5
-rw-r--r--contrib/redux.countries.json194
-rw-r--r--contrib/redux.cz.json5
-rw-r--r--contrib/redux.de.json5
-rw-r--r--contrib/redux.dk.json5
-rw-r--r--contrib/redux.es.json8
-rw-r--r--contrib/redux.fr.json5
-rw-r--r--contrib/redux.in.json3
-rw-r--r--contrib/redux.it.json7
-rw-r--r--contrib/redux.jp.json5
-rw-r--r--contrib/redux.nl.json5
-rw-r--r--contrib/redux.sk.json5
-rw-r--r--contrib/redux.us.json4
-rw-r--r--contrib/redux.xx.json2
-rw-r--r--contrib/tos/.gitignore3
-rw-r--r--contrib/tos/Makefile109
-rw-r--r--contrib/tos/README58
-rw-r--r--contrib/tos/conf.py282
-rw-r--r--contrib/tos/en/0.epubbin16289 -> 0 bytes
-rw-r--r--contrib/tos/en/0.html272
-rw-r--r--contrib/tos/en/0.pdfbin79435 -> 0 bytes
-rw-r--r--contrib/tos/en/0.txt287
-rw-r--r--contrib/tos/en/0.xml271
-rw-r--r--contrib/tos/locale/de/LC_MESSAGES/tos.po517
-rwxr-xr-xcontrib/update-pp.sh11
-rwxr-xr-xcontrib/update-tos.sh11
-rw-r--r--debian/anastasis-httpd.config14
-rw-r--r--debian/anastasis-httpd.install9
-rw-r--r--debian/anastasis-httpd.postinst38
-rw-r--r--debian/anastasis-httpd.postrm11
-rw-r--r--debian/anastasis-httpd.preinst29
-rw-r--r--debian/anastasis-httpd.prerm11
-rw-r--r--debian/anastasis-httpd.service2
-rw-r--r--debian/changelog62
-rw-r--r--debian/control57
-rwxr-xr-xdebian/db/install/pgsql38
-rw-r--r--debian/etc/anastasis/anastasis.conf4
-rw-r--r--debian/etc/anastasis/secrets/anastasis-db.secret.conf2
-rwxr-xr-xdebian/rules8
-rw-r--r--doc/Makefile.am2
-rw-r--r--doc/anastasis-dbconfig.187
-rw-r--r--doc/anastasis-dbinit.189
-rw-r--r--doc/anastasis.texi1893
-rw-r--r--doc/sphinx/conf.py6
-rw-r--r--doc/sphinx/configuration.rst3
-rw-r--r--doc/sphinx/frags/configuration-format.rst7
-rw-r--r--doc/sphinx/frags/legal.rst183
-rw-r--r--doc/sphinx/manpages/anastasis-dbconfig.1.rst61
-rw-r--r--doc/sphinx/manpages/anastasis-dbinit.1.rst67
-rw-r--r--doc/sphinx/manpages/anastasis.conf.5.rst6
-rw-r--r--doc/sphinx/rest.rst4
-rw-r--r--doc/texinfo.tex418
-rw-r--r--po/POTFILES.in77
-rw-r--r--src/authorization/Makefile.am7
-rwxr-xr-xsrc/authorization/anastasis-authorization-email.sh1
-rwxr-xr-xsrc/authorization/anastasis-authorization-post.sh196
-rwxr-xr-xsrc/authorization/anastasis-authorization-sms.sh33
-rw-r--r--src/authorization/anastasis_authorization_plugin_email.c6
-rw-r--r--src/authorization/anastasis_authorization_plugin_post.c6
-rw-r--r--src/authorization/anastasis_authorization_plugin_sms.c6
-rw-r--r--src/authorization/anastasis_authorization_plugin_totp.c2
-rwxr-xr-xsrc/authorization/test-post.sh12
-rw-r--r--src/backend/Makefile.am1
-rw-r--r--src/backend/anastasis-httpd_config.c4
-rw-r--r--src/backend/anastasis-httpd_policy-upload.c117
-rw-r--r--src/backend/anastasis-httpd_policy.c24
-rw-r--r--src/backend/anastasis-httpd_truth-challenge.c27
-rw-r--r--src/backend/anastasis-httpd_truth-solve.c62
-rw-r--r--src/backend/anastasis-httpd_truth-upload.c92
-rw-r--r--src/cli/.gitignore6
-rw-r--r--src/cli/Makefile.am7
-rwxr-xr-xsrc/cli/setup.sh72
-rwxr-xr-xsrc/cli/test_anastasis_reducer_done_authentication.sh4
-rwxr-xr-xsrc/cli/test_anastasis_reducer_enter_secret.sh425
-rwxr-xr-xsrc/cli/test_anastasis_reducer_recovery_enter_user_attributes.sh475
-rwxr-xr-xsrc/cli/test_anastasis_reducer_recovery_hanging.sh376
-rwxr-xr-xsrc/cli/test_anastasis_reducer_recovery_no_pay.sh14
-rwxr-xr-xsrc/cli/test_iban.sh307
-rw-r--r--src/cli/test_reducer.conf68
-rw-r--r--src/cli/test_reducer_free.conf2
-rw-r--r--src/cli/test_reducer_home/.local/share/taler/exchange-offline/master.priv1
-rw-r--r--src/include/anastasis_crypto_lib.h2
-rw-r--r--src/include/anastasis_service.h188
-rw-r--r--src/include/anastasis_testing_lib.h10
-rw-r--r--src/include/platform.h214
-rw-r--r--src/lib/anastasis_meta.c10
-rw-r--r--src/lib/anastasis_recovery.c108
-rw-r--r--src/reducer/Makefile.am1
-rw-r--r--src/reducer/anastasis_api_backup_redux.c121
-rw-r--r--src/reducer/anastasis_api_providers.c300
-rw-r--r--src/reducer/anastasis_api_recovery_redux.c306
-rw-r--r--src/reducer/anastasis_api_redux.c188
-rw-r--r--src/reducer/anastasis_api_redux.h36
-rw-r--r--src/restclient/Makefile.am3
-rw-r--r--src/restclient/anastasis_api_config.c104
-rw-r--r--src/restclient/anastasis_api_curl_defaults.c13
-rw-r--r--src/restclient/anastasis_api_policy_lookup.c23
-rw-r--r--src/restclient/anastasis_api_policy_meta_lookup.c22
-rw-r--r--src/restclient/anastasis_api_policy_store.c2
-rw-r--r--src/restclient/anastasis_api_truth_challenge.c8
-rw-r--r--src/restclient/anastasis_api_truth_store.c10
-rw-r--r--src/stasis/Makefile.am15
-rw-r--r--src/stasis/drop.sql (renamed from src/stasis/drop0001.sql)25
-rw-r--r--src/stasis/plugin_anastasis_postgres.c178
-rw-r--r--src/stasis/stasis-0001.sql46
-rw-r--r--src/stasis/versioning.sql (renamed from src/stasis/stasis-0000.sql)3
-rw-r--r--src/testing/.gitignore5
-rw-r--r--src/testing/Makefile.am6
-rw-r--r--src/testing/test_anastasis.c169
-rw-r--r--src/testing/test_anastasis_api.c163
-rw-r--r--src/testing/test_anastasis_api.conf164
-rw-r--r--src/testing/test_anastasis_api_home/.config/taler/exchange/account-2.json3
-rw-r--r--src/testing/test_anastasis_api_home/taler/exchange-offline/master.priv (renamed from src/testing/test_anastasis_api_home/.local/share/taler/exchange/offline-keys/master.priv)0
-rw-r--r--src/testing/test_anastasis_api_home/taler/exchange/offline-keys/master.priv1
-rw-r--r--src/testing/testing_api_cmd_config.c34
-rw-r--r--src/testing/testing_api_cmd_policy_lookup.c29
-rw-r--r--src/testing/testing_api_cmd_policy_store.c15
-rw-r--r--src/testing/testing_api_cmd_truth_challenge.c34
-rw-r--r--src/testing/testing_api_cmd_truth_solve.c58
-rw-r--r--src/testing/testing_api_cmd_truth_store.c21
-rw-r--r--src/testing/testing_cmd_challenge_answer.c13
-rw-r--r--src/testing/testing_cmd_recover_secret.c41
-rw-r--r--src/testing/testing_cmd_secret_share.c44
-rw-r--r--src/testing/testing_cmd_truth_upload.c27
-rw-r--r--src/util/Makefile.am3
-rw-r--r--src/util/anastasis-config.in5
152 files changed, 5705 insertions, 6556 deletions
diff --git a/.gitignore b/.gitignore
index 0d5dbc1..998e44b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -130,3 +130,4 @@ src/cli/test_reducer.err
vgcore*
__pycache__
tags
+contrib/extracted.h
diff --git a/ChangeLog b/ChangeLog
index 66b6c39..e9407a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Mon 26 Sep 2022 02:48:38 PM CEST
+ Multiple providers operational.
+ WebUI operational at https://webui.anastasis.lu/.
+ Various UI/UX improvements.
+ Releasing Anastasis v0.3.0. -CG
+
+Thu 30 Sep 2021 03:48:38 PM CEST
+ Releasing Anastasis v0.2.0. -CG
+
Tue 24 Aug 2021 10:30:23 PM CEST
IBAN authentication support working.
Releasing Anastasis v0.1.0. -CG
diff --git a/INSTALL b/INSTALL
index 8865734..e82fd21 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,8 +1,8 @@
Installation Instructions
*************************
- Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software
-Foundation, Inc.
+ Copyright (C) 1994-1996, 1999-2002, 2004-2017, 2020-2021 Free
+Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
@@ -225,7 +225,7 @@ order to use an ANSI C compiler:
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
- HP-UX 'make' updates targets which have the same time stamps as their
+ HP-UX 'make' updates targets which have the same timestamps as their
prerequisites, which makes it generally unusable when shipped generated
files such as 'configure' are involved. Use GNU 'make' instead.
diff --git a/README b/README
index db5dcf0..a753c3b 100644
--- a/README
+++ b/README
@@ -48,3 +48,53 @@ src/cli/ includes a reducer-based command-line interface
contrib/ contains resource files, like what identity attributes to ask for
doc/ contains documentation files, like TeXinfo
po/ internationalization via GNU gettext
+
+
+Development note
+================
+
+To test against a local development service, add
+
+ {
+ "code" : "xx",
+ "name" : "Testland",
+ "continent" : "Demoworld",
+ "call_code" : "+00"
+ }
+
+to contrib/redux.countries.json, and also append something like
+
+ {
+ "url" : "http://localhost:8086/",
+ "restricted" : "xx"
+ },
+ {
+ "url" : "http://localhost:8087/",
+ "restricted" : "xx"
+ },
+ {
+ "url" : "http://localhost:8088/",
+ "restricted" : "xx"
+ },
+ {
+ "url" : "http://localhost:8089/",
+ "restricted" : "xx"
+ }
+
+to contrib/provider-list.json. Then the reducer will use these
+providers on loopback for the "testland" country.
+
+
+Experimental providers
+======================
+
+We hope to have another provider running soon. Once it is operational,
+we should add
+
+ {
+ "url" : "https://v1.anastasis.openw3b.org/",
+ "name" : "Openw3b Foundation, India"
+ },
+
+to the contrib/provider-list.json.
+
diff --git a/bootstrap b/bootstrap
index a7414cd..eaaf3fc 100755
--- a/bootstrap
+++ b/bootstrap
@@ -5,10 +5,16 @@ if ! git --version >/dev/null; then
exit 1
fi
+if ! htmlark --version >/dev/null; then
+ echo "htmlark not installed"
+ echo "Run 'pip install htmlark'"
+ exit 1
+fi
+
echo "$0: Updating submodules"
-echo | git submodule update --init
+echo | git submodule update --init --force --remote
-git submodule update --init
+git submodule update --init --force --remote
./contrib/gana-update.sh
diff --git a/configure.ac b/configure.ac
index 70778fb..d1c7805 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@
# This configure file is in the public domain
AC_PREREQ([2.69])
-AC_INIT([anastasis], [0.2.0], [taler-bug@gnu.org])
+AC_INIT([anastasis],[0.4.2],[taler-bug@gnu.org])
AC_CONFIG_SRCDIR([src/backend/anastasis-httpd.c])
AC_CONFIG_HEADERS([anastasis_config.h])
# support for non-recursive builds
@@ -16,7 +16,7 @@ AM_SILENT_RULES([yes])
AC_CONFIG_MACRO_DIR([m4])
AC_PROG_AWK
-AC_PROG_CC_C99
+AC_PROG_CC
AC_PROG_OBJC
AC_PROG_INSTALL
AC_PROG_LN_S
@@ -47,7 +47,6 @@ AS_IF([test "x$doc_only" != xyes],[
# Checks for programs.
AC_PROG_CC
-AC_PROG_CC_C99
# check for gettext
AM_GNU_GETTEXT([external])
@@ -138,25 +137,21 @@ AS_CASE([$with_gnunet],
[no], [AC_MSG_ERROR([--with-gnunet is required])],
[LDFLAGS="-L$with_gnunet/lib $LDFLAGS"
CPPFLAGS="-I$with_gnunet/include $CPPFLAGS"])
-AC_CHECK_HEADERS([gnunet/platform.h gnunet/gnunet_util_lib.h],
+AC_CHECK_HEADERS([gnunet/gnunet_util_lib.h],
[AC_CHECK_LIB([gnunetutil],
[GNUNET_SCHEDULER_run],
- [libgnunetutil=1])],
- [],
- [#ifdef HAVE_GNUNET_PLATFORM_H
- #include <gnunet/platform.h>
- #endif])
+ [libgnunetutil=1])])
AS_IF([test $libgnunetutil != 1],
[AC_MSG_ERROR([[
***
-*** You need libgnunetutil to build this program.
+*** You need libgnunetutil >= 0.20.0 to build this program.
*** This library is part of GNUnet, available at
*** https://gnunet.org
*** ]])])
# test for postgres
-AX_LIB_POSTGRESQL([9.3])
+AX_LIB_POSTGRESQL([15])
AS_IF([test "x$found_postgresql" = "xyes"],[postgres=true])
AM_CONDITIONAL(HAVE_POSTGRESQL, test x$postgres = xtrue)
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index 75bce03..47c5e8e 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -3,50 +3,39 @@
SUBDIRS = .
-# English (en)
-tosendir=$(datadir)/anastasis/tos/en
+bin_SCRIPTS = \
+ anastasis-dbconfig
-# English (en)
-ppendir=$(datadir)/anastasis/pp/en
+termsdir=$(datadir)/anastasis/terms/
+terms_DATA = \
+ anastasis-tos-v0.rst \
+ anastasis-pp-v0.rst
-tosen_DATA = \
- tos/en/0.txt \
- tos/en/0.pdf \
- tos/en/0.epub \
- tos/en/0.xml \
- tos/en/0.html
-
-ppen_DATA = \
- pp/en/0.txt \
- pp/en/0.pdf \
- pp/en/0.epub \
- pp/en/0.xml \
- pp/en/0.html
+install-exec-local:
+ find locale/ -name "*.po"
+ mkdir -p $(DESTDIR)$(datadir)
+ cp --parents -r $$(find locale/ -name "*.po") $(DESTDIR)$(datadir)
+extracted.h: *.json
+ ./extract.sh
+noinst_SCRIPTS = extracted.h
pkgdatadir= $(prefix)/share/anastasis/
EXTRA_DIST = \
+ locale/de/LC_MESSAGES/anastasis-tos-v0.po \
+ $(bin_SCRIPTS) \
$(pkgdata_DATA) \
- $(tosen_DATA) \
- $(ppen_DATA) \
- tos/Makefile \
- tos/README \
- tos/tos.rst \
- tos/conf.py \
- tos/locale/de/LC_MESSAGES/tos.po \
- pp/Makefile \
- pp/README \
- pp/pp.rst \
- pp/conf.py \
- pp/locale/de/LC_MESSAGES/pp.po \
+ $(terms_DATA) \
pogen.sh \
uncrustify.cfg \
uncrustify_precommit \
gana.sh \
gana-update.sh \
- microhttpd.tag
+ microhttpd.tag \
+ extract.sh \
+ extracted.h
pkgdata_DATA = \
redux.al.json \
@@ -66,19 +55,3 @@ pkgdata_DATA = \
redux.xx.json \
redux.countries.json \
provider-list.json
-
-# Change the set of supported languages here. You should
-# also update tos'XX'data and EXTRA_DIST accordingly.
-TOS_LANGUAGES="en de"
-PP_LANGUAGES="en de"
-
-# Change the terms-of-service version (Etag) to generate here!
-# This value should be incremented whenever there is a substantive
-# change in the original text (but not for the translations).
-TOS_VERSION=0
-PP_VERSION=0
-
-update-tos:
- VERSION=$(TOS_VERSION) ./update-tos.sh $(TOS_LANGUAGES)
-update-pp:
- VERSION=$(PP_VERSION) ./update-pp.sh $(PP_LANGUAGES)
diff --git a/contrib/anastasis-dbconfig b/contrib/anastasis-dbconfig
new file mode 100755
index 0000000..d4af960
--- /dev/null
+++ b/contrib/anastasis-dbconfig
@@ -0,0 +1,150 @@
+#!/bin/bash
+# This file is part of GNU ANASTASIS.
+# Copyright (C) 2023 Anastasis Systems SA
+#
+# ANASTASIS is free software; you can redistribute it and/or modify it under the
+# terms of the GNU Lesser General Public License as published by the Free Software
+# Foundation; either version 2.1, or (at your option) any later version.
+#
+# ANASTASIS 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 Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License along with
+# ANASTASIS; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+#
+# @author Christian Grothoff
+#
+#
+# Error checking on
+set -eu
+
+RESET_DB=0
+SKIP_DBINIT=0
+DBUSER="anastasis-httpd"
+CFGFILE="/etc/anastasis/secrets/anastasis-db.secret.conf"
+
+# Parse command-line options
+while getopts 'c:hrsu:' OPTION; do
+ case "$OPTION" in
+ c)
+ CFGFILE="$OPTARG"
+ ;;
+ h)
+ echo 'Supported options:'
+ echo " -c FILENAME -- write configuration to FILENAME (default: $CFGFILE)"
+ echo " -r -- reset database (dangerous)"
+ echo " -s -- skip database initialization"
+ echo " -u USER -- anastasis-httpd to be run by USER (default: $DBUSER)"
+ exit 0
+ ;;
+ r)
+ RESET_DB="1"
+ ;;
+ s)
+ SKIP_DBINIT="1"
+ ;;
+ u)
+ DBUSER="$OPTARG"
+ ;;
+ ?)
+ exit_fail "Unrecognized command line option"
+ ;;
+ esac
+done
+
+if ! id postgres > /dev/null
+then
+ echo "Could not find 'postgres' user. Please install Postgresql first"
+ exit 1
+fi
+
+if [ "$(id -u)" -ne 0 ]
+then
+ echo "This script must be run as root"
+ exit 1
+fi
+
+if [ 0 = "$SKIP_DBINIT" ]
+then
+ if ! anastasis-dbinit -v 2> /dev/null
+ then
+ echo "Required 'anastasis-dbinit' not found. Please fix your installation."
+ exit 1
+ fi
+ DBINIT=$(which anastasis-dbinit)
+fi
+
+if ! id "$DBUSER" > /dev/null
+then
+ echo "Could not find '$DBUSER' user. Please set it up first"
+ exit 1
+fi
+
+echo "Setting up database user $DBUSER." 1>&2
+
+if ! sudo -i -u postgres createuser "$DBUSER" 2> /dev/null
+then
+ echo "Database user '$DBUSER' already existed. Continuing anyway." 1>&2
+fi
+
+DBPATH=$(anastasis-config \
+ -c "$CFGFILE" \
+ -s stasis-postgres \
+ -o CONFIG)
+
+if ! echo "$DBPATH" | grep "postgres://" > /dev/null
+then
+ echo "Invalid database configuration value '$DBPATH'." 1>&2
+ exit 1
+fi
+
+DBNAME=$(echo "$DBPATH" \
+ | sed \
+ -e "s/postgres:\/\/.*\///" \
+ -e "s/?.*//")
+
+
+if sudo -i -u postgres psql "$DBNAME" < /dev/null 2> /dev/null
+then
+ if [ 1 = "$RESET_DB" ]
+ then
+ echo "Deleting existing database $DBNAME." 1>&2
+ if ! sudo -i -u postgres dropdb "$DBNAME"
+ then
+ echo "Failed to delete existing database '$DBNAME'"
+ exit 1
+ fi
+ DO_CREATE=1
+ else
+ echo "Database '$DBNAME' already exists, continuing anyway."
+ DO_CREATE=0
+ fi
+else
+ DO_CREATE=1
+fi
+
+if [1 = "$DO_CREATE" ]
+then
+ echo "Creating database $DBNAME." 1>&2
+
+ if ! sudo -i -u postgres createdb -O "$DBUSER" "$DBNAME"
+ then
+ echo "Failed to create database '$DBNAME'"
+ exit 1
+ fi
+fi
+
+if [ 0 = "$SKIP_DBINIT" ]
+then
+ echo "Initializing database $DBNAME." 1>&2
+ if ! sudo -u "$DBUSER" "$DBINIT" -c "$CFGFILE"
+ then
+ echo "Failed to initialize database schema"
+ exit 1
+ fi
+fi
+
+echo "Database configuration finished." 1>&2
+
+exit 0
diff --git a/contrib/pp/pp.rst b/contrib/anastasis-pp-v0.rst
index 8972028..8972028 100644
--- a/contrib/pp/pp.rst
+++ b/contrib/anastasis-pp-v0.rst
diff --git a/contrib/tos/tos.rst b/contrib/anastasis-tos-v0.rst
index 4445601..4445601 100644
--- a/contrib/tos/tos.rst
+++ b/contrib/anastasis-tos-v0.rst
diff --git a/contrib/extract.sh b/contrib/extract.sh
new file mode 100755
index 0000000..e879e74
--- /dev/null
+++ b/contrib/extract.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+# This file is in the public domain.
+# It extracts translateable strings from the JSON file(s).
+#
+# The resulting 'extracted.h' file is only used by
+# gettext, and not in the actual code. We still make
+# sure it is legal C code.
+
+for n in redux.??.json
+do
+ jq '.required_attributes[].label' < $n | awk '{print "_(" $0 "),"}' >> prep.h
+done
+
+jq '.countries[].continent' < redux.countries.json | awk '{print "_(" $0 "),"}' >> prep.h
+
+jq '.countries[].name' < redux.countries.json | awk '{print "_(" $0 "),"}' >> prep.h
+
+echo "// This is a generated file, see extract.sh" > extracted.h
+echo "const char * i18n[] = {" >> extracted.h
+sort prep.h | uniq >> extracted.h
+echo "};" >> extracted.h
+
+rm -f prep.h
diff --git a/contrib/gana b/contrib/gana
-Subproject 7bfddee1d6e2c04beb9f89a42acad70299fc423
+Subproject 4728c9e60ce121f439b3db30cc08f06ff0beff7
diff --git a/contrib/locale/de/LC_MESSAGES/anastasis-tos-v0.po b/contrib/locale/de/LC_MESSAGES/anastasis-tos-v0.po
new file mode 100644
index 0000000..6eb06d2
--- /dev/null
+++ b/contrib/locale/de/LC_MESSAGES/anastasis-tos-v0.po
@@ -0,0 +1,229 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) 2014-2023 Taler Systems SA (GPLv3+ or GFDL 1.3+)
+# This file is distributed under the same license as the anastasis-tos-v0 package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: anastasis-tos-v0 anastasis-tos-v0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2023-08-12 09:27+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:2
+msgid "Terms Of Service"
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:4
+msgid "Last Updated: 07.09.2021"
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:6
+msgid "Welcome! Anastasis SARL (“we,” “our,” or “us”) provides a distributed privacy-preserving backup and recovery service for key material through our Internet presence (collectively the “Services”). Before using our Services, please read the Terms of Service (the “Terms” or the “Agreement”) carefully."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:13
+msgid "Overview"
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:15
+msgid "This section provides a brief summary of the highlights of this Agreement. Please note that when you accept this Agreement, you are accepting all of the terms and conditions and not just this section. We and possibly other third parties provide Internet services which interact with the Anastasis key backup and recovery application. When using an application to interact with our Services, you are agreeing to our Terms, so please read carefully."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:25
+msgid "Highlights:"
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:27
+msgid "You are responsible for selecting authentication methods and policies that are adequate to protect your key material. Any losses arising from you not being able to satisfy the selected authentication challenges or third parties being able successfully pass the challenges are your problem."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:32
+msgid "We will store your encrypted key shares and disclose them upon successful authentication to the best of our ability within the limitations of the law and our implementation. Our liability will be limited to the liability limit exposed in the protocol."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:36
+msgid "For our Services, we may charge various fees. The specific fee structure is provided based on the Anastasis protocol and should be shown to you when you use an application to interact with our services. You agree and understand that the Anastasis protocol allows for the fee structure to change."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:40
+msgid "You agree to not intentionally overwhelm our systems with requests and follow responsible disclosure if you find security issues in our services."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:42
+msgid "We cannot be held accountable for our Services not being available due to circumstances beyond our control. If we modify or terminate our services, we will announce this and ensure that you can recover your key material for at least one year before we completely terminate the Service."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:47
+msgid "These terms outline approved uses of our Services. If you have any questions or comments related to this Agreement, please send us a message to legal@anastasis.lu. If you do not agree to this Agreement, you must not use our Services."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:54
+msgid "How you accept this policy"
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:56
+msgid "By using our API (typically via an Anastasis-enabled application), you acknowledge that you have read, understood, and agreed to these Terms. We reserve the right to change these Terms at any time. If you disagree with the change, you must simply stop using our APIs. Your continued use of our Services following any such change will signify your acceptance to be bound by the then current Terms. Please check the effective date above to determine if there have been any changes since you have last reviewed these Terms."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:66
+msgid "Services"
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:68
+msgid "We will store your encrypted key shares (and the associated encrypted recovery policy document) to the best of our ability and within the limitations of the implementation. We will disclose the key shares only after the specific authentication challenge has been passed. We will rate-limit the use of the authentication APIs to limit brute-force attacks."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:75
+msgid "We are not guaranteeing that the authentication procedures are effective. Other parties may be able to intercept authentication messages, or you may not be able to receive these messages anymore. You are responsible for choosing safe authentication methods with sufficient security."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:80
+msgid "When using our Services, you agree to not take any action that intentionally imposes an unreasonable load on our infrastructure. If you find security problems in our Services, you agree to first report them to security@anastasis.lu and grant us the right to publish your report. We warrant that we will ourselves publicly disclose any issues reported within 1 month, and that we will not prosecute anyone reporting security issues if they did not exploit the issue beyond a proof-of-concept, and followed the above responsible disclosure practice."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:92
+msgid "Fees"
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:94
+msgid "You agree to pay the fees for backup and recovery operations (\"Fees\") as defined by us, which we may change from time to time. Your Anastasis client should obtain and display applicable fees during backup and recovery."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:101
+msgid "Eligibility"
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:103
+msgid "To be eligible to use our Services, you must be able to form legally binding contracts or have the permission of your legal guardian. By using our Services, you represent and warrant that you meet all eligibility requirements that we outline in these Terms."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:110
+msgid "Copyrights and trademarks"
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:112
+msgid "The Anastasis software is released under the terms of the GNU Affero General Public License (GNU AGPLv3+). You have the right to access, use, and share the Anastasis application, in modified or unmodified form. However, the Affero GPL is a strong copyleft license, which means that any derivative works must be distributed under the same license terms as the original software. If you have any questions, you should review the GNU AGPL’s full terms and conditions at https://www.gnu.org/licenses/agpl-3.0.en.html. “Anastasis” itself is a trademark of Anastasis SARL. You are welcome to use the name in relation to implementations of the Anastasis protocol, assuming your use is compatible with an official release from the GNU Project that is not older than two years."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:127
+msgid "Limitation of liability & disclaimer of warranties"
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:129
+msgid "You understand and agree that we have no control over, and no duty to take any action regarding: Failures, disruptions, errors, or delays in processing that you may experience while using our Services; The risk of failure of hardware, software, and Internet connections; The risk of malicious software being introduced or found in the software underlying the Anastasis implementation. You release us from all liability related to any losses, damages, or claims arising from:"
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:137
+msgid "user error such as forgotten security answers or loss of control over accounts used for authentication;"
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:139
+msgid "(b) server failure or data loss; (d) bugs or other errors in the Anastasis client software; and (e) any unauthorized third party activities, including, but not limited to,"
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:142
+msgid "the use of viruses, phishing, brute forcing, or other means of attack against the Anastasis client. We make no representations concerning any Third Party Content contained in or accessed through our Services."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:146
+msgid "Any other terms, conditions, warranties, or representations associated with such content, are solely between you and such organizations and/or individuals."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:150
+msgid "To the fullest extent permitted by applicable law, in no event will we or any of our officers, directors, representatives, agents, servants, counsel, employees, consultants, lawyers, and other personnel authorized to act, acting, or purporting to act on our behalf (collectively the “Anastasis Parties”) be liable to you under contract, tort, strict liability, negligence, or any other legal or equitable theory, for:"
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:158
+msgid "any lost profits, data loss, cost of procurement of substitute goods or services, or direct, indirect, incidental, special, punitive, compensatory, or consequential damages of any kind whatsoever resulting from:"
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:162
+msgid "your use of, or conduct in connection with, our services;"
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:163
+msgid "any unauthorized use of your wallet and/or private key due to your failure to maintain the confidentiality of your wallet;"
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:165
+msgid "any interruption or cessation of transmission to or from the services; or"
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:166
+msgid "any bugs, viruses, trojan horses, or the like that are found in the Taler Wallet software or that may be transmitted to or through our services by any third party (regardless of the source of origination), or"
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:170
+msgid "any direct damages."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:172
+msgid "These limitations apply regardless of legal theory, whether based on tort, strict liability, breach of contract, breach of warranty, or any other legal theory, and whether or not we were advised of the possibility of such damages. Some jurisdictions do not allow the exclusion or limitation of liability for consequential or incidental damages, so the above limitation may not apply to you."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:179
+msgid "Our services are provided \"as is\" and without warranty of any kind. To the maximum extent permitted by law, we disclaim all representations and warranties, express or implied, relating to the services and underlying software or any content on the services, whether provided or owned by us or by any third party, including without limitation, warranties of merchantability, fitness for a particular purpose, title, non-infringement, freedom from computer virus, and any implied warranties arising from course of dealing, course of performance, or usage in trade, all of which are expressly disclaimed. In addition, we do not represent or warrant that the content accessible via the services is accurate, complete, available, current, free of viruses or other harmful components, or that the results of using the services will meet your requirements. Some states do not allow the disclaimer of implied warranties, so the foregoing disclaimers may not apply to you. This paragraph gives you specific legal rights and you may also have other legal rights that vary from state to state."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:196
+msgid "Indemnity and Time limitation on claims and Termination"
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:198
+msgid "To the extent permitted by applicable law, you agree to defend, indemnify, and hold harmless the Anastasis Parties from and against any and all claims, damages, obligations, losses, liabilities, costs or debt, and expenses (including, but not limited to, attorney’s fees) arising from: (a) your use of and access to the Services; (b) any feedback or submissions you provide to us concerning the Anastasis software; (c) your violation of any term of this Agreement; or (d) your violation of any law, rule, or regulation, or the rights of any third party."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:208
+msgid "You agree that any claim you may have arising out of or related to your relationship with us must be filed within one year after such claim arises, otherwise, your claim in permanently barred."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:212
+msgid "In the event of termination concerning your use of our Services, your obligations under this Agreement will still continue."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:217
+msgid "Discontinuance of services and Force majeure"
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:219
+msgid "We shall not be held liable for any delays, failure in performance, or interruptions of service which result directly or indirectly from any cause or condition beyond our reasonable control, including but not limited to: any delay or failure due to any act of God, act of civil or military authorities, act of terrorism, civil disturbance, war, strike or other labor dispute, fire, interruption in telecommunications or Internet services or network provider services, failure of equipment and/or software, other catastrophe, or any other occurrence which is beyond our reasonable control and shall not affect the validity and enforceability of any remaining provisions."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:231
+msgid "Governing law, Waivers, Severability and Assignment"
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:233
+msgid "No matter where you’re located, the laws of Luxembourg will govern these Terms. If any provisions of these Terms are inconsistent with any applicable law, those provisions will be superseded or modified only to the extent such provisions are inconsistent. The parties agree to submit to the ordinary courts in Luxembourg for exclusive jurisdiction of any dispute arising out of or related to your use of the Services or your breach of these Terms."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:241
+msgid "Our failure to exercise or delay in exercising any right, power, or privilege under this Agreement shall not operate as a waiver; nor shall any single or partial exercise of any right, power, or privilege preclude any other or further exercise thereof."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:246
+msgid "You agree that we may assign any of our rights and/or transfer, sub-contract, or delegate any of our obligations under these Terms."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:249
+msgid "If it turns out that any part of this Agreement is invalid, void, or for any reason unenforceable, that term will be deemed severable and limited or eliminated to the minimum extent necessary."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:253
+msgid "This Agreement sets forth the entire understanding and agreement as to the subject matter hereof and supersedes any and all prior discussions, agreements, and understandings of any kind (including, without limitation, any prior versions of this Agreement) and every nature between us. Except as provided for above, any modification to this Agreement must be in writing and must be signed by both parties."
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:262
+msgid "Questions or comments"
+msgstr ""
+
+#: ../../../../../../../../../tmp/taler-terms-CS0F7n/anastasis-tos-v0.rst:264
+msgid "We welcome comments, questions, concerns, or suggestions. Please send us a message on our contact page at legal@anastasis.lu."
+msgstr ""
diff --git a/contrib/pogen.sh b/contrib/pogen.sh
index 89140ea..21eedce 100755
--- a/contrib/pogen.sh
+++ b/contrib/pogen.sh
@@ -1,3 +1,4 @@
#!/bin/sh
find src -name "*.c" | sort > po/POTFILES.in
-find contrib -name "*.json" | sort >> po/POTFILES.in
+echo "contrib/extracted.h" >> po/POTFILES.in
+echo "src/authorization/extracted.h" >> po/POTFILES.in
diff --git a/contrib/pp/.gitignore b/contrib/pp/.gitignore
deleted file mode 100644
index fb83616..0000000
--- a/contrib/pp/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-sphinx.err
-sphinx.log
-_build/
diff --git a/contrib/pp/Makefile b/contrib/pp/Makefile
deleted file mode 100644
index ab29543..0000000
--- a/contrib/pp/Makefile
+++ /dev/null
@@ -1,109 +0,0 @@
-# Makefile for Sphinx documentation
-#
-# You can set these variables from the command line.
-SPHINXOPTS =
-SPHINXBUILD = sphinx-build
-PAPER =
-BUILDDIR = _build
-
-# User-friendly check for sphinx-build
-ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
-$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
-endif
-
-# Internal variables.
-PAPEROPT_a4 = -D latex_paper_size=a4
-PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-# the i18n builder cannot share the environment and doctrees with the others
-I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-
-.PHONY: help clean html json epub latex latexpdf text man doctest gettext
-
-help:
- @echo "Please use \`make <target>' where <target> is one of"
- @echo " html to make a single large HTML file"
- @echo " json to make JSON files"
- @echo " epub to make an epub"
- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
- @echo " pdf to make LaTeX files and run them through pdflatex"
- @echo " txt to make text files"
- @echo " man to make manual pages"
- @echo " texinfo to make Texinfo files"
- @echo " info to make Texinfo files and run them through makeinfo"
- @echo " gettext to make PO message catalogs"
- @echo " xml to make Docutils-native XML files"
- @echo " pseudoxml to make pseudoxml-XML files for display purposes"
- @echo " doctest to run all doctests embedded in the documentation (if enabled)"
-
-clean:
- rm -rf $(BUILDDIR)/*
-
-
-# The html-linked builder does not support caching, so we
-# remove all cached state first.
-html:
- $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
- @echo
- @echo "Build finished. The HTML page is in $(BUILDDIR)/html."
-
-json:
- $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
- @echo
- @echo "Build finished; now you can process the JSON files."
-
-epub:
- $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
- @echo
- @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
-
-latex:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo
- @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
- @echo "Run \`make' in that directory to run these through (pdf)latex" \
- "(use \`make latexpdf' here to do that automatically)."
-
-pdf:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/pdf
- @echo "Running LaTeX files through pdflatex..."
- $(MAKE) -C $(BUILDDIR)/pdf all-pdf
- @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/pdf."
-
-txt:
- $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/txt
- @echo
- @echo "Build finished. The text files are in $(BUILDDIR)/txt."
-
-man:
- $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
- @echo
- @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
-
-texinfo:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo
- @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
- @echo "Run \`make' in that directory to run these through makeinfo" \
- "(use \`make info' here to do that automatically)."
-
-info:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/info
- @echo "Running Texinfo files through makeinfo..."
- make -C $(BUILDDIR)/texinfo info
- @echo "makeinfo finished; the Info files are in $(BUILDDIR)/info."
-
-gettext:
- $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
- @echo
- @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
-
-doctest:
- $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
- @echo "Testing of doctests in the sources finished, look at the " \
- "results in $(BUILDDIR)/doctest/output.txt."
-
-xml:
- $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
- @echo
- @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
diff --git a/contrib/pp/README b/contrib/pp/README
deleted file mode 100644
index d221b14..0000000
--- a/contrib/pp/README
+++ /dev/null
@@ -1,58 +0,0 @@
-This directory contains the privacy policy (template) for Anastasis
-operators.
-
-
-Dependencies
-============
-
-Generating a new Privacy Policy requires Sphinx, LaTeX with babel
-packages for all supported languages. On Debian, you should
-at least install:
-
-$ apt install python3-sphinx sphinx-intl texlive-lang-german texlive-lang-english
-
-(NOTE: List may be incomplete.)
-
-
-Updating the Privacy Policy
-===========================
-
-The master file with the Privacy Policy is 'pp.rst'.
-
-If you make substantial changes, you MUST change the "PP_VERSION"
-in contrib/Makefile.am to the new Etag.
-
-To begin the translation into other languages after editing the master
-file, run
-
-$ make gettext
-
-to generate the master PO file. Then, run
-
-$ sphinx-intl update -p _build/locale/ -l de -l fr -l it
-
-to update the PO files for the various languages (extend the list of
-languages as necessary). The PO files for the translators are kept
-at locale/$LANG/LC_MESSAGES/pp.po for the language $LANG.
-
-Once all PO files have been updated with new translations, run
-
-$ make update-pp
-
-in the "contrib/" directory to generate all of the formats. The
-respective make rule calls the '../update-pp.sh' script in the
-contrib/ directory, which calls the 'Makefile' in the pp/
-directory for the various supported languages and file formats
-and then moves the generated files to the target directory
-('contrib/pp/$LANG/$VERSION.$FORMAT')
-
-
-Adding a new language
-=====================
-
-To add a new language $LANG, add $LANG to "PP_LANGUAGES" in
-'contrib/Makefile.am' and run
-
-$ sphinx-intl update -p _build/gettext -l $LANG
-
-to generate the PO template.
diff --git a/contrib/pp/en/0.epub b/contrib/pp/en/0.epub
deleted file mode 100644
index b77975b..0000000
--- a/contrib/pp/en/0.epub
+++ /dev/null
Binary files differ
diff --git a/contrib/pp/en/0.html b/contrib/pp/en/0.html
deleted file mode 100644
index 6f9fa46..0000000
--- a/contrib/pp/en/0.html
+++ /dev/null
@@ -1,188 +0,0 @@
-
-
-<html lang="en">
- <head>
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>Privacy Policy &#8212; Taler Privacy Policy</title>
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
- <link rel="stylesheet" href="_static/epub.css" type="text/css" />
- <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
- <script src="_static/jquery.js"></script>
- <script src="_static/underscore.js"></script>
- <script src="_static/doctools.js"></script>
- </head><body>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <div class="section" id="privacy-policy">
-<h1>Privacy Policy<a class="headerlink" href="#privacy-policy" title="Permalink to this headline">¶</a></h1>
-<p>Last Updated: 07.09.2021</p>
-<p>This Privacy Policy describes the policies and procedures of Anastasis
-SARL (“we,” “our,” or “us”) pertaining to the collection, use, and
-disclosure of your information on our sites and related mobile
-applications and products we offer (the “Services”). This Privacy
-Statement applies to your personal data when you use our Services, and
-does not apply to online websites or services that we do not own or
-control.</p>
-<div class="section" id="overview">
-<h2>Overview<a class="headerlink" href="#overview" title="Permalink to this headline">¶</a></h2>
-<p>Your privacy is important to us. We follow a few fundamental
-principles: We don’t ask you for personally identifiable information
-(defined below). That being said, your contact information, such as
-your phone number, social media handle, or email address (depending on
-how you contact us), may be collected when you communicate with us,
-for example to report a bug or other error related to Anastasis. We
-don’t share your information with third parties except when strictly
-required to deliver you our Services and products, or to comply with
-the law. If you have any questions or concerns about this policy,
-please reach out to us at <a class="reference external" href="mailto:privacy&#37;&#52;&#48;anastasis&#46;lu">privacy<span>&#64;</span>anastasis<span>&#46;</span>lu</a>.</p>
-</div>
-<div class="section" id="how-you-accept-this-policy">
-<h2>How you accept this policy<a class="headerlink" href="#how-you-accept-this-policy" title="Permalink to this headline">¶</a></h2>
-<p>By using our Services or visiting our sites, you agree to the use, disclosure,
-and procedures outlined in this Privacy Policy.</p>
-</div>
-<div class="section" id="what-personal-information-do-we-collect-from-our-users">
-<h2>What personal information do we collect from our users?<a class="headerlink" href="#what-personal-information-do-we-collect-from-our-users" title="Permalink to this headline">¶</a></h2>
-<p>The information we collect from you falls into two categories: (i) personally
-identifiable information (i.e., data that could potentially identify you as an
-individual) (“Personal Information”), and (ii) non-personally identifiable
-information (i.e., information that cannot be used to identify who you are)
-(“Non-Personal Information”). This Privacy Policy covers both categories and
-will tell you how we might collect and use each type.</p>
-<p>We do our best to not collect any Personal Information from Anastasis
-users. The detailed Personal Information Anastasis asks from you during
-the regular backup and recovery process at the beginning is never shared
-with us and only used to create a cryptographic account identifier which
-does not allow us to recover any of your details.</p>
-<p>That being said, when using our Services to recover key material, we may
-inherently receive the following information (depending on your choice of
-authentication method):</p>
-<blockquote>
-<div><ul class="simple">
-<li><p>Bank account details necessary when receiving funds from you to authenticate via a SEPA transfer. We will store these as part of our business records for accounting, and our bank will also be legally obliged to store the details for many years.</p></li>
-<li><p>Your phone number when using SMS authentication. We rely on third party providers (such as your mobile network operator) to deliver the SMS to you. These third parties will see the SMS message sent to you and could thus learn that you are using Anastasis. SMS is inherently insecure, and you should expect many governments and private parties to be able to observe these messages. However, we do not store your SMS number on our systems, except maybe in short-term logs to diagnose errors.</p></li>
-<li><p>Your e-mail address when using E-mail authentication. We rely on the Internet and your E-mail provider to deliver the E-mail to you. Internet service providers will see the E-mail message sent to you and could thus learn that you are using Anastasis. E-mail is inherently insecure, and you should expect many governments and private parties to be able to observe these messages. However, we do not store your E-mail address on our systems, except maybe in short-term logs to diagnose errors.</p></li>
-<li><p>Your physical address when using postal mail authentication. We rely on external providers for printing and sending the letter to you. These providers will need to learn your address and could learn that you are using Anastasis. Physical mail has strict privacy protections by law, but governments are known to break postal secrecy. We do not store your physical address on our systems, except maybe in short-term logs to diagnose errors.</p></li>
-<li><p>When you contact us. We may collect certain information if you choose to contact us, for example to report a bug or other error with the Taler Wallet. This may include contact information such as your name, email address or phone number depending on the method you choose to contact us.</p></li>
-</ul>
-</div></blockquote>
-</div>
-<div class="section" id="how-we-collect-and-process-information">
-<h2>How we collect and process information<a class="headerlink" href="#how-we-collect-and-process-information" title="Permalink to this headline">¶</a></h2>
-<p>We may process your information for the following reasons:</p>
-<blockquote>
-<div><ul class="simple">
-<li><p>to authenticate you during secret recovery</p></li>
-<li><p>to support you using Anastasis when you contact us</p></li>
-</ul>
-</div></blockquote>
-</div>
-<div class="section" id="how-we-share-and-use-the-information-we-gather">
-<h2>How we share and use the information we gather<a class="headerlink" href="#how-we-share-and-use-the-information-we-gather" title="Permalink to this headline">¶</a></h2>
-<p>We may share your authentication data with other providers that assist
-us in performing the authentication. We will try to use providers that
-to the best of our knowledge respect your privacy and have good
-privacy practices. We reserve the right to change authentication
-providers at any time to ensure availability of our services.</p>
-<p>We primarily use the limited information we receive directly from you to
-enhance Anastasis. Some ways we may use your Personal Information are
-to: Contact you when necessary to respond to your comments, answer your
-questions, or obtain additional information on issues related to bugs or
-errors with the Anastasis application that you reported.</p>
-</div>
-<div class="section" id="agents-or-third-party-partners">
-<h2>Agents or third party partners<a class="headerlink" href="#agents-or-third-party-partners" title="Permalink to this headline">¶</a></h2>
-<p>We may provide your Personal Information to our employees, contractors,
-agents, service providers, and designees (“Agents”) to enable them to perform
-certain services for us exclusively, including: improvement and maintenance of
-our software and Services. By accepting this Privacy Policy, as outlined
-above, you consent to any such transfer.</p>
-</div>
-<div class="section" id="protection-of-us-and-others">
-<h2>Protection of us and others<a class="headerlink" href="#protection-of-us-and-others" title="Permalink to this headline">¶</a></h2>
-<p>We reserve the right to access, read, preserve, and disclose any information
-that we reasonably believe is necessary to comply with the law or a court
-order.</p>
-</div>
-<div class="section" id="what-personal-information-can-i-access-or-change">
-<h2>What personal information can I access or change?<a class="headerlink" href="#what-personal-information-can-i-access-or-change" title="Permalink to this headline">¶</a></h2>
-<p>You can request access to the information we have collected from
-you. You can do this by contacting us at <a class="reference external" href="mailto:privacy&#37;&#52;&#48;anastasis&#46;lu">privacy<span>&#64;</span>anastasis<span>&#46;</span>lu</a>. We will
-make sure to provide you with a copy of the data we process about
-you. To comply with your request, we may ask you to verify your
-identity. We will fulfill your request by sending your copy
-electronically. For any subsequent access request, we may charge you
-with an administrative fee. If you believe that the information we
-have collected is incorrect, you are welcome to contact us so we can
-update it and keep your data accurate. Any data that is no longer
-needed for purposes specified in the “How We Use the Information We
-Gather” section will be deleted after ninety (90) days.</p>
-</div>
-<div class="section" id="data-retention">
-<h2>Data retention<a class="headerlink" href="#data-retention" title="Permalink to this headline">¶</a></h2>
-<p>Information entered into our bug tracker will be retained indefinitely
-and is typically made public. We will only use it to triage the
-problem. Beyond that, we do not retain personally identifiable
-information about our users for longer than one week.</p>
-</div>
-<div class="section" id="data-security">
-<h2>Data security<a class="headerlink" href="#data-security" title="Permalink to this headline">¶</a></h2>
-<p>We are committed to making sure your information is protected. We employ
-several physical and electronic safeguards to keep your information safe,
-including encrypted user passwords, two factor verification and authentication
-on passwords where possible, and securing connections with industry standard
-transport layer security. You are also welcome to contact us using GnuPG
-encrypted e-mail. Even with all these precautions, we cannot fully guarantee
-against the access, disclosure, alteration, or deletion of data through
-events, including but not limited to hardware or software failure or
-unauthorized use. Any information that you provide to us is done so entirely
-at your own risk.</p>
-</div>
-<div class="section" id="changes-and-updates-to-privacy-policy">
-<h2>Changes and updates to privacy policy<a class="headerlink" href="#changes-and-updates-to-privacy-policy" title="Permalink to this headline">¶</a></h2>
-<p>We reserve the right to update and revise this privacy policy at any time. We
-occasionally review this Privacy Policy to make sure it complies with
-applicable laws and conforms to changes in our business. We may need to update
-this Privacy Policy, and we reserve the right to do so at any time. If we do
-revise this Privacy Policy, we will update the “Effective Date” at the top
-of this page so that you can tell if it has changed since your last visit. As
-we generally do not collect contact information and also do not track your
-visits, we will not be able to notify you directly. However, Anastasis clients
-may inform you about a change in the privacy policy once they detect that the
-policy has changed. Please review this Privacy Policy regularly to ensure that
-you are aware of its terms. Any use of our Services after an amendment to our
-Privacy Policy constitutes your acceptance to the revised or amended
-agreement.</p>
-</div>
-<div class="section" id="international-users-and-visitors">
-<h2>International users and visitors<a class="headerlink" href="#international-users-and-visitors" title="Permalink to this headline">¶</a></h2>
-<p>Our Services are (currently) hosted in Germany. If you are a user
-accessing the Services from the Switzerland, Asia, US, or any other
-region with laws or regulations governing personal data collection,
-use, and disclosure that differ from the laws of Germany, please be
-advised that through your continued use of the Services, which is
-governed by the law of the country hosting the service, you are
-transferring your Personal Information to Germany and you consent to
-that transfer.</p>
-</div>
-<div class="section" id="questions">
-<h2>Questions<a class="headerlink" href="#questions" title="Permalink to this headline">¶</a></h2>
-<p>Please contact us at <a class="reference external" href="mailto:privacy&#37;&#52;&#48;anastasis&#46;lu">privacy<span>&#64;</span>anastasis<span>&#46;</span>lu</a> if you have questions about our
-privacy practices that are not addressed in this Privacy Statement.</p>
-</div>
-</div>
-
-
- <div class="clearer"></div>
- </div>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- </body>
-</html> \ No newline at end of file
diff --git a/contrib/pp/en/0.pdf b/contrib/pp/en/0.pdf
deleted file mode 100644
index 805f725..0000000
--- a/contrib/pp/en/0.pdf
+++ /dev/null
Binary files differ
diff --git a/contrib/pp/en/0.txt b/contrib/pp/en/0.txt
deleted file mode 100644
index 72906ca..0000000
--- a/contrib/pp/en/0.txt
+++ /dev/null
@@ -1,219 +0,0 @@
-Privacy Policy
-**************
-
-Last Updated: 07.09.2021
-
-This Privacy Policy describes the policies and procedures of Anastasis
-SARL (“we,” “our,” or “us”) pertaining to the collection, use, and
-disclosure of your information on our sites and related mobile
-applications and products we offer (the “Services”). This Privacy
-Statement applies to your personal data when you use our Services, and
-does not apply to online websites or services that we do not own or
-control.
-
-
-Overview
-========
-
-Your privacy is important to us. We follow a few fundamental
-principles: We don’t ask you for personally identifiable information
-(defined below). That being said, your contact information, such as
-your phone number, social media handle, or email address (depending on
-how you contact us), may be collected when you communicate with us,
-for example to report a bug or other error related to Anastasis. We
-don’t share your information with third parties except when strictly
-required to deliver you our Services and products, or to comply with
-the law. If you have any questions or concerns about this policy,
-please reach out to us at privacy@anastasis.lu.
-
-
-How you accept this policy
-==========================
-
-By using our Services or visiting our sites, you agree to the use,
-disclosure, and procedures outlined in this Privacy Policy.
-
-
-What personal information do we collect from our users?
-=======================================================
-
-The information we collect from you falls into two categories: (i)
-personally identifiable information (i.e., data that could potentially
-identify you as an individual) (“Personal Information”), and (ii) non-
-personally identifiable information (i.e., information that cannot be
-used to identify who you are) (“Non-Personal Information”). This
-Privacy Policy covers both categories and will tell you how we might
-collect and use each type.
-
-We do our best to not collect any Personal Information from Anastasis
-users. The detailed Personal Information Anastasis asks from you
-during the regular backup and recovery process at the beginning is
-never shared with us and only used to create a cryptographic account
-identifier which does not allow us to recover any of your details.
-
-That being said, when using our Services to recover key material, we
-may inherently receive the following information (depending on your
-choice of authentication method):
-
- * Bank account details necessary when receiving funds from you to
- authenticate via a SEPA transfer. We will store these as part of
- our business records for accounting, and our bank will also be
- legally obliged to store the details for many years.
-
- * Your phone number when using SMS authentication. We rely on third
- party providers (such as your mobile network operator) to deliver
- the SMS to you. These third parties will see the SMS message sent
- to you and could thus learn that you are using Anastasis. SMS is
- inherently insecure, and you should expect many governments and
- private parties to be able to observe these messages. However,
- we do not store your SMS number on our systems, except maybe in
- short-term logs to diagnose errors.
-
- * Your e-mail address when using E-mail authentication. We rely on
- the Internet and your E-mail provider to deliver the E-mail to
- you. Internet service providers will see the E-mail message sent
- to you and could thus learn that you are using Anastasis. E-mail
- is inherently insecure, and you should expect many governments
- and private parties to be able to observe these messages.
- However, we do not store your E-mail address on our systems,
- except maybe in short-term logs to diagnose errors.
-
- * Your physical address when using postal mail authentication. We
- rely on external providers for printing and sending the letter to
- you. These providers will need to learn your address and could
- learn that you are using Anastasis. Physical mail has strict
- privacy protections by law, but governments are known to break
- postal secrecy. We do not store your physical address on our
- systems, except maybe in short-term logs to diagnose errors.
-
- * When you contact us. We may collect certain information if you
- choose to contact us, for example to report a bug or other error
- with the Taler Wallet. This may include contact information such
- as your name, email address or phone number depending on the
- method you choose to contact us.
-
-
-How we collect and process information
-======================================
-
-We may process your information for the following reasons:
-
- * to authenticate you during secret recovery
-
- * to support you using Anastasis when you contact us
-
-
-How we share and use the information we gather
-==============================================
-
-We may share your authentication data with other providers that assist
-us in performing the authentication. We will try to use providers that
-to the best of our knowledge respect your privacy and have good
-privacy practices. We reserve the right to change authentication
-providers at any time to ensure availability of our services.
-
-We primarily use the limited information we receive directly from you
-to enhance Anastasis. Some ways we may use your Personal Information
-are to: Contact you when necessary to respond to your comments, answer
-your questions, or obtain additional information on issues related to
-bugs or errors with the Anastasis application that you reported.
-
-
-Agents or third party partners
-==============================
-
-We may provide your Personal Information to our employees,
-contractors, agents, service providers, and designees (“Agents”) to
-enable them to perform certain services for us exclusively, including:
-improvement and maintenance of our software and Services. By accepting
-this Privacy Policy, as outlined above, you consent to any such
-transfer.
-
-
-Protection of us and others
-===========================
-
-We reserve the right to access, read, preserve, and disclose any
-information that we reasonably believe is necessary to comply with the
-law or a court order.
-
-
-What personal information can I access or change?
-=================================================
-
-You can request access to the information we have collected from you.
-You can do this by contacting us at privacy@anastasis.lu. We will make
-sure to provide you with a copy of the data we process about you. To
-comply with your request, we may ask you to verify your identity. We
-will fulfill your request by sending your copy electronically. For any
-subsequent access request, we may charge you with an administrative
-fee. If you believe that the information we have collected is
-incorrect, you are welcome to contact us so we can update it and keep
-your data accurate. Any data that is no longer needed for purposes
-specified in the “How We Use the Information We Gather” section will
-be deleted after ninety (90) days.
-
-
-Data retention
-==============
-
-Information entered into our bug tracker will be retained indefinitely
-and is typically made public. We will only use it to triage the
-problem. Beyond that, we do not retain personally identifiable
-information about our users for longer than one week.
-
-
-Data security
-=============
-
-We are committed to making sure your information is protected. We
-employ several physical and electronic safeguards to keep your
-information safe, including encrypted user passwords, two factor
-verification and authentication on passwords where possible, and
-securing connections with industry standard transport layer security.
-You are also welcome to contact us using GnuPG encrypted e-mail. Even
-with all these precautions, we cannot fully guarantee against the
-access, disclosure, alteration, or deletion of data through events,
-including but not limited to hardware or software failure or
-unauthorized use. Any information that you provide to us is done so
-entirely at your own risk.
-
-
-Changes and updates to privacy policy
-=====================================
-
-We reserve the right to update and revise this privacy policy at any
-time. We occasionally review this Privacy Policy to make sure it
-complies with applicable laws and conforms to changes in our business.
-We may need to update this Privacy Policy, and we reserve the right to
-do so at any time. If we do revise this Privacy Policy, we will update
-the “Effective Date” at the top of this page so that you can tell if
-it has changed since your last visit. As we generally do not collect
-contact information and also do not track your visits, we will not be
-able to notify you directly. However, Anastasis clients may inform you
-about a change in the privacy policy once they detect that the policy
-has changed. Please review this Privacy Policy regularly to ensure
-that you are aware of its terms. Any use of our Services after an
-amendment to our Privacy Policy constitutes your acceptance to the
-revised or amended agreement.
-
-
-International users and visitors
-================================
-
-Our Services are (currently) hosted in Germany. If you are a user
-accessing the Services from the Switzerland, Asia, US, or any other
-region with laws or regulations governing personal data collection,
-use, and disclosure that differ from the laws of Germany, please be
-advised that through your continued use of the Services, which is
-governed by the law of the country hosting the service, you are
-transferring your Personal Information to Germany and you consent to
-that transfer.
-
-
-Questions
-=========
-
-Please contact us at privacy@anastasis.lu if you have questions about
-our privacy practices that are not addressed in this Privacy
-Statement.
diff --git a/contrib/pp/en/0.xml b/contrib/pp/en/0.xml
deleted file mode 100644
index b972e30..0000000
--- a/contrib/pp/en/0.xml
+++ /dev/null
@@ -1,177 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE document PUBLIC "+//IDN docutils.sourceforge.net//DTD Docutils Generic//EN//XML" "http://docutils.sourceforge.net/docs/ref/docutils.dtd">
-<!-- Generated by Docutils 0.16 -->
-<document source="/research/anastasis/anastasis/contrib/pp/pp.rst">
- <section ids="privacy-policy" names="privacy\ policy">
- <title>Privacy Policy</title>
- <paragraph>Last Updated: 07.09.2021</paragraph>
- <paragraph>This Privacy Policy describes the policies and procedures of Anastasis
- SARL (“we,” “our,” or “us”) pertaining to the collection, use, and
- disclosure of your information on our sites and related mobile
- applications and products we offer (the “Services”). This Privacy
- Statement applies to your personal data when you use our Services, and
- does not apply to online websites or services that we do not own or
- control.</paragraph>
- <section ids="overview" names="overview">
- <title>Overview</title>
- <paragraph>Your privacy is important to us. We follow a few fundamental
- principles: We don’t ask you for personally identifiable information
- (defined below). That being said, your contact information, such as
- your phone number, social media handle, or email address (depending on
- how you contact us), may be collected when you communicate with us,
- for example to report a bug or other error related to Anastasis. We
- don’t share your information with third parties except when strictly
- required to deliver you our Services and products, or to comply with
- the law. If you have any questions or concerns about this policy,
- please reach out to us at <reference refuri="mailto:privacy@anastasis.lu">privacy@anastasis.lu</reference>.</paragraph>
- </section>
- <section ids="how-you-accept-this-policy" names="how\ you\ accept\ this\ policy">
- <title>How you accept this policy</title>
- <paragraph>By using our Services or visiting our sites, you agree to the use, disclosure,
- and procedures outlined in this Privacy Policy.</paragraph>
- </section>
- <section ids="what-personal-information-do-we-collect-from-our-users" names="what\ personal\ information\ do\ we\ collect\ from\ our\ users?">
- <title>What personal information do we collect from our users?</title>
- <paragraph>The information we collect from you falls into two categories: (i) personally
- identifiable information (i.e., data that could potentially identify you as an
- individual) (“Personal Information”), and (ii) non-personally identifiable
- information (i.e., information that cannot be used to identify who you are)
- (“Non-Personal Information”). This Privacy Policy covers both categories and
- will tell you how we might collect and use each type.</paragraph>
- <paragraph>We do our best to not collect any Personal Information from Anastasis
- users. The detailed Personal Information Anastasis asks from you during
- the regular backup and recovery process at the beginning is never shared
- with us and only used to create a cryptographic account identifier which
- does not allow us to recover any of your details.</paragraph>
- <paragraph>That being said, when using our Services to recover key material, we may
- inherently receive the following information (depending on your choice of
- authentication method):</paragraph>
- <block_quote>
- <bullet_list bullet="*">
- <list_item>
- <paragraph>Bank account details necessary when receiving funds from you to authenticate via a SEPA transfer. We will store these as part of our business records for accounting, and our bank will also be legally obliged to store the details for many years.</paragraph>
- </list_item>
- <list_item>
- <paragraph>Your phone number when using SMS authentication. We rely on third party providers (such as your mobile network operator) to deliver the SMS to you. These third parties will see the SMS message sent to you and could thus learn that you are using Anastasis. SMS is inherently insecure, and you should expect many governments and private parties to be able to observe these messages. However, we do not store your SMS number on our systems, except maybe in short-term logs to diagnose errors.</paragraph>
- </list_item>
- <list_item>
- <paragraph>Your e-mail address when using E-mail authentication. We rely on the Internet and your E-mail provider to deliver the E-mail to you. Internet service providers will see the E-mail message sent to you and could thus learn that you are using Anastasis. E-mail is inherently insecure, and you should expect many governments and private parties to be able to observe these messages. However, we do not store your E-mail address on our systems, except maybe in short-term logs to diagnose errors.</paragraph>
- </list_item>
- <list_item>
- <paragraph>Your physical address when using postal mail authentication. We rely on external providers for printing and sending the letter to you. These providers will need to learn your address and could learn that you are using Anastasis. Physical mail has strict privacy protections by law, but governments are known to break postal secrecy. We do not store your physical address on our systems, except maybe in short-term logs to diagnose errors.</paragraph>
- </list_item>
- <list_item>
- <paragraph>When you contact us. We may collect certain information if you choose to contact us, for example to report a bug or other error with the Taler Wallet. This may include contact information such as your name, email address or phone number depending on the method you choose to contact us.</paragraph>
- </list_item>
- </bullet_list>
- </block_quote>
- </section>
- <section ids="how-we-collect-and-process-information" names="how\ we\ collect\ and\ process\ information">
- <title>How we collect and process information</title>
- <paragraph>We may process your information for the following reasons:</paragraph>
- <block_quote>
- <bullet_list bullet="*">
- <list_item>
- <paragraph>to authenticate you during secret recovery</paragraph>
- </list_item>
- <list_item>
- <paragraph>to support you using Anastasis when you contact us</paragraph>
- </list_item>
- </bullet_list>
- </block_quote>
- </section>
- <section ids="how-we-share-and-use-the-information-we-gather" names="how\ we\ share\ and\ use\ the\ information\ we\ gather">
- <title>How we share and use the information we gather</title>
- <paragraph>We may share your authentication data with other providers that assist
- us in performing the authentication. We will try to use providers that
- to the best of our knowledge respect your privacy and have good
- privacy practices. We reserve the right to change authentication
- providers at any time to ensure availability of our services.</paragraph>
- <paragraph>We primarily use the limited information we receive directly from you to
- enhance Anastasis. Some ways we may use your Personal Information are
- to: Contact you when necessary to respond to your comments, answer your
- questions, or obtain additional information on issues related to bugs or
- errors with the Anastasis application that you reported.</paragraph>
- </section>
- <section ids="agents-or-third-party-partners" names="agents\ or\ third\ party\ partners">
- <title>Agents or third party partners</title>
- <paragraph>We may provide your Personal Information to our employees, contractors,
- agents, service providers, and designees (“Agents”) to enable them to perform
- certain services for us exclusively, including: improvement and maintenance of
- our software and Services. By accepting this Privacy Policy, as outlined
- above, you consent to any such transfer.</paragraph>
- </section>
- <section ids="protection-of-us-and-others" names="protection\ of\ us\ and\ others">
- <title>Protection of us and others</title>
- <paragraph>We reserve the right to access, read, preserve, and disclose any information
- that we reasonably believe is necessary to comply with the law or a court
- order.</paragraph>
- </section>
- <section ids="what-personal-information-can-i-access-or-change" names="what\ personal\ information\ can\ i\ access\ or\ change?">
- <title>What personal information can I access or change?</title>
- <paragraph>You can request access to the information we have collected from
- you. You can do this by contacting us at <reference refuri="mailto:privacy@anastasis.lu">privacy@anastasis.lu</reference>. We will
- make sure to provide you with a copy of the data we process about
- you. To comply with your request, we may ask you to verify your
- identity. We will fulfill your request by sending your copy
- electronically. For any subsequent access request, we may charge you
- with an administrative fee. If you believe that the information we
- have collected is incorrect, you are welcome to contact us so we can
- update it and keep your data accurate. Any data that is no longer
- needed for purposes specified in the “How We Use the Information We
- Gather” section will be deleted after ninety (90) days.</paragraph>
- </section>
- <section ids="data-retention" names="data\ retention">
- <title>Data retention</title>
- <paragraph>Information entered into our bug tracker will be retained indefinitely
- and is typically made public. We will only use it to triage the
- problem. Beyond that, we do not retain personally identifiable
- information about our users for longer than one week.</paragraph>
- </section>
- <section ids="data-security" names="data\ security">
- <title>Data security</title>
- <paragraph>We are committed to making sure your information is protected. We employ
- several physical and electronic safeguards to keep your information safe,
- including encrypted user passwords, two factor verification and authentication
- on passwords where possible, and securing connections with industry standard
- transport layer security. You are also welcome to contact us using GnuPG
- encrypted e-mail. Even with all these precautions, we cannot fully guarantee
- against the access, disclosure, alteration, or deletion of data through
- events, including but not limited to hardware or software failure or
- unauthorized use. Any information that you provide to us is done so entirely
- at your own risk.</paragraph>
- </section>
- <section ids="changes-and-updates-to-privacy-policy" names="changes\ and\ updates\ to\ privacy\ policy">
- <title>Changes and updates to privacy policy</title>
- <paragraph>We reserve the right to update and revise this privacy policy at any time. We
- occasionally review this Privacy Policy to make sure it complies with
- applicable laws and conforms to changes in our business. We may need to update
- this Privacy Policy, and we reserve the right to do so at any time. If we do
- revise this Privacy Policy, we will update the “Effective Date” at the top
- of this page so that you can tell if it has changed since your last visit. As
- we generally do not collect contact information and also do not track your
- visits, we will not be able to notify you directly. However, Anastasis clients
- may inform you about a change in the privacy policy once they detect that the
- policy has changed. Please review this Privacy Policy regularly to ensure that
- you are aware of its terms. Any use of our Services after an amendment to our
- Privacy Policy constitutes your acceptance to the revised or amended
- agreement.</paragraph>
- </section>
- <section ids="international-users-and-visitors" names="international\ users\ and\ visitors">
- <title>International users and visitors</title>
- <paragraph>Our Services are (currently) hosted in Germany. If you are a user
- accessing the Services from the Switzerland, Asia, US, or any other
- region with laws or regulations governing personal data collection,
- use, and disclosure that differ from the laws of Germany, please be
- advised that through your continued use of the Services, which is
- governed by the law of the country hosting the service, you are
- transferring your Personal Information to Germany and you consent to
- that transfer.</paragraph>
- </section>
- <section ids="questions" names="questions">
- <title>Questions</title>
- <paragraph>Please contact us at <reference refuri="mailto:privacy@anastasis.lu">privacy@anastasis.lu</reference> if you have questions about our
- privacy practices that are not addressed in this Privacy Statement.</paragraph>
- </section>
- </section>
-</document>
diff --git a/contrib/pp/locale/de/LC_MESSAGES/pp.po b/contrib/pp/locale/de/LC_MESSAGES/pp.po
deleted file mode 100644
index f53add7..0000000
--- a/contrib/pp/locale/de/LC_MESSAGES/pp.po
+++ /dev/null
@@ -1,511 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) 2014-2020 Taler Systems SA (GPLv3+ or GFDL 1.3+)
-# This file is distributed under the same license as the pp package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2020.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: pp 0\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2021-09-07 21:42+0200\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 2.9.1\n"
-
-#: ../../pp.rst:2
-msgid "Privacy Policy"
-msgstr ""
-
-#: ../../pp.rst:4
-msgid "Last Updated: 07.09.2021"
-msgstr ""
-
-#: ../../pp.rst:6
-msgid ""
-"This Privacy Policy describes the policies and procedures of Anastasis "
-"SARL (“we,” “our,” or “us”) pertaining to the collection, use, and "
-"disclosure of your information on our sites and related mobile "
-"applications and products we offer (the “Services”). This Privacy "
-"Statement applies to your personal data when you use our Services, and "
-"does not apply to online websites or services that we do not own or "
-"control."
-msgstr ""
-
-#: ../../pp.rst:16
-msgid "Overview"
-msgstr ""
-
-#: ../../pp.rst:18
-msgid ""
-"Your privacy is important to us. We follow a few fundamental principles: "
-"We don’t ask you for personally identifiable information (defined below)."
-" That being said, your contact information, such as your phone number, "
-"social media handle, or email address (depending on how you contact us), "
-"may be collected when you communicate with us, for example to report a "
-"bug or other error related to Anastasis. We don’t share your information "
-"with third parties except when strictly required to deliver you our "
-"Services and products, or to comply with the law. If you have any "
-"questions or concerns about this policy, please reach out to us at "
-"privacy@anastasis.lu."
-msgstr ""
-
-#: ../../pp.rst:31
-msgid "How you accept this policy"
-msgstr ""
-
-#: ../../pp.rst:33
-msgid ""
-"By using our Services or visiting our sites, you agree to the use, "
-"disclosure, and procedures outlined in this Privacy Policy."
-msgstr ""
-
-#: ../../pp.rst:38
-msgid "What personal information do we collect from our users?"
-msgstr ""
-
-#: ../../pp.rst:40
-msgid ""
-"The information we collect from you falls into two categories: (i) "
-"personally identifiable information (i.e., data that could potentially "
-"identify you as an individual) (“Personal Information”), and (ii) non-"
-"personally identifiable information (i.e., information that cannot be "
-"used to identify who you are) (“Non-Personal Information”). This Privacy "
-"Policy covers both categories and will tell you how we might collect and "
-"use each type."
-msgstr ""
-
-#: ../../pp.rst:47
-msgid ""
-"We do our best to not collect any Personal Information from Anastasis "
-"users. The detailed Personal Information Anastasis asks from you during "
-"the regular backup and recovery process at the beginning is never shared "
-"with us and only used to create a cryptographic account identifier which "
-"does not allow us to recover any of your details."
-msgstr ""
-
-#: ../../pp.rst:53
-msgid ""
-"That being said, when using our Services to recover key material, we may "
-"inherently receive the following information (depending on your choice of"
-" authentication method):"
-msgstr ""
-
-#: ../../pp.rst:57
-msgid ""
-"Bank account details necessary when receiving funds from you to "
-"authenticate via a SEPA transfer. We will store these as part of our "
-"business records for accounting, and our bank will also be legally "
-"obliged to store the details for many years."
-msgstr ""
-
-#: ../../pp.rst:59
-msgid ""
-"Your phone number when using SMS authentication. We rely on third party "
-"providers (such as your mobile network operator) to deliver the SMS to "
-"you. These third parties will see the SMS message sent to you and could "
-"thus learn that you are using Anastasis. SMS is inherently insecure, and "
-"you should expect many governments and private parties to be able to "
-"observe these messages. However, we do not store your SMS number on our "
-"systems, except maybe in short-term logs to diagnose errors."
-msgstr ""
-
-#: ../../pp.rst:61
-msgid ""
-"Your e-mail address when using E-mail authentication. We rely on the "
-"Internet and your E-mail provider to deliver the E-mail to you. Internet "
-"service providers will see the E-mail message sent to you and could thus "
-"learn that you are using Anastasis. E-mail is inherently insecure, and "
-"you should expect many governments and private parties to be able to "
-"observe these messages. However, we do not store your E-mail address on "
-"our systems, except maybe in short-term logs to diagnose errors."
-msgstr ""
-
-#: ../../pp.rst:63
-msgid ""
-"Your physical address when using postal mail authentication. We rely on "
-"external providers for printing and sending the letter to you. These "
-"providers will need to learn your address and could learn that you are "
-"using Anastasis. Physical mail has strict privacy protections by law, but"
-" governments are known to break postal secrecy. We do not store your "
-"physical address on our systems, except maybe in short-term logs to "
-"diagnose errors."
-msgstr ""
-
-#: ../../pp.rst:65
-msgid ""
-"When you contact us. We may collect certain information if you choose to "
-"contact us, for example to report a bug or other error with the Taler "
-"Wallet. This may include contact information such as your name, email "
-"address or phone number depending on the method you choose to contact us."
-msgstr ""
-
-#: ../../pp.rst:69
-msgid "How we collect and process information"
-msgstr ""
-
-#: ../../pp.rst:71
-msgid "We may process your information for the following reasons:"
-msgstr ""
-
-#: ../../pp.rst:73
-msgid "to authenticate you during secret recovery"
-msgstr ""
-
-#: ../../pp.rst:74
-msgid "to support you using Anastasis when you contact us"
-msgstr ""
-
-#: ../../pp.rst:78
-msgid "How we share and use the information we gather"
-msgstr ""
-
-#: ../../pp.rst:80
-msgid ""
-"We may share your authentication data with other providers that assist us"
-" in performing the authentication. We will try to use providers that to "
-"the best of our knowledge respect your privacy and have good privacy "
-"practices. We reserve the right to change authentication providers at "
-"any time to ensure availability of our services."
-msgstr ""
-
-#: ../../pp.rst:86
-msgid ""
-"We primarily use the limited information we receive directly from you to "
-"enhance Anastasis. Some ways we may use your Personal Information are to:"
-" Contact you when necessary to respond to your comments, answer your "
-"questions, or obtain additional information on issues related to bugs or "
-"errors with the Anastasis application that you reported."
-msgstr ""
-
-#: ../../pp.rst:94
-msgid "Agents or third party partners"
-msgstr ""
-
-#: ../../pp.rst:96
-msgid ""
-"We may provide your Personal Information to our employees, contractors, "
-"agents, service providers, and designees (“Agents”) to enable them to "
-"perform certain services for us exclusively, including: improvement and "
-"maintenance of our software and Services. By accepting this Privacy "
-"Policy, as outlined above, you consent to any such transfer."
-msgstr ""
-
-#: ../../pp.rst:104
-msgid "Protection of us and others"
-msgstr ""
-
-#: ../../pp.rst:106
-msgid ""
-"We reserve the right to access, read, preserve, and disclose any "
-"information that we reasonably believe is necessary to comply with the "
-"law or a court order."
-msgstr ""
-
-#: ../../pp.rst:112
-msgid "What personal information can I access or change?"
-msgstr ""
-
-#: ../../pp.rst:114
-msgid ""
-"You can request access to the information we have collected from you. You"
-" can do this by contacting us at privacy@anastasis.lu. We will make sure "
-"to provide you with a copy of the data we process about you. To comply "
-"with your request, we may ask you to verify your identity. We will "
-"fulfill your request by sending your copy electronically. For any "
-"subsequent access request, we may charge you with an administrative fee. "
-"If you believe that the information we have collected is incorrect, you "
-"are welcome to contact us so we can update it and keep your data "
-"accurate. Any data that is no longer needed for purposes specified in the"
-" “How We Use the Information We Gather” section will be deleted after "
-"ninety (90) days."
-msgstr ""
-
-#: ../../pp.rst:128
-msgid "Data retention"
-msgstr ""
-
-#: ../../pp.rst:130
-msgid ""
-"Information entered into our bug tracker will be retained indefinitely "
-"and is typically made public. We will only use it to triage the problem."
-" Beyond that, we do not retain personally identifiable information about"
-" our users for longer than one week."
-msgstr ""
-
-#: ../../pp.rst:137
-msgid "Data security"
-msgstr ""
-
-#: ../../pp.rst:139
-msgid ""
-"We are committed to making sure your information is protected. We employ "
-"several physical and electronic safeguards to keep your information safe,"
-" including encrypted user passwords, two factor verification and "
-"authentication on passwords where possible, and securing connections with"
-" industry standard transport layer security. You are also welcome to "
-"contact us using GnuPG encrypted e-mail. Even with all these precautions,"
-" we cannot fully guarantee against the access, disclosure, alteration, or"
-" deletion of data through events, including but not limited to hardware "
-"or software failure or unauthorized use. Any information that you provide"
-" to us is done so entirely at your own risk."
-msgstr ""
-
-#: ../../pp.rst:152
-msgid "Changes and updates to privacy policy"
-msgstr ""
-
-#: ../../pp.rst:154
-msgid ""
-"We reserve the right to update and revise this privacy policy at any "
-"time. We occasionally review this Privacy Policy to make sure it complies"
-" with applicable laws and conforms to changes in our business. We may "
-"need to update this Privacy Policy, and we reserve the right to do so at "
-"any time. If we do revise this Privacy Policy, we will update the "
-"“Effective Date” at the top of this page so that you can tell if it has "
-"changed since your last visit. As we generally do not collect contact "
-"information and also do not track your visits, we will not be able to "
-"notify you directly. However, Anastasis clients may inform you about a "
-"change in the privacy policy once they detect that the policy has "
-"changed. Please review this Privacy Policy regularly to ensure that you "
-"are aware of its terms. Any use of our Services after an amendment to our"
-" Privacy Policy constitutes your acceptance to the revised or amended "
-"agreement."
-msgstr ""
-
-#: ../../pp.rst:170
-msgid "International users and visitors"
-msgstr ""
-
-#: ../../pp.rst:172
-msgid ""
-"Our Services are (currently) hosted in Germany. If you are a user "
-"accessing the Services from the Switzerland, Asia, US, or any other "
-"region with laws or regulations governing personal data collection, use, "
-"and disclosure that differ from the laws of Germany, please be advised "
-"that through your continued use of the Services, which is governed by the"
-" law of the country hosting the service, you are transferring your "
-"Personal Information to Germany and you consent to that transfer."
-msgstr ""
-
-#: ../../pp.rst:183
-msgid "Questions"
-msgstr ""
-
-#: ../../pp.rst:185
-msgid ""
-"Please contact us at privacy@anastasis.lu if you have questions about our"
-" privacy practices that are not addressed in this Privacy Statement."
-msgstr ""
-
-#~ msgid "Last Updated: 11.12.2019"
-#~ msgstr ""
-
-#~ msgid ""
-#~ "This Privacy Policy describes the "
-#~ "policies and procedures of Taler Systems"
-#~ " SA (“we,” “our,” or “us”) pertaining"
-#~ " to the collection, use, and "
-#~ "disclosure of your information on our"
-#~ " sites and related mobile applications "
-#~ "and products we offer (the “Services”"
-#~ " or “Taler Wallet”). This Privacy "
-#~ "Statement applies to your personal data"
-#~ " when you use our Services, and "
-#~ "does not apply to online websites "
-#~ "or services that we do not own "
-#~ "or control."
-#~ msgstr ""
-
-#~ msgid ""
-#~ "Your privacy is important to us. "
-#~ "We follow a few fundamental principles:"
-#~ " We don’t ask you for personally "
-#~ "identifiable information (defined below). That"
-#~ " being said, your contact information, "
-#~ "such as your phone number, social "
-#~ "media handle, or email address "
-#~ "(depending on how you contact us), "
-#~ "may be collected when you communicate"
-#~ " with us, for example to report "
-#~ "a bug or other error related to"
-#~ " the Taler Wallet. We don’t share "
-#~ "your information with third parties "
-#~ "except when strictly required to deliver"
-#~ " you our Services and products, or"
-#~ " to comply with the law. If you"
-#~ " have any questions or concerns about"
-#~ " this policy, please reach out to "
-#~ "us at privacy@taler-systems.net."
-#~ msgstr ""
-
-#~ msgid ""
-#~ "We do our best to not collect "
-#~ "any Personal Information from Taler "
-#~ "Wallet users. We believe that the "
-#~ "Taler Wallet never transmits personal "
-#~ "information to our services without at"
-#~ " least clear implied consent, and we"
-#~ " only process and retain information "
-#~ "with a strict business need. That "
-#~ "being said, when using our Services, "
-#~ "we inherently have to collect the "
-#~ "following information:"
-#~ msgstr ""
-
-#~ msgid ""
-#~ "Bank account details necessary when "
-#~ "receiving funds from you to top-up"
-#~ " your wallet or to transfer funds "
-#~ "to you when you are being paid "
-#~ "via Taler. At the current experimental"
-#~ " stage, only the pseudonym and "
-#~ "password you entered in the bank "
-#~ "demonstrator is stored."
-#~ msgstr ""
-
-#~ msgid ""
-#~ "The amounts being withdrawn or "
-#~ "deposited, with associated unique transaction"
-#~ " identifiers and cryptographic signatures "
-#~ "authorizing the transaction. Note that "
-#~ "for purchases, we cannot identify the"
-#~ " buyer from the collected data, so"
-#~ " when you spend money, we only "
-#~ "receive non-personal information."
-#~ msgstr ""
-
-#~ msgid "to transfer money as specified by our users (Taler transactions);"
-#~ msgstr ""
-
-#~ msgid ""
-#~ "to assist government entities in linking"
-#~ " income to the underlying contract"
-#~ msgstr ""
-
-#~ msgid "to support you using the Taler Wallet or to improve our Services"
-#~ msgstr ""
-
-#~ msgid ""
-#~ "We may share your Personal Data or"
-#~ " other information about you only if"
-#~ " you are a merchant receiving income,"
-#~ " with your bank, to the degree "
-#~ "necessary to execute the payment."
-#~ msgstr ""
-
-#~ msgid ""
-#~ "We retain Personal Data to transfer "
-#~ "funds to the accounts designated by "
-#~ "our users. We may retain Personal "
-#~ "Data only for as long as mandated"
-#~ " by law and required for the "
-#~ "wire transfers."
-#~ msgstr ""
-
-#~ msgid ""
-#~ "We primarily use the limited information"
-#~ " we receive directly from you to "
-#~ "enhance the Taler Wallet. Some ways "
-#~ "we may use your Personal Information "
-#~ "are to: Contact you when necessary "
-#~ "to respond to your comments, answer "
-#~ "your questions, or obtain additional "
-#~ "information on issues related to bugs"
-#~ " or errors with the Taler Wallet "
-#~ "that you reported."
-#~ msgstr ""
-
-#~ msgid ""
-#~ "You can request access to the "
-#~ "information we have collected from you."
-#~ " You can do this by contacting "
-#~ "us at privacy@taler-systems.net. We will"
-#~ " make sure to provide you with "
-#~ "a copy of the data we process "
-#~ "about you. To comply with your "
-#~ "request, we may ask you to verify"
-#~ " your identity. We will fulfill your"
-#~ " request by sending your copy "
-#~ "electronically. For any subsequent access "
-#~ "request, we may charge you with an"
-#~ " administrative fee. If you believe "
-#~ "that the information we have collected"
-#~ " is incorrect, you are welcome to "
-#~ "contact us so we can update it "
-#~ "and keep your data accurate. Any "
-#~ "data that is no longer needed for"
-#~ " purposes specified in the “How We"
-#~ " Use the Information We Gather” "
-#~ "section will be deleted after ninety "
-#~ "(90) days."
-#~ msgstr ""
-
-#~ msgid ""
-#~ "If you uninstall the Taler Wallet "
-#~ "mobile applications from your device, or"
-#~ " request that your information be "
-#~ "deleted, we still may retain some "
-#~ "information that you have provided to"
-#~ " us to maintain the Taler Wallet "
-#~ "or to comply with relevant laws."
-#~ msgstr ""
-
-#~ msgid ""
-#~ "We reserve the right to update and"
-#~ " revise this privacy policy at any"
-#~ " time. We occasionally review this "
-#~ "Privacy Policy to make sure it "
-#~ "complies with applicable laws and "
-#~ "conforms to changes in our business. "
-#~ "We may need to update this Privacy"
-#~ " Policy, and we reserve the right "
-#~ "to do so at any time. If we"
-#~ " do revise this Privacy Policy, we"
-#~ " will update the “Effective Date” at"
-#~ " the bottom of this page so "
-#~ "that you can tell if it has "
-#~ "changed since your last visit. As "
-#~ "we generally do not collect contact "
-#~ "information and also do not track "
-#~ "your visits, we will not be able"
-#~ " to notify you directly. However, the"
-#~ " Taler Wallet may inform you about"
-#~ " a change in the privacy policy "
-#~ "once it detects that the policy "
-#~ "has changed. Please review this Privacy"
-#~ " Policy regularly to ensure that you"
-#~ " are aware of its terms. Any "
-#~ "use of our Services after an "
-#~ "amendment to our Privacy Policy "
-#~ "constitutes your acceptance to the "
-#~ "revised or amended agreement."
-#~ msgstr ""
-
-#~ msgid ""
-#~ "Our Services are hosted in Switzerland."
-#~ " If you are a user accessing "
-#~ "the Services from the European Union,"
-#~ " Asia, US, or any other region "
-#~ "with laws or regulations governing "
-#~ "personal data collection, use, and "
-#~ "disclosure that differ from Swiss laws,"
-#~ " please be advised that through your"
-#~ " continued use of the Services, which"
-#~ " is governed by Swiss law, you "
-#~ "are transferring your Personal Information "
-#~ "to Switzerland and you consent to "
-#~ "that transfer."
-#~ msgstr ""
-
-#~ msgid ""
-#~ "Please contact us at privacy@taler-"
-#~ "systems.net if you have questions about"
-#~ " our privacy practices that are not"
-#~ " addressed in this Privacy Statement."
-#~ msgstr ""
-
diff --git a/contrib/provider-list.json b/contrib/provider-list.json
index ccac44d..ddce9be 100644
--- a/contrib/provider-list.json
+++ b/contrib/provider-list.json
@@ -11,28 +11,28 @@
"name" : "Codeblau GmbH, Germany"
},
{
- "url" : "https://v1.anastasis.openw3b.org/",
- "name" : "Openw3b Foundation, India"
- },
- {
"url" : "https://v1.anastasis.lu/",
"name" : "Anastasis SARL, Luxembourg"
},
- {
+ {
"url" : "http://localhost:8086/",
- "restricted" : "xx"
- },
- {
+ "name" : "Data Loss Inc. #1",
+ "restricted" : "xx"
+ },
+ {
"url" : "http://localhost:8087/",
- "restricted" : "xx"
- },
- {
+ "name" : "Data Loss Inc. #2",
+ "restricted" : "xx"
+ },
+ {
"url" : "http://localhost:8088/",
- "restricted" : "xx"
- },
- {
+ "name" : "Data Loss Inc. #3",
+ "restricted" : "xx"
+ },
+ {
"url" : "http://localhost:8089/",
- "restricted" : "xx"
- }
+ "name" : "Data Loss Inc. #4",
+ "restricted" : "xx"
+ }
]
}
diff --git a/contrib/redux.al.json b/contrib/redux.al.json
index bb4360e..2696540 100644
--- a/contrib/redux.al.json
+++ b/contrib/redux.al.json
@@ -19,11 +19,8 @@
{
"type": "string",
"name": "nid_number",
- "label": "Numri i Identitetit",
- "label_i18n":{
- "en": "Identity Number",
- "al": "Numri i Identitetit"
- },
+ "label": "Identity Number",
+ "tooltip": "Numri i Identitetit",
"widget": "anastasis_gtk_ia_nid_al",
"uuid": "256e5d30-d65e-481b-9ac4-55f5ac03b24a",
"validation-regex": "^[0-9A-T][0-9](((0|5)[0-9])|10|11|51|52)[0-9]{3}[A-W]$",
diff --git a/contrib/redux.be.json b/contrib/redux.be.json
index 821a3eb..80711cf 100644
--- a/contrib/redux.be.json
+++ b/contrib/redux.be.json
@@ -27,9 +27,6 @@
"type": "string",
"name": "nrn_number",
"label": "National Register Number",
- "label_i18n":{
- "en": "National Register Number"
- },
"widget": "anastasis_gtk_ia_nid_be",
"uuid": "0452f99a-06f7-48bd-8ac0-2e4ed9a24560",
"validation-regex": "^[0-9]{11}$",
diff --git a/contrib/redux.ch.json b/contrib/redux.ch.json
index ecda1a0..6b99ca1 100644
--- a/contrib/redux.ch.json
+++ b/contrib/redux.ch.json
@@ -27,10 +27,7 @@
"type": "string",
"name": "ahv_number",
"label": "AHV number",
- "label_i18n":{
- "de_DE":"AHV-Nummer",
- "de_CH":"AHV-Nummer"
- },
+ "tooltip":"AHV-Nummer",
"widget": "anastasis_gtk_ia_ahv",
"uuid" : "1da87570-ba16-4f62-8a7e-cbda92f51591",
"validation-regex": "^(756)\\.[0-9]{4}\\.[0-9]{4}\\.[0-9]{2}|(756)[0-9]{10}$",
diff --git a/contrib/redux.countries.json b/contrib/redux.countries.json
index 0d824fc..113cb01 100644
--- a/contrib/redux.countries.json
+++ b/contrib/redux.countries.json
@@ -3,168 +3,94 @@
"SPDX-License-Identifier": "GPL3.0-or-later",
"countries": [
{
- "code" : "al",
- "name" : "Albania",
- "continent" : "Europe",
- "name_i18n" : {
- "de_DE": "Albanien",
- "en_UK": "Albania"
- },
- "call_code" : "+355"
+ "code" : "al",
+ "name" : "Albania",
+ "continent" : "Europe",
+ "call_code" : "+355"
},
{
- "code" : "be",
- "name" : "Belgium",
- "continent" : "Europe",
- "name_i18n" : {
- "de_DE": "Belgien",
- "en_UK": "Belgium"
- },
- "call_code" : "+32"
+ "code" : "be",
+ "name" : "Belgium",
+ "continent" : "Europe",
+ "call_code" : "+32"
},
{
- "code" : "ch",
- "name" : "Switzerland",
- "continent" : "Europe",
- "name_i18n" : {
- "de_DE": "Schweiz",
- "de_CH": "Schwiiz",
- "fr_FR": "Suisse",
- "en_UK": "Swiss"
- },
- "call_code" : "+41"
+ "code" : "ch",
+ "name" : "Switzerland",
+ "continent" : "Europe",
+ "call_code" : "+41"
},
{
- "code" : "cz",
- "name" : "Czech Republic",
- "continent" : "Europe",
- "name_i18n" : {
- "en_UK": "Czech Republic"
- },
- "call_code" : "+420"
+ "code" : "cz",
+ "name" : "Czech Republic",
+ "continent" : "Europe",
+ "call_code" : "+420"
},
{
- "code" : "de",
- "name" : "Germany",
- "continent" : "Europe",
- "continent_i18n" : { "de_DE" : "Europa" },
- "name_i18n" : {
- "de_DE": "Deutschland",
- "de_CH": "Deutschland",
- "fr_FR": "Allemagne",
- "en_UK": "Germany"
- },
- "call_code" : "+49"
+ "code" : "de",
+ "name" : "Germany",
+ "continent" : "Europe",
+ "call_code" : "+49"
},
{
- "code" : "dk",
- "name" : "Denmark",
- "continent" : "Europe",
- "continent_i18n" : { "de_DE" : "Europa" },
- "name_i18n" : {
- "en_UK": "Denmark"
- },
- "call_code" : "+45"
+ "code" : "dk",
+ "name" : "Denmark",
+ "continent" : "Europe",
+ "call_code" : "+45"
},
{
- "code" : "es",
- "name" : "Spain",
- "continent" : "Europe",
- "continent_i18n" : { "es_ES" : "Europa" },
- "name_i18n" : {
- "es_ES": "España"
- },
- "call_code" : "+44"
+ "code" : "es",
+ "name" : "Spain",
+ "continent" : "Europe",
+ "call_code" : "+44"
},
{
- "code" : "fr",
- "name" : "France",
- "continent" : "Europe",
- "name_i18n" : {
- "de_DE": "Frankreich",
- "fr_FR": "La France"
- },
- "call_code" : "+33"
+ "code" : "fr",
+ "name" : "France",
+ "continent" : "Europe",
+ "call_code" : "+33"
},
{
- "code" : "in",
- "name" : "India",
- "continent" : "India",
- "continent_i18n" : { "en_EN" : "India" },
- "name_i18n" : {
- "de_DE": "Indien",
- "de_CH": "Indien",
- "fr_FR": "l'Inde",
- "en_UK": "India"
- },
- "call_code" : "+91"
+ "code" : "in",
+ "name" : "India",
+ "continent" : "India",
+ "call_code" : "+91"
},
{
- "code" : "it",
- "name" : "Italy",
- "continent" : "Europe",
- "name_i18n" : {
- "de_DE": "Italien",
- "en_UK": "Italy"
- },
- "call_code" : "+39"
+ "code" : "it",
+ "name" : "Italy",
+ "continent" : "Europe",
+ "call_code" : "+39"
},
{
- "code" : "jp",
- "name" : "Japan",
- "continent" : "Asia",
- "continent_i18n" : { "en_EN" : "Japan" },
- "name_i18n" : {
- "de_DE": "Japan",
- "de_CH": "Japan",
- "en_UK": "Japan"
- },
- "call_code" : "+81"
+ "code" : "jp",
+ "name" : "Japan",
+ "continent" : "Asia",
+ "call_code" : "+81"
},
{
- "code" : "nl",
- "name" : "Netherlands",
- "continent" : "Europe",
- "name_i18n" : {
- "de_DE": "Niederlande",
- "nl_NL": "Nederland",
- "en_UK": "Netherlands"
- },
- "call_code" : "+31"
+ "code" : "nl",
+ "name" : "Netherlands",
+ "continent" : "Europe",
+ "call_code" : "+31"
},
{
- "code" : "sk",
- "name" : "Slovakia",
- "continent" : "Europe",
- "name_i18n" : {
- "en_UK": "Slovakia"
- },
- "call_code" : "+421"
+ "code" : "sk",
+ "name" : "Slovakia",
+ "continent" : "Europe",
+ "call_code" : "+421"
},
{
- "code" : "us",
- "name" : "United States of America (USA)",
- "continent" : "North America",
- "continent_i18n" : { "de_DE" : "Nordamerika" },
- "name_i18n" : {
- "de_DE": "Vereinigte Staaten von Amerika (USA)",
- "de_CH": "Vereinigte Staaten von Amerika (USA)",
- "fr_FR": "États-Unis d'Amérique (USA)",
- "en_UK": "United States of America (USA)"
- },
- "call_code" : "+1"
+ "code" : "us",
+ "name" : "United States of America (USA)",
+ "continent" : "North America",
+ "call_code" : "+1"
},
{
- "code" : "xx",
- "name" : "Testland",
- "continent" : "Demoworld",
- "name_i18n" : {
- "de_DE": "Testlandt",
- "de_CH": "Testlandi",
- "fr_FR": "Testpais",
- "en_UK": "Testland"
- },
- "call_code" : "+00"
+ "code" : "xx",
+ "name" : "Testland",
+ "continent" : "Demoworld",
+ "call_code" : "+0"
}
]
}
diff --git a/contrib/redux.cz.json b/contrib/redux.cz.json
index e7118a8..3f11118 100644
--- a/contrib/redux.cz.json
+++ b/contrib/redux.cz.json
@@ -20,10 +20,7 @@
"type": "string",
"name": "birth_number",
"label": "Birth Number",
- "label_i18n":{
- "en": "Birth Number",
- "cz": "rodné číslo"
- },
+ "tooltip": "rodné číslo",
"widget": "anastasis_gtk_ia_birthnumber_cz",
"uuid": "03e3a05b-1192-44f1-ac36-7425512eee1a",
"validation-regex": "^[0-9]{2}(((0|2|5|7)[0-9])|10|11|31|32|51|52|81|82)/[0-9]{3}[0-9]?$",
diff --git a/contrib/redux.de.json b/contrib/redux.de.json
index 21bbaaf..e62f24a 100644
--- a/contrib/redux.de.json
+++ b/contrib/redux.de.json
@@ -27,10 +27,7 @@
"type": "string",
"name": "social_security_number",
"label": "Social security number",
- "label_i18n":{
- "de_DE": "Deutsche Sozialversicherungsnummer",
- "en": "German Social security number"
- },
+ "tooltip": "Deutsche Sozialversicherungsnummer",
"widget": "anastasis_gtk_ia_ssn_de",
"uuid": "d5e2aa79-1c88-4cf4-a4d2-252508b38e05",
"validation-regex": "^[0-9]{8}[[:upper:]][0-9]{3}$",
diff --git a/contrib/redux.dk.json b/contrib/redux.dk.json
index 29c7c6c..66859b5 100644
--- a/contrib/redux.dk.json
+++ b/contrib/redux.dk.json
@@ -20,10 +20,7 @@
"type": "string",
"name": "cpr_number",
"label": "CPR-nummer",
- "label_i18n":{
- "en": "CPR Number",
- "dk": "CPR-nummer"
- },
+ "tooltip": "CPR-nummer",
"widget": "anastasis_gtk_ia_cpr_dk",
"uuid": "38f13a4d-4302-4ada-ada1-c3ff4a8ff689",
"validation-regex": "^(0[1-9]|[1-2][0-9]|30|31)((0[1-9]|10|11|12))[0-9]{2}-[0-9A-Z]{4}$"
diff --git a/contrib/redux.es.json b/contrib/redux.es.json
index d4a6b2a..320d346 100644
--- a/contrib/redux.es.json
+++ b/contrib/redux.es.json
@@ -27,9 +27,7 @@
"type": "string",
"name": "tax_number",
"label": "Tax number",
- "label_i18n":{
- "es_ES":"Número de Identificación Fiscal (DNI, NIE)"
- },
+ "tooltip":"Número de Identificación Fiscal (DNI, NIE)",
"widget": "anastasis_gtk_ia_es_dni",
"uuid" : "ac8bd865-6be8-445c-b650-6a18eef16a49",
"validation-regex": "^[0-9MXYZ][0-9]{7}[TRWAGMYFPDXBNJZSQVHLCKE]$",
@@ -39,9 +37,7 @@
"type": "string",
"name": "ssn_number",
"label": "Social security number",
- "label_i18n":{
- "es_ES":"Número de Seguridad Social"
- },
+ "tooltip":"Número de Seguridad Social",
"widget": "anastasis_gtk_ia_es_ssn",
"uuid" : "22396a19-f3bb-497e-b63a-961fd639140e",
"validation-regex": "^[0-9]{11}$"
diff --git a/contrib/redux.fr.json b/contrib/redux.fr.json
index 1b57210..fe6ce9b 100644
--- a/contrib/redux.fr.json
+++ b/contrib/redux.fr.json
@@ -27,10 +27,7 @@
"type": "string",
"name": "social_security_number",
"label": "Code Insee",
- "label_i18n":{
- "fr_FR": "Code Insee",
- "en": "INSEE code"
- },
+ "tooltip": "Code Insee",
"widget": "anastasis_gtk_ia_insee_fr",
"uuid": "2f36a81c-3f6d-41f3-97ee-9c885bc41873",
"validation-regex": "^[0-9]{15}$",
diff --git a/contrib/redux.in.json b/contrib/redux.in.json
index a53035c..e7dc8fa 100644
--- a/contrib/redux.in.json
+++ b/contrib/redux.in.json
@@ -27,9 +27,6 @@
"type": "string",
"name": "aadhar_number",
"label": "Aadhar number",
- "label_i18n":{
- "en": "Aadhar number"
- },
"widget": "anastasis_gtk_ia_aadhar_in",
"uuid": "55afe97a-98bc-48d1-bb37-a9658be3fdc9",
"validation-regex": "^[2-9]{1}[0-9]{3}\\s[0-9]{4}\\s[0-9]{4}$",
diff --git a/contrib/redux.it.json b/contrib/redux.it.json
index f744497..f67cd45 100644
--- a/contrib/redux.it.json
+++ b/contrib/redux.it.json
@@ -19,11 +19,8 @@
{
"type": "string",
"name": "fiscal_code",
- "label": "Codice fiscale",
- "label_i18n":{
- "it": "Codice fiscale",
- "en": "Fiscal code"
- },
+ "label": "Fiscal code",
+ "tooltip": "Codice fiscale",
"widget": "anastasis_gtk_ia_cf_it",
"uuid": "88f53c51-52ad-4d63-a163-ec042589f925",
"validation-regex": "^[[:upper:]]{6}[0-9]{2}[A-EHLMPRT](([0-24-6][0-9])|(30|31|70|71))[A-MZ][0-9]{3}[A-Z]$",
diff --git a/contrib/redux.jp.json b/contrib/redux.jp.json
index 2a80cdf..9eda2f6 100644
--- a/contrib/redux.jp.json
+++ b/contrib/redux.jp.json
@@ -27,10 +27,7 @@
"type": "string",
"name": "my_number",
"label": "My number",
- "label_i18n":{
- "en": "My number",
- "jp": "マイナンバー"
- },
+ "tooltip": "マイナンバー",
"widget": "anastasis_gtk_ia_my_jp",
"uuid": "90848f42-a83e-4226-8186-329696c14152",
"validation-regex": "^[0-9]{12}$"
diff --git a/contrib/redux.nl.json b/contrib/redux.nl.json
index 506c2d0..ce6b766 100644
--- a/contrib/redux.nl.json
+++ b/contrib/redux.nl.json
@@ -27,10 +27,7 @@
"type": "string",
"name": "social_security_number",
"label": "Citizen Service Number",
- "label_i18n":{
- "nl_NL": "Burgerservicenummer (BSN)",
- "en": "Citizen Service Number"
- },
+ "tooltip": "Burgerservicenummer (BSN)",
"widget": "anastasis_gtk_ia_ssn_nl",
"uuid": "b6bf1f14-1f85-4afb-af21-f54b88490bdc",
"validation-regex": "^[1-9][0-9]{8}$",
diff --git a/contrib/redux.sk.json b/contrib/redux.sk.json
index e2acef7..7520d15 100644
--- a/contrib/redux.sk.json
+++ b/contrib/redux.sk.json
@@ -20,10 +20,7 @@
"type": "string",
"name": "birth_number",
"label": "Birth Number",
- "label_i18n":{
- "en": "Birth Number",
- "sk": "rodné číslo"
- },
+ "tooltip": "rodné číslo",
"widget": "anastasis_gtk_ia_birthnumber_sk",
"uuid": "1cd372fe-2cea-4928-9f29-66f2bdd8555c",
"validation-regex": "^[0-9]{2}(((0|2|5|7)[0-9])|10|11|31|32|51|52|81|82)/[0-9]{3}[0-9]?$",
diff --git a/contrib/redux.us.json b/contrib/redux.us.json
index 08c0167..c6d0189 100644
--- a/contrib/redux.us.json
+++ b/contrib/redux.us.json
@@ -27,9 +27,7 @@
"type": "string",
"name": "social_security_number",
"label": "Social security number",
- "label_i18n":{
- "en": "US Social security number"
- },
+ "tooltip": "US Social security number",
"widget": "anastasis_gtk_ia_ssn_us",
"uuid": "310a138c-b0b7-4985-b8b8-d00e765e9f9b",
"validation-regex": "^[0-9]{3}-[0-9]{2}-[0-9]{4}$",
diff --git a/contrib/redux.xx.json b/contrib/redux.xx.json
index 1b11cd5..71d67e5 100644
--- a/contrib/redux.xx.json
+++ b/contrib/redux.xx.json
@@ -21,6 +21,7 @@
"type": "string",
"name": "prime_number",
"label": "Prime number",
+ "tooltip": "Mathematics is fun",
"widget": "anastasis_gtk_xx_prime",
"uuid" : "39190a95-cacb-4412-8bae-1f7da3f980b4",
"validation-regex": "^[0-9]+$",
@@ -31,6 +32,7 @@
"type": "string",
"name": "sq_number",
"label": "Square number",
+ "tooltip": "Mathematics is fun",
"widget": "anastasis_gtk_xx_square",
"uuid" : "ed790bca-89bf-11eb-96f2-233996cf644e",
"validation-regex": "^[0-9]+$",
diff --git a/contrib/tos/.gitignore b/contrib/tos/.gitignore
deleted file mode 100644
index fb83616..0000000
--- a/contrib/tos/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-sphinx.err
-sphinx.log
-_build/
diff --git a/contrib/tos/Makefile b/contrib/tos/Makefile
deleted file mode 100644
index ab29543..0000000
--- a/contrib/tos/Makefile
+++ /dev/null
@@ -1,109 +0,0 @@
-# Makefile for Sphinx documentation
-#
-# You can set these variables from the command line.
-SPHINXOPTS =
-SPHINXBUILD = sphinx-build
-PAPER =
-BUILDDIR = _build
-
-# User-friendly check for sphinx-build
-ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
-$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
-endif
-
-# Internal variables.
-PAPEROPT_a4 = -D latex_paper_size=a4
-PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-# the i18n builder cannot share the environment and doctrees with the others
-I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-
-.PHONY: help clean html json epub latex latexpdf text man doctest gettext
-
-help:
- @echo "Please use \`make <target>' where <target> is one of"
- @echo " html to make a single large HTML file"
- @echo " json to make JSON files"
- @echo " epub to make an epub"
- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
- @echo " pdf to make LaTeX files and run them through pdflatex"
- @echo " txt to make text files"
- @echo " man to make manual pages"
- @echo " texinfo to make Texinfo files"
- @echo " info to make Texinfo files and run them through makeinfo"
- @echo " gettext to make PO message catalogs"
- @echo " xml to make Docutils-native XML files"
- @echo " pseudoxml to make pseudoxml-XML files for display purposes"
- @echo " doctest to run all doctests embedded in the documentation (if enabled)"
-
-clean:
- rm -rf $(BUILDDIR)/*
-
-
-# The html-linked builder does not support caching, so we
-# remove all cached state first.
-html:
- $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
- @echo
- @echo "Build finished. The HTML page is in $(BUILDDIR)/html."
-
-json:
- $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
- @echo
- @echo "Build finished; now you can process the JSON files."
-
-epub:
- $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
- @echo
- @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
-
-latex:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo
- @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
- @echo "Run \`make' in that directory to run these through (pdf)latex" \
- "(use \`make latexpdf' here to do that automatically)."
-
-pdf:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/pdf
- @echo "Running LaTeX files through pdflatex..."
- $(MAKE) -C $(BUILDDIR)/pdf all-pdf
- @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/pdf."
-
-txt:
- $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/txt
- @echo
- @echo "Build finished. The text files are in $(BUILDDIR)/txt."
-
-man:
- $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
- @echo
- @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
-
-texinfo:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo
- @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
- @echo "Run \`make' in that directory to run these through makeinfo" \
- "(use \`make info' here to do that automatically)."
-
-info:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/info
- @echo "Running Texinfo files through makeinfo..."
- make -C $(BUILDDIR)/texinfo info
- @echo "makeinfo finished; the Info files are in $(BUILDDIR)/info."
-
-gettext:
- $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
- @echo
- @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
-
-doctest:
- $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
- @echo "Testing of doctests in the sources finished, look at the " \
- "results in $(BUILDDIR)/doctest/output.txt."
-
-xml:
- $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
- @echo
- @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
diff --git a/contrib/tos/README b/contrib/tos/README
deleted file mode 100644
index fde5305..0000000
--- a/contrib/tos/README
+++ /dev/null
@@ -1,58 +0,0 @@
-This directory contains the terms of service (template) for exchange
-operators.
-
-
-Dependencies
-============
-
-Generating new Terms of Service requires Sphinx, LaTeX with babel
-packages for all supported languages. On Debian, you should
-at least install:
-
-$ apt install python3-sphinx sphinx-intl texlive-lang-german texlive-lang-english
-
-(NOTE: List may be incomplete.)
-
-
-Updating the Terms of Service
-=============================
-
-The master file with the Terms of service is 'tos.rst'.
-
-If you make substantial changes, you MUST change the "TOS_VERSION"
-in contrib/Makefile.am to the new Etag.
-
-To begin the translation into other languages after editing the master
-file, run
-
-$ make gettext
-
-to generate the master PO file. Then, run
-
-$ sphinx-intl update -p _build/locale/ -l de -l fr -l it
-
-to update the PO files for the various languages (extend the list of
-languages as necessary). The PO files for the translators are kept
-at locale/$LANG/LC_MESSAGES/tos.po for the language $LANG.
-
-Once all PO files have been updated with new translations, run
-
-$ make update-tos
-
-in the "contrib/" directory to generate all of the formats. The
-respective make rule calls the '../update-tos.sh' script in the
-contrib/ directory, which calls the 'Makefile' in the tos/
-directory for the various supported languages and file formats
-and then moves the generated files to the target directory
-('contrib/tos/$LANG/$VERSION.$FORMAT')
-
-
-Adding a new language
-=====================
-
-To add a new language $LANG, add $LANG to "TOS_LANGUAGES" in
-'contrib/Makefile.am' and run
-
-$ sphinx-intl update -p _build/gettext -l $LANG
-
-to generate the PO template.
diff --git a/contrib/tos/conf.py b/contrib/tos/conf.py
deleted file mode 100644
index 2939255..0000000
--- a/contrib/tos/conf.py
+++ /dev/null
@@ -1,282 +0,0 @@
-"""
- This file is part of GNU TALER.
- Copyright (C) 2014-2020 Taler Systems SA
-
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU Lesser General Public License as published by the Free Software
- Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License along with
- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
-
- @author Florian Dold
- @author Benedikt Muller
- @author Sree Harsha Totakura
- @author Marcello Stanisci
-"""
-# -*- coding: utf-8 -*-
-#
-# neuro documentation build configuration file, created by
-# sphinx-quickstart on Sat May 31 13:11:06 2014.
-#
-# This file is execfile()d with the current directory set to its
-# containing dir.
-#
-# Note that not all possible configuration values are present in this
-# autogenerated file.
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
-
-import sys
-import os
-
-sys.path.append(os.path.abspath('_exts'))
-
-#import taler_sphinx_theme
-
-# If extensions (or modules to document with autodoc) are in another directory,
-# add these directories to sys.path here. If the directory is relative to the
-# documentation root, use os.path.abspath to make it absolute, like shown here.
-#sys.path.insert(0, os.path.abspath('.'))
-
-# -- General configuration ------------------------------------------------
-
-# If your documentation needs a minimal Sphinx version, state it here.
-needs_sphinx = '1.8.5'
-
-# Add any Sphinx extension module names here, as strings. They can be
-# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
-# ones.
-extensions = [
- 'sphinx.ext.todo',
- 'sphinx.ext.imgmath',
-]
-
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
-
-source_suffix = {
- '.rst': 'restructuredtext',
-}
-
-# The encoding of source files.
-#source_encoding = 'utf-8-sig'
-
-# The master toctree document.
-master_doc = 'tos'
-
-# General information about the project.
-project = u'tos'
-copyright = u'2014-2020 Taler Systems SA (GPLv3+ or GFDL 1.3+)'
-
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-# The short X.Y version.
-version = '0'
-# The full version, including alpha/beta/rc tags.
-release = '0'
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-# language = "en de"
-
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# Else, today_fmt is used as the format for a strftime call.
-#today_fmt = '%B %d, %Y'
-
-# List of patterns, relative to source directory, that match files and
-# directories to ignore when looking for source files.
-exclude_patterns = ['_build', '_exts', 'cf', 'prebuilt']
-
-# The reST default role (used for this markup: `text`) to use for all
-# documents.
-# default_role = "ts:type"
-
-locale_dirs = ['locale/']
-gettext_compact = False
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
-# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'sphinx'
-
-# A list of ignored prefixes for module index sorting.
-#modindex_common_prefix = []
-
-# If true, keep warnings as "system message" paragraphs in the built documents.
-#keep_warnings = False
-
-# -- Options for HTML output ----------------------------------------------
-
-# The theme to use for HTML and HTML Help pages. See the documentation for
-# a list of builtin themes.
-html_theme = 'epub'
-
-#html_theme_path = taler_sphinx_theme.html_theme_path()
-
-#html_sidebars = {'**': ['logo-text.html', 'globaltoc.html', 'searchbox.html']}
-
-rst_epilog = ""
-
-html_show_sphinx = False
-
-html_theme_options = {
- # Set the name of the project to appear in the sidebar
- "relbar1": "false",
- "footer": "false",
-}
-
-# Add any paths that contain custom themes here, relative to this directory.
-#html_theme_path = []
-
-# The name for this set of Sphinx documents. If None, it defaults to
-# "<project> v<release> documentation".
-html_title = "Taler Terms of Service"
-
-# A shorter title for the navigation bar. Default is the same as html_title.
-html_short_title = "Terms of Service"
-
-# The name of an image file (relative to this directory) to place at the top
-# of the sidebar.
-#html_logo = None
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
-#html_favicon = None
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-# html_static_path = ['_static']
-
-# Add any extra paths that contain custom files (such as robots.txt or
-# .htaccess) here, relative to this directory. These files are copied
-# directly to the root of the documentation.
-#html_extra_path = []
-
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-#html_last_updated_fmt = '%b %d, %Y'
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
-
-# Custom sidebar templates, maps document names to template names.
-#html_sidebars = {}
-
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-#html_additional_pages = {}
-
-# If false, no module index is generated.
-#html_domain_indices = True
-
-# If false, no index is generated.
-#html_use_index = True
-
-# If true, the index is split into individual pages for each letter.
-#html_split_index = False
-
-# If true, links to the reST sources are added to the pages.
-#html_show_sourcelink = True
-
-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-html_show_sphinx = False
-
-# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
-#html_show_copyright = True
-
-# If true, an OpenSearch description file will be output, and all pages will
-# contain a <link> tag referring to it. The value of this option must be the
-# base URL from which the finished HTML is served.
-#html_use_opensearch = ''
-
-# This is the file name suffix for HTML files (e.g. ".xhtml").
-#html_file_suffix = None
-
-# -- Options for LaTeX output ---------------------------------------------
-
-latex_elements = {
- # The paper size ('letterpaper' or 'a4paper').
- #'papersize': 'letterpaper',
-
- # The font size ('10pt', '11pt' or '12pt').
- #'pointsize': '10pt',
-
- # Additional stuff for the LaTeX preamble.
- #'preamble': '',
-}
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title,
-# author, documentclass [howto, manual, or own class]).
-latex_documents = [
- ('tos', 'tos.tex',
- 'Terms of Service', 'GNU Taler team', 'manual'),
-]
-
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-#latex_logo = None
-
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-#latex_use_parts = False
-
-# If true, show page references after internal links.
-#latex_show_pagerefs = False
-
-# If true, show URL addresses after external links.
-#latex_show_urls = False
-
-# Documents to append as an appendix to all manuals.
-# latex_appendices = ["fdl-1.3"]
-
-# If false, no module index is generated.
-#latex_domain_indices = True
-
-# -- Options for manual page output ---------------------------------------
-
-# If true, show URL addresses after external links.
-#man_show_urls = False
-
-# -- Options for Texinfo output -------------------------------------------
-
-# Documents to append as an appendix to all manuals.
-#texinfo_appendices = []
-
-# If false, no module index is generated.
-#texinfo_domain_indices = True
-
-# How to display URL addresses: 'footnote', 'no', or 'inline'.
-#texinfo_show_urls = 'footnote'
-
-# If true, do not generate a @detailmenu in the "Top" node's menu.
-#texinfo_no_detailmenu = False
-
-
-# -- Options for epub output ----------------------------
-
-epub_basename = "tos"
-
-epub_title = "Terms of Service"
diff --git a/contrib/tos/en/0.epub b/contrib/tos/en/0.epub
deleted file mode 100644
index 095d2c1..0000000
--- a/contrib/tos/en/0.epub
+++ /dev/null
Binary files differ
diff --git a/contrib/tos/en/0.html b/contrib/tos/en/0.html
deleted file mode 100644
index 59e816f..0000000
--- a/contrib/tos/en/0.html
+++ /dev/null
@@ -1,272 +0,0 @@
-
-
-<html lang="en">
- <head>
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>Terms Of Service &#8212; Taler Terms of Service</title>
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
- <link rel="stylesheet" href="_static/epub.css" type="text/css" />
- <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
- <script src="_static/jquery.js"></script>
- <script src="_static/underscore.js"></script>
- <script src="_static/doctools.js"></script>
- </head><body>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <div class="section" id="terms-of-service">
-<h1>Terms Of Service<a class="headerlink" href="#terms-of-service" title="Permalink to this headline">¶</a></h1>
-<p>Last Updated: 07.09.2021</p>
-<p>Welcome! Anastasis SARL (“we,” “our,” or “us”) provides a distributed
-privacy-preserving backup and recovery service for key material
-through our Internet presence (collectively the “Services”). Before
-using our Services, please read the Terms of Service (the “Terms” or
-the “Agreement”) carefully.</p>
-<div class="section" id="overview">
-<h2>Overview<a class="headerlink" href="#overview" title="Permalink to this headline">¶</a></h2>
-<p>This section provides a brief summary of the highlights of this
-Agreement. Please note that when you accept this Agreement, you are
-accepting all of the terms and conditions and not just this
-section. We and possibly other third parties provide Internet services
-which interact with the Anastasis key backup and recovery
-application. When using an application to interact with our Services,
-you are agreeing to our Terms, so please read carefully.</p>
-<div class="section" id="highlights">
-<h3>Highlights:<a class="headerlink" href="#highlights" title="Permalink to this headline">¶</a></h3>
-<blockquote>
-<div><ul class="simple">
-<li><p>You are responsible for selecting authentication methods and
-policies that are adequate to protect your key material.
-Any losses arising from you not being able to satisfy the
-selected authentication challenges or third parties being able
-successfully pass the challenges are your problem.</p></li>
-<li><p>We will store your encrypted key shares and disclose them upon
-successful authentication to the best of our ability within the
-limitations of the law and our implementation. Our liability will
-be limited to the liability limit exposed in the protocol.</p></li>
-<li><p>For our Services, we may charge various fees. The specific fee structure
-is provided based on the Anastasis protocol and should be shown to you when you
-use an application to interact with our services. You agree and understand
-that the Anastasis protocol allows for the fee structure to change.</p></li>
-<li><p>You agree to not intentionally overwhelm our systems with requests and
-follow responsible disclosure if you find security issues in our services.</p></li>
-<li><p>We cannot be held accountable for our Services not being available due to
-circumstances beyond our control. If we modify or terminate our services,
-we will announce this and ensure that you can recover your key material
-for at least one year before we completely terminate the Service.</p></li>
-</ul>
-</div></blockquote>
-<p>These terms outline approved uses of our Services. If you have any
-questions or comments related to this Agreement, please send us a
-message to <a class="reference external" href="mailto:legal&#37;&#52;&#48;anastasis&#46;lu">legal<span>&#64;</span>anastasis<span>&#46;</span>lu</a>. If you do not agree to this Agreement,
-you must not use our Services.</p>
-</div>
-</div>
-<div class="section" id="how-you-accept-this-policy">
-<h2>How you accept this policy<a class="headerlink" href="#how-you-accept-this-policy" title="Permalink to this headline">¶</a></h2>
-<p>By using our API (typically via an Anastasis-enabled application), you
-acknowledge that you have read, understood, and agreed to these
-Terms. We reserve the right to change these Terms at any time. If you
-disagree with the change, you must simply stop using our APIs. Your
-continued use of our Services following any such change will signify
-your acceptance to be bound by the then current Terms. Please check
-the effective date above to determine if there have been any changes
-since you have last reviewed these Terms.</p>
-</div>
-<div class="section" id="services">
-<h2>Services<a class="headerlink" href="#services" title="Permalink to this headline">¶</a></h2>
-<p>We will store your encrypted key shares (and the associated encrypted
-recovery policy document) to the best of our ability and within the
-limitations of the implementation. We will disclose the key shares only
-after the specific authentication challenge has been passed. We will
-rate-limit the use of the authentication APIs to limit brute-force
-attacks.</p>
-<p>We are not guaranteeing that the authentication procedures are effective.
-Other parties may be able to intercept authentication messages, or you
-may not be able to receive these messages anymore. You are responsible
-for choosing safe authentication methods with sufficient security.</p>
-<p>When using our Services, you agree to not take any action that
-intentionally imposes an unreasonable load on our infrastructure. If
-you find security problems in our Services, you agree to first report
-them to <a class="reference external" href="mailto:security&#37;&#52;&#48;anastasis&#46;lu">security<span>&#64;</span>anastasis<span>&#46;</span>lu</a> and grant us the right to publish your
-report. We warrant that we will ourselves publicly disclose any issues
-reported within 1 month, and that we will not prosecute anyone
-reporting security issues if they did not exploit the issue beyond a
-proof-of-concept, and followed the above responsible disclosure
-practice.</p>
-</div>
-<div class="section" id="fees">
-<h2>Fees<a class="headerlink" href="#fees" title="Permalink to this headline">¶</a></h2>
-<p>You agree to pay the fees for backup and recovery operations (“Fees”)
-as defined by us, which we may change from time to time. Your
-Anastasis client should obtain and display applicable fees during
-backup and recovery.</p>
-</div>
-<div class="section" id="eligibility">
-<h2>Eligibility<a class="headerlink" href="#eligibility" title="Permalink to this headline">¶</a></h2>
-<p>To be eligible to use our Services, you must be able to form legally binding
-contracts or have the permission of your legal guardian. By using our
-Services, you represent and warrant that you meet all eligibility requirements
-that we outline in these Terms.</p>
-</div>
-<div class="section" id="copyrights-and-trademarks">
-<h2>Copyrights and trademarks<a class="headerlink" href="#copyrights-and-trademarks" title="Permalink to this headline">¶</a></h2>
-<p>The Anastasis software is released under the terms of the GNU Affero
-General Public License (GNU AGPLv3+). You have the right to access,
-use, and share the Anastasis application, in modified or unmodified
-form. However, the Affero GPL is a strong copyleft license, which
-means that any derivative works must be distributed under the same
-license terms as the original software. If you have any questions, you
-should review the GNU AGPL’s full terms and conditions at
-<a class="reference external" href="https://www.gnu.org/licenses/agpl-3.0.en.html">https://www.gnu.org/licenses/agpl-3.0.en.html</a>. “Anastasis” itself is
-a trademark of Anastasis SARL. You are welcome to use the name in
-relation to implementations of the Anastasis protocol, assuming your
-use is compatible with an official release from the GNU Project that
-is not older than two years.</p>
-</div>
-<div class="section" id="limitation-of-liability-disclaimer-of-warranties">
-<h2>Limitation of liability &amp; disclaimer of warranties<a class="headerlink" href="#limitation-of-liability-disclaimer-of-warranties" title="Permalink to this headline">¶</a></h2>
-<p>You understand and agree that we have no control over, and no duty to
-take any action regarding: Failures, disruptions, errors, or delays in
-processing that you may experience while using our Services; The risk
-of failure of hardware, software, and Internet connections; The risk
-of malicious software being introduced or found in the software
-underlying the Anastasis implementation. You release us from all
-liability related to any losses, damages, or claims arising from:</p>
-<ol class="loweralpha simple">
-<li><p>user error such as forgotten security answers or loss of
-control over accounts used for authentication;</p></li>
-</ol>
-<p>(b) server failure or data loss;
-(d) bugs or other errors in the Anastasis client software; and
-(e) any unauthorized third party activities, including, but not limited to,</p>
-<blockquote>
-<div><p>the use of viruses, phishing, brute forcing, or other means of attack
-against the Anastasis client. We make no representations concerning any
-Third Party Content contained in or accessed through our Services.</p>
-</div></blockquote>
-<p>Any other terms, conditions, warranties, or representations associated with
-such content, are solely between you and such organizations and/or
-individuals.</p>
-<p>To the fullest extent permitted by applicable law, in no event will we
-or any of our officers, directors, representatives, agents, servants,
-counsel, employees, consultants, lawyers, and other personnel
-authorized to act, acting, or purporting to act on our behalf
-(collectively the “Anastasis Parties”) be liable to you under
-contract, tort, strict liability, negligence, or any other legal or
-equitable theory, for:</p>
-<ol class="loweralpha simple">
-<li><p>any lost profits, data loss, cost of procurement of substitute goods or
-services, or direct, indirect, incidental, special, punitive, compensatory,
-or consequential damages of any kind whatsoever resulting from:</p></li>
-</ol>
-<blockquote>
-<div><ol class="lowerroman simple">
-<li><p>your use of, or conduct in connection with, our services;</p></li>
-<li><p>any unauthorized use of your wallet and/or private key due to your
-failure to maintain the confidentiality of your wallet;</p></li>
-<li><p>any interruption or cessation of transmission to or from the services; or</p></li>
-<li><p>any bugs, viruses, trojan horses, or the like that are found in the Taler
-Wallet software or that may be transmitted to or through our services by
-any third party (regardless of the source of origination), or</p></li>
-</ol>
-</div></blockquote>
-<ol class="loweralpha simple" start="2">
-<li><p>any direct damages.</p></li>
-</ol>
-<p>These limitations apply regardless of legal theory, whether based on tort,
-strict liability, breach of contract, breach of warranty, or any other legal
-theory, and whether or not we were advised of the possibility of such
-damages. Some jurisdictions do not allow the exclusion or limitation of
-liability for consequential or incidental damages, so the above limitation may
-not apply to you.</p>
-<p>Our services are provided “as is” and without warranty of any kind. To the
-maximum extent permitted by law, we disclaim all representations and
-warranties, express or implied, relating to the services and underlying
-software or any content on the services, whether provided or owned by us or by
-any third party, including without limitation, warranties of merchantability,
-fitness for a particular purpose, title, non-infringement, freedom from
-computer virus, and any implied warranties arising from course of dealing,
-course of performance, or usage in trade, all of which are expressly
-disclaimed. In addition, we do not represent or warrant that the content
-accessible via the services is accurate, complete, available, current, free of
-viruses or other harmful components, or that the results of using the services
-will meet your requirements. Some states do not allow the disclaimer of
-implied warranties, so the foregoing disclaimers may not apply to you. This
-paragraph gives you specific legal rights and you may also have other legal
-rights that vary from state to state.</p>
-</div>
-<div class="section" id="indemnity-and-time-limitation-on-claims-and-termination">
-<h2>Indemnity and Time limitation on claims and Termination<a class="headerlink" href="#indemnity-and-time-limitation-on-claims-and-termination" title="Permalink to this headline">¶</a></h2>
-<p>To the extent permitted by applicable law, you agree to defend,
-indemnify, and hold harmless the Anastasis Parties from and against
-any and all claims, damages, obligations, losses, liabilities, costs
-or debt, and expenses (including, but not limited to, attorney’s fees)
-arising from: (a) your use of and access to the Services; (b) any
-feedback or submissions you provide to us concerning the Anastasis
-software; (c) your violation of any term of this Agreement; or (d)
-your violation of any law, rule, or regulation, or the rights of any
-third party.</p>
-<p>You agree that any claim you may have arising out of or related to your
-relationship with us must be filed within one year after such claim arises,
-otherwise, your claim in permanently barred.</p>
-<p>In the event of termination concerning your use of our Services, your
-obligations under this Agreement will still continue.</p>
-</div>
-<div class="section" id="discontinuance-of-services-and-force-majeure">
-<h2>Discontinuance of services and Force majeure<a class="headerlink" href="#discontinuance-of-services-and-force-majeure" title="Permalink to this headline">¶</a></h2>
-<p>We shall not be held liable for any delays, failure in performance, or
-interruptions of service which result directly or indirectly from any cause or
-condition beyond our reasonable control, including but not limited to: any
-delay or failure due to any act of God, act of civil or military authorities,
-act of terrorism, civil disturbance, war, strike or other labor dispute, fire,
-interruption in telecommunications or Internet services or network provider
-services, failure of equipment and/or software, other catastrophe, or any
-other occurrence which is beyond our reasonable control and shall not affect
-the validity and enforceability of any remaining provisions.</p>
-</div>
-<div class="section" id="governing-law-waivers-severability-and-assignment">
-<h2>Governing law, Waivers, Severability and Assignment<a class="headerlink" href="#governing-law-waivers-severability-and-assignment" title="Permalink to this headline">¶</a></h2>
-<p>No matter where you’re located, the laws of Luxembourg will govern these
-Terms. If any provisions of these Terms are inconsistent with any applicable
-law, those provisions will be superseded or modified only to the extent such
-provisions are inconsistent. The parties agree to submit to the ordinary
-courts in Luxembourg for exclusive jurisdiction of any dispute
-arising out of or related to your use of the Services or your breach of these
-Terms.</p>
-<p>Our failure to exercise or delay in exercising any right, power, or privilege
-under this Agreement shall not operate as a waiver; nor shall any single or
-partial exercise of any right, power, or privilege preclude any other or
-further exercise thereof.</p>
-<p>You agree that we may assign any of our rights and/or transfer, sub-contract,
-or delegate any of our obligations under these Terms.</p>
-<p>If it turns out that any part of this Agreement is invalid, void, or for any
-reason unenforceable, that term will be deemed severable and limited or
-eliminated to the minimum extent necessary.</p>
-<p>This Agreement sets forth the entire understanding and agreement as to the
-subject matter hereof and supersedes any and all prior discussions,
-agreements, and understandings of any kind (including, without limitation, any
-prior versions of this Agreement) and every nature between us. Except as
-provided for above, any modification to this Agreement must be in writing and
-must be signed by both parties.</p>
-</div>
-<div class="section" id="questions-or-comments">
-<h2>Questions or comments<a class="headerlink" href="#questions-or-comments" title="Permalink to this headline">¶</a></h2>
-<p>We welcome comments, questions, concerns, or suggestions. Please send us a
-message on our contact page at <a class="reference external" href="mailto:legal&#37;&#52;&#48;anastasis&#46;lu">legal<span>&#64;</span>anastasis<span>&#46;</span>lu</a>.</p>
-</div>
-</div>
-
-
- <div class="clearer"></div>
- </div>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- </body>
-</html> \ No newline at end of file
diff --git a/contrib/tos/en/0.pdf b/contrib/tos/en/0.pdf
deleted file mode 100644
index cb1cc36..0000000
--- a/contrib/tos/en/0.pdf
+++ /dev/null
Binary files differ
diff --git a/contrib/tos/en/0.txt b/contrib/tos/en/0.txt
deleted file mode 100644
index 4f1c814..0000000
--- a/contrib/tos/en/0.txt
+++ /dev/null
@@ -1,287 +0,0 @@
-Terms Of Service
-****************
-
-Last Updated: 07.09.2021
-
-Welcome! Anastasis SARL (“we,” “our,” or “us”) provides a distributed
-privacy-preserving backup and recovery service for key material
-through our Internet presence (collectively the “Services”). Before
-using our Services, please read the Terms of Service (the “Terms” or
-the “Agreement”) carefully.
-
-
-Overview
-========
-
-This section provides a brief summary of the highlights of this
-Agreement. Please note that when you accept this Agreement, you are
-accepting all of the terms and conditions and not just this section.
-We and possibly other third parties provide Internet services which
-interact with the Anastasis key backup and recovery application. When
-using an application to interact with our Services, you are agreeing
-to our Terms, so please read carefully.
-
-
-Highlights:
------------
-
- * You are responsible for selecting authentication methods and
- policies that are adequate to protect your key material. Any
- losses arising from you not being able to satisfy the selected
- authentication challenges or third parties being able
- successfully pass the challenges are your problem.
-
- * We will store your encrypted key shares and disclose them upon
- successful authentication to the best of our ability within the
- limitations of the law and our implementation. Our liability will
- be limited to the liability limit exposed in the protocol.
-
- * For our Services, we may charge various fees. The specific fee
- structure is provided based on the Anastasis protocol and should
- be shown to you when you use an application to interact with our
- services. You agree and understand that the Anastasis protocol
- allows for the fee structure to change.
-
- * You agree to not intentionally overwhelm our systems with
- requests and follow responsible disclosure if you find security
- issues in our services.
-
- * We cannot be held accountable for our Services not being
- available due to circumstances beyond our control. If we modify
- or terminate our services, we will announce this and ensure that
- you can recover your key material for at least one year before we
- completely terminate the Service.
-
-These terms outline approved uses of our Services. If you have any
-questions or comments related to this Agreement, please send us a
-message to legal@anastasis.lu. If you do not agree to this Agreement,
-you must not use our Services.
-
-
-How you accept this policy
-==========================
-
-By using our API (typically via an Anastasis-enabled application), you
-acknowledge that you have read, understood, and agreed to these Terms.
-We reserve the right to change these Terms at any time. If you
-disagree with the change, you must simply stop using our APIs. Your
-continued use of our Services following any such change will signify
-your acceptance to be bound by the then current Terms. Please check
-the effective date above to determine if there have been any changes
-since you have last reviewed these Terms.
-
-
-Services
-========
-
-We will store your encrypted key shares (and the associated encrypted
-recovery policy document) to the best of our ability and within the
-limitations of the implementation. We will disclose the key shares
-only after the specific authentication challenge has been passed. We
-will rate-limit the use of the authentication APIs to limit brute-
-force attacks.
-
-We are not guaranteeing that the authentication procedures are
-effective. Other parties may be able to intercept authentication
-messages, or you may not be able to receive these messages anymore.
-You are responsible for choosing safe authentication methods with
-sufficient security.
-
-When using our Services, you agree to not take any action that
-intentionally imposes an unreasonable load on our infrastructure. If
-you find security problems in our Services, you agree to first report
-them to security@anastasis.lu and grant us the right to publish your
-report. We warrant that we will ourselves publicly disclose any issues
-reported within 1 month, and that we will not prosecute anyone
-reporting security issues if they did not exploit the issue beyond a
-proof-of-concept, and followed the above responsible disclosure
-practice.
-
-
-Fees
-====
-
-You agree to pay the fees for backup and recovery operations ("Fees")
-as defined by us, which we may change from time to time. Your
-Anastasis client should obtain and display applicable fees during
-backup and recovery.
-
-
-Eligibility
-===========
-
-To be eligible to use our Services, you must be able to form legally
-binding contracts or have the permission of your legal guardian. By
-using our Services, you represent and warrant that you meet all
-eligibility requirements that we outline in these Terms.
-
-
-Copyrights and trademarks
-=========================
-
-The Anastasis software is released under the terms of the GNU Affero
-General Public License (GNU AGPLv3+). You have the right to access,
-use, and share the Anastasis application, in modified or unmodified
-form. However, the Affero GPL is a strong copyleft license, which
-means that any derivative works must be distributed under the same
-license terms as the original software. If you have any questions, you
-should review the GNU AGPL’s full terms and conditions at
-https://www.gnu.org/licenses/agpl-3.0.en.html. “Anastasis” itself is
-a trademark of Anastasis SARL. You are welcome to use the name in
-relation to implementations of the Anastasis protocol, assuming your
-use is compatible with an official release from the GNU Project that
-is not older than two years.
-
-
-Limitation of liability & disclaimer of warranties
-==================================================
-
-You understand and agree that we have no control over, and no duty to
-take any action regarding: Failures, disruptions, errors, or delays in
-processing that you may experience while using our Services; The risk
-of failure of hardware, software, and Internet connections; The risk
-of malicious software being introduced or found in the software
-underlying the Anastasis implementation. You release us from all
-liability related to any losses, damages, or claims arising from:
-
-1. user error such as forgotten security answers or loss of control
- over accounts used for authentication;
-
-(b) server failure or data loss; (d) bugs or other errors in the
-Anastasis client software; and (e) any unauthorized third party
-activities, including, but not limited to,
-
- the use of viruses, phishing, brute forcing, or other means of
- attack against the Anastasis client. We make no representations
- concerning any Third Party Content contained in or accessed through
- our Services.
-
-Any other terms, conditions, warranties, or representations associated
-with such content, are solely between you and such organizations
-and/or individuals.
-
-To the fullest extent permitted by applicable law, in no event will we
-or any of our officers, directors, representatives, agents, servants,
-counsel, employees, consultants, lawyers, and other personnel
-authorized to act, acting, or purporting to act on our behalf
-(collectively the “Anastasis Parties”) be liable to you under
-contract, tort, strict liability, negligence, or any other legal or
-equitable theory, for:
-
-1. any lost profits, data loss, cost of procurement of substitute
- goods or services, or direct, indirect, incidental, special,
- punitive, compensatory, or consequential damages of any kind
- whatsoever resulting from:
-
- 1. your use of, or conduct in connection with, our services;
-
- 2. any unauthorized use of your wallet and/or private key due to
- your failure to maintain the confidentiality of your wallet;
-
- 3. any interruption or cessation of transmission to or from the
- services; or
-
- 4. any bugs, viruses, trojan horses, or the like that are found in
- the Taler Wallet software or that may be transmitted to or
- through our services by any third party (regardless of the
- source of origination), or
-
-2. any direct damages.
-
-These limitations apply regardless of legal theory, whether based on
-tort, strict liability, breach of contract, breach of warranty, or any
-other legal theory, and whether or not we were advised of the
-possibility of such damages. Some jurisdictions do not allow the
-exclusion or limitation of liability for consequential or incidental
-damages, so the above limitation may not apply to you.
-
-Our services are provided "as is" and without warranty of any kind. To
-the maximum extent permitted by law, we disclaim all representations
-and warranties, express or implied, relating to the services and
-underlying software or any content on the services, whether provided
-or owned by us or by any third party, including without limitation,
-warranties of merchantability, fitness for a particular purpose,
-title, non-infringement, freedom from computer virus, and any implied
-warranties arising from course of dealing, course of performance, or
-usage in trade, all of which are expressly disclaimed. In addition, we
-do not represent or warrant that the content accessible via the
-services is accurate, complete, available, current, free of viruses or
-other harmful components, or that the results of using the services
-will meet your requirements. Some states do not allow the disclaimer
-of implied warranties, so the foregoing disclaimers may not apply to
-you. This paragraph gives you specific legal rights and you may also
-have other legal rights that vary from state to state.
-
-
-Indemnity and Time limitation on claims and Termination
-=======================================================
-
-To the extent permitted by applicable law, you agree to defend,
-indemnify, and hold harmless the Anastasis Parties from and against
-any and all claims, damages, obligations, losses, liabilities, costs
-or debt, and expenses (including, but not limited to, attorney’s fees)
-arising from: (a) your use of and access to the Services; (b) any
-feedback or submissions you provide to us concerning the Anastasis
-software; (c) your violation of any term of this Agreement; or (d)
-your violation of any law, rule, or regulation, or the rights of any
-third party.
-
-You agree that any claim you may have arising out of or related to
-your relationship with us must be filed within one year after such
-claim arises, otherwise, your claim in permanently barred.
-
-In the event of termination concerning your use of our Services, your
-obligations under this Agreement will still continue.
-
-
-Discontinuance of services and Force majeure
-============================================
-
-We shall not be held liable for any delays, failure in performance, or
-interruptions of service which result directly or indirectly from any
-cause or condition beyond our reasonable control, including but not
-limited to: any delay or failure due to any act of God, act of civil
-or military authorities, act of terrorism, civil disturbance, war,
-strike or other labor dispute, fire, interruption in
-telecommunications or Internet services or network provider services,
-failure of equipment and/or software, other catastrophe, or any other
-occurrence which is beyond our reasonable control and shall not affect
-the validity and enforceability of any remaining provisions.
-
-
-Governing law, Waivers, Severability and Assignment
-===================================================
-
-No matter where you’re located, the laws of Luxembourg will govern
-these Terms. If any provisions of these Terms are inconsistent with
-any applicable law, those provisions will be superseded or modified
-only to the extent such provisions are inconsistent. The parties agree
-to submit to the ordinary courts in Luxembourg for exclusive
-jurisdiction of any dispute arising out of or related to your use of
-the Services or your breach of these Terms.
-
-Our failure to exercise or delay in exercising any right, power, or
-privilege under this Agreement shall not operate as a waiver; nor
-shall any single or partial exercise of any right, power, or privilege
-preclude any other or further exercise thereof.
-
-You agree that we may assign any of our rights and/or transfer, sub-
-contract, or delegate any of our obligations under these Terms.
-
-If it turns out that any part of this Agreement is invalid, void, or
-for any reason unenforceable, that term will be deemed severable and
-limited or eliminated to the minimum extent necessary.
-
-This Agreement sets forth the entire understanding and agreement as to
-the subject matter hereof and supersedes any and all prior
-discussions, agreements, and understandings of any kind (including,
-without limitation, any prior versions of this Agreement) and every
-nature between us. Except as provided for above, any modification to
-this Agreement must be in writing and must be signed by both parties.
-
-
-Questions or comments
-=====================
-
-We welcome comments, questions, concerns, or suggestions. Please send
-us a message on our contact page at legal@anastasis.lu.
diff --git a/contrib/tos/en/0.xml b/contrib/tos/en/0.xml
deleted file mode 100644
index 3bf9332..0000000
--- a/contrib/tos/en/0.xml
+++ /dev/null
@@ -1,271 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE document PUBLIC "+//IDN docutils.sourceforge.net//DTD Docutils Generic//EN//XML" "http://docutils.sourceforge.net/docs/ref/docutils.dtd">
-<!-- Generated by Docutils 0.16 -->
-<document source="/research/anastasis/anastasis/contrib/tos/tos.rst">
- <section ids="terms-of-service" names="terms\ of\ service">
- <title>Terms Of Service</title>
- <paragraph>Last Updated: 07.09.2021</paragraph>
- <paragraph>Welcome! Anastasis SARL (“we,” “our,” or “us”) provides a distributed
- privacy-preserving backup and recovery service for key material
- through our Internet presence (collectively the “Services”). Before
- using our Services, please read the Terms of Service (the “Terms” or
- the “Agreement”) carefully.</paragraph>
- <section ids="overview" names="overview">
- <title>Overview</title>
- <paragraph>This section provides a brief summary of the highlights of this
- Agreement. Please note that when you accept this Agreement, you are
- accepting all of the terms and conditions and not just this
- section. We and possibly other third parties provide Internet services
- which interact with the Anastasis key backup and recovery
- application. When using an application to interact with our Services,
- you are agreeing to our Terms, so please read carefully.</paragraph>
- <section ids="highlights" names="highlights:">
- <title>Highlights:</title>
- <block_quote>
- <bullet_list bullet="•">
- <list_item>
- <paragraph>You are responsible for selecting authentication methods and
- policies that are adequate to protect your key material.
- Any losses arising from you not being able to satisfy the
- selected authentication challenges or third parties being able
- successfully pass the challenges are your problem.</paragraph>
- </list_item>
- <list_item>
- <paragraph>We will store your encrypted key shares and disclose them upon
- successful authentication to the best of our ability within the
- limitations of the law and our implementation. Our liability will
- be limited to the liability limit exposed in the protocol.</paragraph>
- </list_item>
- <list_item>
- <paragraph>For our Services, we may charge various fees. The specific fee structure
- is provided based on the Anastasis protocol and should be shown to you when you
- use an application to interact with our services. You agree and understand
- that the Anastasis protocol allows for the fee structure to change.</paragraph>
- </list_item>
- <list_item>
- <paragraph>You agree to not intentionally overwhelm our systems with requests and
- follow responsible disclosure if you find security issues in our services.</paragraph>
- </list_item>
- <list_item>
- <paragraph>We cannot be held accountable for our Services not being available due to
- circumstances beyond our control. If we modify or terminate our services,
- we will announce this and ensure that you can recover your key material
- for at least one year before we completely terminate the Service.</paragraph>
- </list_item>
- </bullet_list>
- </block_quote>
- <paragraph>These terms outline approved uses of our Services. If you have any
- questions or comments related to this Agreement, please send us a
- message to <reference refuri="mailto:legal@anastasis.lu">legal@anastasis.lu</reference>. If you do not agree to this Agreement,
- you must not use our Services.</paragraph>
- </section>
- </section>
- <section ids="how-you-accept-this-policy" names="how\ you\ accept\ this\ policy">
- <title>How you accept this policy</title>
- <paragraph>By using our API (typically via an Anastasis-enabled application), you
- acknowledge that you have read, understood, and agreed to these
- Terms. We reserve the right to change these Terms at any time. If you
- disagree with the change, you must simply stop using our APIs. Your
- continued use of our Services following any such change will signify
- your acceptance to be bound by the then current Terms. Please check
- the effective date above to determine if there have been any changes
- since you have last reviewed these Terms.</paragraph>
- </section>
- <section ids="services" names="services">
- <title>Services</title>
- <paragraph>We will store your encrypted key shares (and the associated encrypted
- recovery policy document) to the best of our ability and within the
- limitations of the implementation. We will disclose the key shares only
- after the specific authentication challenge has been passed. We will
- rate-limit the use of the authentication APIs to limit brute-force
- attacks.</paragraph>
- <paragraph>We are not guaranteeing that the authentication procedures are effective.
- Other parties may be able to intercept authentication messages, or you
- may not be able to receive these messages anymore. You are responsible
- for choosing safe authentication methods with sufficient security.</paragraph>
- <paragraph>When using our Services, you agree to not take any action that
- intentionally imposes an unreasonable load on our infrastructure. If
- you find security problems in our Services, you agree to first report
- them to <reference refuri="mailto:security@anastasis.lu">security@anastasis.lu</reference> and grant us the right to publish your
- report. We warrant that we will ourselves publicly disclose any issues
- reported within 1 month, and that we will not prosecute anyone
- reporting security issues if they did not exploit the issue beyond a
- proof-of-concept, and followed the above responsible disclosure
- practice.</paragraph>
- </section>
- <section ids="fees" names="fees">
- <title>Fees</title>
- <paragraph>You agree to pay the fees for backup and recovery operations (“Fees”)
- as defined by us, which we may change from time to time. Your
- Anastasis client should obtain and display applicable fees during
- backup and recovery.</paragraph>
- </section>
- <section ids="eligibility" names="eligibility">
- <title>Eligibility</title>
- <paragraph>To be eligible to use our Services, you must be able to form legally binding
- contracts or have the permission of your legal guardian. By using our
- Services, you represent and warrant that you meet all eligibility requirements
- that we outline in these Terms.</paragraph>
- </section>
- <section ids="copyrights-and-trademarks" names="copyrights\ and\ trademarks">
- <title>Copyrights and trademarks</title>
- <paragraph>The Anastasis software is released under the terms of the GNU Affero
- General Public License (GNU AGPLv3+). You have the right to access,
- use, and share the Anastasis application, in modified or unmodified
- form. However, the Affero GPL is a strong copyleft license, which
- means that any derivative works must be distributed under the same
- license terms as the original software. If you have any questions, you
- should review the GNU AGPL’s full terms and conditions at
- <reference refuri="https://www.gnu.org/licenses/agpl-3.0.en.html">https://www.gnu.org/licenses/agpl-3.0.en.html</reference>. “Anastasis” itself is
- a trademark of Anastasis SARL. You are welcome to use the name in
- relation to implementations of the Anastasis protocol, assuming your
- use is compatible with an official release from the GNU Project that
- is not older than two years.</paragraph>
- </section>
- <section ids="limitation-of-liability-disclaimer-of-warranties" names="limitation\ of\ liability\ &amp;\ disclaimer\ of\ warranties">
- <title>Limitation of liability &amp; disclaimer of warranties</title>
- <paragraph>You understand and agree that we have no control over, and no duty to
- take any action regarding: Failures, disruptions, errors, or delays in
- processing that you may experience while using our Services; The risk
- of failure of hardware, software, and Internet connections; The risk
- of malicious software being introduced or found in the software
- underlying the Anastasis implementation. You release us from all
- liability related to any losses, damages, or claims arising from:</paragraph>
- <enumerated_list enumtype="loweralpha" prefix="(" suffix=")">
- <list_item>
- <paragraph>user error such as forgotten security answers or loss of
- control over accounts used for authentication;</paragraph>
- </list_item>
- </enumerated_list>
- <paragraph>(b) server failure or data loss;
- (d) bugs or other errors in the Anastasis client software; and
- (e) any unauthorized third party activities, including, but not limited to,</paragraph>
- <block_quote>
- <paragraph>the use of viruses, phishing, brute forcing, or other means of attack
- against the Anastasis client. We make no representations concerning any
- Third Party Content contained in or accessed through our Services.</paragraph>
- </block_quote>
- <paragraph>Any other terms, conditions, warranties, or representations associated with
- such content, are solely between you and such organizations and/or
- individuals.</paragraph>
- <paragraph>To the fullest extent permitted by applicable law, in no event will we
- or any of our officers, directors, representatives, agents, servants,
- counsel, employees, consultants, lawyers, and other personnel
- authorized to act, acting, or purporting to act on our behalf
- (collectively the “Anastasis Parties”) be liable to you under
- contract, tort, strict liability, negligence, or any other legal or
- equitable theory, for:</paragraph>
- <enumerated_list enumtype="loweralpha" prefix="(" suffix=")">
- <list_item>
- <paragraph>any lost profits, data loss, cost of procurement of substitute goods or
- services, or direct, indirect, incidental, special, punitive, compensatory,
- or consequential damages of any kind whatsoever resulting from:</paragraph>
- </list_item>
- </enumerated_list>
- <block_quote>
- <enumerated_list enumtype="lowerroman" prefix="(" suffix=")">
- <list_item>
- <paragraph>your use of, or conduct in connection with, our services;</paragraph>
- </list_item>
- <list_item>
- <paragraph>any unauthorized use of your wallet and/or private key due to your
- failure to maintain the confidentiality of your wallet;</paragraph>
- </list_item>
- <list_item>
- <paragraph>any interruption or cessation of transmission to or from the services; or</paragraph>
- </list_item>
- <list_item>
- <paragraph>any bugs, viruses, trojan horses, or the like that are found in the Taler
- Wallet software or that may be transmitted to or through our services by
- any third party (regardless of the source of origination), or</paragraph>
- </list_item>
- </enumerated_list>
- </block_quote>
- <enumerated_list enumtype="loweralpha" prefix="(" start="2" suffix=")">
- <list_item>
- <paragraph>any direct damages.</paragraph>
- </list_item>
- </enumerated_list>
- <paragraph>These limitations apply regardless of legal theory, whether based on tort,
- strict liability, breach of contract, breach of warranty, or any other legal
- theory, and whether or not we were advised of the possibility of such
- damages. Some jurisdictions do not allow the exclusion or limitation of
- liability for consequential or incidental damages, so the above limitation may
- not apply to you.</paragraph>
- <paragraph>Our services are provided “as is” and without warranty of any kind. To the
- maximum extent permitted by law, we disclaim all representations and
- warranties, express or implied, relating to the services and underlying
- software or any content on the services, whether provided or owned by us or by
- any third party, including without limitation, warranties of merchantability,
- fitness for a particular purpose, title, non-infringement, freedom from
- computer virus, and any implied warranties arising from course of dealing,
- course of performance, or usage in trade, all of which are expressly
- disclaimed. In addition, we do not represent or warrant that the content
- accessible via the services is accurate, complete, available, current, free of
- viruses or other harmful components, or that the results of using the services
- will meet your requirements. Some states do not allow the disclaimer of
- implied warranties, so the foregoing disclaimers may not apply to you. This
- paragraph gives you specific legal rights and you may also have other legal
- rights that vary from state to state.</paragraph>
- </section>
- <section ids="indemnity-and-time-limitation-on-claims-and-termination" names="indemnity\ and\ time\ limitation\ on\ claims\ and\ termination">
- <title>Indemnity and Time limitation on claims and Termination</title>
- <paragraph>To the extent permitted by applicable law, you agree to defend,
- indemnify, and hold harmless the Anastasis Parties from and against
- any and all claims, damages, obligations, losses, liabilities, costs
- or debt, and expenses (including, but not limited to, attorney’s fees)
- arising from: (a) your use of and access to the Services; (b) any
- feedback or submissions you provide to us concerning the Anastasis
- software; (c) your violation of any term of this Agreement; or (d)
- your violation of any law, rule, or regulation, or the rights of any
- third party.</paragraph>
- <paragraph>You agree that any claim you may have arising out of or related to your
- relationship with us must be filed within one year after such claim arises,
- otherwise, your claim in permanently barred.</paragraph>
- <paragraph>In the event of termination concerning your use of our Services, your
- obligations under this Agreement will still continue.</paragraph>
- </section>
- <section ids="discontinuance-of-services-and-force-majeure" names="discontinuance\ of\ services\ and\ force\ majeure">
- <title>Discontinuance of services and Force majeure</title>
- <paragraph>We shall not be held liable for any delays, failure in performance, or
- interruptions of service which result directly or indirectly from any cause or
- condition beyond our reasonable control, including but not limited to: any
- delay or failure due to any act of God, act of civil or military authorities,
- act of terrorism, civil disturbance, war, strike or other labor dispute, fire,
- interruption in telecommunications or Internet services or network provider
- services, failure of equipment and/or software, other catastrophe, or any
- other occurrence which is beyond our reasonable control and shall not affect
- the validity and enforceability of any remaining provisions.</paragraph>
- </section>
- <section ids="governing-law-waivers-severability-and-assignment" names="governing\ law,\ waivers,\ severability\ and\ assignment">
- <title>Governing law, Waivers, Severability and Assignment</title>
- <paragraph>No matter where you’re located, the laws of Luxembourg will govern these
- Terms. If any provisions of these Terms are inconsistent with any applicable
- law, those provisions will be superseded or modified only to the extent such
- provisions are inconsistent. The parties agree to submit to the ordinary
- courts in Luxembourg for exclusive jurisdiction of any dispute
- arising out of or related to your use of the Services or your breach of these
- Terms.</paragraph>
- <paragraph>Our failure to exercise or delay in exercising any right, power, or privilege
- under this Agreement shall not operate as a waiver; nor shall any single or
- partial exercise of any right, power, or privilege preclude any other or
- further exercise thereof.</paragraph>
- <paragraph>You agree that we may assign any of our rights and/or transfer, sub-contract,
- or delegate any of our obligations under these Terms.</paragraph>
- <paragraph>If it turns out that any part of this Agreement is invalid, void, or for any
- reason unenforceable, that term will be deemed severable and limited or
- eliminated to the minimum extent necessary.</paragraph>
- <paragraph>This Agreement sets forth the entire understanding and agreement as to the
- subject matter hereof and supersedes any and all prior discussions,
- agreements, and understandings of any kind (including, without limitation, any
- prior versions of this Agreement) and every nature between us. Except as
- provided for above, any modification to this Agreement must be in writing and
- must be signed by both parties.</paragraph>
- </section>
- <section ids="questions-or-comments" names="questions\ or\ comments">
- <title>Questions or comments</title>
- <paragraph>We welcome comments, questions, concerns, or suggestions. Please send us a
- message on our contact page at <reference refuri="mailto:legal@anastasis.lu">legal@anastasis.lu</reference>.</paragraph>
- </section>
- </section>
-</document>
diff --git a/contrib/tos/locale/de/LC_MESSAGES/tos.po b/contrib/tos/locale/de/LC_MESSAGES/tos.po
deleted file mode 100644
index 21aa9c8..0000000
--- a/contrib/tos/locale/de/LC_MESSAGES/tos.po
+++ /dev/null
@@ -1,517 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) 2014-2020 Taler Systems SA (GPLv3+ or GFDL 1.3+)
-# This file is distributed under the same license as the tos package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2020.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: tos 0\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-02-07 01:00+0100\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 2.6.0\n"
-
-#: ../../tos.rst:2
-msgid "Terms Of Service"
-msgstr ""
-
-#: ../../tos.rst:4
-msgid "Last Updated: 12.4.2019"
-msgstr ""
-
-#: ../../tos.rst:6
-msgid ""
-"Welcome! Taler Systems SA (“we,” “our,” or “us”) provides a payment "
-"service through our Internet presence (collectively the “Services”). "
-"Before using our Services, please read the Terms of Service (the “Terms” "
-"or the “Agreement”) carefully."
-msgstr ""
-
-#: ../../tos.rst:12
-msgid "Overview"
-msgstr ""
-
-#: ../../tos.rst:14
-msgid ""
-"This section provides a brief summary of the highlights of this "
-"Agreement. Please note that when you accept this Agreement, you are "
-"accepting all of the terms and conditions and not just this section. We "
-"and possibly other third parties provide Internet services which interact"
-" with the Taler Wallet’s self-hosted personal payment application. When "
-"using the Taler Wallet to interact with our Services, you are agreeing to"
-" our Terms, so please read carefully."
-msgstr ""
-
-#: ../../tos.rst:23
-msgid "Highlights:"
-msgstr ""
-
-#: ../../tos.rst:25
-msgid ""
-"You are responsible for keeping the data in your Taler Wallet at all "
-"times under your control. Any losses arising from you not being in "
-"control of your private information are your problem."
-msgstr ""
-
-#: ../../tos.rst:28
-msgid ""
-"We will try to transfer funds we hold in escrow for our users to any "
-"legal recipient to the best of our ability within the limitations of the "
-"law and our implementation. However, the Services offered today are "
-"highly experimental and the set of recipients of funds is severely "
-"restricted."
-msgstr ""
-
-#: ../../tos.rst:32
-msgid ""
-"For our Services, we may charge transaction fees. The specific fee "
-"structure is provided based on the Taler protocol and should be shown to "
-"you when you withdraw electronic coins using a Taler Wallet. You agree "
-"and understand that the Taler protocol allows for the fee structure to "
-"change."
-msgstr ""
-
-#: ../../tos.rst:36
-msgid ""
-"You agree to not intentionally overwhelm our systems with requests and "
-"follow responsible disclosure if you find security issues in our "
-"services."
-msgstr ""
-
-#: ../../tos.rst:38
-msgid ""
-"We cannot be held accountable for our Services not being available due to"
-" circumstances beyond our control. If we modify or terminate our "
-"services, we will try to give you the opportunity to recover your funds. "
-"However, given the experimental state of the Services today, this may not"
-" be possible. You are strongly advised to limit your use of the Service "
-"to small-scale experiments expecting total loss of all funds."
-msgstr ""
-
-#: ../../tos.rst:45
-msgid ""
-"These terms outline approved uses of our Services. The Services and these"
-" Terms are still at an experimental stage. If you have any questions or "
-"comments related to this Agreement, please send us a message to legal"
-"@taler-systems.com. If you do not agree to this Agreement, you must not "
-"use our Services."
-msgstr ""
-
-#: ../../tos.rst:52
-msgid "How you accept this policy"
-msgstr ""
-
-#: ../../tos.rst:54
-msgid ""
-"By sending funds to us (to top-up your Taler Wallet), you acknowledge "
-"that you have read, understood, and agreed to these Terms. We reserve the"
-" right to change these Terms at any time. If you disagree with the "
-"change, we may in the future offer you with an easy option to recover "
-"your unspent funds. However, in the current experimental period you "
-"acknowledge that this feature is not yet available, resulting in your "
-"funds being lost unless you accept the new Terms. If you continue to use "
-"our Services other than to recover your unspent funds, your continued use"
-" of our Services following any such change will signify your acceptance "
-"to be bound by the then current Terms. Please check the effective date "
-"above to determine if there have been any changes since you have last "
-"reviewed these Terms."
-msgstr ""
-
-#: ../../tos.rst:67
-msgid "Services"
-msgstr ""
-
-#: ../../tos.rst:69
-msgid ""
-"We will try to transfer funds that we hold in escrow for our users to any"
-" legal recipient to the best of our ability and within the limitations of"
-" the law and our implementation. However, the Services offered today are "
-"highly experimental and the set of recipients of funds is severely "
-"restricted. The Taler Wallet can be loaded by exchanging fiat currencies"
-" against electronic coins. We are providing this exchange service. Once "
-"your Taler Wallet is loaded with electronic coins they can be spent for "
-"purchases if the seller is accepting Taler as a means of payment. We are "
-"not guaranteeing that any seller is accepting Taler at all or a "
-"particular seller. The seller or recipient of deposits of electronic "
-"coins must specify the target account, as per the design of the Taler "
-"protocol. They are responsible for following the protocol and specifying "
-"the correct bank account, and are solely liable for any losses that may "
-"arise from specifying the wrong account. We will allow the government to "
-"link wire transfers to the underlying contract hash. It is the "
-"responsibility of recipients to preserve the full contracts and to pay "
-"whatever taxes and charges may be applicable. Technical issues may lead "
-"to situations where we are unable to make transfers at all or lead to "
-"incorrect transfers that cannot be reversed. We will only refuse to "
-"execute transfers if the transfers are prohibited by a competent legal "
-"authority and we are ordered to do so."
-msgstr ""
-
-#: ../../tos.rst:91
-msgid "Fees"
-msgstr ""
-
-#: ../../tos.rst:93
-msgid ""
-"You agree to pay the fees for exchanges and withdrawals completed via the"
-" Taler Wallet (\"Fees\") as defined by us, which we may change from time "
-"to time. With the exception of wire transfer fees, Taler transaction fees"
-" are set for any electronic coin at the time of withdrawal and fixed "
-"throughout the validity period of the respective electronic coin. Your "
-"wallet should obtain and display applicable fees when withdrawing funds. "
-"Fees for coins obtained as change may differ from the fees applicable to "
-"the original coin. Wire transfer fees that are independent from "
-"electronic coins may change annually. You authorize us to charge or "
-"deduct applicable fees owed in connection with deposits, exchanges and "
-"withdrawals following the rules of the Taler protocol. We reserve the "
-"right to provide different types of rewards to users either in the form "
-"of discount for our Services or in any other form at our discretion and "
-"without prior notice to you."
-msgstr ""
-
-#: ../../tos.rst:108
-msgid "Eligibility"
-msgstr ""
-
-#: ../../tos.rst:110
-msgid ""
-"To be eligible to use our Services, you must be able to form legally "
-"binding contracts or have the permission of your legal guardian. By using"
-" our Services, you represent and warrant that you meet all eligibility "
-"requirements that we outline in these Terms."
-msgstr ""
-
-#: ../../tos.rst:116
-msgid "Financial self-responsibility"
-msgstr ""
-
-#: ../../tos.rst:118
-msgid ""
-"You will be responsible for maintaining the availability, integrity and "
-"confidentiality of the data stored in your wallet. When you setup a Taler"
-" Wallet, you are strongly advised to follow the precautionary measures "
-"offered by the software to minimize the chances to losse access to or "
-"control over your Wallet data. We will not be liable for any loss or "
-"damage arising from your failure to comply with this paragraph."
-msgstr ""
-
-#: ../../tos.rst:126
-msgid "Copyrights and trademarks"
-msgstr ""
-
-#: ../../tos.rst:128
-msgid ""
-"The Taler Wallet is released under the terms of the GNU General Public "
-"License (GNU GPL). You have the right to access, use, and share the Taler"
-" Wallet, in modified or unmodified form. However, the GPL is a strong "
-"copyleft license, which means that any derivative works must be "
-"distributed under the same license terms as the original software. If you"
-" have any questions, you should review the GNU GPL’s full terms and "
-"conditions at https://www.gnu.org/licenses/gpl-3.0.en.html. “Taler” "
-"itself is a trademark of Taler Systems SA. You are welcome to use the "
-"name in relation to processing payments using the Taler protocol, "
-"assuming your use is compatible with an official release from the GNU "
-"Project that is not older than two years."
-msgstr ""
-
-#: ../../tos.rst:140
-msgid "Your use of our services"
-msgstr ""
-
-#: ../../tos.rst:142
-msgid ""
-"When using our Services, you agree to not take any action that "
-"intentionally imposes an unreasonable load on our infrastructure. If you "
-"find security problems in our Services, you agree to first report them to"
-" security@taler-systems.com and grant us the right to publish your "
-"report. We warrant that we will ourselves publicly disclose any issues "
-"reported within 3 months, and that we will not prosecute anyone reporting"
-" security issues if they did not exploit the issue beyond a proof-of-"
-"concept, and followed the above responsible disclosure practice."
-msgstr ""
-
-#: ../../tos.rst:152
-msgid "Limitation of liability & disclaimer of warranties"
-msgstr ""
-
-#: ../../tos.rst:154
-msgid ""
-"You understand and agree that we have no control over, and no duty to "
-"take any action regarding: Failures, disruptions, errors, or delays in "
-"processing that you may experience while using our Services; The risk of "
-"failure of hardware, software, and Internet connections; The risk of "
-"malicious software being introduced or found in the software underlying "
-"the Taler Wallet; The risk that third parties may obtain unauthorized "
-"access to information stored within your Taler Wallet, including, but not"
-" limited to your Taler Wallet coins or backup encryption keys. You "
-"release us from all liability related to any losses, damages, or claims "
-"arising from:"
-msgstr ""
-
-#: ../../tos.rst:164
-msgid ""
-"user error such as forgotten passwords, incorrectly constructed "
-"transactions;"
-msgstr ""
-
-#: ../../tos.rst:166
-msgid "server failure or data loss;"
-msgstr ""
-
-#: ../../tos.rst:167
-msgid "unauthorized access to the Taler Wallet application;"
-msgstr ""
-
-#: ../../tos.rst:168
-msgid "bugs or other errors in the Taler Wallet software; and"
-msgstr ""
-
-#: ../../tos.rst:169
-msgid ""
-"any unauthorized third party activities, including, but not limited to, "
-"the use of viruses, phishing, brute forcing, or other means of attack "
-"against the Taler Wallet. We make no representations concerning any Third"
-" Party Content contained in or accessed through our Services."
-msgstr ""
-
-#: ../../tos.rst:174
-msgid ""
-"Any other terms, conditions, warranties, or representations associated "
-"with such content, are solely between you and such organizations and/or "
-"individuals."
-msgstr ""
-
-#: ../../tos.rst:179
-msgid "Limitation of liability"
-msgstr ""
-
-#: ../../tos.rst:181
-msgid ""
-"To the fullest extent permitted by applicable law, in no event will we or"
-" any of our officers, directors, representatives, agents, servants, "
-"counsel, employees, consultants, lawyers, and other personnel authorized "
-"to act, acting, or purporting to act on our behalf (collectively the "
-"“Taler Parties”) be liable to you under contract, tort, strict liability,"
-" negligence, or any other legal or equitable theory, for:"
-msgstr ""
-
-#: ../../tos.rst:188
-msgid ""
-"any lost profits, data loss, cost of procurement of substitute goods or "
-"services, or direct, indirect, incidental, special, punitive, "
-"compensatory, or consequential damages of any kind whatsoever resulting "
-"from:"
-msgstr ""
-
-#: ../../tos.rst:192
-msgid "your use of, or conduct in connection with, our services;"
-msgstr ""
-
-#: ../../tos.rst:193
-msgid ""
-"any unauthorized use of your wallet and/or private key due to your "
-"failure to maintain the confidentiality of your wallet;"
-msgstr ""
-
-#: ../../tos.rst:195
-msgid "any interruption or cessation of transmission to or from the services; or"
-msgstr ""
-
-#: ../../tos.rst:196
-msgid ""
-"any bugs, viruses, trojan horses, or the like that are found in the Taler"
-" Wallet software or that may be transmitted to or through our services by"
-" any third party (regardless of the source of origination), or"
-msgstr ""
-
-#: ../../tos.rst:200
-msgid "any direct damages."
-msgstr ""
-
-#: ../../tos.rst:202
-msgid ""
-"These limitations apply regardless of legal theory, whether based on "
-"tort, strict liability, breach of contract, breach of warranty, or any "
-"other legal theory, and whether or not we were advised of the possibility"
-" of such damages. Some jurisdictions do not allow the exclusion or "
-"limitation of liability for consequential or incidental damages, so the "
-"above limitation may not apply to you."
-msgstr ""
-
-#: ../../tos.rst:210
-msgid "Warranty disclaimer"
-msgstr ""
-
-#: ../../tos.rst:212
-msgid ""
-"Our services are provided \"as is\" and without warranty of any kind. To "
-"the maximum extent permitted by law, we disclaim all representations and "
-"warranties, express or implied, relating to the services and underlying "
-"software or any content on the services, whether provided or owned by us "
-"or by any third party, including without limitation, warranties of "
-"merchantability, fitness for a particular purpose, title, non-"
-"infringement, freedom from computer virus, and any implied warranties "
-"arising from course of dealing, course of performance, or usage in trade,"
-" all of which are expressly disclaimed. In addition, we do not represent "
-"or warrant that the content accessible via the services is accurate, "
-"complete, available, current, free of viruses or other harmful "
-"components, or that the results of using the services will meet your "
-"requirements. Some states do not allow the disclaimer of implied "
-"warranties, so the foregoing disclaimers may not apply to you. This "
-"paragraph gives you specific legal rights and you may also have other "
-"legal rights that vary from state to state."
-msgstr ""
-
-#: ../../tos.rst:229
-msgid "Indemnity"
-msgstr ""
-
-#: ../../tos.rst:231
-msgid ""
-"To the extent permitted by applicable law, you agree to defend, "
-"indemnify, and hold harmless the Taler Parties from and against any and "
-"all claims, damages, obligations, losses, liabilities, costs or debt, and"
-" expenses (including, but not limited to, attorney’s fees) arising from: "
-"(a) your use of and access to the Services; (b) any feedback or "
-"submissions you provide to us concerning the Taler Wallet; (c) your "
-"violation of any term of this Agreement; or (d) your violation of any "
-"law, rule, or regulation, or the rights of any third party."
-msgstr ""
-
-#: ../../tos.rst:240
-msgid "Time limitation on claims"
-msgstr ""
-
-#: ../../tos.rst:242
-msgid ""
-"You agree that any claim you may have arising out of or related to your "
-"relationship with us must be filed within one year after such claim "
-"arises, otherwise, your claim in permanently barred."
-msgstr ""
-
-#: ../../tos.rst:247
-msgid "Governing law"
-msgstr ""
-
-#: ../../tos.rst:249
-msgid ""
-"No matter where you’re located, the laws of Switzerland will govern these"
-" Terms. If any provisions of these Terms are inconsistent with any "
-"applicable law, those provisions will be superseded or modified only to "
-"the extent such provisions are inconsistent. The parties agree to submit "
-"to the ordinary courts in Zurich, Switzerland for exclusive jurisdiction "
-"of any dispute arising out of or related to your use of the Services or "
-"your breach of these Terms."
-msgstr ""
-
-#: ../../tos.rst:258
-msgid "Termination"
-msgstr ""
-
-#: ../../tos.rst:260
-msgid ""
-"In the event of termination concerning your use of our Services, your "
-"obligations under this Agreement will still continue."
-msgstr ""
-
-#: ../../tos.rst:264
-msgid "Discontinuance of services"
-msgstr ""
-
-#: ../../tos.rst:266
-msgid ""
-"We may, in our sole discretion and without cost to you, with or without "
-"prior notice, and at any time, modify or discontinue, temporarily or "
-"permanently, any portion of our Services. We will use the Taler "
-"protocol’s provisions to notify Wallets if our Services are to be "
-"discontinued. It is your responsibility to ensure that the Taler Wallet "
-"is online at least once every three months to observe these "
-"notifications. We shall not be held responsible or liable for any loss of"
-" funds in the event that we discontinue or depreciate the Services and "
-"your Taler Wallet fails to transfer out the coins within a three months "
-"notification period."
-msgstr ""
-
-#: ../../tos.rst:277
-msgid "No waiver"
-msgstr ""
-
-#: ../../tos.rst:279
-msgid ""
-"Our failure to exercise or delay in exercising any right, power, or "
-"privilege under this Agreement shall not operate as a waiver; nor shall "
-"any single or partial exercise of any right, power, or privilege preclude"
-" any other or further exercise thereof."
-msgstr ""
-
-#: ../../tos.rst:285
-msgid "Severability"
-msgstr ""
-
-#: ../../tos.rst:287
-msgid ""
-"If it turns out that any part of this Agreement is invalid, void, or for "
-"any reason unenforceable, that term will be deemed severable and limited "
-"or eliminated to the minimum extent necessary."
-msgstr ""
-
-#: ../../tos.rst:292
-msgid "Force majeure"
-msgstr ""
-
-#: ../../tos.rst:294
-msgid ""
-"We shall not be held liable for any delays, failure in performance, or "
-"interruptions of service which result directly or indirectly from any "
-"cause or condition beyond our reasonable control, including but not "
-"limited to: any delay or failure due to any act of God, act of civil or "
-"military authorities, act of terrorism, civil disturbance, war, strike or"
-" other labor dispute, fire, interruption in telecommunications or "
-"Internet services or network provider services, failure of equipment "
-"and/or software, other catastrophe, or any other occurrence which is "
-"beyond our reasonable control and shall not affect the validity and "
-"enforceability of any remaining provisions."
-msgstr ""
-
-#: ../../tos.rst:305
-msgid "Assignment"
-msgstr ""
-
-#: ../../tos.rst:307
-msgid ""
-"You agree that we may assign any of our rights and/or transfer, sub-"
-"contract, or delegate any of our obligations under these Terms."
-msgstr ""
-
-#: ../../tos.rst:311
-msgid "Entire agreement"
-msgstr ""
-
-#: ../../tos.rst:313
-msgid ""
-"This Agreement sets forth the entire understanding and agreement as to "
-"the subject matter hereof and supersedes any and all prior discussions, "
-"agreements, and understandings of any kind (including, without "
-"limitation, any prior versions of this Agreement) and every nature "
-"between us. Except as provided for above, any modification to this "
-"Agreement must be in writing and must be signed by both parties."
-msgstr ""
-
-#: ../../tos.rst:321
-msgid "Questions or comments"
-msgstr ""
-
-#: ../../tos.rst:323
-msgid ""
-"We welcome comments, questions, concerns, or suggestions. Please send us "
-"a message on our contact page at legal@taler-systems.com."
-msgstr ""
-
-#~ msgid "Indemntiy"
-#~ msgstr ""
-
diff --git a/contrib/update-pp.sh b/contrib/update-pp.sh
index db31ba1..03aa237 100755
--- a/contrib/update-pp.sh
+++ b/contrib/update-pp.sh
@@ -22,7 +22,16 @@ do
rm -rf _build
echo " Generating format $f"
make -e SPHINXOPTS="-D language='$l'" $f >>sphinx.log 2>>sphinx.err < /dev/null
- mv _build/$f/pp.$f $l/${VERSION}.$f
+ if test $f = "html"
+ then
+ htmlark -o $l/${VERSION}.$f _build/$f/${VERSION}.$f
+ else
+ mv _build/$f/${VERSION}.$f $l/${VERSION}.$f
+ fi
+ if test $f = "txt"
+ then
+ cp $l/${VERSION}.$f $l/${VERSION}.md
+ fi
done
done
cd ..
diff --git a/contrib/update-tos.sh b/contrib/update-tos.sh
index 47d3af7..26d65ed 100755
--- a/contrib/update-tos.sh
+++ b/contrib/update-tos.sh
@@ -22,7 +22,16 @@ do
rm -rf _build
echo " Generating format $f"
make -e SPHINXOPTS="-D language='$l'" $f >>sphinx.log 2>>sphinx.err < /dev/null
- mv _build/$f/tos.$f $l/${VERSION}.$f
+ if test $f = "html"
+ then
+ htmlark -o $l/${VERSION}.$f _build/$f/${VERSION}.$f
+ else
+ mv _build/$f/${VERSION}.$f $l/${VERSION}.$f
+ fi
+ if test $f = "txt"
+ then
+ cp $l/${VERSION}.$f $l/${VERSION}.md
+ fi
done
done
cd ..
diff --git a/debian/anastasis-httpd.config b/debian/anastasis-httpd.config
index 97f57bc..97d5101 100644
--- a/debian/anastasis-httpd.config
+++ b/debian/anastasis-httpd.config
@@ -6,17 +6,3 @@ set -e
_USERNAME=anastasis-httpd
_GROUPNAME=www-data
-
-# For now, we only support postgres
-dbc_dbtypes=pgsql
-dbc_dbuser=${_USERNAME}
-
-dbc_authmethod_user=ident
-dbc_authmethod_admin=ident
-
-if [ -f /usr/share/dbconfig-common/dpkg/config.pgsql ]; then
- . /usr/share/dbconfig-common/dpkg/config.pgsql
- dbc_go anastasis-httpd "$@"
-fi
-
-db_stop
diff --git a/debian/anastasis-httpd.install b/debian/anastasis-httpd.install
index 652caa0..6594f28 100644
--- a/debian/anastasis-httpd.install
+++ b/debian/anastasis-httpd.install
@@ -3,7 +3,9 @@ usr/lib/*/anastasis/
usr/lib/*/libanastasisauthorization.*
usr/lib/*/libanastasisdb.*
usr/lib/*/libanastasiseufin.so.*
-usr/share/man/man5/*
+usr/share/man/man5/anastasis.conf.5
+usr/share/man/man1/anastasis-dbconfig.1
+usr/share/man/man1/anastasis-dbinit.1
usr/share/man/man1/anastasis-httpd.1
usr/share/man/man1/anastasis-helper-authorization-iban.1
usr/share/man/man1/anastasis-config.1
@@ -11,4 +13,7 @@ usr/share/anastasis/*
usr/share/anastasis/sql/*
usr/share/anastasis/config.d/*
debian/etc/* /etc/
-debian/db/install/* usr/share/dbconfig-common/scripts/anastasis/install/
+# Terms of service / privacy policy templates
+usr/share/anastasis/terms/*.rst
+# Translations of ToS/PP
+usr/share/locale/*/LC_MESSAGES/*.po
diff --git a/debian/anastasis-httpd.postinst b/debian/anastasis-httpd.postinst
index 994b06b..1dd41f4 100644
--- a/debian/anastasis-httpd.postinst
+++ b/debian/anastasis-httpd.postinst
@@ -2,37 +2,43 @@
set -e
-TALER_HOME="/var/lib/taler/"
+if [ -d /run/systemd/system ]; then
+ systemctl --system daemon-reload >/dev/null || true
+fi
+if [ "$1" = "remove" ]; then
+ if [ -x "/usr/bin/deb-systemd-helper" ]; then
+ deb-systemd-helper mask 'anastasis-httpd.service' >/dev/null || true
+ fi
+fi
+
+if [ "$1" = "purge" ]; then
+ if [ -x "/usr/bin/deb-systemd-helper" ]; then
+ deb-systemd-helper purge 'anastasis-httpd.service' >/dev/null || true
+ deb-systemd-helper unmask 'anastasis-httpd.service' >/dev/null || true
+ fi
+fi
+
+ANASTASIS_HOME="/var/lib/anastasis/"
_USERNAME=anastasis-httpd
_GROUPNAME=www-data
-# Set permissions for sqlite3 file
-# (for when we support sqlite3 in the future)
-dbc_dbfile_owner="${_USERNAME}:${_GROUPNAME}"
-dbc_dbfile_perms="0600"
-
. /usr/share/debconf/confmodule
case "${1}" in
configure)
# Creating taler users if needed
- if ! getent passwd ${_USERNAME} >/dev/null; then
- adduser --quiet --system --ingroup ${_GROUPNAME} --no-create-home --home ${TALER_HOME} ${_USERNAME}
+ if ! getent passwd ${_USERNAME} >/dev/null
+ then
+ adduser --quiet --system --ingroup ${_GROUPNAME} --no-create-home --home ${ANASTASIS_HOME} ${_USERNAME}
fi
- if ! dpkg-statoverride --list /etc/anastasis/secrets/anastasis-db.secret.conf >/dev/null 2>&1; then
+ if ! dpkg-statoverride --list /etc/anastasis/secrets/anastasis-db.secret.conf >/dev/null 2>&1
+ then
dpkg-statoverride --add --update \
anastasis-httpd root 460 \
/etc/anastasis/secrets/anastasis-db.secret.conf
fi
- # Setup postgres database (needs dbconfig-pgsql package)
- if [ -f /usr/share/dbconfig-common/dpkg/postinst.pgsql ]; then
- . /usr/share/dbconfig-common/dpkg/postinst.pgsql
- dbc_pgsql_createdb_encoding="UTF8"
- dbc_go anastasis-httpd "$@"
- fi
-
;;
abort-upgrade | abort-remove | abort-deconfigure) ;;
diff --git a/debian/anastasis-httpd.postrm b/debian/anastasis-httpd.postrm
index 9954a33..ee84d38 100644
--- a/debian/anastasis-httpd.postrm
+++ b/debian/anastasis-httpd.postrm
@@ -2,18 +2,19 @@
set -e
+_USERNAME=anastasis-httpd
+
if [ -f /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
fi
-if [ -f /usr/share/dbconfig-common/dpkg/postrm.pgsql ]; then
- . /usr/share/dbconfig-common/dpkg/postrm.pgsql
- dbc_go anastasis-httpd "$@"
-fi
-
case "${1}" in
purge)
rm -rf /var/lib/anastasis/httpd/
+ rm -f /etc/anastasis/override.conf
+ deluser --system --quiet ${_USERNAME} || true
+ dpkg-statoverride --remove \
+ /etc/anastasis/secrets/anastasis-db.secret.conf || true
;;
remove | upgrade | failed-upgrade | abort-install | abort-upgrade | disappear)
;;
diff --git a/debian/anastasis-httpd.preinst b/debian/anastasis-httpd.preinst
deleted file mode 100644
index 2d6c261..0000000
--- a/debian/anastasis-httpd.preinst
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-
-# We prevent a few questions from being asked
-# upon installation by specifying defaults. Namely,
-# we want the database to be accessed via Unix domain
-# sockets and password-less.
-
-set -e
-
-# When purging this package after the selections in the preinst have been made,
-# the debconf database is left in an inconsistent state and the package cannot
-# be installed again. This happens because dbconf-common will create a
-# template for these questions with a shared owner. Purging will only delete
-# one of the two templates, leading to a DB state where debconf-set-selections
-# fails. We work around this by manually fixing up the debconf database.
-#
-# Unfortunately we can't do this in "postrm", because during "postrm"
-# the configuration database is locked (even after db_stop).
-#
-# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=487300
-if [ -x /usr/share/debconf/fix_db.pl ]; then
- /usr/share/debconf/fix_db.pl || true
-fi
-
-echo anastasis-httpd anastasis-httpd/pgsql/method select Unix socket | debconf-set-selections
-echo anastasis-httpd anastasis-httpd/pgsql/authmethod-user select ident | debconf-set-selections
-echo anastasis-httpd anastasis-httpd/pgsql/app-pass password | debconf-set-selections
-
-exit 0
diff --git a/debian/anastasis-httpd.prerm b/debian/anastasis-httpd.prerm
index 24625c0..951f5ac 100644
--- a/debian/anastasis-httpd.prerm
+++ b/debian/anastasis-httpd.prerm
@@ -2,15 +2,8 @@
set -e
-if [ -f /usr/share/debconf/confmodule ]; then
- . /usr/share/debconf/confmodule
+if [ -d /run/systemd/system ] && [ "$1" = remove ]; then
+ deb-systemd-invoke stop 'anastasis-httpd.service' >/dev/null || true
fi
-. /usr/share/dbconfig-common/dpkg/prerm
-if [ -f /usr/share/dbconfig-common/dpkg/prerm.pgsql ]; then
- . /usr/share/dbconfig-common/dpkg/prerm.pgsql
- dbc_go anastasis-httpd "$@"
-fi
-
-db_stop
exit 0
diff --git a/debian/anastasis-httpd.service b/debian/anastasis-httpd.service
index bd6919e..372e824 100644
--- a/debian/anastasis-httpd.service
+++ b/debian/anastasis-httpd.service
@@ -5,7 +5,7 @@ Description=Anastasis key recovery backend
User=anastasis-httpd
Type=simple
Restart=on-failure
-ExecStart=/usr/bin/anastasis-httpd -c /etc/anastasis/anastasis.conf
+ExecStart=/usr/bin/anastasis-httpd -c /etc/anastasis/anastasis.conf -L INFO
[Install]
WantedBy=multi-user.target
diff --git a/debian/changelog b/debian/changelog
index fad8c85..071951f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,65 @@
+anastasis (0.4.2-1) unstable; urgency=low
+
+ * Bump for build with Taler 0.10 release.
+
+ -- Christian Grothoff <grothoff@gnu.org> Fri, 12 Apr 2024 09:50:12 +0200
+
+anastasis (0.4.2) unstable; urgency=low
+
+ * Improve auth scripts, install them with the package
+ * Set default log level to INFO
+ * Make drop.sql more robust to future changes
+
+ -- Christian Grothoff <grothoff@gnu.org> Tue, 9 Apr 2024 09:50:12 +0200
+
+anastasis (0.4.1) unstable; urgency=low
+
+ * Actual v0.4.1 release.
+
+ -- Christian Grothoff <grothoff@gnu.org> Sat, 10 Feb 2024 03:50:12 +0200
+
+anastasis (0.4.0-2) unstable; urgency=low
+
+ * Updates for packaging with GNU Taler v0.9.4.
+
+ -- Christian Grothoff <grothoff@gnu.org> Sun, 21 Jan 2024 23:50:12 +0200
+
+anastasis (0.4.0-1) unstable; urgency=low
+
+ * Actual v0.4.0 release.
+
+ -- Christian Grothoff <grothoff@gnu.org> Wed, 27 Sep 2023 03:50:12 +0200
+
+anastasis (0.4.0) unstable; urgency=low
+
+ * First work towards packaging v0.4.0.
+
+ -- Christian Grothoff <grothoff@gnu.org> Thu, 7 Sep 2023 23:50:12 +0200
+
+anastasis (0.3.2) unstable; urgency=low
+
+ * Official Anastasis 0.3.2 release.
+
+ -- Christian Grothoff <grothoff@gnu.org> Tue, 21 Feb 2023 09:50:12 +0200
+
+anastasis (0.3.1) unstable; urgency=low
+
+ * Official Anastasis 0.3.1 release.
+
+ -- Christian Grothoff <grothoff@gnu.org> Tue, 17 Jan 2023 09:50:12 +0200
+
+anastasis (0.3.0) unstable; urgency=low
+
+ * Official Anastasis 0.3.0 release.
+
+ -- Christian Grothoff <grothoff@gnu.org> Mon, 26 Sep 2022 09:50:12 +0200
+
+anastasis (0.2.99-2) unstable; urgency=low
+
+ * Close to Anastasis 0.3.0, but testing package details.
+
+ -- Christian Grothoff <grothoff@gnu.org> Mon, 20 Jun 2022 14:02:10 +0100
+
anastasis (0.2.99-1) unstable; urgency=low
* Close to Anastasis 0.3.0, but a preview release for UX testing.
diff --git a/debian/control b/debian/control
index 0252c0d..85865ef 100644
--- a/debian/control
+++ b/debian/control
@@ -8,19 +8,16 @@ Build-Depends:
autopoint,
debhelper-compat (= 12),
gettext,
- libgnunet-dev,
- libtalerexchange-dev (>= 0.8.5),
- libtalermerchant-dev (>= 0.8.4),
- libpq-dev (>=9.5),
+ libgnunet-dev (>=0.21),
+ libtalerexchange-dev (>= 0.10.2),
+ libtalermerchant-dev (>= 0.10.2),
+ libpq-dev (>=14),
libsqlite3-dev (>=3.8),
pkg-config,
po-debconf,
libqrencode-dev,
uuid-dev,
zlib1g-dev
-Build-Conflicts:
- autoconf2.13,
- automake1.4
Standards-Version: 4.5.0
Vcs-Git: https://salsa.debian.org/debian/anastasis.git
Vcs-browser: https://salsa.debian.org/debian/anastasis
@@ -35,44 +32,66 @@ Depends:
netbase,
${misc:Depends},
${shlibs:Depends}
-Description: libraries to talk to an Anastasis provider.
+Description: libraries to talk to a GNU Anastasis provider.
+ .
+ GNU Anastasis allows users to make backups of their
+ private key material to multiple providers while ensuring that
+ individual providers cannot learn the secret key material.
+ The libraries contained in this package implement the
+ client-side of the Anastasis backup and recovery protocol.
Package: anastasis-httpd
Architecture: any
Pre-Depends:
${misc:Pre-Depends}
Depends:
- libtalerexchange (>= 0.8.5),
+ libtalerexchange (>= 0.10.2),
libgnutls30 (>= 3.7.1),
adduser,
lsb-base,
netbase,
- apache2 | nginx | httpd,
- postgresql,
- dbconfig-pgsql | dbconfig-no-thanks,
${misc:Depends},
${shlibs:Depends}
+Recommends:
+ apache2 | nginx | httpd,
+ postgresql (>=14.0)
Description: GNU's key escrow provider.
+ .
+ GNU Anastasis allows users to make backups of their
+ private key material to multiple providers while ensuring that
+ individual providers cannot learn the secret key material.
+ This package contains the backend logic that must be run by
+ an Anastasis backup provider.
Package: anastasis-cli
Architecture: any
Pre-Depends:
${misc:Pre-Depends}
Depends:
- libanastasis (>= 0.0.0),
+ libanastasis,
${misc:Depends},
${shlibs:Depends}
-Description: Command-line interface for the Anastasis key escrow provider service.
+Description: Command-line interface for the GNU Anastasis key escrow provider service.
+ .
+ GNU Anastasis allows users to make backups of their
+ private key material to multiple providers while ensuring that
+ individual providers cannot learn the secret key material.
+ This package contains a command-line interface to the
+ Anastasis logic. Please note that we do not expect the CLI to
+ be useful to end-users. It may be useful for integration of
+ Anastasis into applications (and for testing).
+ If you are looking for a stand-alone Anastasis client, please
+ use anastasis-gtk.
Package: libanastasis-dev
Section: libdevel
Architecture: any
Depends:
- libtalermerchant-dev (>= 0.8.3),
- libtalerexchange-dev (>= 0.8.5),
- libgnunet-dev (>=0.15.3),
+ libtalermerchant-dev (>= 0.10.2),
+ libtalerexchange-dev (>= 0.10.2),
+ libgnunet-dev (>=0.21),
${misc:Depends},
${shlibs:Depends}
-Description: libraries to talk to a GNU Anastasis provider (development)
+Description: libraries to talk to a GNU Anastasis provider (development).
.
- This package contains the development files.
+ This package contains the development files for the libanastasis libraries.
diff --git a/debian/db/install/pgsql b/debian/db/install/pgsql
deleted file mode 100755
index f695fed..0000000
--- a/debian/db/install/pgsql
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-
-set -eu
-
-conf_anastasis_db=/etc/anastasis/secrets/anastasis-db.secret.conf
-conf_override=/etc/anastasis/override.conf
-
-# Get database settings from dbconfig-common and write anastasis configuration files.
-if [ -f /etc/dbconfig-common/anastasis-httpd.conf ]; then
- . /etc/dbconfig-common/anastasis-httpd.conf
- case "$dbc_dbtype" in
- pgsql)
- echo -e "# Config file auto-generated by Debian.\n[anastasis]\nDB=postgres\n\n" > \
- $conf_override
- # We assume ident auth here. We might support password auth later.
- echo -e "[stasis-postgres]\nCONFIG=postgres:///${dbc_dbname}\n\n" > \
- $conf_anastasis_db
-
- # Allow the taler-merchant-httpd user to create schemas, needed by dbinit
- echo "GRANT CREATE on database \"$dbc_dbname\" to \"anastasis-httpd\";" | sudo -u postgres psql -f -
- # Run database initialization logic
- sudo -u anastasis-httpd anastasis-dbinit -c /etc/anastasis/anastasis.conf
- ;;
- sqlite3)
- # Later: use something like:
- # sqlite:///$DATA_DIR/anastasis.db
- # But for now, sqlite is unsupported:
- echo "Unsupported database type $dbc_type."
- exit 1
- ;;
- "") ;;
-
- *)
- echo "Unsupported database type $dbc_type."
- exit 1
- ;;
- esac
-fi
diff --git a/debian/etc/anastasis/anastasis.conf b/debian/etc/anastasis/anastasis.conf
index 9938438..9b85754 100644
--- a/debian/etc/anastasis/anastasis.conf
+++ b/debian/etc/anastasis/anastasis.conf
@@ -14,7 +14,7 @@ SERVE = unix
# Name of your business
#BUSINESS_NAME = ""
-# Random server salt. Use output of 'uuidgen'
+# Random server salt. Use output of 'uuidgen'. Make a backup of the value.
#SERVER_SALT = ""
# How high is the per key share insurance offered
@@ -32,7 +32,7 @@ PAYMENT_BACKEND_URL = http://backend.demo.taler.net/instances/Tutorial/
[taler]
-# Currency accepted by anastasis via GNU Taler payments.
+# Currency accepted by GNU Anastasis via GNU Taler payments.
CURRENCY = KUDOS
[paths]
diff --git a/debian/etc/anastasis/secrets/anastasis-db.secret.conf b/debian/etc/anastasis/secrets/anastasis-db.secret.conf
index 8f9fb54..512366d 100644
--- a/debian/etc/anastasis/secrets/anastasis-db.secret.conf
+++ b/debian/etc/anastasis/secrets/anastasis-db.secret.conf
@@ -1,3 +1,3 @@
[stasis-postgres]
#The connection string the plugin has to use for connecting to the database
-CONFIG = postgres:///anastasis
+# CONFIG = postgres:///anastasis
diff --git a/debian/rules b/debian/rules
index 0307145..3a1911d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,6 +7,9 @@ include /usr/share/dpkg/architecture.mk
%:
dh ${@}
+override_dh_builddeb:
+ dh_builddeb -- -Zgzip
+
override_dh_auto_configure-arch:
dh_auto_configure -- --disable-rpath --with-microhttpd=yes $(shell dpkg-buildflags --export=configure)
@@ -30,6 +33,11 @@ override_dh_auto_install-indep:
override_dh_auto_clean:
dh_auto_clean
+override_dh_installsystemd:
+ dh_installsystemd -panastasis-httpd --name=anastasis-httpd --no-start --no-enable
+ # final invocation to generate daemon reload
+ dh_installsystemd
+
override_dh_install:
dh_install
# Done manually for debhelper-compat<13
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 1bdb6d1..aa8ee42 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -3,6 +3,8 @@
# SUBDIRS = . doxygen
man_MANS = \
+ anastasis-dbconfig.1 \
+ anastasis-dbinit.1 \
anastasis-httpd.1 \
anastasis-helper-authorization-iban.1 \
anastasis-reducer.1 \
diff --git a/doc/anastasis-dbconfig.1 b/doc/anastasis-dbconfig.1
new file mode 100644
index 0000000..a739c7d
--- /dev/null
+++ b/doc/anastasis-dbconfig.1
@@ -0,0 +1,87 @@
+.\" Man page generated from reStructuredText.
+.
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.TH "ANASTASIS-DBCONFIG" "1" "Sep 08, 2023" "0.0" "Anastasis"
+.SH NAME
+anastasis-dbconfig \- configure Anastasis database
+.SH SYNOPSIS
+.sp
+\fBanastasis\-dbconfig\fP
+[\fB\-c\fP\ \fIFILENAME\fP\ \fI]
+[*\fP\-h**]
+[\fB\-n\fP\ \fINAME\fP\ \fI]
+[*\fP\-r**]
+[\fB\-s\fP]
+[\fB\-u\fP\ \fIUSER\fP\
+.nf
+*
+.fi
+]
+.SH DESCRIPTION
+.sp
+\fBanastasis\-dbconfig\fP is a simple shell script that configures
+a Postgresql database for use by the GNU Anastasis servers.
+.sp
+Its options are as follows:
+.INDENT 0.0
+.TP
+\fB\-c\fP \fIFILENAME\fP
+Write the database configuration to FILENAME. The tool
+will append the required \fBCONFIG\fP option for the
+Postgresql access to the respective file.
+.TP
+\fB\-h\fP
+Print short help on options.
+.TP
+\fB\-n\fP \fIDBNAME\fP
+Use DBNAME for the name of the created database.
+.TP
+\fB\-r\fP
+Reset any existing database. Looses all existing data. DANGEROUS.
+.TP
+\fB\-s\fP
+Skip database initialization. Useful if you want to run
+\fBanastasis\-dbinit\fP manually.
+.TP
+\fB\-u\fP \fIUSER\fP
+Specifies the (main) Anastasis user that will access the database.
+.UNINDENT
+.SH SEE ALSO
+.sp
+anastassis\-dbinit(1), anastasis.conf(5).
+.SH BUGS
+.sp
+Report bugs by using \fI\%https://bugs.taler.net\fP or by sending electronic
+mail to <\fI\%taler@gnu.org\fP>.
+.SH AUTHOR
+Anastasis SARL
+.SH COPYRIGHT
+2020-2021 Anastasis SARL (AGPLv3+ or GFDL 1.3+)
+.\" Generated by docutils manpage writer.
+.
diff --git a/doc/anastasis-dbinit.1 b/doc/anastasis-dbinit.1
new file mode 100644
index 0000000..9791f08
--- /dev/null
+++ b/doc/anastasis-dbinit.1
@@ -0,0 +1,89 @@
+.\" Man page generated from reStructuredText.
+.
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.TH "ANASTASIS-DBINIT" "1" "Sep 08, 2023" "0.0" "Anastasis"
+.SH NAME
+anastasis-dbinit \- initialize Anastasis database
+.SH SYNOPSIS
+.sp
+\fBanastasis\-dbinit\fP
+[\fB\-c\fP\ \fIFILENAME\fP\ |\ \fB\-\-config=\fP‌\fIFILENAME\fP]
+[\fB\-g\fP\ |\ \fB\-\-gc\fP]
+[\fB\-h\fP\ |\ \fB\-\-help\fP]
+[\fB\-L\fP\ \fILOGLEVEL\fP\ |\ \fB\-\-loglevel=\fP‌\fILOGLEVEL\fP]
+[\fB\-l\fP\ \fIFILENAME\fP\ |\ \fB\-\-logfile=\fP‌\fIFILENAME\fP]
+[\fB\-r\fP\ |\ \fB\-\-reset\fP]
+[\fB\-v\fP\ |\ \fB\-\-version\fP]
+.SH DESCRIPTION
+.sp
+\fBanastasis\-dbinit\fP is a command\-line tool to initialize the GNU
+Anastasis database. It creates the necessary tables and indices for
+an Anastasis server to operate.
+.sp
+Its options are as follows:
+.INDENT 0.0
+.TP
+\fB\-c\fP \fIFILENAME\fP | \fB\-\-config=\fP‌\fIFILENAME\fP
+Use the configuration and other resources for the exchange to operate
+from \fIFILENAME\fP\&.
+.TP
+\fB\-g\fP | \fB\-\-gc\fP
+Garbage collect database. Deletes all unnecessary data in the
+database.
+.TP
+\fB\-h\fP | \fB\-\-help\fP
+Print short help on options.
+.TP
+\fB\-L\fP \fILOGLEVEL\fP | \fB\-\-loglevel=\fP‌\fILOGLEVEL\fP
+Specifies the log level to use. Accepted values are: \fBDEBUG\fP, \fBINFO\fP,
+\fBWARNING\fP, \fBERROR\fP\&.
+.TP
+\fB\-l\fP \fIFILENAME\fP | \fB\-\-logfile=\fP‌\fIFILENAME\fP
+Send logging output to \fIFILENAME\fP\&.
+.TP
+\fB\-r\fP | \fB\-\-reset\fP
+Drop tables. Dangerous, will delete all existing data in the database
+before creating the tables.
+.TP
+\fB\-v\fP | \fB–version\fP
+Print version information.
+.UNINDENT
+.SH SEE ALSO
+.sp
+anastasis\-httpd(1), anastasis.conf(5).
+.SH BUGS
+.sp
+Report bugs by using \fI\%https://bugs.taler.net\fP or by sending electronic
+mail to <\fI\%taler@gnu.org\fP>.
+.SH AUTHOR
+Anastasis SARL
+.SH COPYRIGHT
+2020-2021 Anastasis SARL (AGPLv3+ or GFDL 1.3+)
+.\" Generated by docutils manpage writer.
+.
diff --git a/doc/anastasis.texi b/doc/anastasis.texi
index d0f281a..8ac8263 100644
--- a/doc/anastasis.texi
+++ b/doc/anastasis.texi
@@ -3,7 +3,7 @@
@setfilename anastasis.info
@documentencoding UTF-8
@ifinfo
-@*Generated by Sphinx 3.4.3.@*
+@*Generated by Sphinx 4.3.2.@*
@end ifinfo
@settitle Anastasis Manual
@defindex ge
@@ -21,7 +21,7 @@
@copying
@quotation
-Anastasis 0.0.0pre0, Aug 14, 2021
+Anastasis 0.0.0pre0, Aug 12, 2023
Anastasis SARL
@@ -64,7 +64,7 @@ Copyright @copyright{} 2020-2021 Anastasis SARL (AGPLv3+ or GFDL 1.3+)
@c
@c @author Christian Grothoff
-Anastasis is Free Software protocol and implementation that allows
+Anastasis is a Free Software protocol and implementation that allows
users to securely deposit @strong{core secrets} with an open set of escrow
providers and to recover these secrets if their original copies are
lost.
@@ -148,6 +148,16 @@ Configuration
* Configuration format::
* Using anastasis-config::
+* Terms of Service::
+* Privacy Policy::
+* Legal policies directory layout::
+* Generating the Legal Terms::
+* Adding translations::
+* Updating legal documents::
+
+Legal policies directory layout
+
+* Example::
Cryptography
@@ -170,6 +180,10 @@ REST API
* HTTP Request and Response::
* Protocol Version Ranges::
* Common encodings::
+* Receiving Configuration::
+* Receiving Terms of Service::
+* Managing policy::
+* Managing truth::
Common encodings
@@ -185,10 +199,6 @@ Common encodings
* Time::
* Cryptographic primitives::
* Signatures: Signatures<3>.
-* Receiving Configuration::
-* Receiving Terms of Service::
-* Manage policy::
-* Managing truth::
Reducer API
@@ -229,7 +239,10 @@ Anastasis-gtk (git://git.taler.net/anastasis-gtk)
Man Pages
* anastasis-config(1): anastasis-config 1.
+* anastasis-dbconfig(1): anastasis-dbconfig 1.
+* anastasis-dbinit(1): anastasis-dbinit 1.
* anastasis-gtk(1): anastasis-gtk 1.
+* anastasis-helper-authorization-iban(1): anastasis-helper-authorization-iban 1.
* anastasis-httpd(1): anastasis-httpd 1.
* anastasis-reducer(1): anastasis-reducer 1.
* anastasis.conf(5): anastasis conf 5.
@@ -241,40 +254,69 @@ anastasis-config(1)
* See Also::
* Bugs::
-anastasis-gtk(1)
+anastasis-dbconfig(1)
* Synopsis: Synopsis<2>.
* Description: Description<2>.
* See Also: See Also<2>.
* Bugs: Bugs<2>.
-anastasis-httpd(1)
+anastasis-dbinit(1)
* Synopsis: Synopsis<3>.
* Description: Description<3>.
-* Signals::
-* See also::
+* See Also: See Also<3>.
* Bugs: Bugs<3>.
-anastasis-reducer(1)
+anastasis-gtk(1)
* Synopsis: Synopsis<4>.
* Description: Description<4>.
-* See Also: See Also<3>.
+* See Also: See Also<4>.
* Bugs: Bugs<4>.
-anastasis.conf(5)
+anastasis-helper-authorization-iban(1)
+* Synopsis: Synopsis<5>.
* Description: Description<5>.
+* See Also: See Also<5>.
+* Bugs: Bugs<5>.
+
+anastasis-httpd(1)
+
+* Synopsis: Synopsis<6>.
+* Description: Description<6>.
+* Signals::
+* See also::
+* Bugs: Bugs<6>.
+
+anastasis-reducer(1)
+
+* Synopsis: Synopsis<7>.
+* Description: Description<7>.
+* See Also: See Also<6>.
+* Bugs: Bugs<7>.
+
+anastasis.conf(5)
+
+* Description: Description<8>.
* SEE ALSO::
* BUGS::
Description
* GLOBAL OPTIONS::
+* Backend options::
* Authorization options::
* Postgres database configuration::
+Authorization options
+
+* SMS Authorization options::
+* Email Authorization options::
+* Post Authorization options::
+* IBAN Authorization options::
+
GNU Free Documentation License
* 0. PREAMBLE: 0 PREAMBLE.
@@ -430,6 +472,20 @@ network traffic).
@section Installation
+@cartouche
+@quotation Note
+Currently, GNU Anastasis is released as alpha-quality software.
+When testing Anastasis, please choose @code{demoland} as
+your country of residence!
+@strong{It is not yet production ready! You cannot rely on it to keep
+your secrets recoverable today!} In particular, we need to
+still review the various country-specific questions used to create
+unique user identifiers at the beginning of the backup and
+recovery process. Community feedback on those inputs would be
+particularly welcome!
+@end quotation
+@end cartouche
+
Please install the following packages before proceeding with the
exchange compilation.
@@ -712,47 +768,14 @@ find the installed libraries and launching anastasis-gtk would then fail.
To install the GNU Taler Debian packages, first ensure that you have
the right Debian distribution. At this time, the packages are built for
-Sid, which means you should use a system which at least includes
-unstable packages in its source list. We recommend using APT pinning
-to limit unstable packages to those explicitly requested. To do this,
-set your @code{/etc/apt/preferences} as follows:
+Bullseye.
-@example
-Package: *
-Pin: release a=stable
-Pin-Priority: 700
-
-Package: *
-Pin: release a=testing
-Pin-Priority: 650
-
-Package: *
-Pin: release a=unstable
-Pin-Priority: 600
-
-Package: *
-Pin: release l=Debian-Security
-Pin-Priority: 1000
-@end example
-
-A typical @code{/etc/apt/sources.list} file for this setup
-which combines Debian stable with more recent packages
-from testing and unstable would look like this:
-
-@example
-deb http://ftp.ch.debian.org/debian/ buster main
-deb http://security.debian.org/debian-security buster/updates main
-deb http://ftp.ch.debian.org/debian/ testing main
-deb http://ftp.ch.debian.org/debian/ unstable main
-@end example
-
-Naturally, you may want to use different mirrors depending on your region.
-Additionally, you must add a file to import the GNU Taler packages. Typically,
+You need to add a file to import the GNU Taler packages. Typically,
this is done by adding a file @code{/etc/apt/sources.list.d/taler.list} that
looks like this:
@example
-deb https://deb.taler.net/apt/debian sid main
+deb https://deb.taler.net/apt/debian bullseye main
@end example
Next, you must import the Taler Systems SA public package signing key
@@ -944,6 +967,12 @@ configuration format.
@menu
* Configuration format::
* Using anastasis-config::
+* Terms of Service::
+* Privacy Policy::
+* Legal policies directory layout::
+* Generating the Legal Terms::
+* Adding translations::
+* Updating legal documents::
@end menu
@@ -1010,19 +1039,10 @@ Note that, in this stage of development, the file
component. For example, both an exchange and a bank can read values from
it.
-The repository @code{git://taler.net/deployment} contains examples of
+The repository @code{git://git.taler.net/deployment} contains examples of
configuration file used in our demos. See under @code{deployment/config}.
-@quotation
-
-@strong{Note}
-
-Expectably, some components will not work just by using default
-values, as their work is often interdependent. For example, a
-merchant needs to know an exchange URL, or a database name.
-@end quotation
-
-@node Using anastasis-config,,Configuration format,Configuration
+@node Using anastasis-config,Terms of Service,Configuration format,Configuration
@anchor{configuration using-anastasis-config}@anchor{1a}
@subsection Using anastasis-config
@@ -1075,6 +1095,240 @@ While the configuration file is typically located at
to @code{taler-merchant-httpd} and @code{anastasis-config} using the @code{-c}
option.
+@c This file is part of GNU TALER.
+@c
+@c Copyright (C) 2014-2023 Taler Systems SA
+@c
+@c TALER is free software; you can redistribute it and/or modify it under the
+@c terms of the GNU Affero General Public License as published by the Free Software
+@c Foundation; either version 2.1, or (at your option) any later version.
+@c
+@c TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+@c WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+@c A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
+@c
+@c You should have received a copy of the GNU Affero General Public License along with
+@c TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+@c
+@c @author Christian Grothoff
+
+The service has well-known API endpoints to return its legal conditions to the
+user in various languages and various formats. This section describes how to
+setup and configure the legal conditions.
+
+@node Terms of Service,Privacy Policy,Using anastasis-config,Configuration
+@anchor{configuration terms-of-service}@anchor{1b}
+@subsection Terms of Service
+
+
+The service has an endpoint “/terms” to return the terms of service (in legal
+language) of the service operator. Client software show these terms of
+service to the user when the user is first interacting with the service.
+Terms of service are optional for experimental deployments, if none are
+configured, the service will return a simple statement saying that there are
+no terms of service available.
+
+To configure the terms of service response, there are two options
+in the configuration file for the service:
+
+
+@itemize -
+
+@item
+@code{TERMS_ETAG}: The current “Etag” to return for the terms of service.
+This value must be changed whenever the terms of service are
+updated. A common value to use would be a version number.
+Note that if you change the @code{TERMS_ETAG}, you MUST also provide
+the respective files in @code{TERMS_DIR} (see below).
+
+@item
+@code{TERMS_DIR}: The directory that contains the terms of service.
+The files in the directory must be readable to the service
+process.
+@end itemize
+
+@node Privacy Policy,Legal policies directory layout,Terms of Service,Configuration
+@anchor{configuration privacy-policy}@anchor{1c}
+@subsection Privacy Policy
+
+
+The service has an endpoint “/pp” to return the terms privacy policy (in legal
+language) of the service operator. Clients should show the privacy policy to
+the user when the user explicitly asks for it, but it should not be shown by
+default. Privacy policies are optional for experimental deployments, if none
+are configured, the service will return a simple statement saying that there
+is no privacy policy available.
+
+To configure the privacy policy response, there are two options
+in the configuration file for the service:
+
+
+@itemize -
+
+@item
+@code{PRIVACY_ETAG}: The current “Etag” to return for the privacy policy.
+This value must be changed whenever the privacy policy is
+updated. A common value to use would be a version number.
+Note that if you change the @code{PRIVACY_ETAG}, you MUST also provide
+the respective files in @code{PRIVACY_DIR} (see below).
+
+@item
+@code{PRIVACY_DIR}: The directory that contains the privacy policy.
+The files in the directory must be readable to the service
+process.
+@end itemize
+
+@node Legal policies directory layout,Generating the Legal Terms,Privacy Policy,Configuration
+@anchor{configuration legal-policies-directory-layout}@anchor{1d}
+@subsection Legal policies directory layout
+
+
+The @code{TERMS_DIR} and @code{PRIVACY_DIR} directory structures must follow a
+particular layout. You may use the same directory for both the terms of
+service and the privacy policy, as long as you use different ETAGs. Inside of
+the directory, there should be sub-directories using two-letter language codes
+like “en”, “de”, or “jp”. Each of these directories would then hold
+translations of the current terms of service into the respective language.
+Empty directories are permitted in case translations are not available.
+
+Then, inside each language directory, files with the name of the value set as
+the @code{TERMS_ETAG} or @code{PRIVACY_ETAG} must be provided. The extension of each
+of the files should be typical for the respective mime type. The set of
+supported mime types is currently hard-coded in the service, and includes
+“.epub”, “.html”, “.md”, “.pdf” and “.txt” files. If other files are present,
+the service may show a warning on startup.
+
+@menu
+* Example::
+
+@end menu
+
+@node Example,,,Legal policies directory layout
+@anchor{configuration example}@anchor{1e}
+@subsubsection Example
+
+
+A sample file structure for a @code{TERMS_ETAG} of “tos-v0” would be:
+
+
+@itemize -
+
+@item
+TERMS_DIR/en/tos-v0.txt
+
+@item
+TERMS_DIR/en/tos-v0.html
+
+@item
+TERMS_DIR/en/tos-v0.pdf
+
+@item
+TERMS_DIR/en/tos-v0.epub
+
+@item
+TERMS_DIR/en/tos-v0.md
+
+@item
+TERMS_DIR/de/tos-v0.txt
+
+@item
+TERMS_DIR/de/tos-v0.html
+
+@item
+TERMS_DIR/de/tos-v0.pdf
+
+@item
+TERMS_DIR/de/tos-v0.epub
+
+@item
+TERMS_DIR/de/tos-v0.md
+@end itemize
+
+If the user requests an HTML format with language preferences “fr” followed by
+“en”, the service would return @code{TERMS_DIR/en/tos-v0.html} lacking a version in
+French.
+
+@node Generating the Legal Terms,Adding translations,Legal policies directory layout,Configuration
+@anchor{configuration generating-the-legal-terms}@anchor{1f}
+@subsection Generating the Legal Terms
+
+
+The @code{taler-terms-generator} script can be used to generate directories with
+terms of service and privacy policies in multiple languages and all required
+data formats from a single source file in @code{.rst} format and GNU gettext
+translations in @code{.po} format.
+
+To use the tool, you need to first write your legal conditions in English in
+reStructuredText (rst). You should find a templates in
+@code{$PREFIX/share/terms/*.rst} where @code{$PREFIX} is the location where you
+installed the service to. Whenever you make substantive changes to the legal
+terms, you must use a fresh filename and change the respective @code{ETAG}. The
+resulting file must be called @code{$ETAG.rst} and the first line of the file should be the title of the document.
+
+Once you have written the @code{$ETAG.rst} file in English, you can
+generate the first set of outputs:
+
+@example
+$ taler-terms-generator -i $ETAG
+@end example
+
+Afterwards, you should find the terms in various formats for all configured
+languages (initially only English) in @code{$PREFIX/share/terms/}. The generator
+has a few options which are documented in its man page.
+
+@node Adding translations,Updating legal documents,Generating the Legal Terms,Configuration
+@anchor{configuration adding-translations}@anchor{20}
+@subsection Adding translations
+
+
+Translations must be available in subdirectories
+@code{locale/$LANGUAGE/LC_MESSAGES/$ETAG.po}.
+To start translating, you first need to add a new
+language:
+
+@example
+$ taler-terms-generator -i $ETAG -l $LANGUAGE
+@end example
+
+Here, @code{$LANGUAGE} should be a two-letter language
+code like @code{de} or @code{fr}. The command will generate
+a file @code{locale/$LANGUAGE/LC_MESSAGES/$ETAG.po}
+which contains each English sentence or paragraph
+in the original document and an initially empty
+translation. Translators should update the @code{.po}
+file. Afterwards, simply re-run
+
+@example
+$ taler-terms-generator -i $ETAG
+@end example
+
+to make the current translation(s) available to the
+service.
+
+@cartouche
+@quotation Note
+You must restart the service whenever adding or updating legal documents or their translations.
+@end quotation
+@end cartouche
+
+@node Updating legal documents,,Adding translations,Configuration
+@anchor{configuration updating-legal-documents}@anchor{21}
+@subsection Updating legal documents
+
+
+When making minor changes without legal implications, edit the @code{.rst} file,
+then re-run the step to add a new language for each existing translation to
+produce an updated @code{.po} file. Translate the sentences that have changed and
+finally run the generator (without @code{-l}) on the ETAG (@code{-i $ETAG}) to
+create the final files.
+
+When making major changes with legal implications, you should first rename (or
+copy) the existing @code{.rst} file and the associated translation files to a new
+unique name. Afterwards, make the major changes, update the @code{.po} files,
+complete the translations and re-create the final files. Finally, do not
+forget to update the @code{ETAG} configuration option to the new name and to
+restart the service.
+
@c This file is part of Anastasis
@c Copyright (C) 2019-2021 Anastasis SARL
@c
@@ -1094,7 +1348,7 @@ option.
@c @author Dennis Neufeld
@node Cryptography,REST API,Configuration,Documentation Overview
-@anchor{cryptography doc}@anchor{1b}@anchor{cryptography cryptography}@anchor{1c}
+@anchor{cryptography doc}@anchor{22}@anchor{cryptography cryptography}@anchor{23}
@section Cryptography
@@ -1141,7 +1395,7 @@ encrypted @strong{core secret}, a set of escrow methods and a set of policies.
@end menu
@node Key derivations,Key Usage,,Cryptography
-@anchor{cryptography key-derivations}@anchor{1d}
+@anchor{cryptography key-derivations}@anchor{24}
@subsection Key derivations
@@ -1184,7 +1438,7 @@ kdf_id := Argon2( identifier, server_salt, keysize )
@end menu
@node Verification,Encryption,,Key derivations
-@anchor{cryptography verification}@anchor{1e}
+@anchor{cryptography verification}@anchor{25}
@subsubsection Verification
@@ -1204,7 +1458,7 @@ HKDF to ensure that the result differs from other cases where we hash
@example
ver_secret := HKDF(kdf_id, "ver", keysize)
-eddsa_priv := eddsa_d_to_a(ver_secret)
+eddsa_priv := ver_secret
eddsa_pub := get_EdDSA_Pub(eddsa_priv)
@end example
@@ -1216,19 +1470,12 @@ eddsa_pub := get_EdDSA_Pub(eddsa_priv)
@strong{ver_secret}: Derived key from the @code{kdf_id}, serves as intermediate step for the generation of the private key.
-@strong{eddsa_d_to_a()}: Function which converts the ver_key to a valid EdDSA private key. Specifically, assuming the value @code{eddsa_priv} is in a 32-byte array “digest”, the function clears and sets certain bits as follows:
-
-@example
-digest[0] = (digest[0] & 0x7f) | 0x40;
-digest[31] &= 0xf8;
-@end example
-
@strong{eddsa_priv}: The generated EdDSA private key.
@strong{eddsa_pub}: The generated EdDSA public key.
@node Encryption,,Verification,Key derivations
-@anchor{cryptography encryption}@anchor{1f}
+@anchor{cryptography encryption}@anchor{26}
@subsubsection Encryption
@@ -1259,7 +1506,7 @@ avoid key reuse. So, we have to use different nonces to get different keys and I
@strong{iv}: IV which will be used for AES-GCM.
@node Key Usage,Availability Considerations,Key derivations,Cryptography
-@anchor{cryptography key-usage}@anchor{20}
+@anchor{cryptography key-usage}@anchor{27}
@subsection Key Usage
@@ -1273,7 +1520,7 @@ the @strong{key_share} of the user.
@end menu
@node Encryption<2>,Signatures,,Key Usage
-@anchor{cryptography id1}@anchor{21}
+@anchor{cryptography id1}@anchor{28}
@subsubsection Encryption
@@ -1295,7 +1542,7 @@ individual @strong{key share}, we use different salts (“erd” and “eks”,
and the encrypted @strong{core secret}.
@strong{nonce0}: Nonce which is used to generate @emph{key0} and @emph{iv0} which are used for the encryption of the @emph{recovery document}.
-Nonce must contain the string “ERD”.
+This key derivation must be done using the salt “erd”.
@strong{optional data}: Key material that optionally is contributed from the authentication method to further obfuscate the key share from the escrow provider.
@@ -1304,7 +1551,8 @@ Here, @strong{i} must be a positive number used to iterate over the various @str
at the various providers.
@strong{nonce_i}: Nonce which is used to generate @emph{key_i} and @emph{iv_i} which are used for the encryption of the @strong{key share}. @strong{i} must be
-the same number as specified above for @emph{encrypted_key_share_i}. Nonce must contain the string “EKS” plus the according @emph{i}.
+the same number as specified above for @emph{encrypted_key_share_i}.
+Key derivation must be done using the salt “eks”.
As a special rule, when a @strong{security question} is used to authorize access to an
@strong{encrypted_key_share_i}, then the salt “eks” is replaced with an (expensive) hash
@@ -1330,12 +1578,14 @@ ekss := HKDF("Anastasis-secure-question-uuid-salting",
@strong{ekss}: Replacement salt to be used instead of “eks” when deriving the key to encrypt/decrypt the key share.
@node Signatures,,Encryption<2>,Key Usage
-@anchor{cryptography signatures}@anchor{22}
+@anchor{cryptography signatures}@anchor{29}
@subsubsection Signatures
The EdDSA keys are used to sign the data sent from the client to the
-server. Everything the client sends to server is signed. The following
+server. This signature ensures that an adversary that observes the upload is not
+able to upload a new version of the policy without knowing the user’s identity attributes.
+The signature is made over a hash of the request body. The following
algorithm is equivalent for @strong{Anastasis-Policy-Signature}.
@example
@@ -1349,21 +1599,8 @@ ver_res := eddsa_verifiy(h_body, anastasis-account-signature, eddsa_pub)
@strong{ver_res}: A boolean value. True: Signature verification passed, False: Signature verification failed.
-When requesting policy downloads, the client must also provide a signature:
-
-@example
-(anastasis-account-signature) := eddsa_sign(version, eddsa_priv)
-ver_res := eddsa_verifiy(version, anastasis-account-signature, eddsa_pub)
-@end example
-
-@strong{anastasis-account-signature}: Signature over the SHA-512 hash of the body using the purpose code @code{TALER_SIGNATURE_ANASTASIS_POLICY_DOWNLOAD} (1401) (see GNUnet EdDSA signature API for the use of purpose).
-
-@strong{version}: The version requested as a 64-bit integer, 2^64-1 for the “latest version”.
-
-@strong{ver_res}: A boolean value. True: Signature verification passed, False: Signature verification failed.
-
@node Availability Considerations,,Key Usage,Cryptography
-@anchor{cryptography availability-considerations}@anchor{23}
+@anchor{cryptography availability-considerations}@anchor{2a}
@subsection Availability Considerations
@@ -1393,7 +1630,7 @@ from using the append-only policy storage from exhausting Anastasis server
capacity.
@c This file is part of Anastasis
-@c Copyright (C) 2019-2021 Anastasis SARL
+@c Copyright (C) 2019-2022 Anastasis SARL
@c
@c Anastasis is free software; you can redistribute it and/or modify it under the
@c terms of the GNU Affero General Public License as published by the Free Software
@@ -1411,7 +1648,7 @@ capacity.
@c @author Dennis Neufeld
@node REST API,Reducer API,Cryptography,Documentation Overview
-@anchor{rest doc}@anchor{24}@anchor{rest rest-api}@anchor{25}
+@anchor{rest doc}@anchor{2b}@anchor{rest rest-api}@anchor{2c}
@section REST API
@@ -1436,11 +1673,15 @@ capacity.
* HTTP Request and Response::
* Protocol Version Ranges::
* Common encodings::
+* Receiving Configuration::
+* Receiving Terms of Service::
+* Managing policy::
+* Managing truth::
@end menu
@node HTTP Request and Response,Protocol Version Ranges,,REST API
-@anchor{rest http-common}@anchor{26}@anchor{rest http-request-and-response}@anchor{27}
+@anchor{rest http-common}@anchor{2d}@anchor{rest http-request-and-response}@anchor{2e}
@subsection HTTP Request and Response
@@ -1450,7 +1691,7 @@ theoretically fail to receive any response. In this case, the client should
verify that the Internet connection is working properly, and then proceed to
handle the error as if an internal error (500) had been returned.
-@anchor{rest any--*}@anchor{28}
+@anchor{rest any--*}@anchor{2f}
@deffn {HTTP Any} ANY /*
@strong{Request:}
@@ -1505,7 +1746,7 @@ within 24h.
@end table
Unless specified otherwise, all error status codes (4xx and 5xx) have a message
-body with an @ref{29,,ErrorDetail} JSON object.
+body with an @ref{30,,ErrorDetail} JSON object.
@strong{Details:}
@@ -1525,7 +1766,7 @@ interface ErrorDetail @{
@end deffn
@node Protocol Version Ranges,Common encodings,HTTP Request and Response,REST API
-@anchor{rest protocol-version-ranges}@anchor{2a}
+@anchor{rest protocol-version-ranges}@anchor{31}
@subsection Protocol Version Ranges
@@ -1609,8 +1850,8 @@ to decide whether it will talk to the service.
@end quotation
@end cartouche
-@node Common encodings,,Protocol Version Ranges,REST API
-@anchor{rest common-encodings}@anchor{2b}@anchor{rest encodings-ref}@anchor{2c}
+@node Common encodings,Receiving Configuration,Protocol Version Ranges,REST API
+@anchor{rest common-encodings}@anchor{32}@anchor{rest encodings-ref}@anchor{33}
@subsection Common encodings
@@ -1629,15 +1870,11 @@ This section describes how certain types of values are represented throughout th
* Time::
* Cryptographic primitives::
* Signatures: Signatures<3>.
-* Receiving Configuration::
-* Receiving Terms of Service::
-* Manage policy::
-* Managing truth::
@end menu
@node Binary Data,Hash codes,,Common encodings
-@anchor{rest base32}@anchor{2d}@anchor{rest binary-data}@anchor{2e}
+@anchor{rest base32}@anchor{34}@anchor{rest binary-data}@anchor{35}
@subsubsection Binary Data
@@ -1652,12 +1889,12 @@ type “base32” and the term “Crockford Base32” in the text to refer to th
resulting encoding.
@node Hash codes,Large numbers,Binary Data,Common encodings
-@anchor{rest hash-codes}@anchor{2f}
+@anchor{rest hash-codes}@anchor{36}
@subsubsection Hash codes
Hash codes are strings representing base32 encoding of the respective
-hashed data. See @ref{2d,,base32}.
+hashed data. See @ref{34,,base32}.
@example
// 64-byte hash code.
@@ -1670,7 +1907,7 @@ type ShortHashCode = string;
@end example
@node Large numbers,Timestamps,Hash codes,Common encodings
-@anchor{rest large-numbers}@anchor{30}
+@anchor{rest large-numbers}@anchor{37}
@subsubsection Large numbers
@@ -1678,7 +1915,7 @@ Large numbers such as 256 bit keys, are transmitted as other binary data in
Crockford Base32 encoding.
@node Timestamps,Integers,Large numbers,Common encodings
-@anchor{rest timestamps}@anchor{31}
+@anchor{rest timestamps}@anchor{38}
@subsubsection Timestamps
@@ -1702,7 +1939,7 @@ interface Duration @{
@end example
@node Integers,Objects,Timestamps,Common encodings
-@anchor{rest integers}@anchor{32}@anchor{rest publickey}@anchor{33}
+@anchor{rest integers}@anchor{39}@anchor{rest publickey}@anchor{3a}
@subsubsection Integers
@@ -1712,7 +1949,7 @@ type Integer = number;
@end example
@node Objects,Keys,Integers,Common encodings
-@anchor{rest objects}@anchor{34}
+@anchor{rest objects}@anchor{3b}
@subsubsection Objects
@@ -1722,7 +1959,7 @@ type Object = object;
@end example
@node Keys,Signatures<2>,Objects,Common encodings
-@anchor{rest keys}@anchor{35}
+@anchor{rest keys}@anchor{3c}
@subsubsection Keys
@@ -1741,7 +1978,7 @@ type EddsaPrivateKey = string;
@end example
@node Signatures<2>,Amounts,Keys,Common encodings
-@anchor{rest signature}@anchor{36}@anchor{rest signatures}@anchor{37}
+@anchor{rest signature}@anchor{3d}@anchor{rest signatures}@anchor{3e}
@subsubsection Signatures
@@ -1752,7 +1989,7 @@ type EddsaSignature = string;
@end example
@node Amounts,Time,Signatures<2>,Common encodings
-@anchor{rest amount}@anchor{38}@anchor{rest amounts}@anchor{39}
+@anchor{rest amount}@anchor{3f}@anchor{rest amounts}@anchor{40}
@subsubsection Amounts
@@ -1791,7 +2028,7 @@ An amount that is prefixed with a @code{+} or @code{-} character is also used in
When no sign is present, the amount is assumed to be positive.
@node Time,Cryptographic primitives,Amounts,Common encodings
-@anchor{rest time}@anchor{3a}
+@anchor{rest time}@anchor{41}
@subsubsection Time
@@ -1805,10 +2042,18 @@ struct GNUNET_TIME_Absolute @{
struct GNUNET_TIME_AbsoluteNBO @{
uint64_t abs_value_us__; // in network byte order
@};
+struct GNUNET_TIME_Timestamp @{
+ // must be round value (multiple of seconds)
+ struct GNUNET_TIME_Absolute abs_time;
+@};
+struct GNUNET_TIME_TimestampNBO @{
+ // must be round value (multiple of seconds)
+ struct GNUNET_TIME_AbsoluteNBO abs_time;
+@};
@end example
@node Cryptographic primitives,Signatures<3>,Time,Common encodings
-@anchor{rest cryptographic-primitives}@anchor{3b}
+@anchor{rest cryptographic-primitives}@anchor{42}
@subsubsection Cryptographic primitives
@@ -1821,12 +2066,18 @@ struct GNUNET_HashCode @{
uint8_t hash[64]; // usually SHA-512
@};
@end example
-@anchor{rest taler-ecdhephemeralpublickeyp}@anchor{3c}
+@anchor{rest taler-ecdhephemeralpublickeyp}@anchor{43}
@example
struct TALER_EcdhEphemeralPublicKeyP @{
uint8_t ecdh_pub[32];
@};
@end example
+@anchor{rest anastasis-truthkeyp}@anchor{44}
+@example
+struct ANASTASIS_TruthKeyP @{
+ struct GNUNET_HashCode key;
+@};
+@end example
@example
struct UUID @{
@@ -1834,8 +2085,8 @@ struct UUID @{
@};
@end example
-@node Signatures<3>,Receiving Configuration,Cryptographic primitives,Common encodings
-@anchor{rest id1}@anchor{3d}@anchor{rest id2}@anchor{3e}
+@node Signatures<3>,,Cryptographic primitives,Common encodings
+@anchor{rest id1}@anchor{45}@anchor{rest id2}@anchor{46}
@subsubsection Signatures
@@ -1869,21 +2120,21 @@ struct GNUNET_CRYPTO_EccSignaturePurpose @{
uint32_t size;
@};
@end example
-@anchor{rest salt}@anchor{3f}
-@node Receiving Configuration,Receiving Terms of Service,Signatures<3>,Common encodings
-@anchor{rest config}@anchor{40}@anchor{rest receiving-configuration}@anchor{41}
-@subsubsection Receiving Configuration
+@anchor{rest salt}@anchor{47}
+@node Receiving Configuration,Receiving Terms of Service,Common encodings,REST API
+@anchor{rest config}@anchor{48}@anchor{rest receiving-configuration}@anchor{49}
+@subsection Receiving Configuration
-@anchor{rest get--config}@anchor{42}
+@anchor{rest get--config}@anchor{4a}
@deffn {HTTP Get} GET /config
Obtain the configuration details of the escrow provider.
@strong{Response:}
-Returns an @ref{43,,EscrowConfigurationResponse}.
-@anchor{rest escrowconfigurationresponse}@anchor{43}
+Returns an @ref{4b,,EscrowConfigurationResponse}.
+@anchor{rest escrowconfigurationresponse}@anchor{4b}
@example
interface EscrowConfigurationResponse @{
@@ -1921,11 +2172,11 @@ interface EscrowConfigurationResponse @{
// **provider salt** is then used in various operations to ensure
// cryptographic operations differ by provider. A provider must
// never change its salt value.
- server_salt: string;
+ provider_salt: string;
@}
@end example
-@anchor{rest authorizationmethodconfig}@anchor{44}
+@anchor{rest authorizationmethodconfig}@anchor{4c}
@example
interface AuthorizationMethodConfig @{
// Name of the authorization method.
@@ -1938,12 +2189,12 @@ interface AuthorizationMethodConfig @{
@end example
@end deffn
-@node Receiving Terms of Service,Manage policy,Receiving Configuration,Common encodings
-@anchor{rest receiving-terms-of-service}@anchor{45}@anchor{rest terms}@anchor{46}
-@subsubsection Receiving Terms of Service
+@node Receiving Terms of Service,Managing policy,Receiving Configuration,REST API
+@anchor{rest receiving-terms-of-service}@anchor{4d}@anchor{rest terms}@anchor{4e}
+@subsection Receiving Terms of Service
-@anchor{rest get--terms}@anchor{47}
+@anchor{rest get--terms}@anchor{4f}
@deffn {HTTP Get} GET /terms
Obtain the terms of service provided by the escrow provider.
@@ -1954,7 +2205,7 @@ Returns the terms of service of the provider, in the best language
and format available based on the client’s request.
@end deffn
-@anchor{rest get--privacy}@anchor{48}
+@anchor{rest get--privacy}@anchor{50}
@deffn {HTTP Get} GET /privacy
Obtain the privacy policy of the service provided by the escrow provider.
@@ -1965,9 +2216,9 @@ Returns the privacy policy of the provider, in the best language
and format available based on the client’s request.
@end deffn
-@node Manage policy,Managing truth,Receiving Terms of Service,Common encodings
-@anchor{rest id3}@anchor{49}@anchor{rest manage-policy}@anchor{4a}
-@subsubsection Manage policy
+@node Managing policy,Managing truth,Receiving Terms of Service,REST API
+@anchor{rest manage-policy}@anchor{51}@anchor{rest managing-policy}@anchor{52}
+@subsection Managing policy
This API is used by the Anastasis client to deposit or request encrypted
@@ -1981,7 +2232,59 @@ public key using the Crockford base32-encoding.
In the following, UUID is always defined and used according to RFC 4122@footnote{https://tools.ietf.org/html/rfc4122}.
-@anchor{rest get--policy-$ACCOUNT_PUB[?version=$NUMBER]}@anchor{4b}
+@anchor{rest get--policy-$ACCOUNT_PUB-meta[?max_version=$NUMBER]}@anchor{53}
+@deffn {HTTP Get} GET /policy/$ACCOUNT_PUB/meta[?max_version=$NUMBER]
+
+Get meta data about a customer’s encrypted recovery documents.
+If @code{max_version} is specified, only return results up to the
+given version number. The response may not contain meta data
+for all versions if there are way too many. In this case,
+@code{max_version} must be used to incrementally fetch more versions.
+
+@strong{Response}:
+
+
+@table @asis
+
+@item 200 OK@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1}:
+
+The escrow provider responds with a @ref{54,,RecoveryMetaSummary} object.
+
+@item 400 Bad request@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1}:
+
+The @code{$ACCOUNT_PUB} is not an EdDSA public key.
+
+@item 402 Payment Required@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.3}:
+
+The account’s balance is too low for the specified operation.
+See the Taler payment protocol specification for how to pay.
+
+@item 404 Not found@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5}:
+
+The requested resource was not found.
+@end table
+
+@strong{Details:}
+@anchor{rest recoverymetasummary}@anchor{54}
+@example
+interface RecoveryMetaSummary @{
+ // Version numbers as a string (!) are used as keys.
+ "$VERSION": MetaData;
+@}
+
+interface MetaData @{
+ // The meta value can be NULL if the document
+ // exists but no meta data was provided.
+ meta: string;
+
+ // Server-time indicative of when the recovery
+ // document was uploaded.
+ upload_time: Timestamp;
+@}
+@end example
+@end deffn
+
+@anchor{rest get--policy-$ACCOUNT_PUB[?version=$NUMBER]}@anchor{55}
@deffn {HTTP Get} GET /policy/$ACCOUNT_PUB[?version=$NUMBER]
Get the customer’s encrypted recovery document. If @code{version}
@@ -2017,7 +2320,7 @@ code in case the resource matches the provided Etag.
@item 200 OK@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1}:
-The escrow provider responds with an @ref{4c,,EncryptedRecoveryDocument} object.
+The escrow provider responds with an @ref{56,,EncryptedRecoveryDocument} object.
@item 304 Not modified@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5}:
@@ -2032,10 +2335,6 @@ The @code{$ACCOUNT_PUB} is not an EdDSA public key.
The account’s balance is too low for the specified operation.
See the Taler payment protocol specification for how to pay.
-@item 403 Forbidden@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4}:
-
-The required account signature was invalid.
-
@item 404 Not found@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5}:
The requested resource was not found.
@@ -2043,17 +2342,15 @@ The requested resource was not found.
@emph{Anastasis-Version}: $NUMBER — The server must return actual version of the encrypted recovery document via this header.
If the client specified a version number in the header of the request, the server must return that version. If the client
-did not specify a version in the request, the server returns latest version of the @ref{4c,,EncryptedRecoveryDocument}.
+did not specify a version in the request, the server returns latest version of the @ref{56,,EncryptedRecoveryDocument}.
@emph{Etag}: Set by the server to the Base32-encoded SHA512 hash of the body. Used for caching and to prevent redundancies. The server MUST send the Etag if the status code is @code{200 OK}.
@emph{If-None-Match}: If this is not the very first request of the client, this contains the Etag-value which the client has received before from the server.
The client SHOULD send this header with every request (except for the first request) to avoid unnecessary downloads.
-
-@emph{Anastasis-Account-Signature}: The client must provide Base-32 encoded EdDSA signature over hash of body with @code{$ACCOUNT_PRIV}, affirming desire to download the requested encrypted recovery document. The purpose used MUST be @code{TALER_SIGNATURE_ANASTASIS_POLICY_DOWNLOAD} (1401).
@end deffn
-@anchor{rest post--policy-$ACCOUNT_PUB}@anchor{4d}
+@anchor{rest post--policy-$ACCOUNT_PUB}@anchor{57}
@deffn {HTTP Post} POST /policy/$ACCOUNT_PUB
Upload a new version of the customer’s encrypted recovery document.
@@ -2088,7 +2385,7 @@ case.
@code{timeout_ms=NUMBER} – @emph{Optional.} If specified, the Anastasis server will
wait up to @code{timeout_ms} milliseconds for completion of the payment before
sending the HTTP response. A client must never rely on this behavior, as the
-backend may return a response immediately.
+backend may return a response immediately. If a @code{timeout_ms} is not given, the Anastasis server may apply a default timeout (usually 30s) when talking to the merchant backend.
@end itemize
@@ -2099,9 +2396,11 @@ use the Etag to check whether it already knows the encrypted recovery document t
The server MUST refuse the upload with a @code{304} status code if the Etag matches
the latest version already known to the server.
+@emph{Anastasis-Policy-Meta-Data}: Encrypted meta data to be stored by the server and returned with the respective endpoint to provide an overview of the available policies. Encrypted using a random nonce and a key derived from the user ID using the salt “rmd”. The plaintext metadata must consist of the policy hash (for deduplication) and the (human readable) secret name.
+
@emph{Anastasis-Policy-Signature}: The client must provide Base-32 encoded EdDSA signature over hash of body with @code{$ACCOUNT_PRIV}, affirming desire to upload an encrypted recovery document.
-@emph{Payment-Identifier}: Base-32 encoded 32-byte payment identifier that was included in a previous payment (see @code{402} status code). Used to allow the server to check that the client paid for the upload (to protect the server against DoS attacks) and that the client knows a real secret of financial value (as the @strong{kdf_id} might be known to an attacker). If this header is missing in the client’s request (or the associated payment has exceeded the upload limit), the server must return a @code{402} response. When making payments, the server must include a fresh, randomly-generated payment-identifier in the payment request.
+@emph{Payment-Identifier}: Base-32 encoded 32-byte payment identifier that was included in a previous payment (see @code{402} status code). Used to allow the server to check that the client paid for the upload (to protect the server against DoS attacks) and that the client knows a real secret of financial value (as the @strong{kdf_id} might be known to an attacker). If this header is missing in the client’s request (or the associated payment has exceeded the upload limit), the server must return a @code{402} response. When making payments, the server must include a fresh, randomly-generated payment-identifier in the payment request. If a payment identifier is given, the Anastasis backend may block for the payment to be confirmed by Taler as specified by the @code{timeout_ms} argument.
@strong{Response}:
@@ -2110,8 +2409,10 @@ the latest version already known to the server.
@item 204 No content@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5}:
-The encrypted recovery document was accepted and stored. @code{Anastasis-Version} and @code{Anastasis-UUID} headers
-indicate what version and UUID was assigned to this encrypted recovery document upload by the server.
+The encrypted recovery document was accepted and stored. @code{Anastasis-Version}
+indicates what version was assigned to this encrypted recovery document upload by the server.
+@code{Anastasis-Policy-Expiration} indicates the time until the server promises to store the policy,
+in seconds since epoch.
@item 304 Not modified@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5}:
@@ -2139,7 +2440,7 @@ The upload is too large @emph{or} too small. The response body may elaborate on
@end table
@strong{Details:}
-@anchor{rest encryptedrecoverydocument}@anchor{4c}
+@anchor{rest encryptedrecoverydocument}@anchor{56}
@example
interface EncryptedRecoveryDocument @{
// Nonce used to compute the (iv,key) pair for encryption of the
@@ -2151,35 +2452,34 @@ interface EncryptedRecoveryDocument @{
// Variable-size encrypted recovery document. After decryption,
// this contains a gzip compressed JSON-encoded `RecoveryDocument`.
- // The nonce of the HKDF for this encryption must include the
- // string "ERD".
+ // The salt of the HKDF for this encryption must include the
+ // string "erd".
encrypted_compressed_recovery_document: []; //bytearray of undefined length
@}
@end example
-@anchor{rest recoverydocument}@anchor{4e}
+@anchor{rest recoverydocument}@anchor{58}
@example
interface RecoveryDocument @{
- // Account identifier at backup provider, AES-encrypted with
- // the (symmetric) master_key, i.e. an URL
- // https://sync.taler.net/$BACKUP_ID and
- // a private key to decrypt the backup. Anastasis is oblivious
- // to the details of how this is ultimately encoded.
- backup_account: []; //bytearray of undefined length
+ // Human-readable name of the secret
+ secret_name?: string;
+
+ // Encrypted core secret.
+ encrypted_core_secret: string; // bytearray of undefined length
// List of escrow providers and selected authentication method.
- methods: EscrowMethod[];
+ escrow_methods: EscrowMethod[];
// List of possible decryption policies.
- policy: DecryptionPolicy[];
+ policies: DecryptionPolicy[];
@}
@end example
-@anchor{rest escrowmethod}@anchor{4f}
+@anchor{rest escrowmethod}@anchor{59}
@example
interface EscrowMethod @{
// URL of the escrow provider (including possibly this Anastasis server).
- provider_url : string;
+ url : string;
// Type of the escrow method (e.g. security question, SMS etc.).
escrow_type: string;
@@ -2189,46 +2489,48 @@ interface EscrowMethod @{
// Key used to encrypt the `Truth` this `EscrowMethod` is related to.
// Client has to provide this key to the server when using `@w{`}/truth/`@w{`}.
- truth_encryption_key: [32]; //bytearray
+ truth_key: [32]; //bytearray
- // Salt used to encrypt the truth on the Anastasis server.
- truth_salt: [32]; //bytearray
+ // Salt used to hash the security answer if appliccable.
+ question_salt: [32]; //bytearray
- // The challenge to give to the user (i.e. the security question
+ // Salt from the provider to derive the user ID
+ // at this provider.
+ provider_salt: [32]; //bytearray
+
+ // The instructions to give to the user (i.e. the security question
// if this is challenge-response).
// (Q: as string in base32 encoding?)
// (Q: what is the mime-type of this value?)
//
- // For some methods, this value may be absent.
- //
// The plaintext challenge is not revealed to the
// Anastasis server.
- challenge: []; //bytearray of undefined length
+ instructions: string;
@}
@end example
-@anchor{rest decryptionpolicy}@anchor{50}
+@anchor{rest decryptionpolicy}@anchor{5a}
@example
interface DecryptionPolicy @{
// Salt included to encrypt master key share when
// using this decryption policy.
- policy_salt: [32]; //bytearray
+ master_salt: [32]; //bytearray
// Master key, AES-encrypted with key derived from
// salt and keyshares revealed by the following list of
// escrow methods identified by UUID.
- encrypted_master_key: [32]; //bytearray
+ master_key: [32]; //bytearray
// List of escrow methods identified by their UUID.
- uuid: string[];
+ uuids: string[];
@}
@end example
@end deffn
-@node Managing truth,,Manage policy,Common encodings
-@anchor{rest managing-truth}@anchor{51}@anchor{rest truth}@anchor{52}
-@subsubsection Managing truth
+@node Managing truth,,Managing policy,REST API
+@anchor{rest managing-truth}@anchor{5b}@anchor{rest truth}@anchor{5c}
+@subsection Managing truth
Truth always consists of an encrypted key share and encrypted
@@ -2249,14 +2551,14 @@ data required for such a respective escrow method.
An Anastasis-server may store truth for free for a certain time period, or
charge per truth operation using GNU Taler.
-@anchor{rest post--truth-$UUID}@anchor{53}
+@anchor{rest post--truth-$UUID}@anchor{5d}
@deffn {HTTP Post} POST /truth/$UUID
-Upload a @ref{54,,TruthUploadRequest}-Object according to the policy the client created before (see @ref{4e,,RecoveryDocument}).
-If request has been seen before, the server should do nothing, and otherwise store the new object.
-
@strong{Request:}
+Upload a @ref{5e,,TruthUploadRequest}-Object according to the policy the client created before (see @ref{58,,RecoveryDocument}).
+If request has been seen before, the server should do nothing, and otherwise store the new object.
+
@*Query Parameters:
@itemize *
@@ -2301,7 +2603,7 @@ The selected authentication method is not supported on this provider.
@end table
@strong{Details:}
-@anchor{rest truthuploadrequest}@anchor{54}
+@anchor{rest truthuploadrequest}@anchor{5e}
@example
interface TruthUploadRequest @{
// Contains the information of an interface `EncryptedKeyShare`, but simply
@@ -2325,38 +2627,32 @@ interface TruthUploadRequest @{
// For how many years from now would the client like us to
// store the truth?
- storage_duration_years: Integer;
+ storage_duration_years: number;
@}
@end example
-@end deffn
-@anchor{rest get--truth-$UUID}@anchor{55}
-@deffn {HTTP Get} GET /truth/$UUID
+@anchor{rest post--truth-$UUID-solve}@anchor{5f}
+@deffn {HTTP Post} POST /truth/$UUID/solve
+@end deffn
-Get the stored encrypted key share.
-Also, the user has to provide the correct @emph{truth_encryption_key} with every get request (see below).
+Solve the challenge and get the stored encrypted key share.
+Also, the user has to provide the correct @emph{truth_encryption_key} with the request (see below).
The encrypted key share is returned simply as a byte array and not in JSON format.
-@*Query Parameters:
+@strong{Request}:
-@itemize *
+@quotation
-@item
-@code{response=H_RESPONSE} – @emph{Optional.} If @code{$H_RESPONSE} is specified by the client,
-the server checks if @code{$H_RESPONSE} matches the expected response. This can be the
-hash of the security question (as specified before by the client
-within the @ref{54,,TruthUploadRequest} (see @code{encrypted_truth})), or the hash of the
-PIN code sent via SMS, E-mail or postal communication channels.
-When @code{$H_RESPONSE} is correct, the server responds with the encrypted key share.
+Upload a @ref{60,,TruthSolutionRequest}-Object.
-@item
-@code{timeout_ms=NUMBER} – @emph{Optional.} If specified, the Anastasis server will
+@*query timeout_ms=NUMBER:
+@emph{Optional.} If specified, the Anastasis server will
wait up to @code{timeout_ms} milliseconds for completion of the payment or the
challenge before sending the HTTP response. A client must never rely on this
behavior, as the backend may return a response immediately.
-@end itemize
+@end quotation
@strong{Response}:
@@ -2365,24 +2661,7 @@ behavior, as the backend may return a response immediately.
@item 200 OK@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1}:
-@ref{56,,EncryptedKeyShare} is returned in body (in binary).
-
-@item 202 Accepted@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.3}:
-
-The escrow provider will respond out-of-band (i.e. SMS).
-The body may contain human-readable instructions on next steps.
-
-@item >>208 Already Reported<<:
-
-An authentication challenge was recently send, client should
-simply respond to the pending challenge.
-
-@item 303 See other@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4}:
-
-The provider redirects for authentication (i.e. video identification/WebRTC).
-If the client is not a browser, it should launch a browser at the URL
-given in the @code{Location} header and allow the user to re-try the operation
-after successful authorization.
+@ref{61,,EncryptedKeyShare} is returned in body (in binary).
@item 402 Payment required@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.3}:
@@ -2392,39 +2671,50 @@ The response body MAY provide alternative means for payment.
@item 403 Forbidden@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4}:
-The server requires a valid “response” to the challenge associated with the UUID.
+The h_response provided is not a good response to the challenge associated
+with the UUID, or at least the answer is not valid yet. A generic
+response is provided with an error code.
@item 404 Not found@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5}:
The server does not know any truth under the given UUID.
-@item 408 Request Timeout@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.9}:
-
-Accessing this truth requires satisfying an external authentication challenge
-(and not merely passing a response in the request) and this has not happened
-before the timeout was reached.
-
-@item 410 Gone@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.11}:
+@item 429 Too Many Requests@footnote{http://tools.ietf.org/html/rfc6585#section-4}:
-The server has not (recently) issued a challenge under the given UUID,
-but a reply was provided. (This does not apply for secure question.)
-
-@item 417 Expectation Failed@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.18}:
-
-The decrypted @code{truth} does not match the expectations of the authentication
-backend, i.e. a phone number for sending an SMS is not a number, or
-an e-mail address for sending an E-mail is not a valid e-mail address.
+The client exceeded the number of allowed attempts at providing
+a valid response for the given time interval.
+The response format is given by @ref{62,,RateLimitedMessage}.
@item 503 Service Unavailable@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4}:
Server is out of Service.
@end table
-@emph{Truth-Decryption-Key}: Key used to encrypt the @strong{truth} (see encrypted_truth within @ref{54,,TruthUploadRequest}) and which has to provided by the user. The key is stored with
-the according @ref{4f,,EscrowMethod}. The server needs this key to get the info out of @ref{54,,TruthUploadRequest} needed to verify the @code{$RESPONSE}.
-
@strong{Details:}
-@anchor{rest encryptedkeyshare}@anchor{56}
+@anchor{rest truthsolutionrequest}@anchor{60}
+@example
+interface TruthSolutionRequest @{
+
+ // Hash over the response that solves the challenge
+ // issued for this truth. This can be the
+ // hash of the security question (as specified before by the client
+ // within the `TruthUploadRequest`_ (see `@w{`}encrypted_truth`@w{`})), or the hash of the
+ // PIN code sent via SMS, E-mail or postal communication channels.
+ // Only when `@w{`}$H_RESPONSE`@w{`} is correct, the server responds with the encrypted key share.
+ h_response: HashCode;
+
+ // Key that was used to encrypt the **truth** (see encrypted_truth within `TruthUploadRequest`_)
+ // and which has to provided by the user. The key is stored with
+ // the according `EscrowMethod`_. The server needs this key to get the
+ // info out of `TruthUploadRequest`_ to verify the `@w{`}h_response`@w{`}.
+ truth_decryption_key: ANASTASIS_TruthKeyP;
+
+ // Reference to a payment made by the client to
+ // pay for this request. Optional.
+ payment_secret?: ANASTASIS_PaymentSecretP;
+@}
+@end example
+@anchor{rest encryptedkeyshare}@anchor{61}
@example
interface EncryptedKeyShare @{
// Nonce used to compute the decryption (iv,key) pair.
@@ -2447,23 +2737,161 @@ interface EncryptedKeyShare @{
encrypted_key_share_i: [32]; //bytearray
@}
-@end example
-@anchor{rest keyshare}@anchor{57}
-@example
+
+
interface KeyShare @{
- // Key material to concatenate with policy_salt and KDF to derive
- // the key to decrypt the master key.
+ // Key material to derive the key to decrypt the master key.
key_share: [32]; //bytearray
+@}
+@end example
+@anchor{rest ratelimitedmessage}@anchor{62}
+@example
+interface RateLimitedMessage @{
- // Signature over method, UUID, and `@w{`}key_share`@w{`}.
- account_sig: EddsaSignature;
+ // Taler error code, TALER_EC_ANASTASIS_TRUTH_RATE_LIMITED.
+ code: number;
+
+ // How many attempts are allowed per challenge?
+ request_limit: number;
+
+ // At what frequency are new challenges issued?
+ request_frequency: RelativeTime;
+
+ // The error message.
+ hint: string;
+
+@}
+@end example
+
+@anchor{rest post--truth-$UUID-challenge}@anchor{63}
+@deffn {HTTP Post} POST /truth/$UUID/challenge
+@end deffn
+
+NEW API (#7064):
+
+Initiate process to solve challenge associated with the given truth object.
+
+@strong{Request}:
+
+@quotation
+
+Upload a @ref{64,,TruthChallengeRequest}-Object.
+@end quotation
+
+@strong{Response}:
+
+
+@table @asis
+
+@item 200 Ok@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1}:
+
+The escrow provider will respond out-of-band (i.e. SMS).
+The body may contain human- or machine-readable instructions on next steps.
+In case the response is in JSON, the format is given
+by @ref{65,,ChallengeInstructionMessage}.
+
+@item 402 Payment required@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.3}:
+
+The service requires payment to issue a challenge.
+See the Taler payment protocol specification for how to pay.
+The response body MAY provide alternative means for payment.
+
+@item 403 Forbidden@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4}:
+
+This type of truth does not permit requests to trigger a challenge.
+This is the case for security questions and TOTP methods.
+
+@item 404 Not found@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5}:
+
+The server does not know any truth under the given UUID.
+
+@item 424 Failed Dependency@footnote{http://tools.ietf.org/html/rfc4918#section-11.4}:
+
+The decrypted @code{truth} does not match the expectations of the authentication
+backend, i.e. a phone number for sending an SMS is not a number, or
+an e-mail address for sending an E-mail is not a valid e-mail address.
+
+@item 503 Service Unavailable@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4}:
+
+Server is out of Service.
+@end table
+
+@strong{Details:}
+@anchor{rest truthchallengerequest}@anchor{64}
+@example
+interface TruthChallengeRequest @{
+
+ // Key that was used to encrypt the **truth** (see encrypted_truth within `TruthUploadRequest`_)
+ // and which has to provided by the user. The key is stored with
+ // the according `EscrowMethod`_. The server needs this key to get the
+ // info out of `TruthUploadRequest`_ to verify the `@w{`}h_response`@w{`}.
+ truth_decryption_key: ANASTASIS_TruthKeyP;
+
+ // Reference to a payment made by the client to
+ // pay for this request. Optional.
+ payment_secret?: ANASTASIS_PaymentSecretP;
+@}
+@end example
+@anchor{rest challengeinstructionmessage}@anchor{65}
+@example
+type ChallengeInstructionMessage =
+ | FileChallengeInstructionMessage
+ | IbanChallengeInstructionMessage
+ | PinChallengeInstructionMessage;
+
+interface IbanChallengeInstructionMessage @{
+
+ // What kind of challenge is this?
+ method: "IBAN_WIRE";
+
+ // How much should be wired?
+ amount: Amount;
+
+ // What is the target IBAN?
+ credit_iban: string;
+
+ // What is the receiver name?
+ business_name: string;
+
+ // What is the expected wire transfer subject?
+ wire_transfer_subject: string;
+
+ // What is the numeric code (also part of the
+ // wire transfer subject) to be hashed when
+ // solving the challenge?
+ answer_code: number;
+
+ // Hint about the origin account that must be used.
+ debit_account_hint: string;
+
+@}
+
+interface PinChallengeInstructionMessage @{
+
+ // What kind of challenge is this?
+ method: "TAN_SENT";
+
+ // Where was the PIN code sent? Note that this
+ // address will most likely have been obscured
+ // to improve privacy.
+ tan_address_hint: string;
+
+@}
+
+interface FileChallengeInstructionMessage @{
+
+ // What kind of challenge is this?
+ method: "FILE_WRITTEN";
+
+ // Name of the file where the PIN code was written.
+ filename: string;
@}
@end example
@end deffn
@c This file is part of Anastasis
-@c Copyright (C) 2019-2021 Anastasis SARL
+@c Copyright (C) 2019-2022 Anastasis SARL
@c
@c Anastasis is free software; you can redistribute it and/or modify it under the
@c terms of the GNU Affero General Public License as published by the Free Software
@@ -2481,13 +2909,13 @@ interface KeyShare @{
@c @author Dennis Neufeld
@node Reducer API,Authentication Methods,REST API,Documentation Overview
-@anchor{reducer doc}@anchor{58}@anchor{reducer reducer-api}@anchor{59}
+@anchor{reducer doc}@anchor{66}@anchor{reducer reducer-api}@anchor{67}
@section Reducer API
This section describes the Anastasis Reducer API which is used by client applications
to store or load the different states the client application can have.
-The reducer takes a @ref{5a,,state} in JSON syntax and returns the new state in JSON syntax.
+The reducer takes a @ref{68,,state} in JSON syntax and returns the new state in JSON syntax.
For example a @strong{state} may take the following structure:
@@ -2501,7 +2929,7 @@ For example a @strong{state} may take the following structure:
@}
@end example
-The new state depends on the previous one and on the transition @ref{5b,,action} with its
+The new state depends on the previous one and on the transition @ref{69,,action} with its
arguments given to the reducer. A @strong{transition argument} also is a statement in JSON syntax:
@example
@@ -2511,7 +2939,7 @@ arguments given to the reducer. A @strong{transition argument} also is a stateme
@end example
The new state returned by the reducer with the state and transition argument defined
-above would look like following for the transition @ref{5b,,action} @code{select_continent}:
+above would look like following for the transition @ref{69,,action} @code{select_continent}:
@example
@{
@@ -2553,6 +2981,18 @@ above would look like following for the transition @ref{5b,,action} @code{select
@}
@end example
+An action may also result into an @emph{error response} instead of a new state.
+Clients should then render this error response to the user and allow the user
+to continue from the old state. An error response looks like this:
+
+@example
+@{
+ "code": 123,
+ "hint": "something went wrong",
+ "details": "parameter foo failed to frobnify"
+@}
+@end example
+
@menu
* States::
* Backup Reducer::
@@ -2562,7 +3002,7 @@ above would look like following for the transition @ref{5b,,action} @code{select
@end menu
@node States,Backup Reducer,,Reducer API
-@anchor{reducer states}@anchor{5c}
+@anchor{reducer states}@anchor{6a}
@subsection States
@@ -2577,15 +3017,6 @@ Overall, the reducer knows the following states:
@table @asis
-@item @strong{ERROR}: The transition led to an error. No further transitions are possible from
-
-this state, but the client may want to continue from a previous state.
-@end table
-
-@item
-
-@table @asis
-
@item @strong{CONTINENT_SELECTING}: The user should specify the continent where they are living,
so that we can show a list of countries to choose from.
@@ -2697,10 +3128,10 @@ in FINISHED-states, the operation has definitively concluded.
@end quotation
@node Backup Reducer,Recovery Reducer,States,Reducer API
-@anchor{reducer backup-reducer}@anchor{5d}
+@anchor{reducer backup-reducer}@anchor{6b}
@subsection Backup Reducer
-@anchor{reducer state}@anchor{5a}@anchor{reducer action}@anchor{5b}
+@anchor{reducer state}@anchor{68}@anchor{reducer action}@anchor{69}
@float Figure
@@ -2715,7 +3146,7 @@ The illustration above shows the different states the reducer can have during a
process.
@node Recovery Reducer,Reducer transitions,Backup Reducer,Reducer API
-@anchor{reducer recovery-reducer}@anchor{5e}
+@anchor{reducer recovery-reducer}@anchor{6c}
@subsection Recovery Reducer
@@ -2733,7 +3164,7 @@ The illustration above shows the different states the reducer can have during a
process.
@node Reducer transitions,,Recovery Reducer,Reducer API
-@anchor{reducer reducer-transitions}@anchor{5f}
+@anchor{reducer reducer-transitions}@anchor{6d}
@subsection Reducer transitions
@@ -2750,7 +3181,7 @@ state is preserved to enable “back” transitions to function smoothly.
@end menu
@node Initial state,Common transitions,,Reducer transitions
-@anchor{reducer initial-state}@anchor{60}
+@anchor{reducer initial-state}@anchor{6e}
@subsubsection Initial state
@@ -2813,7 +3244,7 @@ continent names:
Translations must be given in the same order as the main English array.
@node Common transitions,Backup transitions,Initial state,Reducer transitions
-@anchor{reducer common-transitions}@anchor{61}
+@anchor{reducer common-transitions}@anchor{6f}
@subsubsection Common transitions
@@ -2939,7 +3370,7 @@ providers that accept payments in the selected currency:
@},
@{
"type": "string",
- "name": "tax_number",
+ "name": "tax_number",
"label": "Taxpayer identification number",
"label_i18n":@{
"de_DE": "Steuerliche Identifikationsnummer",
@@ -2947,7 +3378,7 @@ providers that accept payments in the selected currency:
"en": "German taxpayer identification number"
@},
"widget": "anastasis_gtk_ia_tax_de",
- "uuid": "dae48f85-e3ff-47a4-a4a3-ed981ed8c3c6",
+ "uuid": "dae48f85-e3ff-47a4-a4a3-ed981ed8c3c6",
"validation-regex": "^[0-9]@{11@}$",
"validation-logic": "DE_TIN_check"
@},
@@ -2962,8 +3393,8 @@ providers that accept payments in the selected currency:
"en": "Social security number"
@},
"widget": "anastasis_gtk_ia_ssn",
- "validation-regex": "^[0-9]@{8@}[[:upper:]][0-9]@{3@}$",
- "validation-logic": "DE_SVN_check"
+ "validation-regex": "^[0-9]@{8@}[[:upper:]][0-9]@{3@}$",
+ "validation-logic": "DE_SVN_check"
"optional" : true
@}
],
@@ -3126,37 +3557,44 @@ we did not even obtain an HTTP response).
@strong{add_provider}:
-This operation can be performed in state @code{USER_ATTRIBUTES_COLLECTING}. It
+This operation can be performed in state @code{USER_ATTRIBUTES_COLLECTING}.
+It
adds one or more Anastasis providers to the list of providers the reducer
should henceforth consider. Note that removing providers is not possible at
this time.
-Here, the client must provide an array with the base URLs of the
-providers to add, for example:
+Here, the client must provide an object with the base URLs of the
+providers to add or disable. The object maps the
+URLs to status information about the provider to
+use. For example:
@example
@{
- "urls": [
- "http://localhost:8888/",
- "http://localhost:8089/"
- ]
+ "http://localhost:8088/" : @{ "disabled" : false @},
+ "http://localhost:8089/" : @{ "disabled" : false @},
+ "http://localhost:8090/" : @{ "disabled" : true @}
@}
@end example
-Note that existing providers will remain in the state. The following is an
+Note that existing providers will remain in the state they were in. The following is an
example for an expected new state where the service on port 8089 is
-unreachable, the service on port 8088 was previously known, and service on
-port 8888 was now added:
+unreachable, the services on port 8088 and 8888 were previously known, and service on
+port 8088 was now added, and on 8090 is disabled:
@example
@{
"backup_state": "USER_ATTRIBUTES_COLLECTING",
"authentication_providers": @{
"http://localhost:8089/": @{
+ "disabled": false,
"error_code": 11,
"http_status": 0
@},
+ "http://localhost:8090/": @{
+ "disabled": true
+ @},
"http://localhost:8088/": @{
+ "disabled": false,
"http_status": 200,
"methods": [
@{ "type" : "question",
@@ -3194,7 +3632,7 @@ port 8888 was now added:
@end example
@node Backup transitions,Recovery transitions,Common transitions,Reducer transitions
-@anchor{reducer backup-transitions}@anchor{62}
+@anchor{reducer backup-transitions}@anchor{70}
@subsubsection Backup transitions
@@ -3238,15 +3676,17 @@ to it:
@end example
If required attributes are missing, do not match the required regular
-expression, or fail the custom validation logic, the reducer SHOULD transition
-to an error state indicating what was wrong about the input. A reducer that
-does not support some specific validation logic MAY accept the invalid input
-and proceed anyway. The error state will include a Taler error code that
-is specific to the failure, and optional details. Example:
+expression, or fail the custom validation logic, the reducer SHOULD return an
+error response indicating that the transition has failed and what is wrong about
+the input and not transition to a new state. A reducer that does not support
+some specific validation logic MAY accept the invalid input and proceed anyway.
+The error state will include a Taler error code that is specific to the
+failure, and optional details.
+
+Example:
@example
@{
- "backup_state": "ERROR",
"code": 8404,
"hint": "An input did not match the regular expression.",
"detail": "social_security_number"
@@ -3338,8 +3778,8 @@ response:
@}
@end example
-If the index is invalid, the reducer will instead
-transition into an @code{ERROR} state.
+If the index is invalid, the reducer will return an error
+response instead of making a transition.
@strong{next} (from @code{AUTHENTICATIONS_EDITING}):
@@ -3413,8 +3853,8 @@ policy. The @code{methods} array specifies the index of the
@code{authentication_method} in the @code{authentication_methods} array, as well as
the provider that was selected to supervise this authentication.
-If no authentication method was provided, the reducer will transition into an
-@code{ERROR} state instead of suggesting policies.
+If no authentication method was provided, the reducer will
+return an error response instead of making a transition.
@strong{add_policy}:
@@ -3500,7 +3940,7 @@ the “policies” array, returning an updated state:
If the new policy is invalid, for example because it adds an unknown
authentication method, or the selected provider does not support the type of
-authentication, the reducer will transition into an @code{ERROR} state instead of
+authentication, the reducer return an error response instead of
adding the new policy.
@strong{update_policy}:
@@ -3530,7 +3970,7 @@ An example for a possible argument would thus be:
If the new policy is invalid, for example because it adds an unknown
authentication method, or the selected provider does not support the type of
-authentication, the reducer will transition into an @code{ERROR} state instead of
+authentication, the reducer will return an error response instead of
modifying the policy.
@strong{delete_policy:}
@@ -3591,7 +4031,7 @@ be:
@}
@end example
-If the index given is invalid, the reducer will transition into an @code{ERROR} state
+If the index given is invalid, the reducer will return an error response
instead of deleting a policy.
@strong{delete_challenge:}
@@ -3651,7 +4091,7 @@ be:
@}
@end example
-If the index given is invalid, the reducer will transition into an @code{ERROR} state
+If the index given is invalid, the reducer will return an error response
instead of deleting a challenge.
@strong{next} (from @code{POLICIES_REVIEWING}):
@@ -3664,7 +4104,7 @@ The reducer will simply transition to the @code{SECRET_EDITING} state:
@example
@{
"backup_state": "SECRET_EDITING",
- "upload_fees" : [ "KUDOS:42" ],
+ "upload_fees" : [ @{ "fee": "KUDOS:42" @} ],
"expiration" : @{ "t_ms" : 1245362362 @}
@}
@end example
@@ -3674,8 +4114,8 @@ given policy expiration time. This is an array because fees could
be in different currencies. The final cost may be lower if the
user already paid for some of the time.
-If the array of @code{policies} is currently empty, the reducer will transition
-into an @code{ERROR} state instead of allowing the user to continue.
+If the array of @code{policies} is currently empty, the reducer will
+return an error response instead of allowing the user to continue.
@strong{enter_secret:}
@@ -3709,7 +4149,7 @@ be updated.
"mime" : "text/plain"
@},
"expiration" : @{ "t_ms" : 1245362362 @},
- "upload_fees" : [ "KUDOS:42" ]
+ "upload_fees" : [ @{ "fee": "KUDOS:42" @} ]
@}
@end example
@@ -3775,8 +4215,8 @@ Using this transition, the user confirms that the secret and expiration
settings in the current state are acceptable. The transition does not take any
arguments.
-If the secret is currently empty, the reducer will transition into an
-@code{ERROR} state instead of allowing the user to continue.
+If the secret is currently empty, the reducer will return an
+error response instead of allowing the user to continue.
After adding a secret, the reducer may transition into different states
depending on whether payment(s) are necessary. If payments are needed, the
@@ -3852,13 +4292,12 @@ will wait this long before giving up. If no timeout is given, the check is
done as quickly as possible without additional delays. The reducer will continue
to either an updated state with the remaining payment requests, to the
@code{BACKUP_FINISHED} state (if all payments have been completed and the backup
-finished), or into an @code{ERROR} state in case there was an irrecoverable error,
+finished), or return an error response in case there was an irrecoverable error,
indicating the specific provider and how it failed. An example for this
final error state would be:
@example
@{
- "backup_state": "ERROR",
"http_status" : 500,
"upload_status" : 52,
"provider_url" : "https://bad.example.com/",
@@ -3887,7 +4326,7 @@ In the above example, 52 would thus imply that the Anastasis provider failed to
store information into its database.
@node Recovery transitions,,Backup transitions,Reducer transitions
-@anchor{reducer recovery-transitions}@anchor{63}
+@anchor{reducer recovery-transitions}@anchor{71}
@subsubsection Recovery transitions
@@ -3911,11 +4350,71 @@ the backup process. Example arguments would thus be:
@}
@end example
-However, in contrast to the backup process, the reducer will attempt to
-retrieve the latest recovery document from all known providers for the
-selected currency given the above inputs. If a recovery document was found
-by any provider, the reducer will attempt to load it and transition to
-a state where the user can choose which challenges to satisfy:
+Afterwards, the reducer transitions into the @code{SECRET_SELECTING} state:
+
+@example
+@{
+ "recovery_state": "SECRET_SELECTING",
+ "identity_attributes": @{
+ "full_name": "Max Musterman",
+ "social_security_number": "123456789",
+ "birthdate": "2000-01-01",
+ "birthplace": "Earth"
+ @}
+@}
+@end example
+
+Typically, the special policy discovery process (outside of the state
+machine) is expected to be run in this state. The discovery process
+will use the state (and in particular the identity attributes and the
+list of active providers) to discover a set of possible recovery
+documents with their respective provider URLs, policy version and
+identity attribute mask. An identity attribute mask is a bitmask that
+describes which of the optional attributes from the identity
+attributes should be omitted to recover this backup. Once the user
+has selected a backup providing this triplet, it is possible to
+proceed using @code{next}.
+
+Especially if the discovered policies are inadequate, it is again
+possible to add providers using @code{add_provider}.
+
+@strong{add_provider}:
+
+This operation can be performed in state @code{SECRET_SELECTING}. It
+adds one additional Anastasis provider to the list of providers that
+the discovery process should henceforth consider. Note that removing
+providers is not possible at this time.
+
+Here, the client must provide an object with the base URL of the
+providers to add, for example:
+
+@example
+@{
+ "provider_url" : "http://localhost:8088/"
+@}
+@end example
+
+@strong{select_version}:
+
+Using the @code{select_version} transition in the @code{SECRET_SELECTING} state,
+it is possible to trigger the download and decryption of a recovery
+policy document. Here, the arguments specify which provider, version
+and mask should be used to download the document:
+
+@example
+@{
+ "providers" : [ @{
+ "url": "https://localhost:8088/",
+ "version": 0
+ @} ],
+ "attribute_mask": 0
+@}
+@end example
+
+The reducer will attempt to retrieve the specified recovery document
+from that provider. If a recovery document was found, the reducer
+will attempt to load it and transition to a state where the user can
+choose which challenges to satisfy:
@example
@{
@@ -3924,13 +4423,13 @@ a state where the user can choose which challenges to satisfy:
"challenges": [
@{
"uuid": "MW2R3RCBZPHNC78AW8AKWRCHF9KV3Y82EN62T831ZP54S3K5599G",
- "cost": "TESTKUDOS:0",
+ "uuid-display": "MW2R3RC",
"type": "question",
"instructions": "q1"
@},
@{
"uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0",
- "cost": "TESTKUDOS:0",
+ "uuid-display": "TXYKGE",
"type": "email",
"instructions": "e-mail address m?il@@f*.bar"
@},
@@ -3971,14 +4470,13 @@ four mandatory fields:
@item
@strong{uuid}: A unique identifier of the challenge; this is what the
-UUIDs in the policies array refer to, but also this UUID may be
-included in messages sent to the user. They allow the user to
-distinguish different PIN/TANs should say the same phone number be
-used for SMS-authentication with different providers.
+UUIDs in the policies array refer to.
@item
-@strong{cost}: This is the amount the Anastasis provider will charge
-to allow the user to pass the challenge.
+@strong{uuid-display}: Shortened idenfier which is included in messages
+send to the user. Allows the user to
+distinguish different PIN/TANs should say the same phone number be
+used for SMS-authentication with different providers.
@item
@strong{type}: This is the type of the challenge, as a string.
@@ -4001,7 +4499,6 @@ message together with a transition failure:
@example
@{
- "recovery_state": "ERROR",
"error_message": "account unknown to Anastasis server",
"error_code": 9,
@}
@@ -4015,26 +4512,33 @@ translations should be available in the @code{anastasis} text domain.
However, in general it should be sufficient to display the slightly
more generic Taler error code that is returned with the new state.
-@strong{change_version:}
+@strong{sync_providers}
+
+The downloaded policy may include secrets from providers for which
+we do not (yet) have the cost structure or even the salt. So here
+an application can use the @code{sync_providers} request to download
+@code{/config} from providers that are in the challenge list but not
+yet known with their salt and other attributes in the provider list.
-Even if a recovery document was found, it is possible that the user
-intended to recover a different version, or recover a backup where
-the recovery document is stored at a different provider. Thus, the
-reducer allows the user to explicitly switch to a different provider
-or recovery document version using the @code{change_version} transition,
-which takes a provider URL and policy version as arguments:
+The transition fails if all providers relevant for the selected
+policy are already downloaded. Applications may either internally
+check the state for this, or call @code{sync_providers} until it fails
+with this error:
@example
@{
- "provider_url": "https://localhost:8080/",
- "version": 2
+ "detail": "already in sync",
+ "code": 8400,
+ "hint": "The given action is invalid for the current state of the reducer."
@}
@end example
-Note that using a version of 0 implies fetching “the latest version”. The
-resulting states are the same as those of the @code{enter_user_attributes}
-transition, except that the recovery document version is not necessarily the
-latest available version at the provider.
+As providers may fail to respond, this action may need to be called
+repeatedly. The action will block until progress is made on any provider.
+As some providers may never respond, the application should disable
+challenge buttons for challenges where providers are down. However,
+users should be able to solve challenges where the provider is up while
+the reducer is polling for @code{/config} in the background.
@strong{select_challenge:}
@@ -4089,8 +4593,6 @@ information about attempted challenges, with the final state being @code{solved}
Challenges feedback for a challenge can have many different @code{state} values
that applications must all handle. States other than @code{solved} are:
-@quotation
-
@itemize -
@@ -4111,12 +4613,6 @@ that applications must all handle. States other than @code{solved} are:
@}
@}
@end example
-@end itemize
-
-@quotation
-
-
-@itemize -
@item
@strong{body}: Here, the server provided an HTTP reply for
@@ -4173,7 +4669,7 @@ related to solving the challenge:
@{
"recovery_state": "CHALLENGE_SOLVING",
"recovery_information": @{
- "...": "..."
+ "...": "..."
@}
"selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0",
"challenge_feedback": @{
@@ -4189,25 +4685,16 @@ related to solving the challenge:
@}
@}
@end example
-@end itemize
-
-@quotation
-
-
-@itemize -
@item
@strong{redirect}: To solve the challenge, the user must visit the indicated
Web site at @code{redirect_url}, for example to perform video authentication:
-@end itemize
-
-@quotation
@example
@{
"recovery_state": "CHALLENGE_SOLVING",
"recovery_information": @{
- "...": "..."
+ "...": "..."
@}
"selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0",
"challenge_feedback": @{
@@ -4220,26 +4707,22 @@ Web site at @code{redirect_url}, for example to perform video authentication:
@}
@end example
-
-@itemize -
-
@item
@strong{server-failure}: This indicates that the Anastasis provider encountered
a failure and recovery using this challenge cannot proceed at this time.
Examples for failures might be that the provider is unable to send SMS
messages at this time due to an outage. The body includes details about
the failure. The user may try again later or continue with other challenges.
-@end itemize
@example
-@{
- "recovery_state": "CHALLENGE_SELECTING",
- "recovery_information": @{
- "...": "..."
- @}
- "selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0",
- "challenge_feedback": @{
- "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0": @{
+ @{
+ "recovery_state": "CHALLENGE_SELECTING",
+ "recovery_information": @{
+ "...": "..."
+ @}
+ "selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0",
+ "challenge_feedback": @{
+ "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0": @{
"state": "server-failure",
"http_status": "500",
"error_code": 52
@@ -4248,14 +4731,10 @@ the failure. The user may try again later or continue with other challenges.
@}
@end example
-
-@itemize -
-
@item
@strong{truth-unknown}: This indicates that the Anastasis provider is unaware of
the specified challenge. This is typically a permanent failure, and user
interfaces should not allow users to re-try this challenge.
-@end itemize
@example
@{
@@ -4273,12 +4752,8 @@ interfaces should not allow users to re-try this challenge.
@}
@end example
-
-@itemize -
-
@item
-@strong{rate-limit-exceeded}:
-@end itemize
+@strong{rate-limit-exceeded}: This indicates that the user has made too many invalid attempts in too short an amount of time.
@example
@{
@@ -4295,10 +4770,88 @@ interfaces should not allow users to re-try this challenge.
@}
@}
@end example
-@end quotation
-@end quotation
-@end quotation
-@end quotation
+
+@item
+@strong{authentication-timeout}: This indicates that the challenge is awaiting for some external authentication process to complete. The application should @code{poll} for it to complete, or proceed with selecting other challenges.
+
+@example
+@{
+ "recovery_state": "CHALLENGE_SELECTING",
+ "recovery_information": @{
+ "...": "..."
+ @}
+ "selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0",
+ "challenge_feedback": @{
+ "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0": @{
+ "state": "authentication-timeout",
+ "error_code": 8122
+ @}
+ @}
+@}
+@end example
+
+@item
+@strong{external-instructions}: This indicates that the challenge requires the user to perform some authentication method-specific actions. Details about what the user should do are provided.
+
+@example
+@{
+ "recovery_state": "CHALLENGE_SELECTING",
+ "recovery_information": @{
+ "...": "..."
+ @}
+ "selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0",
+ "challenge_feedback": @{
+ "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0": @{
+ "state": "external-instructions",
+ "method": "iban",
+ "async": true, // optional
+ "answer_code": 987654321, // optional
+ "details": @{
+ "...": "..."
+ @}
+ @}
+ @}
+@}
+@end example
+
+If “async” is “true”, then the client should
+poll for the challenge being satisfied using
+the “answer_code” that has been provided.
+
+The specific instructions on how to satisfy
+the challenge depend on the @code{method}.
+They include:
+
+
+@itemize -
+
+@item
+@strong{iban}: The user must perform a wire transfer from their account to the Anastasis provider.
+
+@example
+@{
+ "challenge_amount": "EUR:1",
+ "credit_iban": "DE12345789000",
+ "business_name": "Data Loss Incorporated",
+ "wire_transfer_subject": "Anastasis 987654321"
+@}
+@end example
+
+Note that the actual wire transfer subject must contain both
+the numeric @code{answer_code} as well as
+the string @code{Anastasis}.
+@end itemize
+@end itemize
+
+@strong{poll:}
+
+With a @code{poll} transition, the application indicates that it wants to wait longer for one or more of the challenges that are awaiting some external authentication (state @code{external-instructions}) or experienced some kind of timeout (state @code{authentication-timeout}) to possibly complete. While technically optional, the @code{timeout} argument should really be provided to enable long-polling, for example:
+
+@example
+@{
+ "timeout" : @{ "d_ms" : 5000 @},
+@}
+@end example
@strong{pay:}
@@ -4364,7 +4917,7 @@ formats are:
@c @author Dennis Neufeld
@node Authentication Methods,DB Schema,Reducer API,Documentation Overview
-@anchor{authentication doc}@anchor{64}@anchor{authentication anastasis-auth-methods}@anchor{65}@anchor{authentication authentication-methods}@anchor{66}
+@anchor{authentication doc}@anchor{72}@anchor{authentication anastasis-auth-methods}@anchor{73}@anchor{authentication authentication-methods}@anchor{74}
@section Authentication Methods
@@ -4392,29 +4945,29 @@ maximum permissible frequency.
@end menu
@node SMS sms,Email verification email,,Authentication Methods
-@anchor{authentication sms-sms}@anchor{67}
+@anchor{authentication sms-sms}@anchor{75}
@subsection SMS (sms)
Sends an SMS with a code (prefixed with @code{A-}) to the user’s phone, including
a UUID which identifies the challenge the code is for. The user must send
-this code back with his request (see @code{$RESPONSE} under @ref{52,,Managing truth}).
+this code back with his request (see @code{$RESPONSE} under @ref{5c,,Managing truth}).
If the transmitted code is correct, the server responses with the requested
encrypted key share.
@node Email verification email,Video identification vid,SMS sms,Authentication Methods
-@anchor{authentication email-verification-email}@anchor{68}
+@anchor{authentication email-verification-email}@anchor{76}
@subsection Email verification (email)
Sends an email with a code (prefixed with @code{A-}) to the user’s mail address,
including a UUID which identifies the challenge the code is for. The user
-must send this code back with his request (see @code{$RESPONSE} under @ref{52,,Managing truth}).
+must send this code back with his request (see @code{$RESPONSE} under @ref{5c,,Managing truth}).
If the transmitted code is correct, the server responses with the
requested encrypted key share.
@node Video identification vid,Security question qa,Email verification email,Authentication Methods
-@anchor{authentication video-identification-vid}@anchor{69}
+@anchor{authentication video-identification-vid}@anchor{77}
@subsection Video identification (vid)
@@ -4432,7 +4985,7 @@ requesting the user to be redirected to a Web site (or other URL) for the
video-call.
@node Security question qa,Snail mail verification post,Video identification vid,Authentication Methods
-@anchor{authentication security-question-qa}@anchor{6a}
+@anchor{authentication security-question-qa}@anchor{78}
@subsection Security question (qa)
@@ -4455,14 +5008,14 @@ remains irrecoverable without the answer even if the Anastasis provider
storing the security question is malicious.
@node Snail mail verification post,,Security question qa,Authentication Methods
-@anchor{authentication snail-mail-verification-post}@anchor{6b}
+@anchor{authentication snail-mail-verification-post}@anchor{79}
@subsection Snail mail verification (post)
Sends physical mail (snail mail) with a code (prefixed with @code{A-}) to the
user’s mail address, including a UUID which identifies the challenge the code
is for. The user must send this code back with their request (see
-@code{$RESPONSE} under @ref{52,,Managing truth}). If the transmitted code is correct,
+@code{$RESPONSE} under @ref{5c,,Managing truth}). If the transmitted code is correct,
the server responds with the requested encrypted key share.
@c This file is part of Anastasis
@@ -4484,7 +5037,7 @@ the server responds with the requested encrypted key share.
@c @author Dennis Neufeld
@node DB Schema,Anastasis licensing information,Authentication Methods,Documentation Overview
-@anchor{db doc}@anchor{6c}@anchor{db db-schema}@anchor{6d}
+@anchor{db doc}@anchor{7a}@anchor{db db-schema}@anchor{7b}
@section DB Schema
@@ -4499,7 +5052,7 @@ the server responds with the requested encrypted key share.
@image{anastasis-figures/anastasis_truth_payment,,,,png}
@node Anastasis licensing information,Man Pages,DB Schema,Documentation Overview
-@anchor{global-licensing doc}@anchor{6e}@anchor{global-licensing anastasis-licensing-information}@anchor{6f}
+@anchor{global-licensing doc}@anchor{7c}@anchor{global-licensing anastasis-licensing-information}@anchor{7d}
@section Anastasis licensing information
@@ -4521,7 +5074,7 @@ GPL.
@end menu
@node Anastasis git //git taler net/anastasis,Anastasis-gtk git //git taler net/anastasis-gtk,,Anastasis licensing information
-@anchor{global-licensing anastasis-git-git-taler-net-anastasis}@anchor{70}@anchor{global-licensing exchange-repo}@anchor{71}
+@anchor{global-licensing anastasis-git-git-taler-net-anastasis}@anchor{7e}@anchor{global-licensing exchange-repo}@anchor{7f}
@subsection Anastasis (git://git.taler.net/anastasis)
@@ -4533,7 +5086,7 @@ Anastasis core logic is under AGPL.
@end menu
@node Runtime dependencies,,,Anastasis git //git taler net/anastasis
-@anchor{global-licensing runtime-dependencies}@anchor{72}
+@anchor{global-licensing runtime-dependencies}@anchor{80}
@subsubsection Runtime dependencies
@@ -4563,7 +5116,7 @@ GNU Taler: LGPLv3+ / GPLv3+ / AGPLv3+: owned by Taler Systems SA
@end itemize
@node Anastasis-gtk git //git taler net/anastasis-gtk,Documentation,Anastasis git //git taler net/anastasis,Anastasis licensing information
-@anchor{global-licensing anastasis-gtk-git-git-taler-net-anastasis-gtk}@anchor{73}
+@anchor{global-licensing anastasis-gtk-git-git-taler-net-anastasis-gtk}@anchor{81}
@subsection Anastasis-gtk (git://git.taler.net/anastasis-gtk)
@@ -4575,7 +5128,7 @@ Anastasis-gtk is under AGPL.
@end menu
@node Runtime dependencies<2>,,,Anastasis-gtk git //git taler net/anastasis-gtk
-@anchor{global-licensing id1}@anchor{74}
+@anchor{global-licensing id1}@anchor{82}
@subsubsection Runtime dependencies
@@ -4608,28 +5161,31 @@ GNU Taler: LGPLv3+ / GPLv3+ / AGPLv3+: owned by Taler Systems SA
@end itemize
@node Documentation,,Anastasis-gtk git //git taler net/anastasis-gtk,Anastasis licensing information
-@anchor{global-licensing documentation}@anchor{75}
+@anchor{global-licensing documentation}@anchor{83}
@subsection Documentation
The documentation is licensed under the GNU Free Documentation License Version 1.3 or later.
@node Man Pages,Complete Index,Anastasis licensing information,Documentation Overview
-@anchor{manindex doc}@anchor{76}@anchor{manindex man-pages}@anchor{77}
+@anchor{manindex doc}@anchor{84}@anchor{manindex man-pages}@anchor{85}
@section Man Pages
@menu
* anastasis-config(1): anastasis-config 1.
+* anastasis-dbconfig(1): anastasis-dbconfig 1.
+* anastasis-dbinit(1): anastasis-dbinit 1.
* anastasis-gtk(1): anastasis-gtk 1.
+* anastasis-helper-authorization-iban(1): anastasis-helper-authorization-iban 1.
* anastasis-httpd(1): anastasis-httpd 1.
* anastasis-reducer(1): anastasis-reducer 1.
* anastasis.conf(5): anastasis conf 5.
@end menu
-@node anastasis-config 1,anastasis-gtk 1,,Man Pages
-@anchor{manpages/anastasis-config 1 doc}@anchor{78}@anchor{manpages/anastasis-config 1 anastasis-config-1}@anchor{79}
+@node anastasis-config 1,anastasis-dbconfig 1,,Man Pages
+@anchor{manpages/anastasis-config 1 doc}@anchor{86}@anchor{manpages/anastasis-config 1 anastasis-config-1}@anchor{87}
@subsection anastasis-config(1)
@@ -4643,7 +5199,7 @@ The documentation is licensed under the GNU Free Documentation License Version 1
@end menu
@node Synopsis,Description,,anastasis-config 1
-@anchor{manpages/anastasis-config 1 synopsis}@anchor{7a}
+@anchor{manpages/anastasis-config 1 synopsis}@anchor{88}
@subsubsection Synopsis
@@ -4663,7 +5219,7 @@ The documentation is licensed under the GNU Free Documentation License Version 1
[@strong{-v} | @strong{––version}]
@node Description,See Also,Synopsis,anastasis-config 1
-@anchor{manpages/anastasis-config 1 description}@anchor{7b}
+@anchor{manpages/anastasis-config 1 description}@anchor{89}
@subsubsection Description
@@ -4747,23 +5303,23 @@ Print Anastasis version number.
@end table
@node See Also,Bugs,Description,anastasis-config 1
-@anchor{manpages/anastasis-config 1 see-also}@anchor{7c}
+@anchor{manpages/anastasis-config 1 see-also}@anchor{8a}
@subsubsection See Also
anastasis.conf(5)
@node Bugs,,See Also,anastasis-config 1
-@anchor{manpages/anastasis-config 1 bugs}@anchor{7d}
+@anchor{manpages/anastasis-config 1 bugs}@anchor{8b}
@subsubsection Bugs
Report bugs by using @indicateurl{https://bugs.anastasis.lu} or by sending electronic
mail to <@email{contact@@anastasis.lu}>.
-@node anastasis-gtk 1,anastasis-httpd 1,anastasis-config 1,Man Pages
-@anchor{manpages/anastasis-gtk 1 doc}@anchor{7e}@anchor{manpages/anastasis-gtk 1 anastasis-gtk-1}@anchor{7f}
-@subsection anastasis-gtk(1)
+@node anastasis-dbconfig 1,anastasis-dbinit 1,anastasis-config 1,Man Pages
+@anchor{manpages/anastasis-dbconfig 1 doc}@anchor{8c}@anchor{manpages/anastasis-dbconfig 1 anastasis-dbconfig-1}@anchor{8d}
+@subsection anastasis-dbconfig(1)
@@ -4775,20 +5331,194 @@ mail to <@email{contact@@anastasis.lu}>.
@end menu
-@node Synopsis<2>,Description<2>,,anastasis-gtk 1
-@anchor{manpages/anastasis-gtk 1 synopsis}@anchor{80}
+@node Synopsis<2>,Description<2>,,anastasis-dbconfig 1
+@anchor{manpages/anastasis-dbconfig 1 synopsis}@anchor{8e}
+@subsubsection Synopsis
+
+
+@strong{anastasis-dbconfig}
+[@strong{-c} @emph{FILENAME} @emph{]
+[*}-h**]
+[@strong{-n} @emph{NAME} @emph{]
+[*}-r**]
+[@strong{-s}]
+[@strong{-u} @emph{USER} >>*<<]
+
+@node Description<2>,See Also<2>,Synopsis<2>,anastasis-dbconfig 1
+@anchor{manpages/anastasis-dbconfig 1 description}@anchor{8f}
+@subsubsection Description
+
+
+@strong{anastasis-dbconfig} is a simple shell script that configures
+a Postgresql database for use by the GNU Anastasis servers.
+
+Its options are as follows:
+
+
+@table @asis
+
+@item @strong{-c} @emph{FILENAME}
+
+Write the database configuration to FILENAME. The tool
+will append the required @code{CONFIG} option for the
+Postgresql access to the respective file.
+
+@item @strong{-h}
+
+Print short help on options.
+
+@item @strong{-n} @emph{DBNAME}
+
+Use DBNAME for the name of the created database.
+
+@item @strong{-r}
+
+Reset any existing database. Looses all existing data. DANGEROUS.
+
+@item @strong{-s}
+
+Skip database initialization. Useful if you want to run
+@code{anastasis-dbinit} manually.
+
+@item @strong{-u} @emph{USER}
+
+Specifies the (main) Anastasis user that will access the database.
+@end table
+
+@node See Also<2>,Bugs<2>,Description<2>,anastasis-dbconfig 1
+@anchor{manpages/anastasis-dbconfig 1 see-also}@anchor{90}
+@subsubsection See Also
+
+
+anastassis-dbinit(1), anastasis.conf(5).
+
+@node Bugs<2>,,See Also<2>,anastasis-dbconfig 1
+@anchor{manpages/anastasis-dbconfig 1 bugs}@anchor{91}
+@subsubsection Bugs
+
+
+Report bugs by using @indicateurl{https://bugs.taler.net} or by sending electronic
+mail to <@email{taler@@gnu.org}>.
+
+@node anastasis-dbinit 1,anastasis-gtk 1,anastasis-dbconfig 1,Man Pages
+@anchor{manpages/anastasis-dbinit 1 doc}@anchor{92}@anchor{manpages/anastasis-dbinit 1 anastasis-dbinit-1}@anchor{93}
+@subsection anastasis-dbinit(1)
+
+
+
+@menu
+* Synopsis: Synopsis<3>.
+* Description: Description<3>.
+* See Also: See Also<3>.
+* Bugs: Bugs<3>.
+
+@end menu
+
+@node Synopsis<3>,Description<3>,,anastasis-dbinit 1
+@anchor{manpages/anastasis-dbinit 1 synopsis}@anchor{94}
+@subsubsection Synopsis
+
+
+@strong{anastasis-dbinit}
+[@strong{-c} @emph{FILENAME} | @strong{–config=}‌@emph{FILENAME}]
+[@strong{-g} | @strong{–gc}]
+[@strong{-h} | @strong{–help}]
+[@strong{-L} @emph{LOGLEVEL} | @strong{–loglevel=}‌@emph{LOGLEVEL}]
+[@strong{-l} @emph{FILENAME} | @strong{–logfile=}‌@emph{FILENAME}]
+[@strong{-r} | @strong{–reset}]
+[@strong{-v} | @strong{–version}]
+
+@node Description<3>,See Also<3>,Synopsis<3>,anastasis-dbinit 1
+@anchor{manpages/anastasis-dbinit 1 description}@anchor{95}
+@subsubsection Description
+
+
+@strong{anastasis-dbinit} is a command-line tool to initialize the GNU
+Anastasis database. It creates the necessary tables and indices for
+an Anastasis server to operate.
+
+Its options are as follows:
+
+
+@table @asis
+
+@item @strong{-c} @emph{FILENAME} | @strong{–config=}‌@emph{FILENAME}
+
+Use the configuration and other resources for the exchange to operate
+from @emph{FILENAME}.
+
+@item @strong{-g} | @strong{–gc}
+
+Garbage collect database. Deletes all unnecessary data in the
+database.
+
+@item @strong{-h} | @strong{–help}
+
+Print short help on options.
+
+@item @strong{-L} @emph{LOGLEVEL} | @strong{–loglevel=}‌@emph{LOGLEVEL}
+
+Specifies the log level to use. Accepted values are: @code{DEBUG}, @code{INFO},
+@code{WARNING}, @code{ERROR}.
+
+@item @strong{-l} @emph{FILENAME} | @strong{–logfile=}‌@emph{FILENAME}
+
+Send logging output to @emph{FILENAME}.
+
+@item @strong{-r} | @strong{–reset}
+
+Drop tables. Dangerous, will delete all existing data in the database
+before creating the tables.
+
+@item @strong{-v} | @strong{–version}
+
+Print version information.
+@end table
+
+@node See Also<3>,Bugs<3>,Description<3>,anastasis-dbinit 1
+@anchor{manpages/anastasis-dbinit 1 see-also}@anchor{96}
+@subsubsection See Also
+
+
+anastasis-httpd(1), anastasis.conf(5).
+
+@node Bugs<3>,,See Also<3>,anastasis-dbinit 1
+@anchor{manpages/anastasis-dbinit 1 bugs}@anchor{97}
+@subsubsection Bugs
+
+
+Report bugs by using @indicateurl{https://bugs.taler.net} or by sending electronic
+mail to <@email{taler@@gnu.org}>.
+
+@node anastasis-gtk 1,anastasis-helper-authorization-iban 1,anastasis-dbinit 1,Man Pages
+@anchor{manpages/anastasis-gtk 1 doc}@anchor{98}@anchor{manpages/anastasis-gtk 1 anastasis-gtk-1}@anchor{99}
+@subsection anastasis-gtk(1)
+
+
+
+@menu
+* Synopsis: Synopsis<4>.
+* Description: Description<4>.
+* See Also: See Also<4>.
+* Bugs: Bugs<4>.
+
+@end menu
+
+@node Synopsis<4>,Description<4>,,anastasis-gtk 1
+@anchor{manpages/anastasis-gtk 1 synopsis}@anchor{9a}
@subsubsection Synopsis
@strong{anastasis-gtk}
+[@strong{-A**_*ID*_|_}–application=**@emph{ID}]
[@strong{-c} @emph{FILENAME} | @strong{––config=}‌@emph{FILENAME}]
[@strong{-h} | @strong{––help}]
[@strong{-L} @emph{LOGLEVEL} | @strong{––loglevel=}‌@emph{LOGLEVEL}]
[@strong{-l} @emph{FILENAME} | @strong{––logfile=}‌@emph{FILENAME}]
[@strong{-v} | @strong{––version}]
-@node Description<2>,See Also<2>,Synopsis<2>,anastasis-gtk 1
-@anchor{manpages/anastasis-gtk 1 description}@anchor{81}
+@node Description<4>,See Also<4>,Synopsis<4>,anastasis-gtk 1
+@anchor{manpages/anastasis-gtk 1 description}@anchor{9b}
@subsubsection Description
@@ -4798,6 +5528,21 @@ key recover and backup operations.
@table @asis
+@item @strong{-A} @emph{ID} | @strong{–application=}@emph{ID}
+
+Set the application ID to @emph{ID}. Default is @code{anastasis-gtk}. Used
+to store different types of secrets from different applications
+while using the same user attributes. Basically the application ID
+is included in the user attributes. Not changable by the GUI as
+only advanced users should even known about this. Applications that
+tightly integrate Anastasis should set the application ID to their
+respective unique name, for example the GNU Taler wallet may use
+@code{gnu-taler-wallet} for the application ID. If anastasis-gtk is
+to be used to recover such a secret, the respective application ID
+must be provided on the command-line. Users that only use
+anastasis-gtk to backup and restore secrets should not set the
+application ID, as forgetting the ID makes the secrets irrecoverable.
+
@item @strong{-c} @emph{FILENAME} | @strong{––config=}‌@emph{FILENAME}
Use the configuration from @emph{FILENAME}.
@@ -4820,45 +5565,123 @@ Send logging output to @emph{FILENAME}.
Print version information.
@end table
-@node See Also<2>,Bugs<2>,Description<2>,anastasis-gtk 1
-@anchor{manpages/anastasis-gtk 1 see-also}@anchor{82}
+@node See Also<4>,Bugs<4>,Description<4>,anastasis-gtk 1
+@anchor{manpages/anastasis-gtk 1 see-also}@anchor{9c}
@subsubsection See Also
anastasis-reducer(1), anastasis-httpd(1), anastasis.conf(5).
-@node Bugs<2>,,See Also<2>,anastasis-gtk 1
-@anchor{manpages/anastasis-gtk 1 bugs}@anchor{83}
+@node Bugs<4>,,See Also<4>,anastasis-gtk 1
+@anchor{manpages/anastasis-gtk 1 bugs}@anchor{9d}
@subsubsection Bugs
Report bugs by using @indicateurl{https://bugs.anastasis.lu/} or by sending electronic
mail to <@email{contact@@anastasis.lu}>.
-@node anastasis-httpd 1,anastasis-reducer 1,anastasis-gtk 1,Man Pages
-@anchor{manpages/anastasis-httpd 1 doc}@anchor{84}@anchor{manpages/anastasis-httpd 1 anastasis-httpd-1}@anchor{85}
+@node anastasis-helper-authorization-iban 1,anastasis-httpd 1,anastasis-gtk 1,Man Pages
+@anchor{manpages/anastasis-helper-authorization-iban 1 doc}@anchor{9e}@anchor{manpages/anastasis-helper-authorization-iban 1 anastasis-helper-authorization-iban-1}@anchor{9f}
+@subsection anastasis-helper-authorization-iban(1)
+
+
+
+@menu
+* Synopsis: Synopsis<5>.
+* Description: Description<5>.
+* See Also: See Also<5>.
+* Bugs: Bugs<5>.
+
+@end menu
+
+@node Synopsis<5>,Description<5>,,anastasis-helper-authorization-iban 1
+@anchor{manpages/anastasis-helper-authorization-iban 1 synopsis}@anchor{a0}
+@subsubsection Synopsis
+
+
+@strong{anastasis-helper-authorization-iban}
+[@strong{-c} @emph{FILENAME} | @strong{––config=}‌@emph{FILENAME}]
+[@strong{-h} | @strong{––help}]
+[@strong{-L} @emph{LOGLEVEL} | @strong{––loglevel=}‌@emph{LOGLEVEL}]
+[@strong{-l} @emph{FILENAME} | @strong{––logfile=}‌@emph{FILENAME}]
+[@strong{-t} | @strong{––test}]
+[@strong{-v} | @strong{––version}]
+
+@node Description<5>,See Also<5>,Synopsis<5>,anastasis-helper-authorization-iban 1
+@anchor{manpages/anastasis-helper-authorization-iban 1 description}@anchor{a1}
+@subsubsection Description
+
+
+@strong{anastasis-helper-authorization-iban} monitors the Anastasis provider’s bank account for incoming wire transfers. This process supports the IBAN authentication method. It must be configured with the respective wire configuration to talk to LibEuFin/Nexus.
+
+
+@table @asis
+
+@item @strong{-c} @emph{FILENAME} | @strong{––config=}‌@emph{FILENAME}
+
+Use the configuration from @emph{FILENAME}.
+
+@item @strong{-h} | @strong{––help}
+
+Print short help on options.
+
+@item @strong{-L} @emph{LOGLEVEL} | @strong{––loglevel=}‌@emph{LOGLEVEL}
+
+Specifies the log level to use. Accepted values are: @code{DEBUG}, @code{INFO},
+@code{WARNING}, @code{ERROR}.
+
+@item @strong{-l} @emph{FILENAME} | @strong{––logfile=}‌@emph{FILENAME}
+
+Send logging output to @emph{FILENAME}.
+
+@item @strong{-t} | @strong{––test}
+
+Run in test mode. Causes the process to terminate after importing current wire transfers instead of running forever in the background.
+
+@item @strong{-v} | @strong{––version}
+
+Print version information.
+@end table
+
+@node See Also<5>,Bugs<5>,Description<5>,anastasis-helper-authorization-iban 1
+@anchor{manpages/anastasis-helper-authorization-iban 1 see-also}@anchor{a2}
+@subsubsection See Also
+
+
+anastasis-httpd(1), anastasis.conf(5).
+
+@node Bugs<5>,,See Also<5>,anastasis-helper-authorization-iban 1
+@anchor{manpages/anastasis-helper-authorization-iban 1 bugs}@anchor{a3}
+@subsubsection Bugs
+
+
+Report bugs by using @indicateurl{https://bugs.anastasis.lu/} or by sending electronic
+mail to <@email{contact@@anastasis.lu}>.
+
+@node anastasis-httpd 1,anastasis-reducer 1,anastasis-helper-authorization-iban 1,Man Pages
+@anchor{manpages/anastasis-httpd 1 doc}@anchor{a4}@anchor{manpages/anastasis-httpd 1 anastasis-httpd-1}@anchor{a5}
@subsection anastasis-httpd(1)
@menu
-* Synopsis: Synopsis<3>.
-* Description: Description<3>.
+* Synopsis: Synopsis<6>.
+* Description: Description<6>.
* Signals::
* See also::
-* Bugs: Bugs<3>.
+* Bugs: Bugs<6>.
@end menu
-@node Synopsis<3>,Description<3>,,anastasis-httpd 1
-@anchor{manpages/anastasis-httpd 1 synopsis}@anchor{86}
+@node Synopsis<6>,Description<6>,,anastasis-httpd 1
+@anchor{manpages/anastasis-httpd 1 synopsis}@anchor{a6}
@subsubsection Synopsis
@strong{anastasis-httpd}
-@node Description<3>,Signals,Synopsis<3>,anastasis-httpd 1
-@anchor{manpages/anastasis-httpd 1 description}@anchor{87}
+@node Description<6>,Signals,Synopsis<6>,anastasis-httpd 1
+@anchor{manpages/anastasis-httpd 1 description}@anchor{a7}
@subsubsection Description
@@ -4889,8 +5712,8 @@ Print short help on options.
Print version information.
@end table
-@node Signals,See also,Description<3>,anastasis-httpd 1
-@anchor{manpages/anastasis-httpd 1 signals}@anchor{88}
+@node Signals,See also,Description<6>,anastasis-httpd 1
+@anchor{manpages/anastasis-httpd 1 signals}@anchor{a8}
@subsubsection Signals
@@ -4904,15 +5727,15 @@ Print version information.
Sending a SIGTERM to the process will cause it to shutdown cleanly.
@end table
-@node See also,Bugs<3>,Signals,anastasis-httpd 1
-@anchor{manpages/anastasis-httpd 1 see-also}@anchor{89}
+@node See also,Bugs<6>,Signals,anastasis-httpd 1
+@anchor{manpages/anastasis-httpd 1 see-also}@anchor{a9}
@subsubsection See also
anastasis-dbinit(1), anastasis-config(1), anastasis-gtk(1), anastasis-reducer(1)
-@node Bugs<3>,,See also,anastasis-httpd 1
-@anchor{manpages/anastasis-httpd 1 bugs}@anchor{8a}
+@node Bugs<6>,,See also,anastasis-httpd 1
+@anchor{manpages/anastasis-httpd 1 bugs}@anchor{aa}
@subsubsection Bugs
@@ -4920,25 +5743,26 @@ Report bugs by using @indicateurl{https://bugs.anastasis.lu} or by sending
electronic mail to <@email{contact@@anastasis.lu}>.
@node anastasis-reducer 1,anastasis conf 5,anastasis-httpd 1,Man Pages
-@anchor{manpages/anastasis-reducer 1 doc}@anchor{8b}@anchor{manpages/anastasis-reducer 1 anastasis-reducer-1}@anchor{8c}
+@anchor{manpages/anastasis-reducer 1 doc}@anchor{ab}@anchor{manpages/anastasis-reducer 1 anastasis-reducer-1}@anchor{ac}
@subsection anastasis-reducer(1)
@menu
-* Synopsis: Synopsis<4>.
-* Description: Description<4>.
-* See Also: See Also<3>.
-* Bugs: Bugs<4>.
+* Synopsis: Synopsis<7>.
+* Description: Description<7>.
+* See Also: See Also<6>.
+* Bugs: Bugs<7>.
@end menu
-@node Synopsis<4>,Description<4>,,anastasis-reducer 1
-@anchor{manpages/anastasis-reducer 1 synopsis}@anchor{8d}
+@node Synopsis<7>,Description<7>,,anastasis-reducer 1
+@anchor{manpages/anastasis-reducer 1 synopsis}@anchor{ad}
@subsubsection Synopsis
@strong{anastasis-reducer}
+[@strong{-A**_*ID*_|_}–application=**@emph{ID}]
[@strong{-a**_*JSON*_|_}–arguments=@emph{JSON}]
[@strong{-b**_|_}–backup]
[@strong{-c} @emph{FILENAME} | @strong{––config=}‌@emph{FILENAME}]
@@ -4948,8 +5772,8 @@ electronic mail to <@email{contact@@anastasis.lu}>.
[@strong{-r**_|_}–restore]
[@strong{-v} | @strong{––version}] COMMAND
-@node Description<4>,See Also<3>,Synopsis<4>,anastasis-reducer 1
-@anchor{manpages/anastasis-reducer 1 description}@anchor{8e}
+@node Description<7>,See Also<6>,Synopsis<7>,anastasis-reducer 1
+@anchor{manpages/anastasis-reducer 1 description}@anchor{ae}
@subsubsection Description
@@ -4959,7 +5783,7 @@ The reducer will read the current state from standard input and
write the resulting state to standard output. A COMMAND must
be given on the command line. The arguments (if any) are to
be given in JSON format to the @strong{-a} option. A list of
-commands can be found in the @ref{58,,Reducer API}
+commands can be found in the @ref{66,,Reducer API}
chapter.
@@ -4969,6 +5793,20 @@ chapter.
Provide JSON inputs for the given command.
+@item @strong{-A} @emph{ID} | @strong{–application=}@emph{ID}
+
+Set the application ID to @emph{ID}. Default is empty, which means the application-id must be explicitly provided
+as part of the JSON inputs or it will be omitted.
+The @strong{-A} option overrides any application ID that
+may be given in the @strong{-a} arguments. Application IDs
+are used to store different types of secrets from different applications
+while using the same user attributes. Basically the application ID
+is included in the user attributes. Applications that
+tightly integrate Anastasis should set the application ID to their
+respective unique name, for example the GNU Taler wallet may use
+@code{gnu-taler-wallet} for the application ID.
+Forgetting the application ID makes the secrets irrecoverable.
+
@item @strong{-b} | @strong{–backup}
Begin fresh reducer operation for a back up operation.
@@ -4999,15 +5837,15 @@ Begin fresh reducer operation for a restore operation.
Print version information.
@end table
-@node See Also<3>,Bugs<4>,Description<4>,anastasis-reducer 1
-@anchor{manpages/anastasis-reducer 1 see-also}@anchor{8f}
+@node See Also<6>,Bugs<7>,Description<7>,anastasis-reducer 1
+@anchor{manpages/anastasis-reducer 1 see-also}@anchor{af}
@subsubsection See Also
anastasis-gtk(1), anastasis-httpd(1), anastasis.conf(5).
-@node Bugs<4>,,See Also<3>,anastasis-reducer 1
-@anchor{manpages/anastasis-reducer 1 bugs}@anchor{90}
+@node Bugs<7>,,See Also<6>,anastasis-reducer 1
+@anchor{manpages/anastasis-reducer 1 bugs}@anchor{b0}
@subsubsection Bugs
@@ -5015,20 +5853,20 @@ Report bugs by using @indicateurl{https://bugs.anastasis.lu/} or by sending elec
mail to <@email{contact@@anastasis.lu}>.
@node anastasis conf 5,,anastasis-reducer 1,Man Pages
-@anchor{manpages/anastasis conf 5 doc}@anchor{91}@anchor{manpages/anastasis conf 5 anastasis-conf-5}@anchor{92}
+@anchor{manpages/anastasis conf 5 doc}@anchor{b1}@anchor{manpages/anastasis conf 5 anastasis-conf-5}@anchor{b2}
@subsection anastasis.conf(5)
@menu
-* Description: Description<5>.
+* Description: Description<8>.
* SEE ALSO::
* BUGS::
@end menu
-@node Description<5>,SEE ALSO,,anastasis conf 5
-@anchor{manpages/anastasis conf 5 description}@anchor{93}
+@node Description<8>,SEE ALSO,,anastasis conf 5
+@anchor{manpages/anastasis conf 5 description}@anchor{b3}
@subsubsection Description
@@ -5076,13 +5914,14 @@ include the entirety of @code{sub.conf} at that point in @code{main.conf}.
@menu
* GLOBAL OPTIONS::
+* Backend options::
* Authorization options::
* Postgres database configuration::
@end menu
-@node GLOBAL OPTIONS,Authorization options,,Description<5>
-@anchor{manpages/anastasis conf 5 global-options}@anchor{94}
+@node GLOBAL OPTIONS,Backend options,,Description<8>
+@anchor{manpages/anastasis conf 5 global-options}@anchor{b4}
@subsubsection GLOBAL OPTIONS
@@ -5092,11 +5931,6 @@ the @strong{anastasis-httpd} service.
@table @asis
-@item PAYMENT_BACKEND_URL
-
-Base-URL of the Taler merchant backend instance to use for payments.
-FIXME: How do we pass the access token?
-
@item ANNUAL_FEE
Annual fee to be paid for policy uploads, i.e. “EUR:1.5”.
@@ -5105,6 +5939,10 @@ Annual fee to be paid for policy uploads, i.e. “EUR:1.5”.
Annual fee to be paid for truth uploads, i.e. “EUR:1.5”.
+@item INSURANCE
+
+Amount up to which key shares are warranted, i.e. “EUR:1000000”.
+
@item DB
Database backend to use, only @code{postgres} is supported right now.
@@ -5131,14 +5969,36 @@ change after the initial configuration.
TCP port on which the HTTP service should listen on.
@end table
-@node Authorization options,Postgres database configuration,GLOBAL OPTIONS,Description<5>
-@anchor{manpages/anastasis conf 5 authorization-options}@anchor{95}
+@node Backend options,Authorization options,GLOBAL OPTIONS,Description<8>
+@anchor{manpages/anastasis conf 5 backend-options}@anchor{b5}
+@subsubsection Backend options
+
+
+The following options are from the @code{[anastasis-merchant-backend]} section and used by
+the @strong{anastasis-httpd} service.
+
+
+@table @asis
+
+@item PAYMENT_BACKEND_URL
+
+Base-URL of the Taler merchant backend instance to use for payments.
+
+@item API_KEY
+
+API key to transmit to the merchant backend for authentication.
+@end table
+
+@node Authorization options,Postgres database configuration,Backend options,Description<8>
+@anchor{manpages/anastasis conf 5 authorization-options}@anchor{b6}
@subsubsection Authorization options
-For each active authorization plugin, options must be configured in
-a section called @code{[authorization-$PLUGIN]} where @code{$PLUGIN} is
-the name of the authorization plugin.
+For each active authorization plugin, options must be configured in a
+section called @code{[authorization-$PLUGIN]} where @code{$PLUGIN} is the
+name of the authorization plugin. Specific plugins may require
+additional options, which are described in the respective sections
+below.
@table @asis
@@ -5151,14 +6011,91 @@ authorization plugin during recovery.
@item ENABLED
@code{yes} to enable this plugin, @code{no} to disable.
+@end table
+
+@menu
+* SMS Authorization options::
+* Email Authorization options::
+* Post Authorization options::
+* IBAN Authorization options::
+
+@end menu
+
+@node SMS Authorization options,Email Authorization options,,Authorization options
+@anchor{manpages/anastasis conf 5 sms-authorization-options}@anchor{b7}
+@subsubsection SMS Authorization options
+
+
+
+@table @asis
@item COMMAND
-Helper command to run (only relevant for some plugins).
+Helper command to run to send SMS. The command will be given the phone number as its first argument. The message to be transmitted will be passed via STDIN.
+@end table
+
+@node Email Authorization options,Post Authorization options,SMS Authorization options,Authorization options
+@anchor{manpages/anastasis conf 5 email-authorization-options}@anchor{b8}
+@subsubsection Email Authorization options
+
+
+
+@table @asis
+
+@item COMMAND
+
+Helper command to run to send E-mail. The command will be given the e-mail address as its first argument. The message to be transmitted will be passed via STDIN.
+@end table
+
+@node Post Authorization options,IBAN Authorization options,Email Authorization options,Authorization options
+@anchor{manpages/anastasis conf 5 post-authorization-options}@anchor{b9}
+@subsubsection Post Authorization options
+
+
+
+@table @asis
+
+@item COMMAND
+
+Helper command to run to send physical mail. The command will be given the mailing address address as its first argument in JSON object fields ‘full_name’, ‘street’, ‘city’, ‘postcode’ and ‘country’. The message to be transmitted will be passed via STDIN.
+@end table
+
+@node IBAN Authorization options,,Post Authorization options,Authorization options
+@anchor{manpages/anastasis conf 5 iban-authorization-options}@anchor{ba}
+@subsubsection IBAN Authorization options
+
+
+
+@table @asis
+
+@item CREDIT_IBAN
+
+IBAN number where the consumers must
+wire the money to for authentication.
+
+@item BUSINESS_NAME
+
+Name of the account holder.
+
+@item WIRE_GATEWAY_URL
+
+Base URL of the LibEuFin wire gateway (Anastasis facade).
+
+@item WIRE_GATEWAY_AUTH_METHOD
+
+Authentication method used to talk to the LibEuFin wire gateway, i.e. ‘basic’ for HTTP basic authentication.
+
+@item USERNAME
+
+Username to use when using HTTP basic authentication.
+
+@item PASSWORD
+
+Password to use when using HTTP basic authentication.
@end table
-@node Postgres database configuration,,Authorization options,Description<5>
-@anchor{manpages/anastasis conf 5 postgres-database-configuration}@anchor{96}
+@node Postgres database configuration,,Authorization options,Description<8>
+@anchor{manpages/anastasis conf 5 postgres-database-configuration}@anchor{bb}
@subsubsection Postgres database configuration
@@ -5175,15 +6112,15 @@ Path under which the Postgres database is that the service
should use, i.e. @code{postgres://anastasis}.
@end table
-@node SEE ALSO,BUGS,Description<5>,anastasis conf 5
-@anchor{manpages/anastasis conf 5 see-also}@anchor{97}
+@node SEE ALSO,BUGS,Description<8>,anastasis conf 5
+@anchor{manpages/anastasis conf 5 see-also}@anchor{bc}
@subsubsection SEE ALSO
anastasis-httpd(1), anastasis-config(1)
@node BUGS,,SEE ALSO,anastasis conf 5
-@anchor{manpages/anastasis conf 5 bugs}@anchor{98}
+@anchor{manpages/anastasis conf 5 bugs}@anchor{bd}
@subsubsection BUGS
@@ -5191,12 +6128,12 @@ Report bugs by using @indicateurl{https://bugs.anastasis.lu/} or by sending elec
mail to <@email{contact@@anastasis.lu}>.
@node Complete Index,GNU Free Documentation License,Man Pages,Documentation Overview
-@anchor{genindex doc}@anchor{99}@anchor{genindex complete-index}@anchor{9a}
+@anchor{genindex doc}@anchor{be}@anchor{genindex complete-index}@anchor{bf}
@section Complete Index
@node GNU Free Documentation License,,Complete Index,Documentation Overview
-@anchor{fdl-1 3 doc}@anchor{9b}@anchor{fdl-1 3 gnu-fdl-1-3}@anchor{9c}@anchor{fdl-1 3 gnu-free-documentation-license}@anchor{9d}
+@anchor{fdl-1 3 doc}@anchor{c0}@anchor{fdl-1 3 gnu-fdl-1-3}@anchor{c1}@anchor{fdl-1 3 gnu-free-documentation-license}@anchor{c2}
@section GNU Free Documentation License
@@ -5226,7 +6163,7 @@ license document, but changing it is not allowed.
@end menu
@node 0 PREAMBLE,1 APPLICABILITY AND DEFINITIONS,,GNU Free Documentation License
-@anchor{fdl-1 3 preamble}@anchor{9e}
+@anchor{fdl-1 3 preamble}@anchor{c3}
@subsection 0. PREAMBLE
@@ -5252,7 +6189,7 @@ published as a printed book. We recommend this License principally for
works whose purpose is instruction or reference.
@node 1 APPLICABILITY AND DEFINITIONS,2 VERBATIM COPYING,0 PREAMBLE,GNU Free Documentation License
-@anchor{fdl-1 3 applicability-and-definitions}@anchor{9f}
+@anchor{fdl-1 3 applicability-and-definitions}@anchor{c4}
@subsection 1. APPLICABILITY AND DEFINITIONS
@@ -5342,7 +6279,7 @@ these Warranty Disclaimers may have is void and has no effect on the
meaning of this License.
@node 2 VERBATIM COPYING,3 COPYING IN QUANTITY,1 APPLICABILITY AND DEFINITIONS,GNU Free Documentation License
-@anchor{fdl-1 3 verbatim-copying}@anchor{a0}
+@anchor{fdl-1 3 verbatim-copying}@anchor{c5}
@subsection 2. VERBATIM COPYING
@@ -5360,7 +6297,7 @@ You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
@node 3 COPYING IN QUANTITY,4 MODIFICATIONS,2 VERBATIM COPYING,GNU Free Documentation License
-@anchor{fdl-1 3 copying-in-quantity}@anchor{a1}
+@anchor{fdl-1 3 copying-in-quantity}@anchor{c6}
@subsection 3. COPYING IN QUANTITY
@@ -5400,7 +6337,7 @@ Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
@node 4 MODIFICATIONS,5 COMBINING DOCUMENTS,3 COPYING IN QUANTITY,GNU Free Documentation License
-@anchor{fdl-1 3 modifications}@anchor{a2}
+@anchor{fdl-1 3 modifications}@anchor{c7}
@subsection 4. MODIFICATIONS
@@ -5536,7 +6473,7 @@ give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
@node 5 COMBINING DOCUMENTS,6 COLLECTIONS OF DOCUMENTS,4 MODIFICATIONS,GNU Free Documentation License
-@anchor{fdl-1 3 combining-documents}@anchor{a3}
+@anchor{fdl-1 3 combining-documents}@anchor{c8}
@subsection 5. COMBINING DOCUMENTS
@@ -5563,7 +6500,7 @@ sections Entitled “Dedications”. You must delete all sections Entitled
“Endorsements”.
@node 6 COLLECTIONS OF DOCUMENTS,7 AGGREGATION WITH INDEPENDENT WORKS,5 COMBINING DOCUMENTS,GNU Free Documentation License
-@anchor{fdl-1 3 collections-of-documents}@anchor{a4}
+@anchor{fdl-1 3 collections-of-documents}@anchor{c9}
@subsection 6. COLLECTIONS OF DOCUMENTS
@@ -5579,7 +6516,7 @@ License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
@node 7 AGGREGATION WITH INDEPENDENT WORKS,8 TRANSLATION,6 COLLECTIONS OF DOCUMENTS,GNU Free Documentation License
-@anchor{fdl-1 3 aggregation-with-independent-works}@anchor{a5}
+@anchor{fdl-1 3 aggregation-with-independent-works}@anchor{ca}
@subsection 7. AGGREGATION WITH INDEPENDENT WORKS
@@ -5600,7 +6537,7 @@ equivalent of covers if the Document is in electronic form. Otherwise
they must appear on printed covers that bracket the whole aggregate.
@node 8 TRANSLATION,9 TERMINATION,7 AGGREGATION WITH INDEPENDENT WORKS,GNU Free Documentation License
-@anchor{fdl-1 3 translation}@anchor{a6}
+@anchor{fdl-1 3 translation}@anchor{cb}
@subsection 8. TRANSLATION
@@ -5622,7 +6559,7 @@ If a section in the Document is Entitled “Acknowledgements”,
Title (section 1) will typically require changing the actual title.
@node 9 TERMINATION,10 FUTURE REVISIONS OF THIS LICENSE,8 TRANSLATION,GNU Free Documentation License
-@anchor{fdl-1 3 termination}@anchor{a7}
+@anchor{fdl-1 3 termination}@anchor{cc}
@subsection 9. TERMINATION
@@ -5652,7 +6589,7 @@ reinstated, receipt of a copy of some or all of the same material does
not give you any rights to use it.
@node 10 FUTURE REVISIONS OF THIS LICENSE,11 RELICENSING,9 TERMINATION,GNU Free Documentation License
-@anchor{fdl-1 3 future-revisions-of-this-license}@anchor{a8}
+@anchor{fdl-1 3 future-revisions-of-this-license}@anchor{cd}
@subsection 10. FUTURE REVISIONS OF THIS LICENSE
@@ -5674,7 +6611,7 @@ used, that proxy’s public statement of acceptance of a version
permanently authorizes you to choose that version for the Document.
@node 11 RELICENSING,ADDENDUM How to use this License for your documents,10 FUTURE REVISIONS OF THIS LICENSE,GNU Free Documentation License
-@anchor{fdl-1 3 relicensing}@anchor{a9}
+@anchor{fdl-1 3 relicensing}@anchor{ce}
@subsection 11. RELICENSING
@@ -5705,7 +6642,7 @@ under CC-BY-SA on the same site at any time before August 1, 2009,
provided the MMC is eligible for relicensing.
@node ADDENDUM How to use this License for your documents,,11 RELICENSING,GNU Free Documentation License
-@anchor{fdl-1 3 addendum-how-to-use-this-license-for-your-documents}@anchor{aa}
+@anchor{fdl-1 3 addendum-how-to-use-this-license-for-your-documents}@anchor{cf}
@subsection ADDENDUM: How to use this License for your documents
@@ -5739,7 +6676,7 @@ If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of free
software license, such as the GNU General Public License, to permit
their use in free software.
-@anchor{29}@w{ }
+@anchor{30}@w{ }
@anchor{rest tsref-type-ErrorDetail}@w{ }
@c %**end of body
diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py
index 932692b..40928c6 100644
--- a/doc/sphinx/conf.py
+++ b/doc/sphinx/conf.py
@@ -260,6 +260,12 @@ man_pages = [
("manpages/anastasis-httpd.1", "anastasis-httpd",
"anastasis HTTP backend", "Anastasis SARL",
1),
+ ("manpages/anastasis-dbconfig.1", "anastasis-dbconfig",
+ "configure Anastasis database", "Anastasis SARL",
+ 1),
+ ("manpages/anastasis-dbinit.1", "anastasis-dbinit",
+ "initialize Anastasis database", "Anastasis SARL",
+ 1),
("manpages/anastasis.conf.5", "anastasis.conf",
"anastasis configuration file", "Anastasis SARL",
5),
diff --git a/doc/sphinx/configuration.rst b/doc/sphinx/configuration.rst
index a2c9ad0..b99c712 100644
--- a/doc/sphinx/configuration.rst
+++ b/doc/sphinx/configuration.rst
@@ -28,3 +28,6 @@ configuration format.
.. include:: frags/configuration-format.rst
.. include:: frags/using-anastasis-config.rst
+
+.. include:: frags/legal.rst
+
diff --git a/doc/sphinx/frags/configuration-format.rst b/doc/sphinx/frags/configuration-format.rst
index f9b28e1..6f7ad86 100644
--- a/doc/sphinx/frags/configuration-format.rst
+++ b/doc/sphinx/frags/configuration-format.rst
@@ -59,11 +59,6 @@ Note that, in this stage of development, the file
component. For example, both an exchange and a bank can read values from
it.
-The repository ``git://taler.net/deployment`` contains examples of
+The repository ``git://git.taler.net/deployment`` contains examples of
configuration file used in our demos. See under ``deployment/config``.
- **Note**
-
- Expectably, some components will not work just by using default
- values, as their work is often interdependent. For example, a
- merchant needs to know an exchange URL, or a database name.
diff --git a/doc/sphinx/frags/legal.rst b/doc/sphinx/frags/legal.rst
new file mode 100644
index 0000000..dcecfaa
--- /dev/null
+++ b/doc/sphinx/frags/legal.rst
@@ -0,0 +1,183 @@
+..
+ This file is part of GNU TALER.
+
+ Copyright (C) 2014-2023 Taler Systems SA
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU Affero General Public License as published by the Free Software
+ Foundation; either version 2.1, 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 Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+
+ @author Christian Grothoff
+
+
+The service has well-known API endpoints to return its legal conditions to the
+user in various languages and various formats. This section describes how to
+setup and configure the legal conditions.
+
+
+Terms of Service
+----------------
+
+The service has an endpoint "/terms" to return the terms of service (in legal
+language) of the service operator. Client software show these terms of
+service to the user when the user is first interacting with the service.
+Terms of service are optional for experimental deployments, if none are
+configured, the service will return a simple statement saying that there are
+no terms of service available.
+
+To configure the terms of service response, there are two options
+in the configuration file for the service:
+
+- ``TERMS_ETAG``: The current "Etag" to return for the terms of service.
+ This value must be changed whenever the terms of service are
+ updated. A common value to use would be a version number.
+ Note that if you change the ``TERMS_ETAG``, you MUST also provide
+ the respective files in ``TERMS_DIR`` (see below).
+- ``TERMS_DIR``: The directory that contains the terms of service.
+ The files in the directory must be readable to the service
+ process.
+
+
+Privacy Policy
+--------------
+
+The service has an endpoint "/pp" to return the terms privacy policy (in legal
+language) of the service operator. Clients should show the privacy policy to
+the user when the user explicitly asks for it, but it should not be shown by
+default. Privacy policies are optional for experimental deployments, if none
+are configured, the service will return a simple statement saying that there
+is no privacy policy available.
+
+To configure the privacy policy response, there are two options
+in the configuration file for the service:
+
+- ``PRIVACY_ETAG``: The current "Etag" to return for the privacy policy.
+ This value must be changed whenever the privacy policy is
+ updated. A common value to use would be a version number.
+ Note that if you change the ``PRIVACY_ETAG``, you MUST also provide
+ the respective files in ``PRIVACY_DIR`` (see below).
+- ``PRIVACY_DIR``: The directory that contains the privacy policy.
+ The files in the directory must be readable to the service
+ process.
+
+
+Legal policies directory layout
+-------------------------------
+
+The ``TERMS_DIR`` and ``PRIVACY_DIR`` directory structures must follow a
+particular layout. You may use the same directory for both the terms of
+service and the privacy policy, as long as you use different ETAGs. Inside of
+the directory, there should be sub-directories using two-letter language codes
+like "en", "de", or "jp". Each of these directories would then hold
+translations of the current terms of service into the respective language.
+Empty directories are permitted in case translations are not available.
+
+Then, inside each language directory, files with the name of the value set as
+the ``TERMS_ETAG`` or ``PRIVACY_ETAG`` must be provided. The extension of each
+of the files should be typical for the respective mime type. The set of
+supported mime types is currently hard-coded in the service, and includes
+".epub", ".html", ".md", ".pdf" and ".txt" files. If other files are present,
+the service may show a warning on startup.
+
+Example
+^^^^^^^
+
+A sample file structure for a ``TERMS_ETAG`` of "tos-v0" would be:
+
+- TERMS_DIR/en/tos-v0.txt
+- TERMS_DIR/en/tos-v0.html
+- TERMS_DIR/en/tos-v0.pdf
+- TERMS_DIR/en/tos-v0.epub
+- TERMS_DIR/en/tos-v0.md
+- TERMS_DIR/de/tos-v0.txt
+- TERMS_DIR/de/tos-v0.html
+- TERMS_DIR/de/tos-v0.pdf
+- TERMS_DIR/de/tos-v0.epub
+- TERMS_DIR/de/tos-v0.md
+
+If the user requests an HTML format with language preferences "fr" followed by
+"en", the service would return ``TERMS_DIR/en/tos-v0.html`` lacking a version in
+French.
+
+
+Generating the Legal Terms
+--------------------------
+
+The ``taler-terms-generator`` script can be used to generate directories with
+terms of service and privacy policies in multiple languages and all required
+data formats from a single source file in ``.rst`` format and GNU gettext
+translations in ``.po`` format.
+
+To use the tool, you need to first write your legal conditions in English in
+reStructuredText (rst). You should find a templates in
+``$PREFIX/share/terms/*.rst`` where ``$PREFIX`` is the location where you
+installed the service to. Whenever you make substantive changes to the legal
+terms, you must use a fresh filename and change the respective ``ETAG``. The
+resulting file must be called ``$ETAG.rst`` and the first line of the file should be the title of the document.
+
+Once you have written the ``$ETAG.rst`` file in English, you can
+generate the first set of outputs:
+
+.. code-block:: shell-session
+
+ $ taler-terms-generator -i $ETAG
+
+Afterwards, you should find the terms in various formats for all configured
+languages (initially only English) in ``$PREFIX/share/terms/``. The generator
+has a few options which are documented in its man page.
+
+
+Adding translations
+-------------------
+
+Translations must be available in subdirectories
+``locale/$LANGUAGE/LC_MESSAGES/$ETAG.po``.
+To start translating, you first need to add a new
+language:
+
+.. code-block:: shell-session
+
+ $ taler-terms-generator -i $ETAG -l $LANGUAGE
+
+Here, ``$LANGUAGE`` should be a two-letter language
+code like ``de`` or ``fr``. The command will generate
+a file ``locale/$LANGUAGE/LC_MESSAGES/$ETAG.po``
+which contains each English sentence or paragraph
+in the original document and an initially empty
+translation. Translators should update the ``.po``
+file. Afterwards, simply re-run
+
+.. code-block:: shell-session
+
+ $ taler-terms-generator -i $ETAG
+
+to make the current translation(s) available to the
+service.
+
+.. note::
+
+ You must restart the service whenever adding or updating legal documents or their translations.
+
+
+Updating legal documents
+------------------------
+
+When making minor changes without legal implications, edit the ``.rst`` file,
+then re-run the step to add a new language for each existing translation to
+produce an updated ``.po`` file. Translate the sentences that have changed and
+finally run the generator (without ``-l``) on the ETAG (``-i $ETAG``) to
+create the final files.
+
+When making major changes with legal implications, you should first rename (or
+copy) the existing ``.rst`` file and the associated translation files to a new
+unique name. Afterwards, make the major changes, update the ``.po`` files,
+complete the translations and re-create the final files. Finally, do not
+forget to update the ``ETAG`` configuration option to the new name and to
+restart the service.
diff --git a/doc/sphinx/manpages/anastasis-dbconfig.1.rst b/doc/sphinx/manpages/anastasis-dbconfig.1.rst
new file mode 100644
index 0000000..3483c36
--- /dev/null
+++ b/doc/sphinx/manpages/anastasis-dbconfig.1.rst
@@ -0,0 +1,61 @@
+anastasis-dbconfig(1)
+#####################
+
+.. only:: html
+
+ Name
+ ====
+
+ **anastasis-dbconfig** - configure Anastasis database
+
+
+Synopsis
+========
+
+**anastasis-dbconfig**
+[**-c** *FILENAME* *]
+[**-h**]
+[**-n** *NAME* *]
+[**-r**]
+[**-s**]
+[**-u** *USER* *]
+
+Description
+===========
+
+**anastasis-dbconfig** is a simple shell script that configures
+a Postgresql database for use by the GNU Anastasis servers.
+
+Its options are as follows:
+
+**-c** *FILENAME*
+ Write the database configuration to FILENAME. The tool
+ will append the required ``CONFIG`` option for the
+ Postgresql access to the respective file.
+
+**-h**
+ Print short help on options.
+
+**-n** *DBNAME*
+ Use DBNAME for the name of the created database.
+
+**-r**
+ Reset any existing database. Looses all existing data. DANGEROUS.
+
+**-s**
+ Skip database initialization. Useful if you want to run
+ ``anastasis-dbinit`` manually.
+
+**-u** *USER*
+ Specifies the (main) Anastasis user that will access the database.
+
+See Also
+========
+
+anastassis-dbinit(1), anastasis.conf(5).
+
+Bugs
+====
+
+Report bugs by using https://bugs.taler.net or by sending electronic
+mail to <taler@gnu.org>.
diff --git a/doc/sphinx/manpages/anastasis-dbinit.1.rst b/doc/sphinx/manpages/anastasis-dbinit.1.rst
new file mode 100644
index 0000000..1b0d5fa
--- /dev/null
+++ b/doc/sphinx/manpages/anastasis-dbinit.1.rst
@@ -0,0 +1,67 @@
+anastasis-dbinit(1)
+###################
+
+.. only:: html
+
+ Name
+ ====
+
+ **anastasis-dbinit** - initialize Anastasis database
+
+
+Synopsis
+========
+
+**anastasis-dbinit**
+[**-c** *FILENAME* | **--config=**\ ‌\ *FILENAME*]
+[**-g** | **--gc**]
+[**-h** | **--help**]
+[**-L** *LOGLEVEL* | **--loglevel=**\ ‌\ *LOGLEVEL*]
+[**-l** *FILENAME* | **--logfile=**\ ‌\ *FILENAME*]
+[**-r** | **--reset**]
+[**-v** | **--version**]
+
+Description
+===========
+
+**anastasis-dbinit** is a command-line tool to initialize the GNU
+Anastasis database. It creates the necessary tables and indices for
+an Anastasis server to operate.
+
+Its options are as follows:
+
+**-c** *FILENAME* \| **--config=**\ ‌\ *FILENAME*
+ Use the configuration and other resources for the exchange to operate
+ from *FILENAME*.
+
+**-g** \| **--gc**
+ Garbage collect database. Deletes all unnecessary data in the
+ database.
+
+**-h** \| **--help**
+ Print short help on options.
+
+**-L** *LOGLEVEL* \| **--loglevel=**\ ‌\ *LOGLEVEL*
+ Specifies the log level to use. Accepted values are: ``DEBUG``, ``INFO``,
+ ``WARNING``, ``ERROR``.
+
+**-l** *FILENAME* \| **--logfile=**\ ‌\ *FILENAME*
+ Send logging output to *FILENAME*.
+
+**-r** \| **--reset**
+ Drop tables. Dangerous, will delete all existing data in the database
+ before creating the tables.
+
+**-v** \| **–version**
+ Print version information.
+
+See Also
+========
+
+anastasis-httpd(1), anastasis.conf(5).
+
+Bugs
+====
+
+Report bugs by using https://bugs.taler.net or by sending electronic
+mail to <taler@gnu.org>.
diff --git a/doc/sphinx/manpages/anastasis.conf.5.rst b/doc/sphinx/manpages/anastasis.conf.5.rst
index 000d8f0..a32cd4c 100644
--- a/doc/sphinx/manpages/anastasis.conf.5.rst
+++ b/doc/sphinx/manpages/anastasis.conf.5.rst
@@ -125,20 +125,20 @@ SMS Authorization options
^^^^^^^^^^^^^^^^^^^^^^^^^
COMMAND
- Helper command to run to send SMS.
+ Helper command to run to send SMS. The command will be given the phone number as its first argument. The message to be transmitted will be passed via STDIN.
Email Authorization options
^^^^^^^^^^^^^^^^^^^^^^^^^^^
COMMAND
- Helper command to run to send E-mail.
+ Helper command to run to send E-mail. The command will be given the e-mail address as its first argument. The message to be transmitted will be passed via STDIN.
Post Authorization options
^^^^^^^^^^^^^^^^^^^^^^^^^^
COMMAND
- Helper command to run to send physical mail.
+ Helper command to run to send physical mail. The command will be given the mailing address address as its first argument in JSON object fields 'full_name', 'street', 'city', 'postcode' and 'country'. The message to be transmitted will be passed via STDIN.
IBAN Authorization options
diff --git a/doc/sphinx/rest.rst b/doc/sphinx/rest.rst
index a9f78a9..79c1355 100644
--- a/doc/sphinx/rest.rst
+++ b/doc/sphinx/rest.rst
@@ -35,6 +35,7 @@ Receiving Configuration
.. http:get:: /config
Obtain the configuration details of the escrow provider.
+ This specification corresponds to ``current`` protocol being version **0**.
**Response:**
@@ -54,6 +55,9 @@ Receiving Configuration
// The format is "current:revision:age".
version: string;
+ // URN of the implementation (needed to interpret 'revision' in version).
+ // @since v0, may become mandatory in the future.
+ implementation?: string;
// Currency in which this provider processes payments.
currency: string;
diff --git a/doc/texinfo.tex b/doc/texinfo.tex
index 3c7051d..e48383d 100644
--- a/doc/texinfo.tex
+++ b/doc/texinfo.tex
@@ -3,9 +3,9 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
-\def\texinfoversion{2020-10-24.12}
+\def\texinfoversion{2021-04-25.21}
%
-% Copyright 1985, 1986, 1988, 1990-2020 Free Software Foundation, Inc.
+% Copyright 1985, 1986, 1988, 1990-2021 Free Software Foundation, Inc.
%
% This texinfo.tex file is free software: you can redistribute it and/or
% modify it under the terms of the GNU General Public License as
@@ -572,9 +572,8 @@
\fi
}
-% @end foo executes the definition of \Efoo.
-% But first, it executes a specialized version of \checkenv
-%
+
+% @end foo calls \checkenv and executes the definition of \Efoo.
\parseargdef\end{%
\if 1\csname iscond.#1\endcsname
\else
@@ -1003,6 +1002,14 @@ where each line of input produces a line of output.}
\global\everypar = {}%
}
+% leave vertical mode without cancelling any first paragraph indent
+\gdef\imageindent{%
+ \toks0=\everypar
+ \everypar={}%
+ \ptexnoindent
+ \global\everypar=\toks0
+}
+
% @refill is a no-op.
\let\refill=\relax
@@ -1863,19 +1870,23 @@ output) for that.)}
\closein 1
\endgroup
%
- \def\xetexpdfext{pdf}%
- \ifx\xeteximgext\xetexpdfext
- \XeTeXpdffile "#1".\xeteximgext ""
- \else
- \def\xetexpdfext{PDF}%
+ % Putting an \hbox around the image can prevent an over-long line
+ % after the image.
+ \hbox\bgroup
+ \def\xetexpdfext{pdf}%
\ifx\xeteximgext\xetexpdfext
\XeTeXpdffile "#1".\xeteximgext ""
\else
- \XeTeXpicfile "#1".\xeteximgext ""
+ \def\xetexpdfext{PDF}%
+ \ifx\xeteximgext\xetexpdfext
+ \XeTeXpdffile "#1".\xeteximgext ""
+ \else
+ \XeTeXpicfile "#1".\xeteximgext ""
+ \fi
\fi
- \fi
- \ifdim \wd0 >0pt width \xeteximagewidth \fi
- \ifdim \wd2 >0pt height \xeteximageheight \fi \relax
+ \ifdim \wd0 >0pt width \xeteximagewidth \fi
+ \ifdim \wd2 >0pt height \xeteximageheight \fi \relax
+ \egroup
}
\fi
@@ -2673,8 +2684,6 @@ end
\definetextfontsizexi
-\message{markup,}
-
% Check if we are currently using a typewriter font. Since all the
% Computer Modern typewriter fonts have zero interword stretch (and
% shrink), and it is reasonable to expect all typewriter fonts to have
@@ -2682,68 +2691,14 @@ end
%
\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
-% Markup style infrastructure. \defmarkupstylesetup\INITMACRO will
-% define and register \INITMACRO to be called on markup style changes.
-% \INITMACRO can check \currentmarkupstyle for the innermost
-% style.
-
-\let\currentmarkupstyle\empty
-
-\def\setupmarkupstyle#1{%
- \def\currentmarkupstyle{#1}%
- \markupstylesetup
-}
-
-\let\markupstylesetup\empty
-
-\def\defmarkupstylesetup#1{%
- \expandafter\def\expandafter\markupstylesetup
- \expandafter{\markupstylesetup #1}%
- \def#1%
-}
-
-% Markup style setup for left and right quotes.
-\defmarkupstylesetup\markupsetuplq{%
- \expandafter\let\expandafter \temp
- \csname markupsetuplq\currentmarkupstyle\endcsname
- \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
-}
-
-\defmarkupstylesetup\markupsetuprq{%
- \expandafter\let\expandafter \temp
- \csname markupsetuprq\currentmarkupstyle\endcsname
- \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
-}
-
{
\catcode`\'=\active
\catcode`\`=\active
-\gdef\markupsetuplqdefault{\let`\lq}
-\gdef\markupsetuprqdefault{\let'\rq}
-
-\gdef\markupsetcodequoteleft{\let`\codequoteleft}
-\gdef\markupsetcodequoteright{\let'\codequoteright}
+\gdef\setcodequotes{\let`\codequoteleft \let'\codequoteright}
+\gdef\setregularquotes{\let`\lq \let'\rq}
}
-\let\markupsetuplqcode \markupsetcodequoteleft
-\let\markupsetuprqcode \markupsetcodequoteright
-%
-\let\markupsetuplqexample \markupsetcodequoteleft
-\let\markupsetuprqexample \markupsetcodequoteright
-%
-\let\markupsetuplqkbd \markupsetcodequoteleft
-\let\markupsetuprqkbd \markupsetcodequoteright
-%
-\let\markupsetuplqsamp \markupsetcodequoteleft
-\let\markupsetuprqsamp \markupsetcodequoteright
-%
-\let\markupsetuplqverb \markupsetcodequoteleft
-\let\markupsetuprqverb \markupsetcodequoteright
-%
-\let\markupsetuplqverbatim \markupsetcodequoteleft
-\let\markupsetuprqverbatim \markupsetcodequoteright
-
% Allow an option to not use regular directed right quote/apostrophe
% (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
% The undirected quote is ugly, so don't make it the default, but it
@@ -2906,7 +2861,7 @@ end
}
% @samp.
-\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
+\def\samp#1{{\setcodequotes\lq\tclose{#1}\rq\null}}
% @indicateurl is \samp, that is, with quotes.
\let\indicateurl=\samp
@@ -2949,8 +2904,7 @@ end
\global\let'=\rq \global\let`=\lq % default definitions
%
\global\def\code{\begingroup
- \setupmarkupstyle{code}%
- % The following should really be moved into \setupmarkupstyle handlers.
+ \setcodequotes
\catcode\dashChar=\active \catcode\underChar=\active
\ifallowcodebreaks
\let-\codedash
@@ -3104,7 +3058,7 @@ end
\urefcatcodes
%
\global\def\urefcode{\begingroup
- \setupmarkupstyle{code}%
+ \setcodequotes
\urefcatcodes
\let&\urefcodeamp
\let.\urefcodedot
@@ -3225,8 +3179,8 @@ end
\def\kbdsub#1#2#3\par{%
\def\one{#1}\def\three{#3}\def\threex{??}%
\ifx\one\xkey\ifx\threex\three \key{#2}%
- \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
- \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
+ \else{\tclose{\kbdfont\setcodequotes\look}}\fi
+ \else{\tclose{\kbdfont\setcodequotes\look}}\fi
}
% definition of @key that produces a lozenge. Doesn't adjust to text size.
@@ -3243,7 +3197,7 @@ end
% monospace, don't change it; that way, we respect @kbdinputstyle. But
% if it isn't monospace, then use \tt.
%
-\def\key#1{{\setupmarkupstyle{key}%
+\def\key#1{{\setregularquotes
\nohyphenation
\ifmonospace\else\tt\fi
#1}\null}
@@ -3373,16 +3327,20 @@ end
{\obeylines
\globaldefs=1
\envdef\displaymath{%
-\tex
+\tex%
\def\thisenv{\displaymath}%
+\begingroup\let\end\displaymathend%
$$%
}
-\def\Edisplaymath{$$
+\def\displaymathend{$$\endgroup\end}%
+
+\def\Edisplaymath{%
\def\thisenv{\tex}%
\end tex
}}
+
% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
% Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
% except specified as a normal braced arg, so no newlines to worry about.
@@ -4343,82 +4301,8 @@ $$%
\doitemize{#1.}\flushcr
}
-% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
-% to @enumerate.
-%
-\def\alphaenumerate{\enumerate{a}}
-\def\capsenumerate{\enumerate{A}}
-\def\Ealphaenumerate{\Eenumerate}
-\def\Ecapsenumerate{\Eenumerate}
-
% @multitable macros
-% Amy Hendrickson, 8/18/94, 3/6/96
-%
-% @multitable ... @end multitable will make as many columns as desired.
-% Contents of each column will wrap at width given in preamble. Width
-% can be specified either with sample text given in a template line,
-% or in percent of \hsize, the current width of text on page.
-
-% Table can continue over pages but will only break between lines.
-
-% To make preamble:
-%
-% Either define widths of columns in terms of percent of \hsize:
-% @multitable @columnfractions .25 .3 .45
-% @item ...
-%
-% Numbers following @columnfractions are the percent of the total
-% current hsize to be used for each column. You may use as many
-% columns as desired.
-
-
-% Or use a template:
-% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
-% @item ...
-% using the widest term desired in each column.
-
-% Each new table line starts with @item, each subsequent new column
-% starts with @tab. Empty columns may be produced by supplying @tab's
-% with nothing between them for as many times as empty columns are needed,
-% ie, @tab@tab@tab will produce two empty columns.
-
-% @item, @tab do not need to be on their own lines, but it will not hurt
-% if they are.
-
-% Sample multitable:
-
-% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
-% @item first col stuff @tab second col stuff @tab third col
-% @item
-% first col stuff
-% @tab
-% second col stuff
-% @tab
-% third col
-% @item first col stuff @tab second col stuff
-% @tab Many paragraphs of text may be used in any column.
-%
-% They will wrap at the width determined by the template.
-% @item@tab@tab This will be in third column.
-% @end multitable
-
-% Default dimensions may be reset by user.
-% @multitableparskip is vertical space between paragraphs in table.
-% @multitableparindent is paragraph indent in table.
-% @multitablecolmargin is horizontal space to be left between columns.
-% @multitablelinespace is space to leave between table items, baseline
-% to baseline.
-% 0pt means it depends on current normal line spacing.
-%
-\newskip\multitableparskip
-\newskip\multitableparindent
-\newdimen\multitablecolspace
-\newskip\multitablelinespace
-\multitableparskip=0pt
-\multitableparindent=6pt
-\multitablecolspace=12pt
-\multitablelinespace=0pt
% Macros used to set up halign preamble:
%
@@ -4466,8 +4350,6 @@ $$%
\go
}
-% multitable-only commands.
-%
% @headitem starts a heading row, which we typeset in bold. Assignments
% have to be global since we are inside the implicit group of an
% alignment entry. \everycr below resets \everytab so we don't have to
@@ -4484,14 +4366,8 @@ $$%
% default for tables with no headings.
\let\headitemcrhook=\relax
%
-% A \tab used to include \hskip1sp. But then the space in a template
-% line is not enough. That is bad. So let's go back to just `&' until
-% we again encounter the problem the 1sp was intended to solve.
-% --karl, nathan@acm.org, 20apr99.
\def\tab{\checkenv\multitable &\the\everytab}%
-% @multitable ... @end multitable definitions:
-%
\newtoks\everytab % insert after every tab.
%
\envdef\multitable{%
@@ -4506,9 +4382,8 @@ $$%
%
\tolerance=9500
\hbadness=9500
- \setmultitablespacing
- \parskip=\multitableparskip
- \parindent=\multitableparindent
+ \parskip=0pt
+ \parindent=6pt
\overfullrule=0pt
\global\colcount=0
%
@@ -4538,47 +4413,24 @@ $$%
% continue for many paragraphs if desired.
\halign\bgroup &%
\global\advance\colcount by 1
- \multistrut
+ \strut
\vtop{%
- % Use the current \colcount to find the correct column width:
+ \advance\hsize by -1\leftskip
+ % Find the correct column width
\hsize=\expandafter\csname col\the\colcount\endcsname
%
- % In order to keep entries from bumping into each other
- % we will add a \leftskip of \multitablecolspace to all columns after
- % the first one.
- %
- % If a template has been used, we will add \multitablecolspace
- % to the width of each template entry.
- %
- % If the user has set preamble in terms of percent of \hsize we will
- % use that dimension as the width of the column, and the \leftskip
- % will keep entries from bumping into each other. Table will start at
- % left margin and final column will justify at right margin.
- %
- % Make sure we don't inherit \rightskip from the outer environment.
\rightskip=0pt
\ifnum\colcount=1
- % The first column will be indented with the surrounding text.
- \advance\hsize by\leftskip
+ \advance\hsize by\leftskip % Add indent of surrounding text
\else
- \ifsetpercent \else
- % If user has not set preamble in terms of percent of \hsize
- % we will advance \hsize by \multitablecolspace.
- \advance\hsize by \multitablecolspace
- \fi
- % In either case we will make \leftskip=\multitablecolspace:
- \leftskip=\multitablecolspace
+ % In order to keep entries from bumping into each other.
+ \leftskip=12pt
+ \ifsetpercent \else
+ % If a template has been used
+ \advance\hsize by \leftskip
+ \fi
\fi
- % Ignoring space at the beginning and end avoids an occasional spurious
- % blank line, when TeX decides to break the line at the space before the
- % box from the multistrut, so the strut ends up on a line by itself.
- % For example:
- % @multitable @columnfractions .11 .89
- % @item @code{#}
- % @tab Legal holiday which is valid in major parts of the whole country.
- % Is automatically provided with highlighting sequences respectively
- % marking characters.
- \noindent\ignorespaces##\unskip\multistrut
+ \noindent\ignorespaces##\unskip\strut
}\cr
}
\def\Emultitable{%
@@ -4587,31 +4439,6 @@ $$%
\global\setpercentfalse
}
-\def\setmultitablespacing{%
- \def\multistrut{\strut}% just use the standard line spacing
- %
- % Compute \multitablelinespace (if not defined by user) for use in
- % \multitableparskip calculation. We used define \multistrut based on
- % this, but (ironically) that caused the spacing to be off.
- % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
-\ifdim\multitablelinespace=0pt
-\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
-\global\advance\multitablelinespace by-\ht0
-\fi
-% Test to see if parskip is larger than space between lines of
-% table. If not, do nothing.
-% If so, set to same dimension as multitablelinespace.
-\ifdim\multitableparskip>\multitablelinespace
-\global\multitableparskip=\multitablelinespace
-\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
- % than skip between lines in the table.
-\fi%
-\ifdim\multitableparskip=0pt
-\global\multitableparskip=\multitablelinespace
-\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
- % than skip between lines in the table.
-\fi}
-
\message{conditionals,}
@@ -5225,30 +5052,29 @@ $$%
\let\lbracechar\{%
\let\rbracechar\}%
%
+ % Non-English letters.
+ \def\AA{AA}%
+ \def\AE{AE}%
+ \def\DH{DZZ}%
+ \def\L{L}%
+ \def\OE{OE}%
+ \def\O{O}%
+ \def\TH{TH}%
+ \def\aa{aa}%
+ \def\ae{ae}%
+ \def\dh{dzz}%
+ \def\exclamdown{!}%
+ \def\l{l}%
+ \def\oe{oe}%
+ \def\ordf{a}%
+ \def\ordm{o}%
+ \def\o{o}%
+ \def\questiondown{?}%
+ \def\ss{ss}%
+ \def\th{th}%
%
\let\do\indexnofontsdef
%
- % Non-English letters.
- \do\AA{AA}%
- \do\AE{AE}%
- \do\DH{DZZ}%
- \do\L{L}%
- \do\OE{OE}%
- \do\O{O}%
- \do\TH{TH}%
- \do\aa{aa}%
- \do\ae{ae}%
- \do\dh{dzz}%
- \do\exclamdown{!}%
- \do\l{l}%
- \do\oe{oe}%
- \do\ordf{a}%
- \do\ordm{o}%
- \do\o{o}%
- \do\questiondown{?}%
- \do\ss{ss}%
- \do\th{th}%
- %
\do\LaTeX{LaTeX}%
\do\TeX{TeX}%
%
@@ -7144,7 +6970,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% But \@ or @@ will get a plain @ character.
\envdef\tex{%
- \setupmarkupstyle{tex}%
+ \setregularquotes
\catcode `\\=0 \catcode `\{=1 \catcode `\}=2
\catcode `\$=3 \catcode `\&=4 \catcode `\#=6
\catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
@@ -7370,7 +7196,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% If you want all examples etc. small: @set dispenvsize small.
% If you want even small examples the full size: @set dispenvsize nosmall.
% This affects the following displayed environments:
-% @example, @display, @format, @lisp
+% @example, @display, @format, @lisp, @verbatim
%
\def\smallword{small}
\def\nosmallword{nosmall}
@@ -7416,9 +7242,9 @@ might help (with 'rm \jobname.?? \jobname.??s')%
%
\maketwodispenvdef{lisp}{example}{%
\nonfillstart
- \tt\setupmarkupstyle{example}%
+ \tt\setcodequotes
\let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
- \gobble % eat return
+ \parsearg\gobble
}
% @display/@smalldisplay: same as @lisp except keep current font.
%
@@ -7576,7 +7402,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\def\setupverb{%
\tt % easiest (and conventionally used) font for verbatim
\def\par{\leavevmode\endgraf}%
- \setupmarkupstyle{verb}%
+ \setcodequotes
\tabeightspaces
% Respect line breaks,
% print special symbols as themselves, and
@@ -7617,7 +7443,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\tt % easiest (and conventionally used) font for verbatim
\def\par{\egroup\leavevmode\box\verbbox\endgraf\starttabbox}%
\tabexpand
- \setupmarkupstyle{verbatim}%
+ \setcodequotes
% Respect line breaks,
% print special symbols as themselves, and
% make each space count.
@@ -8036,7 +7862,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% leave the code in, but it's strange for @var to lead to typewriter.
% Nowadays we recommend @code, since the difference between a ttsl hyphen
% and a tt hyphen is pretty tiny. @code also disables ?` !`.
- \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
+ \def\var##1{{\setregularquotes\ttslanted{##1}}}%
#1%
\sl\hyphenchar\font=45
}
@@ -8145,11 +7971,18 @@ might help (with 'rm \jobname.?? \jobname.??s')%
}
\fi
+\let\E=\expandafter
+
% Used at the time of macro expansion.
% Argument is macro body with arguments substituted
\def\scanmacro#1{%
\newlinechar`\^^M
- \def\xeatspaces{\eatspaces}%
+ % expand the expansion of \eatleadingcr twice to maybe remove a leading
+ % newline (and \else and \fi tokens), then call \eatspaces on the result.
+ \def\xeatspaces##1{%
+ \E\E\E\E\E\E\E\eatspaces\E\E\E\E\E\E\E{\eatleadingcr##1%
+ }}%
+ \def\xempty##1{}%
%
% Process the macro body under the current catcode regime.
\scantokens{#1@comment}%
@@ -8202,6 +8035,11 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\unbrace{\gdef\trim@@@ #1 } #2@{#1}
}
+{\catcode`\^^M=\other%
+\gdef\eatleadingcr#1{\if\noexpand#1\noexpand^^M\else\E#1\fi}}%
+% Warning: this won't work for a delimited argument
+% or for an empty argument
+
% Trim a single trailing ^^M off a string.
{\catcode`\^^M=\other \catcode`\Q=3%
\gdef\eatcr #1{\eatcra #1Q^^MQ}%
@@ -8368,6 +8206,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\let\hash\relax
% \hash is redefined to `#' later to get it into definitions
\let\xeatspaces\relax
+ \let\xempty\relax
\parsemargdefxxx#1,;,%
\ifnum\paramno<10\relax\else
\paramno0\relax
@@ -8379,9 +8218,11 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\else \let\next=\parsemargdefxxx
\advance\paramno by 1
\expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
- {\xeatspaces{\hash\the\paramno}}%
+ {\xeatspaces{\hash\the\paramno\noexpand\xempty{}}}%
\edef\paramlist{\paramlist\hash\the\paramno,}%
\fi\next}
+% the \xempty{} is to give \eatleadingcr an argument in the case of an
+% empty macro argument.
% \parsemacbody, \parsermacbody
%
@@ -8970,7 +8811,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\else
\ifhavexrefs
% We (should) know the real title if we have the xref values.
- \def\printedrefname{\refx{#1-title}{}}%
+ \def\printedrefname{\refx{#1-title}}%
\else
% Otherwise just copy the Info node name.
\def\printedrefname{\ignorespaces #1}%
@@ -9064,7 +8905,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% If the user specified the print name (third arg) to the ref,
% print it instead of our usual "Figure 1.2".
\ifdim\wd\printedrefnamebox = 0pt
- \refx{#1-snt}{}%
+ \refx{#1-snt}%
\else
\printedrefname
\fi
@@ -9099,28 +8940,30 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\else
% Reference within this manual.
%
- % Only output a following space if the -snt ref is nonempty; for
- % @unnumbered and @anchor, it won't be.
- \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
+ % Only output a following space if the -snt ref is nonempty, as the ref
+ % will be empty for @unnumbered and @anchor.
+ \setbox2 = \hbox{\ignorespaces \refx{#1-snt}}%
\ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
%
% output the `[mynode]' via the macro below so it can be overridden.
\xrefprintnodename\printedrefname
%
- % But we always want a comma and a space:
- ,\space
- %
- % output the `page 3'.
- \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
- % Add a , if xref followed by a space
- \if\space\noexpand\tokenafterxref ,%
- \else\ifx\ \tokenafterxref ,% @TAB
- \else\ifx\*\tokenafterxref ,% @*
- \else\ifx\ \tokenafterxref ,% @SPACE
- \else\ifx\
- \tokenafterxref ,% @NL
- \else\ifx\tie\tokenafterxref ,% @tie
- \fi\fi\fi\fi\fi\fi
+ \expandafter\ifx\csname SETtxiomitxrefpg\endcsname\relax
+ % But we always want a comma and a space:
+ ,\space
+ %
+ % output the `page 3'.
+ \turnoffactive \putwordpage\tie\refx{#1-pg}%
+ % Add a , if xref followed by a space
+ \if\space\noexpand\tokenafterxref ,%
+ \else\ifx\ \tokenafterxref ,% @TAB
+ \else\ifx\*\tokenafterxref ,% @*
+ \else\ifx\ \tokenafterxref ,% @SPACE
+ \else\ifx\
+ \tokenafterxref ,% @NL
+ \else\ifx\tie\tokenafterxref ,% @tie
+ \fi\fi\fi\fi\fi\fi
+ \fi
\fi\fi
\fi
\endlink
@@ -9187,9 +9030,8 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\fi\fi\fi
}
-% \refx{NAME}{SUFFIX} - reference a cross-reference string named NAME. SUFFIX
-% is output afterwards if non-empty.
-\def\refx#1#2{%
+% \refx{NAME} - reference a cross-reference string named NAME.
+\def\refx#1{%
\requireauxfile
{%
\indexnofonts
@@ -9216,7 +9058,6 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% It's defined, so just use it.
\thisrefX
\fi
- #2% Output the suffix in any case.
}
% This is the macro invoked by entries in the aux file. Define a control
@@ -9326,10 +9167,10 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\catcode`\[=\other
\catcode`\]=\other
\catcode`\"=\other
- \catcode`\_=\other
- \catcode`\|=\other
- \catcode`\<=\other
- \catcode`\>=\other
+ \catcode`\_=\active
+ \catcode`\|=\active
+ \catcode`\<=\active
+ \catcode`\>=\active
\catcode`\$=\other
\catcode`\#=\other
\catcode`\&=\other
@@ -9550,7 +9391,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
\catcode`\^^M = 5 % in case we're inside an example
\normalturnoffactive % allow _ et al. in names
- \def\xprocessmacroarg{\eatspaces}% in case we are being used via a macro
+ \makevalueexpandable
% If the image is by itself, center it.
\ifvmode
\imagevmodetrue
@@ -9576,7 +9417,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% On the other hand, if we are in the case of @center @image, we don't
% want to start a paragraph, which will create a hsize-width box and
% eradicate the centering.
- \ifx\centersub\centerV\else \noindent \fi
+ \ifx\centersub\centerV \else \imageindent \fi
%
% Output the image.
\ifpdf
@@ -11603,7 +11444,7 @@ directory should work if nowhere else does.}
\let> = \activegtr
\let~ = \activetilde
\let^ = \activehat
- \markupsetuplqdefault \markupsetuprqdefault
+ \setregularquotes
\let\b = \strong
\let\i = \smartitalic
% in principle, all other definitions in \tex have to be undone too.
@@ -11662,8 +11503,7 @@ directory should work if nowhere else does.}
@let|=@normalverticalbar
@let~=@normaltilde
@let\=@ttbackslash
- @markupsetuplqdefault
- @markupsetuprqdefault
+ @setregularquotes
@unsepspaces
}
}
@@ -11756,8 +11596,7 @@ directory should work if nowhere else does.}
@c Do this last of all since we use ` in the previous @catcode assignments.
@catcode`@'=@active
@catcode`@`=@active
-@markupsetuplqdefault
-@markupsetuprqdefault
+@setregularquotes
@c Local variables:
@c eval: (add-hook 'before-save-hook 'time-stamp)
@@ -11770,3 +11609,4 @@ directory should work if nowhere else does.}
@c vim:sw=2:
@enablebackslashhack
+
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 1c8ee65..7395de9 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,2 +1,77 @@
-# List of source files which contain translatable strings.
+src/authorization/anastasis_authorization_plugin.c
+src/authorization/anastasis_authorization_plugin_email.c
+src/authorization/anastasis_authorization_plugin_file.c
+src/authorization/anastasis_authorization_plugin_iban.c
+src/authorization/anastasis_authorization_plugin_post.c
+src/authorization/anastasis_authorization_plugin_sms.c
+src/authorization/anastasis_authorization_plugin_totp.c
+src/authorization/anastasis-helper-authorization-iban.c
+src/authorization/iban.c
+src/authorization/libanastasiseufin/lae_common.c
+src/authorization/libanastasiseufin/lae_credit.c
+src/authorization/libanastasiseufin/lae_parse.c
+src/backend/anastasis-httpd.c
+src/backend/anastasis-httpd_config.c
+src/backend/anastasis-httpd_mhd.c
+src/backend/anastasis-httpd_policy.c
+src/backend/anastasis-httpd_policy-meta.c
+src/backend/anastasis-httpd_policy-upload.c
+src/backend/anastasis-httpd_terms.c
+src/backend/anastasis-httpd_truth-challenge.c
+src/backend/anastasis-httpd_truth-solve.c
+src/backend/anastasis-httpd_truth-upload.c
+src/cli/anastasis-cli-discover.c
+src/cli/anastasis-cli-redux.c
+src/lib/anastasis_backup.c
+src/lib/anastasis_meta.c
+src/lib/anastasis_recovery.c
+src/reducer/anastasis_api_backup_redux.c
+src/reducer/anastasis_api_discovery.c
src/reducer/anastasis_api_recovery_redux.c
+src/reducer/anastasis_api_redux.c
+src/reducer/validation_CH_AHV.c
+src/reducer/validation_CZ_BN.c
+src/reducer/validation_DE_SVN.c
+src/reducer/validation_DE_TIN.c
+src/reducer/validation_ES_DNI.c
+src/reducer/validation_FR_INSEE.c
+src/reducer/validation_IN_AADHAR.c
+src/reducer/validation_IT_CF.c
+src/reducer/validation_NL_BSN.c
+src/reducer/validation_XX_SQUARE.c
+src/reducer/validation_XY_PRIME.c
+src/restclient/anastasis_api_config.c
+src/restclient/anastasis_api_curl_defaults.c
+src/restclient/anastasis_api_keyshare_lookup.c
+src/restclient/anastasis_api_policy_lookup.c
+src/restclient/anastasis_api_policy_meta_lookup.c
+src/restclient/anastasis_api_policy_store.c
+src/restclient/anastasis_api_truth_challenge.c
+src/restclient/anastasis_api_truth_solve.c
+src/restclient/anastasis_api_truth_store.c
+src/stasis/anastasis-dbinit.c
+src/stasis/anastasis_db_plugin.c
+src/stasis/plugin_anastasis_postgres.c
+src/stasis/test_anastasis_db.c
+src/testing/test_anastasis_api.c
+src/testing/test_anastasis.c
+src/testing/testing_api_cmd_config.c
+src/testing/testing_api_cmd_policy_lookup.c
+src/testing/testing_api_cmd_policy_store.c
+src/testing/testing_api_cmd_truth_challenge.c
+src/testing/testing_api_cmd_truth_solve.c
+src/testing/testing_api_cmd_truth_store.c
+src/testing/testing_api_helpers.c
+src/testing/testing_api_traits.c
+src/testing/testing_cmd_challenge_answer.c
+src/testing/testing_cmd_policy_create.c
+src/testing/testing_cmd_recover_secret.c
+src/testing/testing_cmd_secret_share.c
+src/testing/testing_cmd_truth_upload.c
+src/util/anastasis-config.c
+src/util/anastasis_crypto.c
+src/util/anastasis-crypto-tvg.c
+src/util/os_installation.c
+src/util/pin.c
+src/util/test_anastasis_crypto.c
+contrib/extracted.h
diff --git a/src/authorization/Makefile.am b/src/authorization/Makefile.am
index ec9ae5a..5d2854d 100644
--- a/src/authorization/Makefile.am
+++ b/src/authorization/Makefile.am
@@ -35,7 +35,9 @@ bin_PROGRAMS = \
anastasis-helper-authorization-iban
bin_SCRIPTS = \
- anastasis-authorization-email.sh
+ anastasis-authorization-email.sh \
+ anastasis-authorization-sms.sh \
+ anastasis-authorization-post.sh
anastasis_helper_authorization_iban_SOURCES = \
anastasis-helper-authorization-iban.c
@@ -98,6 +100,7 @@ libanastasis_plugin_authorization_email_la_LIBADD = \
libanastasis_plugin_authorization_email_la_LDFLAGS = \
$(ANASTASIS_PLUGIN_LDFLAGS) \
$(top_builddir)/src/stasis/libanastasisdb.la \
+ $(top_builddir)/src/util/libanastasisutil.la \
-ltalerjson \
-ltalermhd \
-ltalerutil \
@@ -130,6 +133,7 @@ libanastasis_plugin_authorization_post_la_LIBADD = \
libanastasis_plugin_authorization_post_la_LDFLAGS = \
$(ANASTASIS_PLUGIN_LDFLAGS) \
$(top_builddir)/src/stasis/libanastasisdb.la \
+ $(top_builddir)/src/util/libanastasisutil.la \
-ltalerjson \
-ltalermhd \
-ltalerutil \
@@ -146,6 +150,7 @@ libanastasis_plugin_authorization_sms_la_LIBADD = \
libanastasis_plugin_authorization_sms_la_LDFLAGS = \
$(ANASTASIS_PLUGIN_LDFLAGS) \
$(top_builddir)/src/stasis/libanastasisdb.la \
+ $(top_builddir)/src/util/libanastasisutil.la \
-ltalerjson \
-ltalermhd \
-ltalerutil \
diff --git a/src/authorization/anastasis-authorization-email.sh b/src/authorization/anastasis-authorization-email.sh
index ae3ecf7..738aaf0 100755
--- a/src/authorization/anastasis-authorization-email.sh
+++ b/src/authorization/anastasis-authorization-email.sh
@@ -1,2 +1,3 @@
#!/bin/sh
+# This file is in the public domain.
exec mail -s "Anastasis" -r noreply "$1"
diff --git a/src/authorization/anastasis-authorization-post.sh b/src/authorization/anastasis-authorization-post.sh
new file mode 100755
index 0000000..66255ea
--- /dev/null
+++ b/src/authorization/anastasis-authorization-post.sh
@@ -0,0 +1,196 @@
+#!/bin/bash
+# This file is in the public domain.
+set -eu
+
+# Check shared secrets
+if [ -x "$PINGEN_CLIENT_ID" ]
+then
+ echo "PINGEN_CLIENT_ID not sent in environment"
+ exit 1
+fi
+if [ -x "$PINGEN_CLIENT_SECRET" ]
+then
+ echo "PINGEN_CLIENT_SECRET not sent in environment"
+ exit 1
+fi
+if [ -x "$PINGEN_ORG_ID" ]
+then
+ echo "PINGEN_ORG_ID not sent in environment"
+ exit 1
+fi
+
+ENDPOINT="https://api.pingen.com"
+LOGS="$PWD/authorization-post.log"
+
+MESSAGE=$(cat -)
+DATE=$(date +%F)
+ADDR="$1"
+NAME=$(echo $ADDR | jq -r .full_name)
+STREET=$(echo $ADDR | jq -r .street)
+
+LNUMBER=$(echo $STREET | awk '{print $NF}')
+FNUMBER=$(echo $STREET | awk '{print $1}')
+case $LNUMBER in
+ ''|*[!0-9]*)
+ case $FNUMBER in
+ ''|*[!0-9]*)
+ NUMBER=0
+ ;;
+ *)
+ NUMBER=$FNUMBER
+ ;;
+ esac
+ ;;
+ *)
+ NUMBER=$LNUMBER
+ ;;
+esac
+
+
+CITY=$(echo $ADDR | jq -r .city)
+POSTCODE=$(echo $ADDR | jq -r .postcode)
+COUNTRY=$(echo $ADDR | jq -r .country)
+
+MYDIR=$(mktemp -d /tmp/authorization-post-XXXXXX)
+cd "$MYDIR"
+cat - | sed -e "s/%NAME%/$NAME/g" \
+ -e "s/%STREET%/$STREET/g" \
+ -e "s/%POSTCODE%/$POSTCODE/g" \
+ -e "s/%CITY%/$CITY/g" \
+ -e "s/%COUNTRY%/$COUNTRY/g" \
+ -e "s/%MESSAGE%/$MESSAGE/g" > input.tex <<EOF
+\NeedsTeXFormat{LaTeX2e}
+\documentclass[fontsize=11pt,a4paper]{scrlttr2}
+\makeatletter
+\KOMAoptions{foldmarks=off}
+%\@setplength{toaddrvpos}{30mm}
+%\@setplength{toaddrhpos}{130mm}
+%\@setplength{sigbeforevskip}{10mm}
+\makeatother
+\setkomavar{subject}{Anastasis Recovery}
+%\setkomavar{fromname}{Anastasis SARL}
+\setkomavar{signature}{Anastasis SARL}
+\date{\today}
+%\address{Anastasis SARL \\\\ 7 rue de Mondorf \\\\ 5431 Erpeldange}
+%\signature{Anastasis SARL}
+\begin{document}
+\begin{letter}{\ \ %NAME% \\\\ \ \ %STREET% \\\\ \ \ %POSTCODE% %CITY% \\\\ \ \ %COUNTRY% }
+\opening{To whom it may concern,}
+%MESSAGE%
+\closing{Best regards}
+\end{letter}
+\end{document}
+EOF
+pdflatex input.tex > /dev/null 2> /dev/null
+
+REPLY=$(curl -s -X POST -H "Content-Type: application/x-www-form-urlencoded" \
+ --data-urlencode "grant_type=client_credentials" \
+ --data-urlencode "client_id=$PINGEN_CLIENT_ID" \
+ --data-urlencode "client_secret=$PINGEN_CLIENT_SECRET" \
+ --data-urlencode "scope=letter" \
+ https://identity.pingen.com/auth/access-tokens)
+
+ACCESS_TOKEN=$(echo $REPLY | jq -r .access_token)
+
+REPLY=$(curl -s \
+ -X GET "$ENDPOINT/file-upload" \
+ -H "Authorization: Bearer $ACCESS_TOKEN")
+ATTRS=$(echo $REPLY | jq .data.attributes)
+UPLOAD_URL=$(echo $ATTRS | jq -r .url)
+URL_SIG=$(echo $ATTRS | jq -r .url_signature)
+
+curl -s -X PUT -T input.pdf "$UPLOAD_URL"
+
+
+RECIPIENT="$(jq -n '
+ {
+ name: $NAME,
+ street: $STREET,
+ number: $NUMBER,
+ city: $CITY,
+ zip: $POSTCODE,
+ country: $COUNTRY,
+ }' \
+ --arg NAME "$NAME" \
+ --arg STREET "$STREET" \
+ --arg NUMBER "$NUMBER" \
+ --arg CITY "$CITY" \
+ --arg POSTCODE "$POSTCODE" \
+ --arg COUNTRY "$COUNTRY" \
+ )"
+
+SENDER="$(jq -n '
+ {
+ name: "Anastasis SARL",
+ street: "Rue de Mondorf",
+ number: "7",
+ zip: "5421",
+ city: "Erpeldange",
+ country: "LU"
+ }'
+ )"
+
+REQUEST="$(jq -n '
+ { data: {
+ type: "letters",
+ attributes: {
+ file_original_name: "input.pdf",
+ file_url: $UPLOAD_URL,
+ file_url_signature: $URL_SIG,
+ address_position: "left",
+ delivery_product: "cheap",
+ print_mode: "duplex",
+ auto_send: true,
+ print_spectrum: "grayscale"
+ } }
+ }' \
+ --argjson RECIPIENT "$RECIPIENT" \
+ --argjson SENDER "$SENDER" \
+ --arg UPLOAD_URL "$UPLOAD_URL" \
+ --arg URL_SIG "$URL_SIG" \
+ )"
+
+STATUS=$(curl -s --request POST \
+ --url "$ENDPOINT/organisations/${PINGEN_ORG_ID}/letters" \
+ --header 'Content-Type: application/vnd.api+json' \
+ --header "Authorization: Bearer $ACCESS_TOKEN" \
+ -d "$REQUEST" \
+ -o "$MYDIR/final-reply.txt" \
+ -w "%{http_code}" -s)
+cat "$MYDIR/final-reply.txt" >> "$LOGS"
+case $STATUS in
+ 201)
+ ;;
+ *)
+ echo "Failed to add letter: $STATUS" >> "$LOGS"
+ echo "$REPLY"
+ exit 1;
+ ;;
+esac
+LETTER_ID=$(cat "$MYDIR/final-reply.txt" | jq -r .data.id)
+REPLY=$MYDIR/delete-reply.txt
+STATUS=409
+sleep 1;
+while test "$STATUS" = 409;
+do
+ STATUS=$(curl -s --request DELETE \
+ --url "$ENDPOINT/organisations/$PINGEN_ORG_ID/letters/$LETTER_ID" \
+ --header "Authorization: Bearer $ACCESS_TOKEN" \
+ -o "$REPLY" \
+ -w "%{http_code}" -s)
+ case $STATUS in
+ 204)
+ cat "$REPLY" >> "$LOGS"
+ ;;
+ 409)
+ # Happens, likely still in processing...
+ ;;
+ *)
+ echo "Failed to delete letter: $STATUS" >> "$LOGS"
+ ;;
+ esac
+done
+
+rm -r "$MYDIR"
+
+exit 0
diff --git a/src/authorization/anastasis-authorization-sms.sh b/src/authorization/anastasis-authorization-sms.sh
new file mode 100755
index 0000000..1e38661
--- /dev/null
+++ b/src/authorization/anastasis-authorization-sms.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+# This file is in the public domain.
+set -eu
+
+# Check shared secrets
+if [ -x "$TELESIGN_AUTH_TOKEN" ]
+then
+ echo "TELESIGN_AUTH_TOKEN not sent in environment"
+ exit 1
+fi
+
+MESSAGE=$(cat -)
+TMPFILE=$(mktemp /tmp/sms-loggingXXXXXX)
+STATUS=$(curl --request POST \
+ --url https://rest-api.telesign.com/v1/messaging \
+ --header 'authorization: Basic $TELESIGN_AUTH_TOKEN' \
+ --header 'content-type: application/x-www-form-urlencoded' \
+ --data account_livecycle_event=transact \
+ --data "message=$MESSAGE" \
+ --data message_type=OTP \
+ --data "phone_number=$1" \
+ -w "%{http_code}" -s -o $TMPFILE)
+echo `cat $TMPFILE` >> /var/log/sms.log
+rm -f $TMPFILE
+case $STATUS in
+ 200|203|250|290|291|295)
+ exit 0;
+ ;;
+ *)
+ exit 1;
+ ;;
+esac
+exit 1
diff --git a/src/authorization/anastasis_authorization_plugin_email.c b/src/authorization/anastasis_authorization_plugin_email.c
index 62b50b8..7fc97e7 100644
--- a/src/authorization/anastasis_authorization_plugin_email.c
+++ b/src/authorization/anastasis_authorization_plugin_email.c
@@ -296,8 +296,12 @@ email_done_cb (void *cls,
{
struct ANASTASIS_AUTHORIZATION_State *as = cls;
- as->child = NULL;
as->cwh = NULL;
+ if (NULL != as->child)
+ {
+ GNUNET_OS_process_destroy (as->child);
+ as->child = NULL;
+ }
as->pst = type;
as->exit_code = exit_code;
MHD_resume_connection (as->connection);
diff --git a/src/authorization/anastasis_authorization_plugin_post.c b/src/authorization/anastasis_authorization_plugin_post.c
index 1863279..9410b58 100644
--- a/src/authorization/anastasis_authorization_plugin_post.c
+++ b/src/authorization/anastasis_authorization_plugin_post.c
@@ -334,8 +334,12 @@ post_done_cb (void *cls,
{
struct ANASTASIS_AUTHORIZATION_State *as = cls;
- as->child = NULL;
as->cwh = NULL;
+ if (NULL != as->child)
+ {
+ GNUNET_OS_process_destroy (as->child);
+ as->child = NULL;
+ }
as->pst = type;
as->exit_code = exit_code;
MHD_resume_connection (as->connection);
diff --git a/src/authorization/anastasis_authorization_plugin_sms.c b/src/authorization/anastasis_authorization_plugin_sms.c
index 47439eb..51457b6 100644
--- a/src/authorization/anastasis_authorization_plugin_sms.c
+++ b/src/authorization/anastasis_authorization_plugin_sms.c
@@ -295,8 +295,12 @@ sms_done_cb (void *cls,
{
struct ANASTASIS_AUTHORIZATION_State *as = cls;
- as->child = NULL;
as->cwh = NULL;
+ if (NULL != as->child)
+ {
+ GNUNET_OS_process_destroy (as->child);
+ as->child = NULL;
+ }
as->pst = type;
as->exit_code = exit_code;
MHD_resume_connection (as->connection);
diff --git a/src/authorization/anastasis_authorization_plugin_totp.c b/src/authorization/anastasis_authorization_plugin_totp.c
index e1c104a..c127e38 100644
--- a/src/authorization/anastasis_authorization_plugin_totp.c
+++ b/src/authorization/anastasis_authorization_plugin_totp.c
@@ -188,7 +188,7 @@ compute_totp (int time_off,
offset = hmac[sizeof (hmac) - 1] & 0x0f;
for (int count = 0; count < 4; count++)
- code |= hmac[offset + 3 - count] << (8 * count);
+ code |= ((uint32_t) hmac[offset + 3 - count]) << (8 * count);
code &= 0x7fffffff;
/* always use 8 digits (maximum) */
code = code % 100000000;
diff --git a/src/authorization/test-post.sh b/src/authorization/test-post.sh
new file mode 100755
index 0000000..fd3a8d8
--- /dev/null
+++ b/src/authorization/test-post.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+# This file is in the public domain.
+set -eu
+ADDR=`jq -n '{
+ full_name: "John Doe",
+ street: "Bar street 3",
+ city: "Wuppertal",
+ postcode: 42289,
+ country: "DE",
+ }'`
+
+echo "Your recovery code is 1234" | ./anastasis-authorization-post.sh "$ADDR"
diff --git a/src/backend/Makefile.am b/src/backend/Makefile.am
index db37478..10edef5 100644
--- a/src/backend/Makefile.am
+++ b/src/backend/Makefile.am
@@ -41,7 +41,6 @@ anastasis_httpd_LDADD = \
-lgnunetjson \
-lgnunetutil \
-lmicrohttpd \
- -luuid \
$(XLIB)
EXTRA_DIST = \
diff --git a/src/backend/anastasis-httpd_config.c b/src/backend/anastasis-httpd_config.c
index 015fd01..677c5dc 100644
--- a/src/backend/anastasis-httpd_config.c
+++ b/src/backend/anastasis-httpd_config.c
@@ -103,7 +103,9 @@ AH_handler_config (struct AH_RequestHandler *rh,
GNUNET_JSON_pack_string ("name",
"anastasis"),
GNUNET_JSON_pack_string ("version",
- "0:0:0"),
+ "0:1:0"),
+ GNUNET_JSON_pack_string ("implementation",
+ "urn:net:taler:specs:anastasis:c-reference"),
GNUNET_JSON_pack_string ("business_name",
AH_business_name),
GNUNET_JSON_pack_array_steal ("methods",
diff --git a/src/backend/anastasis-httpd_policy-upload.c b/src/backend/anastasis-httpd_policy-upload.c
index 94a38bc..83e8117 100644
--- a/src/backend/anastasis-httpd_policy-upload.c
+++ b/src/backend/anastasis-httpd_policy-upload.c
@@ -387,15 +387,14 @@ proposal_cb (void *cls,
* Callback to process a GET /check-payment request
*
* @param cls our `struct PolicyUploadContext`
- * @param hr HTTP response details
* @param osr order status
*/
static void
check_payment_cb (void *cls,
- const struct TALER_MERCHANT_HttpResponse *hr,
const struct TALER_MERCHANT_OrderStatusResponse *osr)
{
struct PolicyUploadContext *puc = cls;
+ const struct TALER_MERCHANT_HttpResponse *hr = &osr->hr;
/* refunds are not supported, verify */
puc->cpo = NULL;
@@ -422,10 +421,12 @@ check_payment_cb (void *cls,
puc->response_code = MHD_HTTP_BAD_GATEWAY;
return;
}
+
+ GNUNET_assert (MHD_HTTP_OK == hr->http_status);
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Payment status checked: %s\n",
- osr->status ? "paid" : "unpaid");
- switch (osr->status)
+ "Payment status checked: %d\n",
+ osr->details.ok.status);
+ switch (osr->details.ok.status)
{
case TALER_MERCHANT_OSC_PAID:
{
@@ -440,7 +441,7 @@ check_payment_cb (void *cls,
GNUNET_JSON_spec_end ()
};
- contract = osr->details.paid.contract_terms;
+ contract = osr->details.ok.details.paid.contract_terms;
if (GNUNET_OK !=
GNUNET_JSON_parse (contract,
cspec,
@@ -536,7 +537,6 @@ await_payment (struct PolicyUploadContext *puc)
AH_backend_url,
order_id,
NULL /* our payments are NOT session-bound */,
- false,
timeout,
&check_payment_cb,
puc);
@@ -557,6 +557,7 @@ await_payment (struct PolicyUploadContext *puc)
static MHD_RESULT
begin_payment (struct PolicyUploadContext *puc)
{
+ static const char *no_uuids[1] = { NULL };
json_t *order;
GNUNET_CONTAINER_DLL_insert (puc_head,
@@ -607,7 +608,7 @@ begin_payment (struct PolicyUploadContext *puc)
0,
NULL, /* no inventory products */
0,
- NULL, /* no uuids */
+ no_uuids, /* no uuids */
false, /* do NOT require claim token */
&proposal_cb,
puc);
@@ -661,34 +662,10 @@ AH_handler_policy_post (
hc->cc = &cleanup_ctx;
puc->con = connection;
- {
- const char *pay_id;
-
- pay_id = MHD_lookup_connection_value (connection,
- MHD_HEADER_KIND,
- ANASTASIS_HTTP_HEADER_PAYMENT_IDENTIFIER);
- if (NULL != pay_id)
- {
- if (GNUNET_OK !=
- GNUNET_STRINGS_string_to_data (
- pay_id,
- strlen (pay_id),
- &puc->payment_identifier,
- sizeof (struct ANASTASIS_PaymentSecretP)))
- {
- GNUNET_break_op (0);
- return TALER_MHD_reply_with_error (connection,
- MHD_HTTP_BAD_REQUEST,
- TALER_EC_GENERIC_PARAMETER_MALFORMED,
- ANASTASIS_HTTP_HEADER_PAYMENT_IDENTIFIER
- " header must be a base32-encoded Payment-Secret");
- }
- puc->payment_identifier_provided = true;
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Policy upload started with payment identifier `%s'\n",
- pay_id);
- }
- }
+ TALER_MHD_parse_request_header_auto (connection,
+ ANASTASIS_HTTP_HEADER_PAYMENT_IDENTIFIER,
+ &puc->payment_identifier,
+ puc->payment_identifier_provided);
puc->account = *account_pub;
/* check for meta-data */
@@ -767,28 +744,10 @@ AH_handler_policy_post (
}
puc->upload_size = (size_t) len;
}
- {
- /* Check if header contains Anastasis-Policy-Signature */
- const char *sig_s;
- sig_s = MHD_lookup_connection_value (connection,
- MHD_HEADER_KIND,
- ANASTASIS_HTTP_HEADER_POLICY_SIGNATURE);
- if ( (NULL == sig_s) ||
- (GNUNET_OK !=
- GNUNET_STRINGS_string_to_data (sig_s,
- strlen (sig_s),
- &puc->account_sig,
- sizeof (puc->account_sig))) )
- {
- GNUNET_break_op (0);
- return TALER_MHD_reply_with_error (connection,
- MHD_HTTP_BAD_REQUEST,
- TALER_EC_ANASTASIS_POLICY_BAD_SIGNATURE,
- ANASTASIS_HTTP_HEADER_POLICY_SIGNATURE
- " header must include a base32-encoded EdDSA signature");
- }
- }
+ TALER_MHD_parse_request_header_auto_t (connection,
+ ANASTASIS_HTTP_HEADER_POLICY_SIGNATURE,
+ &puc->account_sig);
{
/* Check if header contains an ETAG */
const char *etag;
@@ -797,9 +756,12 @@ AH_handler_policy_post (
MHD_HEADER_KIND,
MHD_HTTP_HEADER_IF_NONE_MATCH);
if ( (NULL == etag) ||
+ (2 >= strlen (etag)) ||
+ ('"' != etag[0]) ||
+ ('"' != etag[strlen (etag) - 1]) ||
(GNUNET_OK !=
- GNUNET_STRINGS_string_to_data (etag,
- strlen (etag),
+ GNUNET_STRINGS_string_to_data (etag + 1,
+ strlen (etag) - 2,
&puc->new_policy_upload_hash,
sizeof (puc->new_policy_upload_hash))) )
{
@@ -833,39 +795,10 @@ AH_handler_policy_post (
}
}
- {
- const char *long_poll_timeout_ms;
-
- long_poll_timeout_ms = MHD_lookup_connection_value (connection,
- MHD_GET_ARGUMENT_KIND,
- "timeout_ms");
- if (NULL != long_poll_timeout_ms)
- {
- unsigned int timeout;
- char dummy;
-
- if (1 != sscanf (long_poll_timeout_ms,
- "%u%c",
- &timeout,
- &dummy))
- {
- GNUNET_break_op (0);
- return TALER_MHD_reply_with_error (connection,
- MHD_HTTP_BAD_REQUEST,
- TALER_EC_GENERIC_PARAMETER_MALFORMED,
- "timeout_ms (must be non-negative number)");
- }
- puc->timeout
- = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply (
- GNUNET_TIME_UNIT_MILLISECONDS,
- timeout));
- }
- else
- {
- puc->timeout = GNUNET_TIME_relative_to_absolute (
- CHECK_PAYMENT_GENERIC_TIMEOUT);
- }
- }
+ puc->timeout = GNUNET_TIME_relative_to_absolute (
+ CHECK_PAYMENT_GENERIC_TIMEOUT);
+ TALER_MHD_parse_request_timeout (connection,
+ &puc->timeout);
/* check if the client insists on paying */
{
diff --git a/src/backend/anastasis-httpd_policy.c b/src/backend/anastasis-httpd_policy.c
index a26d11e..177cc06 100644
--- a/src/backend/anastasis-httpd_policy.c
+++ b/src/backend/anastasis-httpd_policy.c
@@ -122,25 +122,30 @@ return_policy (struct MHD_Connection *connection,
{
char *sig_s;
char *etag;
+ char *etagq;
sig_s = GNUNET_STRINGS_data_to_string_alloc (&account_sig,
sizeof (account_sig));
- etag = GNUNET_STRINGS_data_to_string_alloc (&recovery_data_hash,
- sizeof (recovery_data_hash));
GNUNET_break (MHD_YES ==
MHD_add_response_header (resp,
ANASTASIS_HTTP_HEADER_POLICY_SIGNATURE,
sig_s));
+ GNUNET_free (sig_s);
GNUNET_break (MHD_YES ==
MHD_add_response_header (resp,
ANASTASIS_HTTP_HEADER_POLICY_VERSION,
version_s));
+ etag = GNUNET_STRINGS_data_to_string_alloc (&recovery_data_hash,
+ sizeof (recovery_data_hash));
+ GNUNET_asprintf (&etagq,
+ "\"%s\"",
+ etag);
+ GNUNET_free (etag);
GNUNET_break (MHD_YES ==
MHD_add_response_header (resp,
MHD_HTTP_HEADER_ETAG,
- etag));
- GNUNET_free (etag);
- GNUNET_free (sig_s);
+ etagq));
+ GNUNET_free (etagq);
}
{
MHD_RESULT ret;
@@ -203,13 +208,16 @@ AH_policy_get (struct MHD_Connection *connection,
inm = MHD_lookup_connection_value (connection,
MHD_HEADER_KIND,
MHD_HTTP_HEADER_IF_NONE_MATCH);
- if (NULL != inm)
+ if ( (NULL != inm) &&
+ (2 < strlen (inm)) &&
+ ('"' == inm[0]) &&
+ ('"' == inm[strlen (inm) - 1]) )
{
struct GNUNET_HashCode inm_h;
if (GNUNET_OK !=
- GNUNET_STRINGS_string_to_data (inm,
- strlen (inm),
+ GNUNET_STRINGS_string_to_data (inm + 1,
+ strlen (inm) - 2,
&inm_h,
sizeof (inm_h)))
{
diff --git a/src/backend/anastasis-httpd_truth-challenge.c b/src/backend/anastasis-httpd_truth-challenge.c
index 30379a7..a7d138f 100644
--- a/src/backend/anastasis-httpd_truth-challenge.c
+++ b/src/backend/anastasis-httpd_truth-challenge.c
@@ -360,22 +360,17 @@ AH_truth_challenge_shutdown (void)
* Callback to process a POST /orders/ID/refund request
*
* @param cls closure with a `struct RefundEntry *`
- * @param hr HTTP response details
- * @param taler_refund_uri the refund uri offered to the wallet
- * @param h_contract hash of the contract a Browser may need to authorize
- * obtaining the HTTP response.
+ * @param rr response details
*/
static void
refund_cb (
void *cls,
- const struct TALER_MERCHANT_HttpResponse *hr,
- const char *taler_refund_uri,
- const struct TALER_PrivateContractHashP *h_contract)
+ const struct TALER_MERCHANT_RefundResponse *rr)
{
struct RefundEntry *re = cls;
re->ro = NULL;
- switch (hr->http_status)
+ switch (rr->hr.http_status)
{
case MHD_HTTP_OK:
{
@@ -407,9 +402,9 @@ refund_cb (
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Refund `%s' failed with HTTP status %u: %s (#%u)\n",
re->order_id,
- hr->http_status,
- hr->hint,
- (unsigned int) hr->ec);
+ rr->hr.http_status,
+ rr->hr.hint,
+ (unsigned int) rr->hr.ec);
break;
}
GNUNET_CONTAINER_DLL_remove (re_head,
@@ -650,16 +645,15 @@ proposal_cb (void *cls,
* Callback to process a GET /check-payment request
*
* @param cls our `struct ChallengeContext`
- * @param hr HTTP response details
* @param osr order status
*/
static void
check_payment_cb (void *cls,
- const struct TALER_MERCHANT_HttpResponse *hr,
const struct TALER_MERCHANT_OrderStatusResponse *osr)
{
struct ChallengeContext *gc = cls;
+ const struct TALER_MERCHANT_HttpResponse *hr = &osr->hr;
gc->cpo = NULL;
GNUNET_assert (gc->in_list);
@@ -713,7 +707,8 @@ check_payment_cb (void *cls,
}
}
- switch (osr->status)
+ GNUNET_assert (MHD_HTTP_OK == hr->http_status);
+ switch (osr->details.ok.status)
{
case TALER_MERCHANT_OSC_PAID:
{
@@ -796,7 +791,6 @@ begin_payment (struct ChallengeContext *gc)
AH_backend_url,
order_id,
NULL /* NOT session-bound */,
- false,
timeout,
&check_payment_cb,
gc);
@@ -804,6 +798,7 @@ begin_payment (struct ChallengeContext *gc)
else
{
/* Create a fresh order */
+ static const char *no_uuids[1] = { NULL };
json_t *order;
struct GNUNET_TIME_Timestamp pay_deadline;
@@ -837,7 +832,7 @@ begin_payment (struct ChallengeContext *gc)
0,
NULL, /* no inventory products */
0,
- NULL, /* no uuids */
+ no_uuids, /* no uuids */
false, /* do NOT require claim token */
&proposal_cb,
gc);
diff --git a/src/backend/anastasis-httpd_truth-solve.c b/src/backend/anastasis-httpd_truth-solve.c
index 8133cc9..eb09dc7 100644
--- a/src/backend/anastasis-httpd_truth-solve.c
+++ b/src/backend/anastasis-httpd_truth-solve.c
@@ -199,14 +199,24 @@ static struct GNUNET_SCHEDULER_Task *to_task;
static MHD_RESULT
reply_rate_limited (const struct SolveContext *gc)
{
+ if (NULL != gc->authorization)
+ return TALER_MHD_REPLY_JSON_PACK (
+ gc->connection,
+ MHD_HTTP_TOO_MANY_REQUESTS,
+ TALER_MHD_PACK_EC (TALER_EC_ANASTASIS_TRUTH_RATE_LIMITED),
+ GNUNET_JSON_pack_uint64 ("request_limit",
+ gc->authorization->retry_counter),
+ GNUNET_JSON_pack_time_rel ("request_frequency",
+ gc->authorization->code_rotation_period));
+ /* must be security question */
return TALER_MHD_REPLY_JSON_PACK (
gc->connection,
MHD_HTTP_TOO_MANY_REQUESTS,
TALER_MHD_PACK_EC (TALER_EC_ANASTASIS_TRUTH_RATE_LIMITED),
GNUNET_JSON_pack_uint64 ("request_limit",
- gc->authorization->retry_counter),
+ INITIAL_RETRY_COUNTER),
GNUNET_JSON_pack_time_rel ("request_frequency",
- gc->authorization->code_rotation_period));
+ MAX_QUESTION_FREQ));
}
@@ -482,16 +492,15 @@ proposal_cb (void *cls,
* Callback to process a GET /check-payment request
*
* @param cls our `struct SolveContext`
- * @param hr HTTP response details
* @param osr order status
*/
static void
check_payment_cb (void *cls,
- const struct TALER_MERCHANT_HttpResponse *hr,
const struct TALER_MERCHANT_OrderStatusResponse *osr)
{
struct SolveContext *gc = cls;
+ const struct TALER_MERCHANT_HttpResponse *hr = &osr->hr;
gc->cpo = NULL;
GNUNET_assert (gc->in_list);
@@ -545,7 +554,8 @@ check_payment_cb (void *cls,
}
}
- switch (osr->status)
+ GNUNET_assert (MHD_HTTP_OK == hr->http_status);
+ switch (osr->details.ok.status)
{
case TALER_MERCHANT_OSC_PAID:
{
@@ -628,7 +638,6 @@ begin_payment (struct SolveContext *gc)
AH_backend_url,
order_id,
NULL /* NOT session-bound */,
- false,
timeout,
&check_payment_cb,
gc);
@@ -636,6 +645,7 @@ begin_payment (struct SolveContext *gc)
else
{
/* Create a fresh order */
+ static const char *no_uuids[1] = { NULL };
json_t *order;
struct GNUNET_TIME_Timestamp pay_deadline;
@@ -669,7 +679,7 @@ begin_payment (struct SolveContext *gc)
0,
NULL, /* no inventory products */
0,
- NULL, /* no uuids */
+ no_uuids, /* no uuids */
false, /* do NOT require claim token */
&proposal_cb,
gc);
@@ -1130,40 +1140,10 @@ AH_handler_truth_solve (
gc->connection = connection;
gc->truth_uuid = *truth_uuid;
gc->hc->cc = &request_done;
-
- {
- const char *long_poll_timeout_ms;
-
- long_poll_timeout_ms = MHD_lookup_connection_value (connection,
- MHD_GET_ARGUMENT_KIND,
- "timeout_ms");
- if (NULL != long_poll_timeout_ms)
- {
- unsigned int timeout;
- char dummy;
-
- if (1 != sscanf (long_poll_timeout_ms,
- "%u%c",
- &timeout,
- &dummy))
- {
- GNUNET_break_op (0);
- return TALER_MHD_reply_with_error (connection,
- MHD_HTTP_BAD_REQUEST,
- TALER_EC_GENERIC_PARAMETER_MALFORMED,
- "timeout_ms (must be non-negative number)");
- }
- gc->timeout
- = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply (
- GNUNET_TIME_UNIT_MILLISECONDS,
- timeout));
- }
- else
- {
- gc->timeout = GNUNET_TIME_relative_to_absolute (
- GNUNET_TIME_UNIT_SECONDS);
- }
- }
+ gc->timeout = GNUNET_TIME_relative_to_absolute (
+ GNUNET_TIME_UNIT_SECONDS);
+ TALER_MHD_parse_request_timeout (connection,
+ &gc->timeout);
} /* end of first-time initialization (if NULL == gc) */
else
{
diff --git a/src/backend/anastasis-httpd_truth-upload.c b/src/backend/anastasis-httpd_truth-upload.c
index 356dc36..1c2a58d 100644
--- a/src/backend/anastasis-httpd_truth-upload.c
+++ b/src/backend/anastasis-httpd_truth-upload.c
@@ -287,15 +287,14 @@ proposal_cb (void *cls,
* Callback to process a GET /check-payment request
*
* @param cls our `struct PolicyUploadContext`
- * @param hr HTTP response details
* @param osr order status
*/
static void
check_payment_cb (void *cls,
- const struct TALER_MERCHANT_HttpResponse *hr,
const struct TALER_MERCHANT_OrderStatusResponse *osr)
{
struct TruthUploadContext *tuc = cls;
+ const struct TALER_MERCHANT_HttpResponse *hr = &osr->hr;
tuc->cpo = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -311,7 +310,7 @@ check_payment_cb (void *cls,
NULL);
break;
case MHD_HTTP_OK:
- switch (osr->status)
+ switch (osr->details.ok.status)
{
case TALER_MERCHANT_OSC_PAID:
{
@@ -326,7 +325,7 @@ check_payment_cb (void *cls,
GNUNET_JSON_spec_end ()
};
- contract = osr->details.paid.contract_terms;
+ contract = osr->details.ok.details.paid.contract_terms;
if (GNUNET_OK !=
GNUNET_JSON_parse (contract,
cspec,
@@ -355,7 +354,7 @@ check_payment_cb (void *cls,
qs = db->record_truth_upload_payment (
db->cls,
&tuc->truth_uuid,
- &osr->details.paid.deposit_total,
+ &osr->details.ok.details.paid.deposit_total,
paid_until);
if (qs <= 0)
{
@@ -397,6 +396,7 @@ check_payment_cb (void *cls,
case MHD_HTTP_NOT_FOUND:
/* Setup fresh order */
{
+ static const char *no_uuids[1] = { NULL };
char *order_id;
json_t *order;
@@ -416,7 +416,6 @@ check_payment_cb (void *cls,
"description", "challenge storage fee",
"quantity", (json_int_t) tuc->years_to_pay,
"unit", "years",
-
"order_id",
order_id);
GNUNET_free (order_id);
@@ -428,7 +427,7 @@ check_payment_cb (void *cls,
0,
NULL, /* no inventory products */
0,
- NULL, /* no uuids */
+ no_uuids, /* no uuids */
false, /* do NOT require claim token */
&proposal_cb,
tuc);
@@ -486,7 +485,6 @@ begin_payment (struct TruthUploadContext *tuc)
AH_backend_url,
order_id,
NULL /* our payments are NOT session-bound */,
- false,
timeout,
&check_payment_cb,
tuc);
@@ -551,78 +549,12 @@ AH_handler_truth_post (
tuc->truth_uuid = *truth_uuid;
hc->ctx = tuc;
hc->cc = &cleanup_truth_post;
-
- /* check for excessive upload */
- {
- const char *lens;
- unsigned long len;
- char dummy;
-
- lens = MHD_lookup_connection_value (connection,
- MHD_HEADER_KIND,
- MHD_HTTP_HEADER_CONTENT_LENGTH);
- if ( (NULL == lens) ||
- (1 != sscanf (lens,
- "%lu%c",
- &len,
- &dummy)) )
- {
- GNUNET_break_op (0);
- return TALER_MHD_reply_with_error (
- connection,
- MHD_HTTP_BAD_REQUEST,
- (NULL == lens)
- ? TALER_EC_ANASTASIS_GENERIC_MISSING_CONTENT_LENGTH
- : TALER_EC_ANASTASIS_GENERIC_MALFORMED_CONTENT_LENGTH,
- NULL);
- }
- if (len / 1024 / 1024 >= AH_upload_limit_mb)
- {
- GNUNET_break_op (0);
- return TALER_MHD_reply_with_error (connection,
- MHD_HTTP_PAYLOAD_TOO_LARGE,
- TALER_EC_SYNC_MALFORMED_CONTENT_LENGTH,
- "Content-length value not acceptable");
- }
- }
-
- {
- const char *long_poll_timeout_ms;
-
- long_poll_timeout_ms = MHD_lookup_connection_value (connection,
- MHD_GET_ARGUMENT_KIND,
- "timeout_ms");
- if (NULL != long_poll_timeout_ms)
- {
- unsigned int timeout;
- char dummy;
-
- if (1 != sscanf (long_poll_timeout_ms,
- "%u%c",
- &timeout,
- &dummy))
- {
- GNUNET_break_op (0);
- return TALER_MHD_reply_with_error (connection,
- MHD_HTTP_BAD_REQUEST,
- TALER_EC_GENERIC_PARAMETER_MALFORMED,
- "timeout_ms (must be non-negative number)");
- }
- tuc->timeout
- = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply (
- GNUNET_TIME_UNIT_MILLISECONDS,
- timeout));
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Long polling for %u ms enabled\n",
- timeout);
- }
- else
- {
- tuc->timeout = GNUNET_TIME_relative_to_absolute (
- GNUNET_TIME_UNIT_SECONDS);
- }
- }
-
+ TALER_MHD_check_content_length (connection,
+ AH_upload_limit_mb * 1024LLU * 1024LLU);
+ tuc->timeout = GNUNET_TIME_relative_to_absolute (
+ GNUNET_TIME_UNIT_SECONDS);
+ TALER_MHD_parse_request_timeout (connection,
+ &tuc->timeout);
} /* end 'if (NULL == tuc)' */
if (NULL != tuc->resp)
diff --git a/src/cli/.gitignore b/src/cli/.gitignore
index 72921e1..111e321 100644
--- a/src/cli/.gitignore
+++ b/src/cli/.gitignore
@@ -1,7 +1,13 @@
*.log
+*.err
+*.out
anastasis-reducer
test_reducer_home
*.trs
taler-bank.err
wallet.err
anastasis-discover
+talercheck
+test_reducer.conf.edited
+wallet-withdraw.out
+libeufin-transfer-initiate.out
diff --git a/src/cli/Makefile.am b/src/cli/Makefile.am
index dccd9af..8b2a9a0 100644
--- a/src/cli/Makefile.am
+++ b/src/cli/Makefile.am
@@ -21,7 +21,10 @@ check_SCRIPTS = \
test_anastasis_reducer_enter_secret.sh \
test_anastasis_reducer_recovery_enter_user_attributes.sh \
test_anastasis_reducer_recovery_no_pay.sh \
- test_iban.sh
+ test_anastasis_reducer_recovery_hanging.sh
+
+# Removed for now, libeufin is not yet working OK for this.
+# test_iban.sh
AM_TESTS_ENVIRONMENT=export ANASTASIS_PREFIX=$${ANASTASIS_PREFIX:-@libdir@};export PATH=$${ANASTASIS_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
@@ -31,6 +34,8 @@ TESTS = \
EXTRA_DIST = \
$(check_SCRIPTS) \
+ setup.sh \
+ test_reducer_home/.local/share/taler/exchange-offline/master.priv \
test_reducer.conf \
test_reducer_free.conf \
test_free_reducer.conf \
diff --git a/src/cli/setup.sh b/src/cli/setup.sh
new file mode 100755
index 0000000..6d26168
--- /dev/null
+++ b/src/cli/setup.sh
@@ -0,0 +1,72 @@
+#!/bin/sh
+# This file is in the public domain
+
+# Script to be inlined into the main test scripts. Defines function 'setup()'
+# which wraps around 'taler-unified-setup.sh' to launch GNU Taler services.
+# Call setup() with the arguments to pass to 'taler-unified-setup'. setup()
+# will then launch GNU Taler, wait for the process to be complete before
+# returning. The script will also install an exit handler to ensure the GNU
+# Taler processes are stopped when the shell exits.
+
+set -eu
+
+# Cleanup to run whenever we exit
+function exit_cleanup()
+{
+ if [ ! -z ${SETUP_PID+x} ]
+ then
+ echo "Killing taler-unified-setup ($SETUP_PID)" >&2
+ kill -TERM "$SETUP_PID" 2> /dev/null || true
+ wait "$SETUP_PID" 2> /dev/null || true
+ fi
+}
+
+# Install cleanup handler (except for kill -9)
+trap exit_cleanup EXIT
+
+function setup()
+{
+ echo "Starting test system ..." >&2
+ # Create a named pipe in a temp directory we own.
+ FIFO_DIR=$(mktemp -p "${TMPDIR:-/tmp}" -d fifo-XXXXXX)
+ FIFO_OUT=$(echo "$FIFO_DIR/out")
+ mkfifo "$FIFO_OUT"
+ # Open pipe as FD 3 (RW) and FD 4 (RO)
+ exec 3<> "$FIFO_OUT" 4< "$FIFO_OUT"
+ rm -rf "$FIFO_DIR"
+ # We require '-W' for our termination logic to work.
+ taler-unified-setup.sh -W "$@" >&3 &
+ SETUP_PID=$!
+ # Close FD3
+ exec 3>&-
+ sed -u '/<<READY>>/ q' <&4
+ # Close FD4
+ exec 4>&-
+ echo "Test system ready" >&2
+}
+
+# Exit, with status code "skip" (no 'real' failure)
+function exit_fail() {
+ echo "$@" >&2
+ exit 1
+}
+
+# Exit, with status code "skip" (no 'real' failure)
+function exit_skip() {
+ echo "SKIPPING: $1"
+ exit 77
+}
+
+function get_payto_uri() {
+ export LIBEUFIN_SANDBOX_USERNAME="$1"
+ export LIBEUFIN_SANDBOX_PASSWORD="$2"
+ export LIBEUFIN_SANDBOX_URL="http://localhost:18082"
+ libeufin-cli sandbox demobank info --bank-account "$1" | jq --raw-output '.paytoUri'
+}
+
+function get_bankaccount_transactions() {
+ export LIBEUFIN_SANDBOX_USERNAME=$1
+ export LIBEUFIN_SANDBOX_PASSWORD=$2
+ export LIBEUFIN_SANDBOX_URL="http://localhost:18082"
+ libeufin-cli sandbox demobank list-transactions --bank-account $1
+}
diff --git a/src/cli/test_anastasis_reducer_done_authentication.sh b/src/cli/test_anastasis_reducer_done_authentication.sh
index 87c738c..545c733 100755
--- a/src/cli/test_anastasis_reducer_done_authentication.sh
+++ b/src/cli/test_anastasis_reducer_done_authentication.sh
@@ -46,9 +46,9 @@ echo " OK"
echo -n "Test done authentication (next) ..."
-anastasis-reducer next resources/04-backup.json $TFILE
+anastasis-reducer next resources/04-backup.json "$TFILE"
-STATE=`jq -r -e .backup_state < $TFILE`
+STATE=$(jq -r -e .backup_state < "$TFILE")
if test "$STATE" != "POLICIES_REVIEWING"
then
exit_fail "Expected new state to be AUTHENTICATIONS_EDITING, got $STATE"
diff --git a/src/cli/test_anastasis_reducer_enter_secret.sh b/src/cli/test_anastasis_reducer_enter_secret.sh
index cfba181..3b25537 100755
--- a/src/cli/test_anastasis_reducer_enter_secret.sh
+++ b/src/cli/test_anastasis_reducer_enter_secret.sh
@@ -1,6 +1,7 @@
#!/bin/bash
# This file is in the public domain.
+# shellcheck disable=SC2317
## Coloring style Text shell script
COLOR='\033[0;35m'
NOCOLOR='\033[0m'
@@ -8,48 +9,23 @@ BOLD="$(tput bold)"
NORM="$(tput sgr0)"
set -eu
-set -x
-# Exit, with status code "skip" (no 'real' failure)
-function exit_skip() {
- echo " SKIP: $1"
- exit 77
-}
-
-# Exit, with error message (hard failure)
-function exit_fail() {
- echo " FAIL: $1"
- exit 1
-}
-
-# Cleanup to run whenever we exit
-function cleanup()
-{
- for n in `jobs -p`
- do
- kill $n 2> /dev/null || true
- done
- rm -rf $CONF $WALLET_DB $TFILE $UFILE $TMP_DIR
- wait
-}
-
-CONF_1="test_anastasis_reducer_1.conf"
-CONF_2="test_anastasis_reducer_2.conf"
-CONF_3="test_anastasis_reducer_3.conf"
-CONF_4="test_anastasis_reducer_4.conf"
-
-# Exchange configuration file will be edited, so we create one
-# from the template.
-CONF=`mktemp test_reducerXXXXXX.conf`
-cp test_reducer.conf $CONF
-
-TMP_DIR=`mktemp -d keys-tmp-XXXXXX`
-WALLET_DB=`mktemp test_reducer_walletXXXXXX.json`
-TFILE=`mktemp test_reducer_statePPXXXXXX`
-UFILE=`mktemp test_reducer_stateBFXXXXXX`
-
-# Install cleanup handler (except for kill -9)
-trap cleanup EXIT
+# Replace with 0 for nexus...
+USE_FAKEBANK=1
+if [ 1 = "$USE_FAKEBANK" ]
+then
+ ACCOUNT="exchange-account-2"
+ WIRE_METHOD="x-taler-bank"
+ BANK_FLAGS="-f -d $WIRE_METHOD -u $ACCOUNT"
+ BANK_URL="http://localhost:18082/"
+ MERCHANT_PAYTO="payto://x-taler-bank/localhost/anastasis?receiver-name=anastasis"
+else
+ ACCOUNT="exchange-account-1"
+ WIRE_METHOD="iban"
+ BANK_FLAGS="-ns -d $WIRE_METHOD -u $ACCOUNT"
+ BANK_URL="http://localhost:18082/"
+ MERCHANT_PAYTO="payto://iban/SANDBOXX/DE648226?receiver-name=anastasis"
+fi
# Check we can actually run
echo -n "Testing for jq"
@@ -64,9 +40,6 @@ taler-exchange-httpd -h > /dev/null || exit_skip " taler-exchange required"
taler-merchant-httpd -h > /dev/null || exit_skip " taler-merchant required"
echo " FOUND"
-echo -n "Testing for taler-bank-manage"
-taler-bank-manage --help >/dev/null </dev/null || exit_skip " MISSING"
-echo " FOUND"
echo -n "Testing for taler-wallet-cli"
taler-wallet-cli -v >/dev/null </dev/null || exit_skip " MISSING"
echo " FOUND"
@@ -75,88 +48,65 @@ echo -n "Testing for anastasis-httpd"
anastasis-httpd -h >/dev/null </dev/null || exit_skip " MISSING"
echo " FOUND"
-echo -n "Initialize anastasis database ..."
-# Name of the Postgres database we will use for the script.
-# Will be dropped, do NOT use anything that might be used
-# elsewhere
-TARGET_DB_1=`anastasis-config -c $CONF_1 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"`
-TARGET_DB_2=`anastasis-config -c $CONF_2 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"`
-TARGET_DB_3=`anastasis-config -c $CONF_3 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"`
-TARGET_DB_4=`anastasis-config -c $CONF_4 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"`
-
-dropdb $TARGET_DB_1 >/dev/null 2>/dev/null || true
-createdb $TARGET_DB_1 || exit_skip "Could not create database $TARGET_DB_1"
-anastasis-dbinit -c $CONF_1 2> anastasis-dbinit_1.log
-dropdb $TARGET_DB_2 >/dev/null 2>/dev/null || true
-createdb $TARGET_DB_2 || exit_skip "Could not create database $TARGET_DB_2"
-anastasis-dbinit -c $CONF_2 2> anastasis-dbinit_2.log
-dropdb $TARGET_DB_3 >/dev/null 2>/dev/null || true
-createdb $TARGET_DB_3 || exit_skip "Could not create database $TARGET_DB_3"
-anastasis-dbinit -c $CONF_3 2> anastasis-dbinit_3.log
-dropdb $TARGET_DB_4 >/dev/null 2>/dev/null || true
-createdb $TARGET_DB_4 || exit_skip "Could not create database $TARGET_DB_4"
-anastasis-dbinit -c $CONF_4 2> anastasis-dbinit_4.log
+. setup.sh
+# Launch exchange, merchant and bank.
+# shellcheck disable=SC2086
+setup -c "test_reducer.conf" \
+ -aemw \
+ $BANK_FLAGS
-echo " OK"
-echo -n "Generating Taler auditor, exchange and merchant configurations ..."
-
-DATA_DIR=`taler-config -f -c $CONF -s PATHS -o TALER_HOME`
-rm -rf $DATA_DIR
-
-# obtain key configuration data
-MASTER_PRIV_FILE=`taler-config -f -c $CONF -s "EXCHANGE-OFFLINE" -o "MASTER_PRIV_FILE"`
-MASTER_PRIV_DIR=`dirname $MASTER_PRIV_FILE`
-mkdir -p $MASTER_PRIV_DIR
-gnunet-ecc -g1 $MASTER_PRIV_FILE > /dev/null 2> /dev/null
-MASTER_PUB=`gnunet-ecc -p $MASTER_PRIV_FILE`
-EXCHANGE_URL=`taler-config -c $CONF -s EXCHANGE -o BASE_URL`
-MERCHANT_PORT=`taler-config -c $CONF -s MERCHANT -o PORT`
-MERCHANT_URL=http://localhost:${MERCHANT_PORT}/
-BANK_PORT=`taler-config -c $CONF -s BANK -o HTTP_PORT`
-BANK_URL=http://localhost:${BANK_PORT}/
-AUDITOR_URL=http://localhost:8083/
-AUDITOR_PRIV_FILE=`taler-config -f -c $CONF -s AUDITOR -o AUDITOR_PRIV_FILE`
-AUDITOR_PRIV_DIR=`dirname $AUDITOR_PRIV_FILE`
-mkdir -p $AUDITOR_PRIV_DIR
-gnunet-ecc -g1 $AUDITOR_PRIV_FILE > /dev/null 2> /dev/null
-AUDITOR_PUB=`gnunet-ecc -p $AUDITOR_PRIV_FILE`
-
-# patch configuration
-TALER_DB=talercheck
-taler-config -c $CONF -s exchange -o MASTER_PUBLIC_KEY -V $MASTER_PUB
-taler-config -c $CONF -s merchant-exchange-default -o MASTER_KEY -V $MASTER_PUB
-taler-config -c $CONF -s exchangedb-postgres -o CONFIG -V postgres:///$TALER_DB
-taler-config -c $CONF -s auditordb-postgres -o CONFIG -V postgres:///$TALER_DB
-taler-config -c $CONF -s merchantdb-postgres -o CONFIG -V postgres:///$TALER_DB
-taler-config -c $CONF -s bank -o database -V postgres:///$TALER_DB
-taler-config -c $CONF -s exchange -o KEYDIR -V "${TMP_DIR}/keydir/"
-taler-config -c $CONF -s exchange -o REVOCATION_DIR -V "${TMP_DIR}/revdir/"
+# Cleanup to run whenever we exit
+function cleanup()
+{
+ exit_cleanup
+ for n in $(jobs -p)
+ do
+ kill "$n" 2> /dev/null || true
+ done
+ rm -rf "$CONF" "$WALLET_DB" "$TFILE" "$UFILE" "$TMP_DIR"
+ wait
+}
-echo " OK"
+CONF_1="test_anastasis_reducer_1.conf"
+CONF_2="test_anastasis_reducer_2.conf"
+CONF_3="test_anastasis_reducer_3.conf"
+CONF_4="test_anastasis_reducer_4.conf"
+
+# Exchange configuration file will be edited, so we create one
+# from the template.
+CONF="test_reducer.conf.edited"
-echo -n "Setting up exchange ..."
+TMP_DIR=$(mktemp -p "${TMPDIR:-/tmp}" -d keys-tmp-XXXXXX)
+WALLET_DB=$(mktemp -p "${TMPDIR:-/tmp}" test_reducer_walletXXXXXX.json)
+TFILE=$(mktemp -p "${TMPDIR:-/tmp}" test_reducer_statePPXXXXXX)
+UFILE=$(mktemp -p "${TMPDIR:-/tmp}" test_reducer_stateBFXXXXXX)
-# reset database
-dropdb $TALER_DB >/dev/null 2>/dev/null || true
-createdb $TALER_DB || exit_skip "Could not create database $TALER_DB"
-taler-exchange-dbinit -c $CONF
-taler-merchant-dbinit -c $CONF
-taler-auditor-dbinit -c $CONF
-taler-auditor-exchange -c $CONF -m $MASTER_PUB -u $EXCHANGE_URL
+# Install cleanup handler (except for kill -9)
+trap cleanup EXIT
-echo " OK"
-# Launch services
-echo -n "Launching taler services ..."
-taler-bank-manage-testing $CONF postgres:///$TALER_DB serve > taler-bank.log 2> taler-bank.err &
-taler-exchange-secmod-eddsa -c $CONF 2> taler-exchange-secmod-eddsa.log &
-taler-exchange-secmod-rsa -c $CONF 2> taler-exchange-secmod-rsa.log &
-taler-exchange-secmod-cs -c $CONF 2> taler-exchange-secmod-cs.log &
-taler-exchange-httpd -c $CONF 2> taler-exchange-httpd.log &
-taler-merchant-httpd -c $CONF -L INFO 2> taler-merchant-httpd.log &
-taler-exchange-wirewatch -c $CONF 2> taler-exchange-wirewatch.log &
-taler-auditor-httpd -L INFO -c $CONF 2> taler-auditor-httpd.log &
+echo -n "Initialize anastasis databases ..."
+# Name of the Postgres database we will use for the script.
+# Will be dropped, do NOT use anything that might be used
+# elsewhere
+TARGET_DB_1=$(anastasis-config -c "$CONF_1" -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///")
+TARGET_DB_2=$(anastasis-config -c "$CONF_2" -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///")
+TARGET_DB_3=$(anastasis-config -c "$CONF_3" -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///")
+TARGET_DB_4=$(anastasis-config -c "$CONF_4" -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///")
+
+dropdb "$TARGET_DB_1" >/dev/null 2>/dev/null || true
+createdb "$TARGET_DB_1" || exit_skip "Could not create database $TARGET_DB_1"
+anastasis-dbinit -c "$CONF_1" 2> anastasis-dbinit_1.log
+dropdb "$TARGET_DB_2" >/dev/null 2>/dev/null || true
+createdb "$TARGET_DB_2" || exit_skip "Could not create database $TARGET_DB_2"
+anastasis-dbinit -c "$CONF_2" 2> anastasis-dbinit_2.log
+dropdb "$TARGET_DB_3" >/dev/null 2>/dev/null || true
+createdb "$TARGET_DB_3" || exit_skip "Could not create database $TARGET_DB_3"
+anastasis-dbinit -c "$CONF_3" 2> anastasis-dbinit_3.log
+dropdb "$TARGET_DB_4" >/dev/null 2>/dev/null || true
+createdb "$TARGET_DB_4" || exit_skip "Could not create database $TARGET_DB_4"
+anastasis-dbinit -c "$CONF_4" 2> anastasis-dbinit_4.log
echo " OK"
@@ -167,82 +117,9 @@ $PREFIX anastasis-httpd -c $CONF_2 2> anastasis-httpd_2.log &
$PREFIX anastasis-httpd -c $CONF_3 2> anastasis-httpd_3.log &
$PREFIX anastasis-httpd -c $CONF_4 2> anastasis-httpd_4.log &
-# Wait for bank to be available (usually the slowest)
-for n in `seq 1 50`
-do
- echo -n "."
- sleep 0.2
- OK=0
- # bank
- wget --tries=1 --timeout=1 http://localhost:8082/ -o /dev/null -O /dev/null >/dev/null || continue
- OK=1
- break
-done
-
-if [ 1 != $OK ]
-then
- exit_skip "Failed to launch services (bank)"
-fi
-
-# Wait for all other taler services to be available
-for n in `seq 1 50`
-do
- echo -n "."
- sleep 0.1
- OK=0
- # exchange
- wget --tries=1 --timeout=1 http://localhost:8081/seed -o /dev/null -O /dev/null >/dev/null || continue
- # merchant
- wget --tries=1 --timeout=1 http://localhost:9966/ -o /dev/null -O /dev/null >/dev/null || continue
- # auditor
- wget --tries=1 --timeout=1 http://localhost:8083/ -o /dev/null -O /dev/null >/dev/null || continue
- OK=1
- break
-done
-
-if [ 1 != $OK ]
-then
- exit_skip "Failed to launch taler services"
-fi
-
-echo "OK"
-
-echo -n "Setting up keys ..."
-taler-exchange-offline -c $CONF \
- download \
- sign \
- enable-account payto://x-taler-bank/localhost/Exchange \
- enable-auditor $AUDITOR_PUB $AUDITOR_URL "TESTKUDOS Auditor" \
- wire-fee now x-taler-bank TESTKUDOS:0.01 TESTKUDOS:0.01 TESTKUDOS:0.01 \
- upload &> taler-exchange-offline.log
-
-echo -n "."
-
-for n in `seq 1 3`
-do
- echo -n "."
- OK=0
- wget --tries=1 --timeout=1 http://localhost:8081/keys -o /dev/null -O /dev/null >/dev/null || continue
- OK=1
- break
-done
-
-if [ 1 != $OK ]
-then
- exit_skip "Failed to setup keys"
-fi
-
-echo " OK"
-
-echo -n "Setting up auditor signatures ..."
-taler-auditor-offline -c $CONF \
- download sign upload &> taler-auditor-offline.log
-echo " OK"
-
echo -n "Waiting for anastasis services ..."
-
# Wait for anastasis services to be available
-for n in `seq 1 50`
+for n in $(seq 1 50)
do
echo -n "."
sleep 0.1
@@ -259,7 +136,7 @@ do
break
done
-if [ 1 != $OK ]
+if [ 1 != "$OK" ]
then
exit_skip "Failed to launch anastasis services"
fi
@@ -268,70 +145,74 @@ echo "OK"
echo -n "Configuring merchant instance ..."
# Setup merchant
-curl -H "Content-Type: application/json" -X POST -d '{"auth":{"method":"external"},"payto_uris":["payto://x-taler-bank/localhost/43"],"id":"default","name":"default","address":{},"jurisdiction":{},"default_max_wire_fee":"TESTKUDOS:1", "default_max_deposit_fee":"TESTKUDOS:1","default_wire_fee_amortization":1,"default_wire_transfer_delay":{"d_ms" : 3600000},"default_pay_delay":{"d_ms": 3600000}}' http://localhost:9966/management/instances
+curl -H "Content-Type: application/json" -X POST -d '{"auth":{"method":"external"},"id":"default","name":"default","user_type":"business","address":{},"jurisdiction":{},"use_stefan":true,"default_wire_transfer_delay":{"d_us" : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' http://localhost:9966/management/instances
+
+
+curl -H "Content-Type: application/json" -X POST -d '{"payto_uri":"'"$MERCHANT_PAYTO"'"}' http://localhost:9966/private/accounts
+
echo " DONE"
-echo -en $COLOR$BOLD"Test enter secret in a backup state ..."$NORM$NOCOLOR
+echo -en "${COLOR}${BOLD}Test enter secret in a backup state ...${NORM}${NOCOLOR}"
$PREFIX anastasis-reducer -a \
'{"secret": { "value" : "veryhardtoguesssecret", "mime" : "text/plain" } }' \
- enter_secret resources/06-backup.json $TFILE
+ enter_secret resources/06-backup.json "$TFILE"
-STATE=`jq -r -e .backup_state < $TFILE`
-if test "$STATE" != "SECRET_EDITING"
+STATE=$(jq -r -e .backup_state < "$TFILE")
+if [ "$STATE" != "SECRET_EDITING" ]
then
- jq -e . $TFILE
+ jq -e . "$TFILE"
exit_fail "Expected new state to be 'SECRET_EDITING', got '$STATE'"
fi
echo " DONE"
-echo -en $COLOR$BOLD"Test expiration change ..."$NORM$NOCOLOR
+echo -en "${COLOR}${BOLD}Test expiration change ...${NORM}${NOCOLOR}"
-MILLIS=`date '+%s'`000
+SECS=$(date '+%s')
# Use 156 days into the future to get 1 year
-MILLIS=`expr $MILLIS + 13478400000`
+SECS=$(( SECS + 13478400 ))
$PREFIX anastasis-reducer -a \
"$(jq -n '
- {"expiration": { "t_ms" : $MSEC } }' \
- --argjson MSEC $MILLIS
+ {"expiration": { "t_s" : $SEC } }' \
+ --argjson SEC "$SECS"
)" \
- update_expiration $TFILE $UFILE
+ update_expiration "$TFILE" "$UFILE"
-STATE=`jq -r -e .backup_state < $UFILE`
+STATE=$(jq -r -e .backup_state < "$UFILE")
if test "$STATE" != "SECRET_EDITING"
then
- jq -e . $UFILE
+ jq -e . "$UFILE"
exit_fail "Expected new state to be 'SECRET_EDITING', got '$STATE'"
fi
-FEES=`jq -r -e '.upload_fees[0].fee' < $UFILE`
+FEES=$(jq -r -e '.upload_fees[0].fee' < "$UFILE")
# 4x 4.99 for annual fees, plus 4x0.01 for truth uploads
-if test "$FEES" != "TESTKUDOS:20"
+if [ "$FEES" != "TESTKUDOS:20" ]
then
- jq -e . $UFILE
+ jq -e . "$UFILE"
exit_fail "Expected upload fees to be 'TESTKUDOS:20', got '$FEES'"
fi
echo " DONE"
-echo -en $COLOR$BOLD"Test advance to payment ..."$NORM$NOCOLOR
+echo -en "${COLOR}${BOLD}Test advance to payment ...${NORM}${NOCOLOR}"
-$PREFIX anastasis-reducer next $UFILE $TFILE
+$PREFIX anastasis-reducer next "$UFILE" "$TFILE"
-STATE=`jq -r -e .backup_state < $TFILE`
-if test "$STATE" != "TRUTHS_PAYING"
+STATE=$(jq -r -e .backup_state < "$TFILE")
+if [ "$STATE" != "TRUTHS_PAYING" ]
then
- jq -e . $TFILE
+ jq -e . "$TFILE"
exit_fail "Expected new state to be 'TRUTHS_PAYING', got '$STATE'"
fi
# FIXME: this test is specific to how the
# C reducer stores state (redundantly!), should converge eventually!
-#TMETHOD=`jq -r -e '.policies[0].methods[0].truth.type' < $TFILE`
+#TMETHOD=$(jq -r -e '.policies[0].methods[0].truth.type' < $TFILE)
#if test $TMETHOD != "question"
#then
# exit_fail "Expected method to be >='question', got $TMETHOD"
@@ -342,85 +223,115 @@ fi
#Pay
-echo -en $COLOR$BOLD"Withdrawing amount to wallet ..."$NORM$NOCOLOR
+echo -en "${COLOR}${BOLD}Withdrawing amount to wallet ...${NORM}${NOCOLOR}"
+
+EXCHANGE_URL="$(taler-config -c "$CONF" -s exchange -o BASE_URL)"
-rm $WALLET_DB
-taler-wallet-cli --no-throttle --wallet-db=$WALLET_DB api 'withdrawTestBalance' \
+rm "$WALLET_DB"
+taler-wallet-cli \
+ --no-throttle \
+ --wallet-db="$WALLET_DB" \
+ api \
+ --expect-success 'withdrawTestBalance' \
"$(jq -n '
{
amount: "TESTKUDOS:40",
- bankBaseUrl: $BANK_URL,
+ corebankApiBaseUrl: $BANK_URL,
exchangeBaseUrl: $EXCHANGE_URL
}' \
- --arg BANK_URL "$BANK_URL" \
- --arg EXCHANGE_URL "$EXCHANGE_URL"
- )" 2>wallet.err >wallet.log
-taler-wallet-cli --wallet-db=$WALLET_DB run-until-done 2>wallet.err >wallet.log
+ --arg BANK_URL "${BANK_URL}" \
+ --arg EXCHANGE_URL "${EXCHANGE_URL}"
+ )" 2>wallet-withdraw.err \
+ >wallet-withdraw.log
+taler-wallet-cli \
+ --no-throttle \
+ --wallet-db="$WALLET_DB" \
+ run-until-done \
+ 2>wallet-withdraw-finish.err \
+ >wallet-withdraw-finish.log
echo " OK"
-echo -en $COLOR$BOLD"Making payments for truth uploads ... "$NORM$NOCOLOR
-OBJECT_SIZE=`jq -r -e '.payments | length' < $TFILE`
-for ((INDEX=0; INDEX < $OBJECT_SIZE; INDEX++))
+echo -en "${COLOR}${BOLD}Making payments for truth uploads ... ${NORM}${NOCOLOR}"
+OBJECT_SIZE=$(jq -r -e '.payments | length' < "$TFILE")
+for ((INDEX=0; INDEX < "$OBJECT_SIZE"; INDEX++))
do
- PAY_URI=`jq --argjson INDEX $INDEX -r -e '.payments[$INDEX]' < $TFILE`
+ PAY_URI=$(jq --argjson INDEX $INDEX -r -e '.payments[$INDEX]' < "$TFILE")
# run wallet CLI
echo -n "$INDEX"
- taler-wallet-cli --wallet-db=$WALLET_DB handle-uri $PAY_URI -y 2>wallet.err >wallet.log
+ taler-wallet-cli \
+ --no-throttle \
+ --wallet-db="$WALLET_DB" \
+ handle-uri "${PAY_URI}" \
+ -y \
+ 2>wallet-pay1.err \
+ >wallet-pay1.log
echo -n ","
done
echo " OK"
-echo -e $COLOR$BOLD"Running wallet run-pending..."$NORM$NOCOLOR
-taler-wallet-cli --wallet-db=$WALLET_DB run-pending 2>wallet.err >wallet.log
-echo -e $COLOR$BOLD"Payments done"$NORM$NOCOLOR
-
-
-echo -en $COLOR$BOLD"Try to upload again ..."$NORM$NOCOLOR
-$PREFIX anastasis-reducer pay $TFILE $UFILE
-mv $UFILE $TFILE
+echo -e "${COLOR}${BOLD}Running wallet run-until-done...${NORM}${NOCOLOR}"
+taler-wallet-cli \
+ --wallet-db="$WALLET_DB" \
+ run-until-done \
+ 2>wallet-pay-finish.err \
+ >wallet-pay-finish.log
+echo -e "${COLOR}${BOLD}Payments done${NORM}${NOCOLOR}"
+
+
+echo -en "${COLOR}${BOLD}Try to upload again ...${NORM}${NOCOLOR}"
+$PREFIX anastasis-reducer pay "$TFILE" "$UFILE"
+mv "$UFILE" "$TFILE"
echo " OK"
-STATE=`jq -r -e .backup_state < $TFILE`
-if test "$STATE" != "POLICIES_PAYING"
+STATE="$(jq -r -e .backup_state < "$TFILE")"
+if [ "$STATE" != "POLICIES_PAYING" ]
then
exit_fail "Expected new state to be 'POLICIES_PAYING', got '$STATE'"
fi
-export TFILE
-export UFILE
-
-echo -en $COLOR$BOLD"Making payments for policy uploads ... "$NORM$NOCOLOR
-OBJECT_SIZE=`jq -r -e '.policy_payment_requests | length' < $TFILE`
-for ((INDEX=0; INDEX < $OBJECT_SIZE; INDEX++))
+echo -en "${COLOR}${BOLD}Making payments for policy uploads ... ${NORM}${NOCOLOR}"
+OBJECT_SIZE="$(jq -r -e '.policy_payment_requests | length' < "$TFILE")"
+for ((INDEX=0; INDEX < "$OBJECT_SIZE"; INDEX++))
do
- PAY_URI=`jq --argjson INDEX $INDEX -r -e '.policy_payment_requests[$INDEX].payto' < $TFILE`
+ PAY_URI="$(jq --argjson INDEX "$INDEX" -r -e '.policy_payment_requests[$INDEX].payto' < "$TFILE")"
# run wallet CLI
export PAY_URI
echo -n "$INDEX"
- taler-wallet-cli --wallet-db=$WALLET_DB handle-uri $PAY_URI -y 2>wallet.err >wallet.log
+ taler-wallet-cli \
+ --wallet-db="$WALLET_DB" \
+ handle-uri "$PAY_URI" \
+ -y \
+ 2>"wallet-pay2-$INDEX.err" \
+ >"wallet-pay2-$INDEX.log"
echo -n ","
done
echo " OK"
-echo -e $COLOR$BOLD"Running wallet run-pending..."$NORM$NOCOLOR
-taler-wallet-cli --wallet-db=$WALLET_DB run-pending 2>wallet.err >wallet.log
-echo -e $COLOR$BOLD"Payments done"$NORM$NOCOLOR
+echo -e "${COLOR}${BOLD}Running wallet run-until-done...${NORM}${NOCOLOR}"
+taler-wallet-cli \
+ --wallet-db="$WALLET_DB" \
+ run-until-done \
+ 2>wallet-pay2-finish.err \
+ >wallet-pay2-finish.log
+echo -e "${COLOR}${BOLD}Payments done${NORM}${NOCOLOR}"
-echo -en $COLOR$BOLD"Try to upload again ..."$NORM$NOCOLOR
-$PREFIX anastasis-reducer pay $TFILE $UFILE
+echo -en "${COLOR}${BOLD}Try to upload again ...${NORM}${NOCOLOR}"
+$PREFIX anastasis-reducer pay "$TFILE" "$UFILE"
echo " OK"
echo -n "Final checks ..."
-STATE=`jq -r -e .backup_state < $UFILE`
-if test "$STATE" != "BACKUP_FINISHED"
+STATE=$(jq -r -e .backup_state < "$UFILE")
+if [ "$STATE" != "BACKUP_FINISHED" ]
then
exit_fail "Expected new state to be BACKUP_FINISHED, got $STATE"
fi
-jq -r -e .core_secret < $UFILE > /dev/null && exit_fail "'core_secret' was not cleared upon success"
+jq -r -e .core_secret \
+ < "$UFILE" \
+ > /dev/null \
+ && exit_fail "'core_secret' was not cleared upon success"
echo " OK"
-
exit 0
diff --git a/src/cli/test_anastasis_reducer_recovery_enter_user_attributes.sh b/src/cli/test_anastasis_reducer_recovery_enter_user_attributes.sh
index 49814cd..551ab36 100755
--- a/src/cli/test_anastasis_reducer_recovery_enter_user_attributes.sh
+++ b/src/cli/test_anastasis_reducer_recovery_enter_user_attributes.sh
@@ -1,28 +1,64 @@
#!/bin/bash
# This file is in the public domain.
+# shellcheck disable=SC2317
+
set -eu
-# Exit, with status code "skip" (no 'real' failure)
-function exit_skip() {
- echo " SKIP: $1"
- exit 77
-}
+# Replace with 0 for nexus...
+USE_FAKEBANK=1
+if [ 1 = "$USE_FAKEBANK" ]
+then
+ ACCOUNT="exchange-account-2"
+ WIRE_METHOD="x-taler-bank"
+ BANK_FLAGS="-f -d $WIRE_METHOD -u $ACCOUNT"
+ BANK_URL="http://localhost:18082/"
+ MERCHANT_PAYTO="payto://x-taler-bank/localhost/anastasis?receiver-name=anastasis"
+else
+ ACCOUNT="exchange-account-1"
+ WIRE_METHOD="iban"
+ BANK_FLAGS="-ns -d $WIRE_METHOD -u $ACCOUNT"
+ BANK_URL="http://localhost:18082/"
+ MERCHANT_PAYTO="payto://iban/SANDBOXX/DE648226?receiver-name=anastasis"
+fi
-# Exit, with error message (hard failure)
-function exit_fail() {
- echo " FAIL: $1"
- exit 1
-}
+# Check we can actually run
+echo -n "Testing for jq"
+jq -h > /dev/null || exit_skip "jq required"
+echo " FOUND"
+echo -n "Testing for anastasis-reducer ..."
+anastasis-reducer -h > /dev/null || exit_skip "anastasis-reducer required"
+echo " FOUND"
+
+echo -n "Testing for taler"
+taler-exchange-httpd -h > /dev/null || exit_skip " taler-exchange required"
+taler-merchant-httpd -h > /dev/null || exit_skip " taler-merchant required"
+echo " FOUND"
+
+echo -n "Testing for taler-wallet-cli"
+taler-wallet-cli -v >/dev/null </dev/null || exit_skip " MISSING"
+echo " FOUND"
+
+echo -n "Testing for anastasis-httpd"
+anastasis-httpd -h >/dev/null </dev/null || exit_skip " MISSING"
+echo " FOUND"
+
+. setup.sh
+# Launch exchange, merchant and bank.
+# shellcheck disable=SC2086
+setup -c "test_reducer.conf" \
+ -aemw \
+ $BANK_FLAGS
# Cleanup to run whenever we exit
function cleanup()
{
- for n in `jobs -p`
+ exit_cleanup
+ for n in $(jobs -p)
do
- kill $n 2> /dev/null || true
+ kill "$n" 2> /dev/null || true
done
- rm -rf $CONF $WALLET_DB $R1FILE $R2FILE $B1FILE $B2FILE $TMP_DIR
+ rm -rf "$CONF" "$WALLET_DB" "$R1FILE" "$R2FILE" "$B1FILE" "$B2FILE" "$TMP_DIR"
wait
}
@@ -33,25 +69,28 @@ function sync_providers() {
# Sync with providers (up to 3 providers aren't synced here)
for x in 1 2 3; do
echo "Synchronizing providers (round $x)"
- anastasis-reducer sync_providers < $infile > $outfile 2> /dev/null || true
- CODE=$(jq -r -e ".code // 0" < $outfile)
+ anastasis-reducer sync_providers < "$infile" > "$outfile" 2> /dev/null || true
+ CODE=$(jq -r -e ".code // 0" < "$outfile")
# ANASTASIS_REDUCER_PROVIDERS_ALREADY_SYNCED
# FIXME: Temporary workaround for C reducer. See #7227.
- if test "$CODE" = "8420"; then
+ if [ "$CODE" = "8420" ]
+ then
# restore previous non-error state
- cat $infile > $outfile
+ cat "$infile" > "$outfile"
break
fi
# ANASTASIS_REDUCER_ACTION_INVALID
- if test "$CODE" = "8400"; then
+ if [ "$CODE" = "8400" ]
+ then
# restore previous non-error state
- cat $infile > $outfile
+ cat "$infile" > "$outfile"
break
fi
- if test "$CODE" != "0"; then
+ if [ "$CODE" != "0" ]
+ then
exit_fail "Expected no error or 8420/8400, got $CODE"
fi
- cat $outfile > $infile
+ cat "$outfile" > "$infile"
done
echo "Providers synced."
}
@@ -65,211 +104,56 @@ CONF_4="test_anastasis_reducer_4.conf"
# Configuration file will be edited, so we create one
# from the template.
-CONF=`mktemp test_reducerXXXXXX.conf`
-cp test_reducer.conf $CONF
+CONF="$(mktemp -p "${TMPDIR:-/tmp}" test_reducerXXXXXX.conf)"
+cp test_reducer.conf "$CONF"
-TMP_DIR=`mktemp -d keys-tmp-XXXXXX`
-WALLET_DB=`mktemp test_reducer_walletXXXXXX.json`
-B1FILE=`mktemp test_reducer_stateB1XXXXXX`
-B2FILE=`mktemp test_reducer_stateB2XXXXXX`
-R1FILE=`mktemp test_reducer_stateR1XXXXXX`
-R2FILE=`mktemp test_reducer_stateR2XXXXXX`
+TMP_DIR=$(mktemp -p "${TMPDIR:-/tmp}" -d keys-tmp-XXXXXX)
+WALLET_DB=$(mktemp -p "${TMPDIR:-/tmp}" test_reducer_walletXXXXXX.json)
+B1FILE=$(mktemp -p "${TMPDIR:-/tmp}" test_reducer_stateB1XXXXXX)
+B2FILE=$(mktemp -p "${TMPDIR:-/tmp}" test_reducer_stateB2XXXXXX)
+R1FILE=$(mktemp -p "${TMPDIR:-/tmp}" test_reducer_stateR1XXXXXX)
+R2FILE=$(mktemp -p "${TMPDIR:-/tmp}" test_reducer_stateR2XXXXXX)
# Install cleanup handler (except for kill -9)
trap cleanup EXIT
-# Check we can actually run
-echo -n "Testing for jq"
-jq -h > /dev/null || exit_skip "jq required"
-echo " FOUND"
-echo -n "Testing for anastasis-reducer ..."
-anastasis-reducer -h > /dev/null || exit_skip "anastasis-reducer required"
-echo " FOUND"
-
-echo -n "Testing for taler"
-taler-exchange-httpd -h > /dev/null || exit_skip " taler-exchange required"
-taler-merchant-httpd -h > /dev/null || exit_skip " taler-merchant required"
-echo " FOUND"
-
-echo -n "Testing for taler-bank-manage"
-taler-bank-manage --help >/dev/null </dev/null || exit_skip " MISSING"
-echo " FOUND"
-echo -n "Testing for taler-wallet-cli"
-taler-wallet-cli -v >/dev/null </dev/null || exit_skip " MISSING"
-echo " FOUND"
-
-echo -n "Testing for anastasis-httpd"
-anastasis-httpd -h >/dev/null </dev/null || exit_skip " MISSING"
-echo " FOUND"
-
echo -n "Initialize anastasis database ..."
# Name of the Postgres database we will use for the script.
# Will be dropped, do NOT use anything that might be used
# elsewhere
-TARGET_DB_1=`anastasis-config -c $CONF_1 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"`
-TARGET_DB_2=`anastasis-config -c $CONF_2 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"`
-TARGET_DB_3=`anastasis-config -c $CONF_3 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"`
-TARGET_DB_4=`anastasis-config -c $CONF_4 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"`
-
-dropdb $TARGET_DB_1 >/dev/null 2>/dev/null || true
-createdb $TARGET_DB_1 || exit_skip "Could not create database $TARGET_DB_1"
-anastasis-dbinit -c $CONF_1 2> anastasis-dbinit_1.log
-dropdb $TARGET_DB_2 >/dev/null 2>/dev/null || true
-createdb $TARGET_DB_2 || exit_skip "Could not create database $TARGET_DB_2"
-anastasis-dbinit -c $CONF_2 2> anastasis-dbinit_2.log
-dropdb $TARGET_DB_3 >/dev/null 2>/dev/null || true
-createdb $TARGET_DB_3 || exit_skip "Could not create database $TARGET_DB_3"
-anastasis-dbinit -c $CONF_3 2> anastasis-dbinit_3.log
-dropdb $TARGET_DB_4 >/dev/null 2>/dev/null || true
-createdb $TARGET_DB_4 || exit_skip "Could not create database $TARGET_DB_4"
-anastasis-dbinit -c $CONF_4 2> anastasis-dbinit_4.log
-
-echo " OK"
-
-echo -n "Generating Taler auditor, exchange and merchant configurations ..."
-
-DATA_DIR=`taler-config -f -c $CONF -s PATHS -o TALER_HOME`
-rm -rf $DATA_DIR
-
-# obtain key configuration data
-MASTER_PRIV_FILE=`taler-config -f -c $CONF -s "EXCHANGE-OFFLINE" -o "MASTER_PRIV_FILE"`
-MASTER_PRIV_DIR=`dirname $MASTER_PRIV_FILE`
-mkdir -p $MASTER_PRIV_DIR
-gnunet-ecc -g1 $MASTER_PRIV_FILE > /dev/null 2> /dev/null
-MASTER_PUB=`gnunet-ecc -p $MASTER_PRIV_FILE`
-EXCHANGE_URL=`taler-config -c $CONF -s EXCHANGE -o BASE_URL`
-MERCHANT_PORT=`taler-config -c $CONF -s MERCHANT -o PORT`
-MERCHANT_URL=http://localhost:${MERCHANT_PORT}/
-BANK_PORT=`taler-config -c $CONF -s BANK -o HTTP_PORT`
-BANK_URL=http://localhost:${BANK_PORT}/
-AUDITOR_URL=http://localhost:8083/
-AUDITOR_PRIV_FILE=`taler-config -f -c $CONF -s AUDITOR -o AUDITOR_PRIV_FILE`
-AUDITOR_PRIV_DIR=`dirname $AUDITOR_PRIV_FILE`
-mkdir -p $AUDITOR_PRIV_DIR
-gnunet-ecc -g1 $AUDITOR_PRIV_FILE > /dev/null 2> /dev/null
-AUDITOR_PUB=`gnunet-ecc -p $AUDITOR_PRIV_FILE`
-
-# patch configuration
-TALER_DB=talercheck
-taler-config -c $CONF -s exchange -o MASTER_PUBLIC_KEY -V $MASTER_PUB
-taler-config -c $CONF -s merchant-exchange-default -o MASTER_KEY -V $MASTER_PUB
-taler-config -c $CONF -s exchangedb-postgres -o CONFIG -V postgres:///$TALER_DB
-taler-config -c $CONF -s auditordb-postgres -o CONFIG -V postgres:///$TALER_DB
-taler-config -c $CONF -s merchantdb-postgres -o CONFIG -V postgres:///$TALER_DB
-taler-config -c $CONF -s bank -o database -V postgres:///$TALER_DB
-taler-config -c $CONF -s exchange -o KEYDIR -V "${TMP_DIR}/keydir/"
-taler-config -c $CONF -s exchange -o REVOCATION_DIR -V "${TMP_DIR}/revdir/"
-
-echo " OK"
-
-echo -n "Setting up exchange ..."
-
-# reset database
-dropdb $TALER_DB >/dev/null 2>/dev/null || true
-createdb $TALER_DB || exit_skip "Could not create database $TALER_DB"
-taler-exchange-dbinit -c $CONF
-taler-merchant-dbinit -c $CONF
-taler-auditor-dbinit -c $CONF
-taler-auditor-exchange -c $CONF -m $MASTER_PUB -u $EXCHANGE_URL
-
-echo " OK"
-
-# Launch services
-echo -n "Launching taler services ..."
-taler-bank-manage-testing $CONF postgres:///$TALER_DB serve > taler-bank.log 2> taler-bank.err &
-taler-exchange-secmod-eddsa -c $CONF 2> taler-exchange-secmod-eddsa.log &
-taler-exchange-secmod-rsa -c $CONF 2> taler-exchange-secmod-rsa.log &
-taler-exchange-secmod-cs -c $CONF 2> taler-exchange-secmod-cs.log &
-taler-exchange-httpd -c $CONF 2> taler-exchange-httpd.log &
-taler-merchant-httpd -c $CONF -L INFO 2> taler-merchant-httpd.log &
-taler-exchange-wirewatch -c $CONF 2> taler-exchange-wirewatch.log &
-taler-auditor-httpd -L INFO -c $CONF 2> taler-auditor-httpd.log &
+TARGET_DB_1=$(anastasis-config -c $CONF_1 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///")
+TARGET_DB_2=$(anastasis-config -c $CONF_2 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///")
+TARGET_DB_3=$(anastasis-config -c $CONF_3 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///")
+TARGET_DB_4=$(anastasis-config -c $CONF_4 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///")
+
+dropdb "$TARGET_DB_1" >/dev/null 2>/dev/null || true
+createdb "$TARGET_DB_1" || exit_skip "Could not create database $TARGET_DB_1"
+anastasis-dbinit -c "$CONF_1" 2> anastasis-dbinit_1.log
+dropdb "$TARGET_DB_2" >/dev/null 2>/dev/null || true
+createdb "$TARGET_DB_2" || exit_skip "Could not create database $TARGET_DB_2"
+anastasis-dbinit -c "$CONF_2" 2> anastasis-dbinit_2.log
+dropdb "$TARGET_DB_3" >/dev/null 2>/dev/null || true
+createdb "$TARGET_DB_3" || exit_skip "Could not create database $TARGET_DB_3"
+anastasis-dbinit -c "$CONF_3" 2> anastasis-dbinit_3.log
+dropdb "$TARGET_DB_4" >/dev/null 2>/dev/null || true
+createdb "$TARGET_DB_4" || exit_skip "Could not create database $TARGET_DB_4"
+anastasis-dbinit -c "$CONF_4" 2> anastasis-dbinit_4.log
echo " OK"
echo -n "Launching anastasis services ..."
PREFIX="" #valgrind
-$PREFIX anastasis-httpd -c $CONF_1 2> anastasis-httpd_1.log &
-$PREFIX anastasis-httpd -c $CONF_2 2> anastasis-httpd_2.log &
-$PREFIX anastasis-httpd -c $CONF_3 2> anastasis-httpd_3.log &
-$PREFIX anastasis-httpd -c $CONF_4 2> anastasis-httpd_4.log &
-
-# Wait for bank to be available (usually the slowest)
-for n in `seq 1 50`
-do
- echo -n "."
- sleep 0.2
- OK=0
- # bank
- wget --tries=1 --timeout=1 http://localhost:8082/ -o /dev/null -O /dev/null >/dev/null || continue
- OK=1
- break
-done
-
-if [ 1 != $OK ]
-then
- exit_skip "Failed to launch services (bank)"
-fi
-
-# Wait for all other taler services to be available
-for n in `seq 1 50`
-do
- echo -n "."
- sleep 0.1
- OK=0
- # exchange
- wget --tries=1 --timeout=1 http://localhost:8081/seed -o /dev/null -O /dev/null >/dev/null || continue
- # merchant
- wget --tries=1 --timeout=1 http://localhost:9966/ -o /dev/null -O /dev/null >/dev/null || continue
- # auditor
- wget --tries=1 --timeout=1 http://localhost:8083/ -o /dev/null -O /dev/null >/dev/null || continue
- OK=1
- break
-done
-
-if [ 1 != $OK ]
-then
- exit_skip "Failed to launch taler services"
-fi
+$PREFIX anastasis-httpd -c "$CONF_1" 2> anastasis-httpd_1.log &
+$PREFIX anastasis-httpd -c "$CONF_2" 2> anastasis-httpd_2.log &
+$PREFIX anastasis-httpd -c "$CONF_3" 2> anastasis-httpd_3.log &
+$PREFIX anastasis-httpd -c "$CONF_4" 2> anastasis-httpd_4.log &
echo "OK"
-echo -n "Setting up keys ..."
-taler-exchange-offline -c $CONF \
- download \
- sign \
- enable-account payto://x-taler-bank/localhost/Exchange \
- enable-auditor $AUDITOR_PUB $AUDITOR_URL "TESTKUDOS Auditor" \
- wire-fee now x-taler-bank TESTKUDOS:0.01 TESTKUDOS:0.01 TESTKUDOS:0.01 \
- upload &> taler-exchange-offline.log
-
-echo -n "."
-
-for n in `seq 1 3`
-do
- echo -n "."
- OK=0
- wget --tries=1 --timeout=1 http://localhost:8081/keys -o /dev/null -O /dev/null >/dev/null || continue
- OK=1
- break
-done
-
-if [ 1 != $OK ]
-then
- exit_skip "Failed to setup keys"
-fi
-
-echo " OK"
-
-echo -n "Setting up auditor signatures ..."
-taler-auditor-offline -c $CONF \
- download sign upload &> taler-auditor-offline.log
-echo " OK"
-
echo -n "Waiting for anastasis services ..."
# Wait for anastasis services to be available
-for n in `seq 1 50`
+for n in $(seq 1 50)
do
echo -n "."
sleep 0.1
@@ -286,7 +170,7 @@ do
break
done
-if [ 1 != $OK ]
+if [ 1 != "$OK" ]
then
exit_skip "Failed to launch anastasis services"
fi
@@ -295,31 +179,32 @@ echo "OK"
echo -n "Configuring merchant instance ..."
# Setup merchant
-curl -H "Content-Type: application/json" -X POST -d '{"auth":{"method":"external"},"payto_uris":["payto://x-taler-bank/localhost/43"],"id":"default","name":"default","address":{},"jurisdiction":{},"default_max_wire_fee":"TESTKUDOS:1", "default_max_deposit_fee":"TESTKUDOS:1","default_wire_fee_amortization":1,"default_wire_transfer_delay":{"d_ms" : 3600000},"default_pay_delay":{"d_ms": 3600000}}' http://localhost:9966/management/instances
+curl -H "Content-Type: application/json" -X POST -d '{"auth":{"method":"external"},"id":"default","name":"default","user_type":"business","address":{},"jurisdiction":{},"use_stefan":true,"default_wire_transfer_delay":{"d_us" : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' http://localhost:9966/management/instances
+curl -H "Content-Type: application/json" -X POST -d '{"payto_uri":"'"$MERCHANT_PAYTO"'"}' http://localhost:9966/private/accounts
echo " DONE"
echo -n "Running backup logic ...,"
-anastasis-reducer -b > $B1FILE
+anastasis-reducer -b > "$B1FILE"
echo -n "."
anastasis-reducer -a \
'{"continent": "Demoworld"}' \
- select_continent < $B1FILE > $B2FILE
+ select_continent < "$B1FILE" > "$B2FILE"
echo -n "."
anastasis-reducer -a \
'{"country_code": "xx"}' \
- select_country < $B2FILE > $B1FILE
+ select_country < "$B2FILE" > "$B1FILE"
echo -n "."
anastasis-reducer -a \
'{"identity_attributes": {
"full_name": "Max Musterman",
"sq_number": "4",
"birthdate": "2000-01-01"}}' \
- enter_user_attributes < $B1FILE > $B2FILE
-cat $B2FILE > $B1FILE
+ enter_user_attributes < "$B1FILE" > "$B2FILE"
+cat "$B2FILE" > "$B1FILE"
echo -n ","
-sync_providers $B1FILE $B2FILE
+sync_providers "$B1FILE" "$B2FILE"
echo -n ","
# "91GPWWR" encodes "Hans"
anastasis-reducer -a \
@@ -328,7 +213,7 @@ anastasis-reducer -a \
"instructions": "What is your name?",
"challenge": "91GPWWR"
} }' \
- add_authentication < $B2FILE > $B1FILE
+ add_authentication < "$B2FILE" > "$B1FILE"
echo -n "."
# "64S36" encodes "123"
anastasis-reducer -a \
@@ -337,7 +222,7 @@ anastasis-reducer -a \
"instructions": "How old are you?",
"challenge": "64S36"
} }' \
- add_authentication < $B1FILE > $B2FILE
+ add_authentication < "$B1FILE" > "$B2FILE"
echo -n "."
# "9NGQ4WR" encodes "Mars"
anastasis-reducer -a \
@@ -346,155 +231,177 @@ anastasis-reducer -a \
"instructions": "Where do you live?",
"challenge": "9NGQ4WR"
} }' \
- add_authentication < $B2FILE > $B1FILE
+ add_authentication < "$B2FILE" > "$B1FILE"
echo -n "."
# Finished adding authentication methods
anastasis-reducer \
- next < $B1FILE > $B2FILE
+ next < "$B1FILE" > "$B2FILE"
echo -n ","
# Finished policy review
anastasis-reducer \
- next < $B2FILE > $B1FILE
+ next < "$B2FILE" > "$B1FILE"
echo -n "."
# Note: 'secret' must here be a Crockford base32-encoded value
anastasis-reducer -a \
'{"secret": { "value" : "VERYHARDT0GVESSSECRET", "mime" : "text/plain" }}' \
- enter_secret < $B1FILE > $B2FILE
-mv $B2FILE $B1FILE
-anastasis-reducer next $B1FILE $B2FILE
+ enter_secret < "$B1FILE" > "$B2FILE"
+mv "$B2FILE" "$B1FILE"
+anastasis-reducer next "$B1FILE" "$B2FILE"
echo " OK"
echo -n "Preparing wallet"
-rm $WALLET_DB
-taler-wallet-cli --no-throttle --wallet-db=$WALLET_DB api 'withdrawTestBalance' \
+
+EXCHANGE_URL="$(taler-config -c "$CONF" -s exchange -o BASE_URL)"
+
+rm -f "$WALLET_DB"
+taler-wallet-cli --no-throttle --wallet-db="$WALLET_DB" api --expect-success 'withdrawTestBalance' \
"$(jq -n '
{
amount: "TESTKUDOS:100",
- bankBaseUrl: $BANK_URL,
+ corebankApiBaseUrl: $BANK_URL,
exchangeBaseUrl: $EXCHANGE_URL
}' \
- --arg BANK_URL "$BANK_URL" \
+ --arg BANK_URL "${BANK_URL}" \
--arg EXCHANGE_URL "$EXCHANGE_URL"
- )" 2> /dev/null >/dev/null
-taler-wallet-cli --wallet-db=$WALLET_DB run-until-done 2>/dev/null >/dev/null
+ )" 2> wallet-withdraw.err > wallet-withdraw.out
+taler-wallet-cli \
+ --wallet-db="$WALLET_DB" \
+ run-until-done \
+ 2>wallet-withdraw-finish.err \
+ >wallet-withdraw-finish.out
echo " OK"
echo -en "Making payments for truth uploads ... "
-OBJECT_SIZE=`jq -r -e '.payments | length' < $B2FILE`
-for ((INDEX=0; INDEX < $OBJECT_SIZE; INDEX++))
+OBJECT_SIZE=$(jq -r -e '.payments | length' < "$B2FILE")
+for ((INDEX=0; INDEX < "$OBJECT_SIZE"; INDEX++))
do
- PAY_URI=`jq --argjson INDEX $INDEX -r -e '.payments[$INDEX]' < $B2FILE`
+ PAY_URI=$(jq --argjson INDEX $INDEX -r -e '.payments[$INDEX]' < "$B2FILE")
# run wallet CLI
echo -n "$INDEX"
- taler-wallet-cli --wallet-db=$WALLET_DB handle-uri $PAY_URI -y 2>/dev/null >/dev/null
+ taler-wallet-cli \
+ --wallet-db="$WALLET_DB" \
+ handle-uri "$PAY_URI" \
+ -y \
+ 2>"wallet-pay-truth-$INDEX.err" \
+ >"wallet-pay-truth-$INDEX.out"
echo -n ", "
done
echo "OK"
-echo -e "Running wallet run-pending..."
-taler-wallet-cli --wallet-db=$WALLET_DB run-pending 2>/dev/null >/dev/null
+echo -e "Running wallet run-until-done..."
+taler-wallet-cli \
+ --wallet-db="$WALLET_DB" \
+ run-until-done \
+ 2>"wallet-pay-truth-finish-$INDEX.err" \
+ >"wallet-pay-truth-finish-$INDEX.out"
echo -e "Payments done"
-export B2FILE
-export B1FILE
-
echo -en "Try to upload again ..."
-$PREFIX anastasis-reducer pay $B2FILE $B1FILE
-mv $B1FILE $B2FILE
+$PREFIX anastasis-reducer pay "$B2FILE" "$B1FILE"
+mv "$B1FILE" "$B2FILE"
echo " OK"
echo -en "Making payments for policy uploads ... "
-OBJECT_SIZE=`jq -r -e '.policy_payment_requests | length' < $B2FILE`
-for ((INDEX=0; INDEX < $OBJECT_SIZE; INDEX++))
+OBJECT_SIZE=$(jq -r -e '.policy_payment_requests | length' < "$B2FILE")
+for ((INDEX=0; INDEX < "$OBJECT_SIZE"; INDEX++))
do
- PAY_URI=`jq --argjson INDEX $INDEX -r -e '.policy_payment_requests[$INDEX].payto' < $B2FILE`
+ PAY_URI=$(jq --argjson INDEX $INDEX -r -e '.policy_payment_requests[$INDEX].payto' < "$B2FILE")
# run wallet CLI
echo -n "$INDEX"
- taler-wallet-cli --wallet-db=$WALLET_DB handle-uri $PAY_URI -y 2>/dev/null >/dev/null
+ taler-wallet-cli \
+ --wallet-db="$WALLET_DB" \
+ handle-uri "$PAY_URI" \
+ -y \
+ 2>"wallet-pay-policy-$INDEX.err" \
+ >"wallet-pay-policy-$INDEX.out"
echo -n ", "
done
echo " OK"
-echo -en "Running wallet run-pending..."
-taler-wallet-cli --wallet-db=$WALLET_DB run-pending 2>/dev/null >/dev/null
+echo -en "Running wallet run-until-done..."
+taler-wallet-cli \
+ --wallet-db="$WALLET_DB" \
+ run-until-done \
+ 2>wallet-pay-policy-finish.err \
+ >wallet-pay-policy-finish.out
echo -e " payments DONE"
echo -en "Try to upload again ..."
anastasis-reducer \
- pay < $B2FILE > $B1FILE
+ pay < "$B2FILE" > "$B1FILE"
echo " OK: Backup finished"
echo -n "Final backup checks ..."
-STATE=`jq -r -e .backup_state < $B1FILE`
-if test "$STATE" != "BACKUP_FINISHED"
+STATE=$(jq -r -e .backup_state < "$B1FILE")
+if [ "$STATE" != "BACKUP_FINISHED" ]
then
exit_fail "Expected new state to be 'BACKUP_FINISHED', got '$STATE'"
fi
-jq -r -e .core_secret < $B1FILE > /dev/null && exit_fail "'core_secret' was not cleared upon success"
+jq -r -e .core_secret < "$B1FILE" > /dev/null && exit_fail "'core_secret' was not cleared upon success"
echo " OK"
echo -n "Running recovery basic logic ..."
-anastasis-reducer -r > $R1FILE
+anastasis-reducer -r > "$R1FILE"
anastasis-reducer -a \
'{"continent": "Demoworld"}' \
- select_continent < $R1FILE > $R2FILE
+ select_continent < "$R1FILE" > "$R2FILE"
anastasis-reducer -a \
'{"country_code": "xx"}' \
- select_country < $R2FILE > $R1FILE
-anastasis-reducer -a '{"identity_attributes": { "full_name": "Max Musterman", "sq_number": "4", "birthdate": "2000-01-01" }}' enter_user_attributes < $R1FILE > $R2FILE
+ select_country < "$R2FILE" > "$R1FILE"
+anastasis-reducer -a '{"identity_attributes": { "full_name": "Max Musterman", "sq_number": "4", "birthdate": "2000-01-01" }}' enter_user_attributes < "$R1FILE" > "$R2FILE"
-STATE=`jq -r -e .recovery_state < $R2FILE`
-if test "$STATE" != "SECRET_SELECTING"
+STATE=$(jq -r -e .recovery_state < "$R2FILE")
+if [ "$STATE" != "SECRET_SELECTING" ]
then
exit_fail "Expected new state to be 'SECRET_SELECTING', got '$STATE'"
fi
echo " OK"
echo -n "Adding provider (to ensure it is loaded)"
-anastasis-reducer -a '{"provider_url" : "http://localhost:8086/" }' add_provider < $R2FILE > $R1FILE
+anastasis-reducer -a '{"provider_url" : "http://localhost:8086/" }' add_provider < "$R2FILE" > "$R1FILE"
echo " OK"
echo -n "Selecting secret to recover"
-anastasis-reducer -a '{"attribute_mask": 0, "providers" : [ { "version": 1, "url" : "http://localhost:8086/" } ] }' select_version < $R1FILE > $R2FILE
+anastasis-reducer -a '{"attribute_mask": 0, "providers" : [ { "version": 1, "url" : "http://localhost:8086/" } ] }' select_version < "$R1FILE" > "$R2FILE"
-STATE=`jq -r -e .recovery_state < $R2FILE`
-if test "$STATE" != "CHALLENGE_SELECTING"
+STATE=$(jq -r -e .recovery_state < "$R2FILE")
+if [ "$STATE" != "CHALLENGE_SELECTING" ]
then
exit_fail "Expected new state to be 'CHALLENGE_SELECTING', got '$STATE'"
fi
echo " OK"
-cat $R2FILE > $R1FILE
+cat "$R2FILE" > "$R1FILE"
-sync_providers $R1FILE $R2FILE
+sync_providers "$R1FILE" "$R2FILE"
echo -n "Running challenge logic ..."
-UUID0=`jq -r -e .recovery_information.challenges[0].uuid < $R2FILE`
-UUID1=`jq -r -e .recovery_information.challenges[1].uuid < $R2FILE`
-UUID2=`jq -r -e .recovery_information.challenges[2].uuid < $R2FILE`
-UUID0Q=`jq -r -e .recovery_information.challenges[0].instructions < $R2FILE`
-UUID1Q=`jq -r -e .recovery_information.challenges[1].instructions < $R2FILE`
-UUID2Q=`jq -r -e .recovery_information.challenges[2].instructions < $R2FILE`
+UUID0=$(jq -r -e .recovery_information.challenges[0].uuid < "$R2FILE")
+UUID1=$(jq -r -e .recovery_information.challenges[1].uuid < "$R2FILE")
+UUID2=$(jq -r -e .recovery_information.challenges[2].uuid < "$R2FILE")
+#UUID0Q=$(jq -r -e .recovery_information.challenges[0].instructions < "$R2FILE")
+UUID1Q=$(jq -r -e .recovery_information.challenges[1].instructions < "$R2FILE")
+UUID2Q=$(jq -r -e .recovery_information.challenges[2].instructions < "$R2FILE")
-if test "$UUID2Q" = 'How old are you?'
+if [ "$UUID2Q" = 'How old are you?' ]
then
AGE_UUID=$UUID2
-elif test "$UUID1Q" = 'How old are you?'
+elif [ "$UUID1Q" = 'How old are you?' ]
then
AGE_UUID=$UUID1
else
AGE_UUID=$UUID0
fi
-if test "$UUID2Q" = 'What is your name?'
+if [ "$UUID2Q" = 'What is your name?' ]
then
NAME_UUID=$UUID2
-elif test "$UUID1Q" = 'What is your name?'
+elif [ "$UUID1Q" = 'What is your name?' ]
then
NAME_UUID=$UUID1
else
@@ -508,10 +415,10 @@ anastasis-reducer -a \
}' \
--arg UUID "$NAME_UUID"
)" \
- select_challenge < $R2FILE > $R1FILE
+ select_challenge < "$R2FILE" > "$R1FILE"
anastasis-reducer -a '{"answer": "Hans"}' \
- solve_challenge < $R1FILE > $R2FILE
+ solve_challenge < "$R1FILE" > "$R2FILE"
anastasis-reducer -a \
"$(jq -n '
@@ -520,34 +427,34 @@ anastasis-reducer -a \
}' \
--arg UUID "$AGE_UUID"
)" \
- select_challenge < $R2FILE > $R1FILE
+ select_challenge < "$R2FILE" > "$R1FILE"
anastasis-reducer -a '{"answer": "123"}' \
- solve_challenge < $R1FILE > $R2FILE
+ solve_challenge < "$R1FILE" > "$R2FILE"
echo " OK"
echo -n "Checking recovered secret ..."
# finally: check here that we recovered the secret...
-STATE=`jq -r -e .recovery_state < $R2FILE`
-if test "$STATE" != "RECOVERY_FINISHED"
+STATE=$(jq -r -e .recovery_state < "$R2FILE")
+if [ "$STATE" != "RECOVERY_FINISHED" ]
then
- jq -e . $R2FILE
+ jq -e . "$R2FILE"
exit_fail "Expected new state to be 'RECOVERY_FINISHED', got '$STATE'"
fi
-SECRET=`jq -r -e .core_secret.value < $R2FILE`
-if test "$SECRET" != "VERYHARDT0GVESSSECRET"
+SECRET=$(jq -r -e .core_secret.value < "$R2FILE")
+if [ "$SECRET" != "VERYHARDT0GVESSSECRET" ]
then
- jq -e . $R2FILE
+ jq -e . "$R2FILE"
exit_fail "Expected recovered secret to be 'VERYHARDT0GVESSSECRET', got '$SECRET'"
fi
-MIME=`jq -r -e .core_secret.mime < $R2FILE`
-if test "$MIME" != "text/plain"
+MIME=$(jq -r -e .core_secret.mime < "$R2FILE")
+if [ "$MIME" != "text/plain" ]
then
- jq -e . $R2FILE
+ jq -e . "$R2FILE"
exit_fail "Expected recovered mime to be 'text/plain', got '$MIME'"
fi
diff --git a/src/cli/test_anastasis_reducer_recovery_hanging.sh b/src/cli/test_anastasis_reducer_recovery_hanging.sh
new file mode 100755
index 0000000..f67b850
--- /dev/null
+++ b/src/cli/test_anastasis_reducer_recovery_hanging.sh
@@ -0,0 +1,376 @@
+#!/bin/bash
+# This file is in the public domain.
+# Runs tests with a 'hanging' Anastasis provider.
+
+set -eu
+#set -x
+
+# Exit, with status code "skip" (no 'real' failure)
+function exit_skip() {
+ echo " SKIP: $1"
+ exit 77
+}
+
+# Exit, with error message (hard failure)
+function exit_fail() {
+ echo " FAIL: $1"
+ exit 1
+}
+
+# Cleanup to run whenever we exit
+function cleanup()
+{
+ for n in `jobs -p`
+ do
+ kill -SIGCONT $n # in case suspended...
+ kill $n 2> /dev/null || true
+ done
+ rm -rf $CONF $R1FILE $R2FILE $B1FILE $B2FILE $TMP_DIR
+ wait
+}
+
+function sync_providers() {
+ infile=$1
+ outfile=$2
+ echo "Synchronizing providers"
+ # Sync with providers (up to 3 providers aren't synced here)
+ for x in 1 2 3; do
+ echo "Synchronizing providers (round $x)"
+ #anastasis-reducer sync_providers < $infile > $outfile 2> /dev/null || true
+ anastasis-reducer sync_providers < $infile > $outfile || true
+ CODE=$(jq -r -e ".code // 0" < $outfile)
+ # ANASTASIS_REDUCER_PROVIDERS_ALREADY_SYNCED
+ # FIXME: Temporary workaround for C reducer. See #7227.
+ if test "$CODE" = "8420"; then
+ # restore previous non-error state
+ cat $infile > $outfile
+ break
+ fi
+ # ANASTASIS_REDUCER_ACTION_INVALID
+ if test "$CODE" = "8400"; then
+ # restore previous non-error state
+ cat $infile > $outfile
+ break
+ fi
+ if test "$CODE" != "0"; then
+ exit_fail "Expected no error or 8420/8400, got $CODE"
+ fi
+ cat $outfile > $infile
+ done
+ echo "Providers synced."
+}
+
+
+CONF_1="test_anastasis_reducer_free_1.conf"
+CONF_2="test_anastasis_reducer_free_2.conf"
+CONF_3="test_anastasis_reducer_free_3.conf"
+CONF_4="test_anastasis_reducer_free_4.conf"
+
+
+# Configuration file will be edited, so we create one
+# from the template.
+CONF=`mktemp test_reducerXXXXXX.conf`
+cp test_reducer.conf $CONF
+
+TMP_DIR=`mktemp -d keys-tmp-XXXXXX`
+B1FILE=`mktemp test_reducer_stateB1XXXXXX`
+B2FILE=`mktemp test_reducer_stateB2XXXXXX`
+R1FILE=`mktemp test_reducer_stateR1XXXXXX`
+R2FILE=`mktemp test_reducer_stateR2XXXXXX`
+export B1FILE
+export B2FILE
+export R1FILE
+export R2FILE
+
+# Install cleanup handler (except for kill -9)
+trap cleanup EXIT
+
+# Check we can actually run
+echo -n "Testing for jq"
+jq -h > /dev/null || exit_skip "jq required"
+echo " FOUND"
+echo -n "Testing for timeout"
+timeout --help > /dev/null || exit_skip "timeout required"
+echo " FOUND"
+echo -n "Testing for anastasis-reducer ..."
+anastasis-reducer -h > /dev/null || exit_skip "anastasis-reducer required"
+echo " FOUND"
+
+echo -n "Testing for anastasis-httpd"
+anastasis-httpd -h >/dev/null </dev/null || exit_skip " MISSING"
+echo " FOUND"
+
+echo -n "Initialize anastasis database ..."
+# Name of the Postgres database we will use for the script.
+# Will be dropped, do NOT use anything that might be used
+# elsewhere
+TARGET_DB_1=`anastasis-config -c $CONF_1 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"`
+TARGET_DB_2=`anastasis-config -c $CONF_2 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"`
+TARGET_DB_3=`anastasis-config -c $CONF_3 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"`
+TARGET_DB_4=`anastasis-config -c $CONF_4 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"`
+
+dropdb $TARGET_DB_1 >/dev/null 2>/dev/null || true
+createdb $TARGET_DB_1 || exit_skip "Could not create database $TARGET_DB_1"
+anastasis-dbinit -c $CONF_1 2> anastasis-dbinit_1.log
+dropdb $TARGET_DB_2 >/dev/null 2>/dev/null || true
+createdb $TARGET_DB_2 || exit_skip "Could not create database $TARGET_DB_2"
+anastasis-dbinit -c $CONF_2 2> anastasis-dbinit_2.log
+dropdb $TARGET_DB_3 >/dev/null 2>/dev/null || true
+createdb $TARGET_DB_3 || exit_skip "Could not create database $TARGET_DB_3"
+anastasis-dbinit -c $CONF_3 2> anastasis-dbinit_3.log
+dropdb $TARGET_DB_4 >/dev/null 2>/dev/null || true
+createdb $TARGET_DB_4 || exit_skip "Could not create database $TARGET_DB_4"
+anastasis-dbinit -c $CONF_4 2> anastasis-dbinit_4.log
+
+echo " OK"
+
+echo -n "Launching anastasis services ..."
+PREFIX="" #valgrind
+$PREFIX anastasis-httpd -c $CONF_1 2> anastasis-httpd_1.log &
+PPID_1=$!
+$PREFIX anastasis-httpd -c $CONF_2 2> anastasis-httpd_2.log &
+PPID_2=$!
+$PREFIX anastasis-httpd -c $CONF_3 2> anastasis-httpd_3.log &
+PPID_3=$!
+$PREFIX anastasis-httpd -c $CONF_4 2> anastasis-httpd_4.log &
+PPID_4=$!
+export PPID_1
+export PPID_2
+export PPID_3
+export PPID_4
+
+echo -n "Waiting for anastasis services ..."
+
+# Wait for anastasis services to be available
+for n in `seq 1 50`
+do
+ echo -n "."
+ sleep 0.1
+ OK=0
+ # anastasis_01
+ wget --tries=1 --timeout=1 http://localhost:8086/ -o /dev/null -O /dev/null >/dev/null || continue
+ # anastasis_02
+ wget --tries=1 --timeout=1 http://localhost:8087/ -o /dev/null -O /dev/null >/dev/null || continue
+ # anastasis_03
+ wget --tries=1 --timeout=1 http://localhost:8088/ -o /dev/null -O /dev/null >/dev/null || continue
+ # anastasis_04
+ wget --tries=1 --timeout=1 http://localhost:8089/ -o /dev/null -O /dev/null >/dev/null || continue
+ OK=1
+ break
+done
+
+if [ 1 != $OK ]
+then
+ exit_skip "Failed to launch anastasis services"
+fi
+echo "OK"
+
+echo -n "Running backup logic ...,"
+anastasis-reducer -b > $B1FILE
+echo -n "."
+anastasis-reducer -a \
+ '{"continent": "Demoworld"}' \
+ select_continent < $B1FILE > $B2FILE
+echo -n "."
+anastasis-reducer -a \
+ '{"country_code": "xx"}' \
+ select_country < $B2FILE > $B1FILE
+echo -n "."
+
+kill -SIGSTOP $PPID_4
+START=`date '+%s'`
+timeout 10 anastasis-reducer -L DEBUG -a \
+ '{"identity_attributes": {
+ "full_name": "Max Musterman",
+ "sq_number": "4",
+ "birthdate": "2000-01-01"}}' \
+ enter_user_attributes < $B1FILE > $B2FILE || true
+END=`date '+%s'`
+DELTA=`expr $END - $START`
+kill -SIGCONT $PPID_4
+
+if test $DELTA -ge 5
+then
+ exit_fail "Reducer hangs on suspended provider in 'enter_user_attributes'"
+fi
+
+cat $B2FILE > $B1FILE
+echo -n ","
+sync_providers $B1FILE $B2FILE
+echo -n ","
+# "91GPWWR" encodes "Hans"
+anastasis-reducer -a \
+ '{"authentication_method": {
+ "type": "question",
+ "instructions": "What is your name?",
+ "challenge": "91GPWWR"
+ } }' \
+ add_authentication < $B2FILE > $B1FILE
+echo -n "."
+# "64S36" encodes "123"
+anastasis-reducer -a \
+ '{"authentication_method": {
+ "type": "question",
+ "instructions": "How old are you?",
+ "challenge": "64S36"
+ } }' \
+ add_authentication < $B1FILE > $B2FILE
+echo -n "."
+# "9NGQ4WR" encodes "Mars"
+anastasis-reducer -a \
+ '{"authentication_method": {
+ "type": "question",
+ "instructions": "Where do you live?",
+ "challenge": "9NGQ4WR"
+ } }' \
+ add_authentication < $B2FILE > $B1FILE
+echo -n "."
+# Finished adding authentication methods
+anastasis-reducer \
+ next < $B1FILE > $B2FILE
+
+
+echo -n ","
+# Finished policy review
+anastasis-reducer \
+ next < $B2FILE > $B1FILE
+echo -n "."
+
+# Note: 'secret' must here be a Crockford base32-encoded value
+anastasis-reducer -a \
+ '{"secret": { "value" : "VERYHARDT0GVESSSECRET", "mime" : "text/plain" }}' \
+ enter_secret < $B1FILE > $B2FILE
+anastasis-reducer next $B2FILE $B1FILE
+echo " OK"
+
+echo -n "Final backup checks ..."
+STATE=`jq -r -e .backup_state < $B1FILE`
+if test "$STATE" != "BACKUP_FINISHED"
+then
+ exit_fail "Expected new state to be 'BACKUP_FINISHED', got '$STATE'"
+fi
+
+jq -r -e .core_secret < $B1FILE > /dev/null && exit_fail "'core_secret' was not cleared upon success"
+
+echo " OK"
+
+
+echo -n "Running recovery basic logic ..."
+anastasis-reducer -r > $R1FILE
+anastasis-reducer -a \
+ '{"continent": "Demoworld"}' \
+ select_continent < $R1FILE > $R2FILE
+anastasis-reducer -a \
+ '{"country_code": "xx" }' \
+ select_country < $R2FILE > $R1FILE
+anastasis-reducer -a '{"identity_attributes": { "full_name": "Max Musterman", "sq_number": "4", "birthdate": "2000-01-01" }}' enter_user_attributes < $R1FILE > $R2FILE
+
+
+STATE=`jq -r -e .recovery_state < $R2FILE`
+if test "$STATE" != "SECRET_SELECTING"
+then
+ exit_fail "Expected new state to be 'SECRET_SELECTING', got '$STATE'"
+fi
+echo " OK"
+
+echo -n "Adding provider (to ensure it is loaded)"
+anastasis-reducer -a '{"provider_url" : "http://localhost:8086/" }' add_provider < $R2FILE > $R1FILE
+echo " OK"
+
+echo -n "Selecting secret to recover"
+anastasis-reducer -a '{"attribute_mask": 0, "providers" : [ { "version": 1, "url" : "http://localhost:8086/" } ] }' select_version < $R1FILE > $R2FILE
+
+STATE=`jq -r -e .recovery_state < $R2FILE`
+if test "$STATE" != "CHALLENGE_SELECTING"
+then
+ exit_fail "Expected new state to be 'CHALLENGE_SELECTING', got '$STATE'"
+fi
+echo " OK"
+
+cat $R2FILE > $R1FILE
+sync_providers $R1FILE $R2FILE
+
+echo -n "Running challenge logic ..."
+
+cat $R2FILE | jq .
+
+UUID0=`jq -r -e .recovery_information.challenges[0].uuid < $R2FILE`
+UUID1=`jq -r -e .recovery_information.challenges[1].uuid < $R2FILE`
+UUID2=`jq -r -e .recovery_information.challenges[2].uuid < $R2FILE`
+UUID0Q=`jq -r -e .recovery_information.challenges[0].instructions < $R2FILE`
+UUID1Q=`jq -r -e .recovery_information.challenges[1].instructions < $R2FILE`
+UUID2Q=`jq -r -e .recovery_information.challenges[2].instructions < $R2FILE`
+
+if test "$UUID2Q" = 'How old are you?'
+then
+ AGE_UUID=$UUID2
+elif test "$UUID1Q" = 'How old are you?'
+then
+ AGE_UUID=$UUID1
+else
+ AGE_UUID=$UUID0
+fi
+
+if test "$UUID2Q" = 'What is your name?'
+then
+ NAME_UUID=$UUID2
+elif test "$UUID1Q" = 'What is your name?'
+then
+ NAME_UUID=$UUID1
+else
+ NAME_UUID=$UUID0
+fi
+
+anastasis-reducer -a \
+ "$(jq -n '
+ {
+ uuid: $UUID
+ }' \
+ --arg UUID "$NAME_UUID"
+ )" \
+ select_challenge < $R2FILE > $R1FILE
+
+anastasis-reducer -a '{"answer": "Hans"}' \
+ solve_challenge < $R1FILE > $R2FILE
+
+anastasis-reducer -a \
+ "$(jq -n '
+ {
+ uuid: $UUID
+ }' \
+ --arg UUID "$AGE_UUID"
+ )" \
+ select_challenge < $R2FILE > $R1FILE
+
+anastasis-reducer -a '{"answer": "123"}' \
+ solve_challenge < $R1FILE > $R2FILE
+
+echo " OK"
+
+echo -n "Checking recovered secret ..."
+# finally: check here that we recovered the secret...
+
+STATE=`jq -r -e .recovery_state < $R2FILE`
+if test "$STATE" != "RECOVERY_FINISHED"
+then
+ jq -e . $R2FILE
+ exit_fail "Expected new state to be 'RECOVERY_FINISHED', got '$STATE'"
+fi
+
+SECRET=`jq -r -e .core_secret.value < $R2FILE`
+if test "$SECRET" != "VERYHARDT0GVESSSECRET"
+then
+ jq -e . $R2FILE
+ exit_fail "Expected recovered secret to be 'VERYHARDT0GVESSSECRET', got '$SECRET'"
+fi
+
+MIME=`jq -r -e .core_secret.mime < $R2FILE`
+if test "$MIME" != "text/plain"
+then
+ jq -e . $R2FILE
+ exit_fail "Expected recovered mime to be 'text/plain', got '$MIME'"
+fi
+
+echo " OK"
+
+exit 0
diff --git a/src/cli/test_anastasis_reducer_recovery_no_pay.sh b/src/cli/test_anastasis_reducer_recovery_no_pay.sh
index 12ac7e9..42f5b0c 100755
--- a/src/cli/test_anastasis_reducer_recovery_no_pay.sh
+++ b/src/cli/test_anastasis_reducer_recovery_no_pay.sh
@@ -67,8 +67,8 @@ CONF_4="test_anastasis_reducer_free_4.conf"
# Configuration file will be edited, so we create one
# from the template.
-CONF=`mktemp test_reducerXXXXXX.conf`
-cp test_reducer.conf $CONF
+CONF=$(mktemp test_reducerXXXXXX.conf)
+cp test_reducer.conf "$CONF"
TMP_DIR=`mktemp -d keys-tmp-XXXXXX`
B1FILE=`mktemp test_reducer_stateB1XXXXXX`
@@ -121,10 +121,10 @@ echo " OK"
echo -n "Launching anastasis services ..."
PREFIX="" #valgrind
-$PREFIX anastasis-httpd -c $CONF_1 2> anastasis-httpd_1.log &
-$PREFIX anastasis-httpd -c $CONF_2 2> anastasis-httpd_2.log &
-$PREFIX anastasis-httpd -c $CONF_3 2> anastasis-httpd_3.log &
-$PREFIX anastasis-httpd -c $CONF_4 2> anastasis-httpd_4.log &
+$PREFIX anastasis-httpd -L DEBUG -c $CONF_1 2> anastasis-httpd_1.log &
+$PREFIX anastasis-httpd -L DEBUG -c $CONF_2 2> anastasis-httpd_2.log &
+$PREFIX anastasis-httpd -L DEBUG -c $CONF_3 2> anastasis-httpd_3.log &
+$PREFIX anastasis-httpd -L DEBUG -c $CONF_4 2> anastasis-httpd_4.log &
echo -n "Waiting for anastasis services ..."
@@ -180,7 +180,7 @@ anastasis-reducer -a \
"instructions": "What is your name?",
"challenge": "91GPWWR"
} }' \
- add_authentication < $B2FILE > $B1FILE
+ add_authentication < $B2FILE > $B1FILE
echo -n "."
# "64S36" encodes "123"
anastasis-reducer -a \
diff --git a/src/cli/test_iban.sh b/src/cli/test_iban.sh
index 8278961..207d2d5 100755
--- a/src/cli/test_iban.sh
+++ b/src/cli/test_iban.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# This file is in the public domain.
set -eu
#set -x
@@ -18,65 +19,64 @@ function exit_fail() {
# Cleanup to run whenever we exit
function cleanup()
{
- for n in `jobs -p`
+ for n in $(jobs -p)
do
- kill $n 2> /dev/null || true
+ kill "$n" 2> /dev/null || true
done
- rm -rf $CONF $R1FILE $R2FILE $B1FILE $B2FILE
+ rm -rf "$CONF" "$R1FILE" "$R2FILE" "$B1FILE" "$B2FILE"
wait
}
# $1=ebics username, $2=ebics partner name, $3=person name, $4=sandbox bank account name, $5=iban
function prepare_sandbox_account() {
- echo -n "Activating ebics subscriber $1 at the sandbox ..."
- libeufin-cli \
- sandbox --sandbox-url=$SANDBOX_URL \
- ebicssubscriber create \
- --host-id=$EBICS_HOST \
- --partner-id=$2 \
- --user-id=$1
+ echo -n "Registering $4 to the Sandbox..."
+ export LIBEUFIN_SANDBOX_USERNAME="$4"
+ export LIBEUFIN_SANDBOX_PASSWORD=unused
+ libeufin-cli sandbox --sandbox-url="$SANDBOX_URL" \
+ demobank register --name "$3" --iban "$5"
echo " OK"
- echo -n "Giving a bank account ($4) to $1 ..."
- libeufin-cli \
- sandbox --sandbox-url=$SANDBOX_URL \
- ebicsbankaccount create \
- --iban=$5 \
- --bic="BCMAESM1XXX"\
- --person-name="$3" \
- --account-name=$4 \
- --ebics-user-id=$1 \
- --ebics-host-id=$EBICS_HOST \
- --ebics-partner-id=$2
+ echo -n "Associating a EBICS subscriber to $4..."
+ export LIBEUFIN_SANDBOX_USERNAME=admin
+ libeufin-cli sandbox --sandbox-url="$SANDBOX_URL" demobank new-ebicssubscriber \
+ --host-id "$EBICS_HOST" \
+ --user-id "$1" --partner-id "$2" \
+ --bank-account "$4" # that's a username _and_ a bank account name
echo " OK"
+
+ unset LIBEUFIN_SANDBOX_USERNAME
+ unset LIBEUFIN_SANDBOX_PASSWORD
}
function sync_providers() {
- infile=$1
- outfile=$2
+ infile="$1"
+ outfile="$2"
echo "Synchronizing providers"
# Sync with providers (up to 3 providers aren't synced here)
for x in 1 2 3; do
echo "Synchronizing providers (round $x)"
- anastasis-reducer sync_providers < $infile > $outfile 2> /dev/null || true
+ anastasis-reducer sync_providers < "$infile" > "$outfile" 2> /dev/null || true
CODE=$(jq -r -e ".code // 0" < $outfile)
# ANASTASIS_REDUCER_PROVIDERS_ALREADY_SYNCED
# FIXME: Temporary workaround for C reducer. See #7227.
- if test "$CODE" = "8420"; then
+ if [ "$CODE" = "8420" ]
+ then
# restore previous non-error state
- cat $infile > $outfile
+ cp "$infile" "$outfile"
break
fi
# ANASTASIS_REDUCER_ACTION_INVALID
- if test "$CODE" = "8400"; then
+ if [ "$CODE" = "8400" ]
+ then
# restore previous non-error state
- cat $infile > $outfile
+ cp "$infile" "$outfile"
break
fi
- if test "$CODE" != "0"; then
+ if [ "$CODE" != "0" ]
+ then
exit_fail "Expected no error or 8420/8400, got $CODE"
fi
- cat $outfile > $infile
+ cp "$outfile" "$infile"
done
echo "Providers synced."
}
@@ -91,13 +91,19 @@ trap cleanup EXIT
# to pass through the Nexus+Ebics layer to issue the payment
# $1 = amount ($CURRENCY:X.Y), $2 = subject.
function wire_transfer_to_anastasis() {
+ echo -n "Initiating wire transfer ..."
libeufin-sandbox make-transaction \
--debit-account=sandbox-account-debit \
- --credit-account=sandbox-account-credit "$1" "$2"
- # Sync nexus with sandbox
- export LIBEUFIN_NEXUS_USERNAME=$CREDIT_USERNAME
- export LIBEUFIN_NEXUS_PASSWORD=$CREDIT_PASSWORD
- libeufin-cli accounts fetch-transactions nexus-bankaccount-credit > /dev/null
+ --credit-account=sandbox-account-credit "$1" "$2" &> libeufin-transfer-initiate.out
+ echo " OK"
+ # FIXME-MS: the following command reports that it did not
+ # sync any transactions, even though presumably we just
+ # made one in the one above (which succeeded...)
+ echo -n "Syncing nexus with sandbox ..."
+ export LIBEUFIN_NEXUS_USERNAME="$CREDIT_USERNAME"
+ export LIBEUFIN_NEXUS_PASSWORD="$CREDIT_PASSWORD"
+ libeufin-cli accounts fetch-transactions nexus-bankaccount-credit &> libeufin-transfer-fetch.out
+ echo " OK"
}
# $1 = facade base URL. Merely a debug utility.
@@ -112,43 +118,33 @@ function prepare_nexus_account() {
echo -n "Making bank connection $3 ..."
libeufin-cli connections new-ebics-connection \
--ebics-url="${SANDBOX_URL}ebicsweb" \
- --host-id=$EBICS_HOST \
- --partner-id=$2 \
- --ebics-user-id=$1 \
+ --host-id="$EBICS_HOST" \
+ --partner-id="$2" \
+ --ebics-user-id="$1" \
$3 > /dev/null
echo " OK"
echo -n "Connecting $3 ..."
- libeufin-cli connections connect $3 > /dev/null
+ libeufin-cli connections connect "$3" > /dev/null
echo " OK"
echo -n "Importing Sandbox bank account ($5) to Nexus ($4) ..."
- libeufin-cli connections download-bank-accounts $3 > /dev/null
+ libeufin-cli connections download-bank-accounts "$3" > /dev/null
libeufin-cli connections import-bank-account \
- --offered-account-id=$5 --nexus-bank-account-id=$4 $3 > /dev/null
+ --offered-account-id="$5" --nexus-bank-account-id="$4" "$3" > /dev/null
echo " OK"
}
-# $1 = facade name, $2 = bank connection to use, $3 = bank account name
-# local to Nexus
-function prepare_anastasis_facade() {
- echo -n "Creating facade ..."
- libeufin-cli facades new-anastasis-facade \
- --currency=$CURRENCY \
- --facade-name=$1 \
- $2 $3
- echo " OK"
- # No need to setup facade permissions, as the anastasis client
- # is superuser at Nexus.
-}
# Configuration file will be edited, so we create one
# from the template.
-CONF=`mktemp test_free_reducerXXXXXX.conf`
-cp test_free_reducer.conf $CONF
+CONF=$(mktemp test_free_reducerXXXXXX.conf)
+cp test_free_reducer.conf "$CONF"
+
+
-B1FILE=`mktemp test_reducer_stateB1XXXXXX`
-B2FILE=`mktemp test_reducer_stateB2XXXXXX`
-R1FILE=`mktemp test_reducer_stateR1XXXXXX`
-R2FILE=`mktemp test_reducer_stateR2XXXXXX`
+B1FILE=$(mktemp test_reducer_stateB1XXXXXX)
+B2FILE=$(mktemp test_reducer_stateB2XXXXXX)
+R1FILE=$(mktemp test_reducer_stateR1XXXXXX)
+R2FILE=$(mktemp test_reducer_stateR2XXXXXX)
export CONF
export B2FILE
@@ -176,23 +172,40 @@ echo -n "Testing for anastasis-reducer ..."
anastasis-reducer -h > /dev/null || exit_skip "anastasis-reducer required"
echo " FOUND"
-export LIBEUFIN_NEXUS_DB_CONNECTION="jdbc:sqlite:$(mktemp -u /tmp/nexus-db-XXXXXX.sqlite)"
-export LIBEUFIN_SANDBOX_DB_CONNECTION="jdbc:sqlite:$(mktemp -u /tmp/sandbox-db-XXXXXX.sqlite)"
+echo -n "Initialize Anastasis database ..."
+# Name of the Postgres database we will use for the script.
+# Will be dropped, do NOT use anything that might be used
+# elsewhere
+
+TARGET_DB=$(anastasis-config -c "$CONF" -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///")
+
+dropdb "$TARGET_DB" >/dev/null 2>/dev/null || true
+createdb "$TARGET_DB" || exit_skip "Could not create database $TARGET_DB"
+anastasis-dbinit -c "$CONF" 2> anastasis-dbinit.log
+
+echo " OK"
+
+
+export LIBEUFIN_NEXUS_DB_CONNECTION="postgres:///anastasischeck"
+export LIBEUFIN_SANDBOX_DB_CONNECTION="postgres:///anastasischeck"
NEXUS_URL="http://localhost:5001/"
SANDBOX_URL="http://localhost:5000/"
echo -n "Starting Nexus ..."
libeufin-nexus serve &> nexus.log &
nexus_pid=$!
-if ! curl -s --retry 5 --retry-connrefused $NEXUS_URL > /dev/null; then
+if ! curl -s --retry 5 --retry-connrefused "$NEXUS_URL" > /dev/null; then
exit_skip "Could not launch Nexus"
fi
echo " OK"
+echo -n "Configuring Sandbox..."
+libeufin-sandbox config default &> sandbox-config.log
+echo " OK"
echo -n "Starting Sandbox ..."
-libeufin-sandbox serve --no-auth &> sandbox.log &
+libeufin-sandbox serve --no-auth &> sandbox-serve.log &
sandbox_pid=$!
-if ! curl -s --retry 5 --retry-connrefused $SANDBOX_URL > /dev/null; then
+if ! curl -s --retry 5 --retry-connrefused "$SANDBOX_URL" > /dev/null; then
exit_skip "Could not launch Sandbox"
fi
echo " OK"
@@ -204,11 +217,11 @@ EBICS_HOST="ebicstesthost"
export IBAN_CREDIT="DE89370400440532013000"
export IBAN_DEBIT="FR1420041010050500013M02606"
-echo -n "Preparing Sandbox ..."
+echo -n "Preparing Sandbox (creating the EBICS host) ..."
libeufin-cli \
- sandbox --sandbox-url=$SANDBOX_URL \
+ sandbox --sandbox-url="$SANDBOX_URL" \
ebicshost create \
- --host-id=$EBICS_HOST
+ --host-id="$EBICS_HOST"
echo " OK"
PERSON_CREDIT_NAME="Person Credit"
@@ -219,32 +232,32 @@ prepare_sandbox_account \
ebicspartnerCredit \
"${PERSON_CREDIT_NAME}" \
sandbox-account-credit \
- $IBAN_CREDIT
+ "$IBAN_CREDIT"
prepare_sandbox_account \
ebicsuserDebit \
ebicspartnerDebit \
"Person Debit" \
sandbox-account-debit \
- $IBAN_DEBIT
+ "$IBAN_DEBIT"
echo "Sandbox preparation done"
echo -n "Preparing Nexus ..."
-export LIBEUFIN_NEXUS_URL=$NEXUS_URL
+export LIBEUFIN_NEXUS_URL="$NEXUS_URL"
# Make debit user, will buy Anastasis services.
DEBIT_USERNAME=anastasis-debit-user
DEBIT_PASSWORD=anastasis-debit-password
-libeufin-nexus superuser $DEBIT_USERNAME --password=$DEBIT_PASSWORD
+libeufin-nexus superuser "$DEBIT_USERNAME" --password="$DEBIT_PASSWORD"
echo " OK"
-export LIBEUFIN_NEXUS_USERNAME=$DEBIT_USERNAME
-export LIBEUFIN_NEXUS_PASSWORD=$DEBIT_PASSWORD
+export LIBEUFIN_NEXUS_USERNAME="$DEBIT_USERNAME"
+export LIBEUFIN_NEXUS_PASSWORD="$DEBIT_PASSWORD"
# Make credit user, will be Anastasis client.
CREDIT_USERNAME=anastasis-credit-user
CREDIT_PASSWORD=anastasis-credit-password
echo -n "Create credit user (for anastasis) at Nexus ..."
-libeufin-nexus superuser $CREDIT_USERNAME --password=$CREDIT_PASSWORD
+libeufin-nexus superuser "$CREDIT_USERNAME" --password="$CREDIT_PASSWORD"
echo " OK"
-export LIBEUFIN_NEXUS_USERNAME=$CREDIT_USERNAME
-export LIBEUFIN_NEXUS_PASSWORD=$CREDIT_PASSWORD
+export LIBEUFIN_NEXUS_USERNAME="$CREDIT_USERNAME"
+export LIBEUFIN_NEXUS_PASSWORD="$CREDIT_PASSWORD"
prepare_nexus_account \
ebicsuserCredit \
@@ -255,7 +268,7 @@ prepare_nexus_account \
echo -n "Create facade ..."
libeufin-cli facades new-anastasis-facade \
- --currency=$CURRENCY \
+ --currency="$CURRENCY" \
--facade-name=facade-credit \
bankconnection-credit nexus-bankaccount-credit
echo " OK"
@@ -263,41 +276,29 @@ FACADE_URL=$(libeufin-cli facades list | jq .facades[0].baseUrl | tr -d \")
## Reach facade with: $FACADE_URL + $CREDIT_USERNAME + $CREDIT_PASSWORD
-echo -n "Initialize Anastasis database ..."
-# Name of the Postgres database we will use for the script.
-# Will be dropped, do NOT use anything that might be used
-# elsewhere
-
-TARGET_DB=`anastasis-config -c $CONF -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"`
-
-dropdb $TARGET_DB >/dev/null 2>/dev/null || true
-createdb $TARGET_DB || exit_skip "Could not create database $TARGET_DB"
-anastasis-dbinit -c $CONF 2> anastasis-dbinit.log
-
-echo " OK"
echo -n "Configuring Anastasis IBAN account ..."
-anastasis-config -c $CONF \
+anastasis-config -c "$CONF" \
-s authorization-iban \
-o CREDIT_IBAN \
-V "${IBAN_CREDIT}"
-anastasis-config -c $CONF \
+anastasis-config -c "$CONF" \
-s authorization-iban \
-o BUSINESS_NAME \
-V "${PERSON_CREDIT_NAME}"
-anastasis-config -c $CONF \
+anastasis-config -c "$CONF" \
-s authorization-iban \
-o WIRE_GATEWAY_URL \
-V "${FACADE_URL}"
-anastasis-config -c $CONF \
+anastasis-config -c "$CONF" \
-s authorization-iban \
-o WIRE_GATEWAY_AUTH_METHOD \
-V "basic"
-anastasis-config -c $CONF \
+anastasis-config -c "$CONF" \
-s authorization-iban \
-o USERNAME \
-V "${LIBEUFIN_NEXUS_USERNAME}"
-anastasis-config -c $CONF \
+anastasis-config -c "$CONF" \
-s authorization-iban \
-o PASSWORD \
-V "${LIBEUFIN_NEXUS_PASSWORD}"
@@ -305,12 +306,12 @@ echo " OK"
echo -n "Launching Anastasis service ..."
PREFIX="" #valgrind
-$PREFIX anastasis-httpd -c $CONF -L INFO 2> anastasis-httpd_1.log &
+$PREFIX anastasis-httpd -c "$CONF" -L INFO 2> anastasis-httpd_1.log &
echo " OK"
echo -n "Waiting for Anastasis service ..."
# Wait for Anastasis service to be available
-for n in `seq 1 50`
+for n in $(seq 1 50)
do
echo -n "."
sleep 0.1
@@ -327,15 +328,15 @@ fi
echo "OK"
echo -n "Running backup logic ...,"
-anastasis-reducer -b > $B1FILE
+anastasis-reducer -b > "$B1FILE"
echo -n "."
anastasis-reducer -a \
'{"continent": "Demoworld"}' \
- select_continent < $B1FILE > $B2FILE
+ select_continent < "$B1FILE" > "$B2FILE"
echo -n "."
anastasis-reducer -a \
'{"country_code": "xx" }' \
- select_country < $B2FILE > $B1FILE 2>> test_reducer.err
+ select_country < "$B2FILE" > "$B1FILE" 2>> test_reducer.err
echo -n "."
anastasis-reducer -a \
@@ -343,12 +344,12 @@ anastasis-reducer -a \
"full_name": "Max Musterman",
"sq_number": "4",
"birthdate": "2000-01-01"}}' \
- enter_user_attributes < $B1FILE > $B2FILE 2>> test_reducer.err
+ enter_user_attributes < "$B1FILE" > "$B2FILE" 2>> test_reducer.err
echo -n ","
-cat $B2FILE > $B1FILE
-sync_providers $B1FILE $B2FILE
+cat "$B2FILE" > "$B1FILE"
+sync_providers "$B1FILE" "$B2FILE"
echo -n ","
-BASEIBAN=`echo -n $IBAN_DEBIT | gnunet-base32`
+BASEIBAN=$(echo -n $IBAN_DEBIT | gnunet-base32)
anastasis-reducer -a \
"$(jq -n '{ authentication_method: {
type: "iban",
@@ -357,7 +358,7 @@ anastasis-reducer -a \
} }' \
--arg CHALLENGE "$BASEIBAN"
)" \
- add_authentication < $B2FILE > $B1FILE 2>> test_reducer.err
+ add_authentication < "$B2FILE" > "$B1FILE" 2>> test_reducer.err
echo -n "."
# "91GPWWR" encodes "Hans"
@@ -367,82 +368,82 @@ anastasis-reducer -a \
"instructions": "What is your name?",
"challenge": "91GPWWR"
} }' \
- add_authentication < $B1FILE > $B2FILE 2>> test_reducer.err
+ add_authentication < "$B1FILE" > "$B2FILE" 2>> test_reducer.err
echo -n "."
-mv $B2FILE $B1FILE
+mv "$B2FILE" "$B1FILE"
# Finished adding authentication methods
anastasis-reducer \
- next < $B1FILE > $B2FILE 2>> test_reducer.err
+ next < "$B1FILE" > "$B2FILE" 2>> test_reducer.err
echo -n ","
# Finished policy review
anastasis-reducer \
- next < $B2FILE > $B1FILE 2>> test_reducer.err
+ next < "$B2FILE" > "$B1FILE" 2>> test_reducer.err
echo -n "."
# Note: 'secret' must here be a Crockford base32-encoded value
anastasis-reducer -a \
'{"secret": { "value" : "VERYHARDT0GVESSSECRET", "mime" : "text/plain" }}' \
- enter_secret < $B1FILE > $B2FILE 2>> test_reducer.err
-mv $B2FILE $B1FILE
-anastasis-reducer next < $B1FILE > $B2FILE 2>> test_reducer.err
+ enter_secret < "$B1FILE" > "$B2FILE" 2>> test_reducer.err
+mv "$B2FILE" "$B1FILE"
+anastasis-reducer next < "$B1FILE" > "$B2FILE" 2>> test_reducer.err
echo " OK"
echo -n "Final backup checks ..."
-STATE=`jq -r -e .backup_state < $B2FILE`
-if test "$STATE" != "BACKUP_FINISHED"
+STATE=$(jq -r -e .backup_state < "$B2FILE")
+if [ "$STATE" != "BACKUP_FINISHED" ]
then
exit_fail "Expected new state to be 'BACKUP_FINISHED', got '$STATE'"
fi
-jq -r -e .core_secret < $B2FILE > /dev/null && exit_fail "'core_secret' was not cleared upon success"
+jq -r -e .core_secret < "$B2FILE" > /dev/null && exit_fail "'core_secret' was not cleared upon success"
echo " OK"
echo -n "Running recovery basic logic ..."
-anastasis-reducer -r > $R1FILE
+anastasis-reducer -r > "$R1FILE"
anastasis-reducer -a \
'{"continent": "Demoworld"}' \
- select_continent < $R1FILE > $R2FILE
+ select_continent < "$R1FILE" > "$R2FILE"
anastasis-reducer -a \
'{"country_code": "xx",
"currencies":["TESTKUDOS"]}' \
- select_country < $R2FILE > $R1FILE 2>> test_reducer.err
-anastasis-reducer -a '{"identity_attributes": { "full_name": "Max Musterman", "sq_number": "4", "birthdate": "2000-01-01" }}' enter_user_attributes < $R1FILE > $R2FILE 2>> test_reducer.err
+ select_country < "$R2FILE" > "$R1FILE" 2>> test_reducer.err
+anastasis-reducer -a '{"identity_attributes": { "full_name": "Max Musterman", "sq_number": "4", "birthdate": "2000-01-01" }}' enter_user_attributes < "$R1FILE" > "$R2FILE" 2>> test_reducer.err
-STATE=`jq -r -e .recovery_state < $R2FILE`
-if test "$STATE" != "SECRET_SELECTING"
+STATE=$(jq -r -e .recovery_state < "$R2FILE")
+if [ "$STATE" != "SECRET_SELECTING" ]
then
exit_fail "Expected new state to be 'SECRET_SELECTING', got '$STATE'"
fi
echo " OK"
echo -n "Adding provider (to ensure it is loaded)"
-anastasis-reducer -a '{"provider_url" : "http://localhost:8086/" }' add_provider < $R2FILE > $R1FILE
+anastasis-reducer -a '{"provider_url" : "http://localhost:8086/" }' add_provider < "$R2FILE" > "$R1FILE"
echo " OK"
echo -n "Selecting secret to recover"
anastasis-reducer -a '{"attribute_mask": 0, "providers" : [ { "version": 1, "url" : "http://localhost:8086/" } ] }' \
- select_version < $R1FILE > $R2FILE 2>> test_reducer.err
+ select_version < "$R1FILE" > "$R2FILE" 2>> test_reducer.err
-STATE=`jq -r -e .recovery_state < $R2FILE`
-if test "$STATE" != "CHALLENGE_SELECTING"
+STATE=$(jq -r -e .recovery_state < "$R2FILE")
+if [ "$STATE" != "CHALLENGE_SELECTING" ]
then
exit_fail "Expected new state to be 'CHALLENGE_SELECTING', got '$STATE'"
fi
echo " OK"
-cat $R2FILE > $R1FILE
-sync_providers $R1FILE $R2FILE
+cp "$R2FILE" "$R1FILE"
+sync_providers "$R1FILE" "$R2FILE"
echo -n "Running challenge selection logic ..."
-UUID0=`jq -r -e .recovery_information.challenges[0].uuid < $R2FILE`
-UUID1=`jq -r -e .recovery_information.challenges[1].uuid < $R2FILE`
-UUID0Q=`jq -r -e .recovery_information.challenges[0].instructions < $R2FILE`
-UUID1Q=`jq -r -e .recovery_information.challenges[1].instructions < $R2FILE`
+UUID0=$(jq -r -e .recovery_information.challenges[0].uuid < "$R2FILE")
+UUID1=$(jq -r -e .recovery_information.challenges[1].uuid < "$R2FILE")
+UUID0Q=$(jq -r -e .recovery_information.challenges[0].instructions < "$R2FILE")
+UUID1Q=$(jq -r -e .recovery_information.challenges[1].instructions < "$R2FILE")
-if test "$UUID1Q" = 'What is your name?'
+if [ "$UUID1Q" = 'What is your name?' ]
then
NAME_UUID=$UUID1
IBAN_UUID=$UUID0
@@ -460,10 +461,10 @@ anastasis-reducer -a \
}' \
--arg UUID "$NAME_UUID"
)" \
- select_challenge < $R2FILE > $R1FILE 2>> test_reducer.err
+ select_challenge < "$R2FILE" > "$R1FILE" 2>> test_reducer.err
anastasis-reducer -a '{"answer": "Hans"}' \
- solve_challenge < $R1FILE > $R2FILE
+ solve_challenge < "$R1FILE" > "$R2FILE"
echo "OK"
echo -n "Solving IBAN challenge ..."
@@ -475,28 +476,28 @@ anastasis-reducer -a \
}' \
--arg UUID "$IBAN_UUID"
)" \
- select_challenge < $R2FILE > $R1FILE 2>> test_reducer.err
+ select_challenge < "$R2FILE" > "$R1FILE" 2>> test_reducer.err
echo "OK"
-METHOD=`jq -r -e .challenge_feedback.\"$IBAN_UUID\".state < $R1FILE`
-if test "$METHOD" != "iban-instructions"
+METHOD=$(jq -r -e .challenge_feedback.\"$IBAN_UUID\".state < "$R1FILE")
+if [ "$METHOD" != "iban-instructions" ]
then
exit_fail "Expected method to be 'iban-instructions', got ${METHOD}"
fi
-ACC=`jq -r -e .challenge_feedback.\"$IBAN_UUID\".target_iban < $R1FILE`
-if test "$ACC" != ${IBAN_CREDIT}
+ACC=$(jq -r -e .challenge_feedback.\"$IBAN_UUID\".target_iban < "$R1FILE")
+if [ "$ACC" != "${IBAN_CREDIT}" ]
then
exit_fail "Expected account to be ${IBAN_CREDIT}, got ${ACC}"
fi
anastasis-reducer \
- back < $R1FILE > $R2FILE 2>> test_reducer.err
+ back < "$R1FILE" > "$R2FILE" 2>> test_reducer.err
-AMOUNT=`jq -r -e .challenge_feedback.\"$IBAN_UUID\".challenge_amount < $R1FILE`
-SUBJECT=`jq -r -e .challenge_feedback.\"$IBAN_UUID\".wire_transfer_subject < $R1FILE`
+AMOUNT=$(jq -r -e .challenge_feedback.\"$IBAN_UUID\".challenge_amount < "$R1FILE")
+SUBJECT=$(jq -r -e .challenge_feedback.\"$IBAN_UUID\".wire_transfer_subject < "$R1FILE")
echo -n "Performing authorization wire transfer ${SUBJECT} ..."
wire_transfer_to_anastasis "${AMOUNT}" "${SUBJECT}"
@@ -504,35 +505,35 @@ wire_transfer_to_anastasis "${AMOUNT}" "${SUBJECT}"
echo " OK"
echo -n "Triggering inbound check ..."
-anastasis-helper-authorization-iban -c $CONF -t
+anastasis-helper-authorization-iban -c "$CONF" -t -L INFO
echo " OK"
# Now we should get the secret...
echo -n "Polling for recovery ..."
-anastasis-reducer poll -L INFO < $R2FILE > $R1FILE
+anastasis-reducer poll -L INFO < "$R2FILE" > "$R1FILE"
echo " OK"
echo -n "Checking recovered secret ..."
# finally: check here that we recovered the secret...
-STATE=`jq -r -e .recovery_state < $R1FILE`
-if test "$STATE" != "RECOVERY_FINISHED"
+STATE=$(jq -r -e .recovery_state < "$R1FILE")
+if [ "$STATE" != "RECOVERY_FINISHED" ]
then
- jq -e . $R1FILE
+ jq -e . "$R1FILE"
exit_fail "Expected new state to be 'RECOVERY_FINISHED', got '$STATE'"
fi
-SECRET=`jq -r -e .core_secret.value < $R1FILE`
-if test "$SECRET" != "VERYHARDT0GVESSSECRET"
+SECRET=$(jq -r -e .core_secret.value < "$R1FILE")
+if [ "$SECRET" != "VERYHARDT0GVESSSECRET" ]
then
- jq -e . $R1FILE
+ jq -e . "$R1FILE"
exit_fail "Expected recovered secret to be 'VERYHARDT0GVESSSECRET', got '$SECRET'"
fi
-MIME=`jq -r -e .core_secret.mime < $R1FILE`
-if test "$MIME" != "text/plain"
+MIME=$(jq -r -e .core_secret.mime < "$R1FILE")
+if [ "$MIME" != "text/plain" ]
then
- jq -e . $R1FILE
+ jq -e . "$R1FILE"
exit_fail "Expected recovered mime to be 'text/plain', got '$MIME'"
fi
diff --git a/src/cli/test_reducer.conf b/src/cli/test_reducer.conf
index e87313b..4f26a79 100644
--- a/src/cli/test_reducer.conf
+++ b/src/cli/test_reducer.conf
@@ -26,9 +26,10 @@ COST = TESTKUDOS:0.0
[exchange]
+MASTER_PUBLIC_KEY = 3NX5DJDBD8XVGZYHV3PBF8C3Z4GK48XD59YY5GF3CZE8AJM04WSG
+AML_THRESHOLD = TESTKUDOS:1000000
MAX_KEYS_CACHING = forever
DB = postgres
-MASTER_PRIV_FILE = ${TALER_DATA_HOME}/exchange/offline-keys/master.priv
SERVE = tcp
UNIXPATH = ${TALER_RUNTIME_DIR}/exchange.http
UNIXPATH_MODE = 660
@@ -39,26 +40,40 @@ SIGNKEY_LEGAL_DURATION = 2 years
LEGAL_DURATION = 2 years
LOOKAHEAD_SIGN = 3 weeks 1 day
LOOKAHEAD_PROVIDE = 2 weeks 1 day
-KEYDIR = ${TALER_DATA_HOME}/exchange/live-keys/
-REVOCATION_DIR = ${TALER_DATA_HOME}/exchange/revocations/
TERMS_ETAG = 0
PRIVACY_ETAG = 0
+STEFAN_ABS = "TESTKUDOS:5"
+
+# Account of the EXCHANGE
+[exchange-account-1]
+# What is the exchange's bank account (with the "Taler Bank" demo system)?
+PAYTO_URI = payto://iban/SANDBOXX/DE989651?receiver-name=Exchange+Company
+ENABLE_DEBIT = YES
+ENABLE_CREDIT = YES
+
+[exchange-accountcredentials-1]
+WIRE_GATEWAY_URL = http://localhost:18082/accounts/exchange/taler-wire-gateway/
+WIRE_GATEWAY_AUTH_METHOD = basic
+USERNAME = exchange
+PASSWORD = x
+
+
+[exchange-account-2]
+PAYTO_URI = "payto://x-taler-bank/localhost/exchange?receiver-name=exchange"
+ENABLE_DEBIT = YES
+ENABLE_CREDIT = YES
+
+[exchange-accountcredentials-2]
+WIRE_GATEWAY_AUTH_METHOD = none
+WIRE_GATEWAY_URL = "http://localhost:18082/accounts/exchange/taler-wire-gateway/"
[merchant]
SERVE = tcp
PORT = 9966
UNIXPATH = ${TALER_RUNTIME_DIR}/merchant.http
UNIXPATH_MODE = 660
-DEFAULT_WIRE_FEE_AMORTIZATION = 1
DB = postgres
-WIREFORMAT = default
-# Set very low, so we can be sure that the database generated
-# will contain wire transfers "ready" for the aggregator.
-WIRE_TRANSFER_DELAY = 1 minute
-DEFAULT_PAY_DEADLINE = 1 day
-DEFAULT_MAX_DEPOSIT_FEE = TESTKUDOS:0.1
KEYFILE = ${TALER_DATA_HOME}/merchant/merchant.priv
-DEFAULT_MAX_WIRE_FEE = TESTKUDOS:0.10
# Ensure that merchant reports EVERY deposit confirmation to auditor
FORCE_AUDIT = YES
@@ -79,30 +94,41 @@ BASE_URL = "http://localhost:8083/"
DATABASE = postgres:///taler-auditor-basedb
MAX_DEBT = TESTKUDOS:50.0
MAX_DEBT_BANK = TESTKUDOS:100000.0
-HTTP_PORT = 8082
+HTTP_PORT = 18082
SUGGESTED_EXCHANGE = http://localhost:8081/
SUGGESTED_EXCHANGE_PAYTO = payto://x-taler-bank/localhost/2
ALLOW_REGISTRATIONS = YES
SERVE = http
+[libeufin-bank]
+CURRENCY = TESTKUDOS
+WIRE_TYPE = iban
+IBAN_PAYTO_BIC = SANDBOXX
+DEFAULT_CUSTOMER_DEBT_LIMIT = TESTKUDOS:200
+DEFAULT_ADMIN_DEBT_LIMIT = TESTKUDOS:2000
+REGISTRATION_BONUS_ENABLED = yes
+REGISTRATION_BONUS = TESTKUDOS:100
+SUGGESTED_WITHDRAWAL_EXCHANGE = http://localhost:8081/
+SERVE = tcp
+PORT = 18082
+
[exchangedb]
IDLE_RESERVE_EXPIRATION_TIME = 4 weeks
LEGAL_RESERVE_EXPIRATION_TIME = 7 years
-[exchange-account-1]
-PAYTO_URI = payto://x-taler-bank/localhost/Exchange
-enable_debit = yes
-enable_credit = yes
+[auditordb-postgres]
+CONFIG = "postgres:///talercheck"
-[exchange-accountcredentials-1]
-WIRE_GATEWAY_URL = "http://localhost:8082/taler-wire-gateway/Exchange/"
-WIRE_GATEWAY_AUTH_METHOD = basic
-USERNAME = Exchange
-PASSWORD = x
+[exchangedb-postgres]
+CONFIG = "postgres:///talercheck"
+
+[merchantdb-postgres]
+CONFIG = "postgres:///talercheck"
[merchant-exchange-default]
EXCHANGE_BASE_URL = http://localhost:8081/
CURRENCY = TESTKUDOS
+MASTER_KEY = 3NX5DJDBD8XVGZYHV3PBF8C3Z4GK48XD59YY5GF3CZE8AJM04WSG
[payments-generator]
currency = TESTKUDOS
diff --git a/src/cli/test_reducer_free.conf b/src/cli/test_reducer_free.conf
index 1c7da88..4e46929 100644
--- a/src/cli/test_reducer_free.conf
+++ b/src/cli/test_reducer_free.conf
@@ -95,7 +95,7 @@ enable_debit = yes
enable_credit = yes
[exchange-accountcredentials-1]
-WIRE_GATEWAY_URL = "http://localhost:8082/taler-wire-gateway/Exchange/"
+WIRE_GATEWAY_URL = "http://localhost:8082/accounts/Exchange/taler-wire-gateway/"
WIRE_GATEWAY_AUTH_METHOD = basic
USERNAME = Exchange
PASSWORD = x
diff --git a/src/cli/test_reducer_home/.local/share/taler/exchange-offline/master.priv b/src/cli/test_reducer_home/.local/share/taler/exchange-offline/master.priv
new file mode 100644
index 0000000..d990a05
--- /dev/null
+++ b/src/cli/test_reducer_home/.local/share/taler/exchange-offline/master.priv
@@ -0,0 +1 @@
+>en͙[z3pwTj?cn21 \ No newline at end of file
diff --git a/src/include/anastasis_crypto_lib.h b/src/include/anastasis_crypto_lib.h
index 648a8eb..8cbc954 100644
--- a/src/include/anastasis_crypto_lib.h
+++ b/src/include/anastasis_crypto_lib.h
@@ -21,7 +21,7 @@
* @author Dennis Neufeld
*/
#include <jansson.h>
-#include <gnunet/gnunet_crypto_lib.h>
+#include <gnunet/gnunet_util_lib.h>
/**
diff --git a/src/include/anastasis_service.h b/src/include/anastasis_service.h
index ba55314..2f30a8b 100644
--- a/src/include/anastasis_service.h
+++ b/src/include/anastasis_service.h
@@ -51,51 +51,82 @@ struct ANASTASIS_AuthorizationMethodConfig
*/
struct ANASTASIS_Config
{
- /**
- * Protocol version supported by the server.
- */
- const char *version;
/**
- * Business name of the anastasis provider.
+ * HTTP status returned.
*/
- const char *business_name;
+ unsigned int http_status;
/**
- * Array of authorization methods supported by the server.
+ * Taler-specific error code, #TALER_EC_NONE on success.
*/
- const struct ANASTASIS_AuthorizationMethodConfig *methods;
+ enum TALER_ErrorCode ec;
/**
- * Length of the @e methods array.
+ * Full response in JSON, if provided.
*/
- unsigned int methods_length;
+ const json_t *response;
/**
- * Maximum size of an upload in megabytes.
+ * Details depending on @e http_status.
*/
- uint32_t storage_limit_in_megabytes;
+ union
+ {
- /**
- * Annual fee for an account / policy upload.
- */
- struct TALER_Amount annual_fee;
+ /**
+ * Details on #MHD_HTTP_OK.
+ */
+ struct
+ {
- /**
- * Fee for a truth upload.
- */
- struct TALER_Amount truth_upload_fee;
+ /**
+ * Protocol version supported by the server.
+ */
+ const char *version;
- /**
- * Maximum legal liability for data loss covered by the
- * provider.
- */
- struct TALER_Amount liability_limit;
+ /**
+ * Business name of the anastasis provider.
+ */
+ const char *business_name;
- /**
- * Provider salt.
- */
- struct ANASTASIS_CRYPTO_ProviderSaltP provider_salt;
+ /**
+ * Array of authorization methods supported by the server.
+ */
+ const struct ANASTASIS_AuthorizationMethodConfig *methods;
+
+ /**
+ * Length of the @e methods array.
+ */
+ unsigned int methods_length;
+
+ /**
+ * Maximum size of an upload in megabytes.
+ */
+ uint32_t storage_limit_in_megabytes;
+
+ /**
+ * Annual fee for an account / policy upload.
+ */
+ struct TALER_Amount annual_fee;
+
+ /**
+ * Fee for a truth upload.
+ */
+ struct TALER_Amount truth_upload_fee;
+
+ /**
+ * Maximum legal liability for data loss covered by the
+ * provider.
+ */
+ struct TALER_Amount liability_limit;
+
+ /**
+ * Provider salt.
+ */
+ struct ANASTASIS_CRYPTO_ProviderSaltP provider_salt;
+ } ok;
+
+ } details;
};
@@ -107,12 +138,10 @@ struct ANASTASIS_Config
* the server provided an acceptable response.
*
* @param cls closure
- * @param http_status the HTTP status
* @param acfg configuration obtained, NULL if we could not parse it
*/
typedef void
(*ANASTASIS_ConfigCallback)(void *cls,
- unsigned int http_status,
const struct ANASTASIS_Config *acfg);
@@ -185,15 +214,45 @@ struct ANASTASIS_MetaDownloadDetails
{
/**
- * Version-sorted array of meta data we downloaded.
+ * HTTP status returned.
+ */
+ unsigned int http_status;
+
+ /**
+ * Taler-specific error code, #TALER_EC_NONE on success.
+ */
+ enum TALER_ErrorCode ec;
+
+ /**
+ * Full response in JSON, if provided.
*/
- const struct ANASTASIS_MetaDataEntry *metas;
+ const json_t *response;
/**
- * Number of entries in @e metas.
+ * Details depending on @e http_status.
*/
- size_t metas_length;
+ union
+ {
+ /**
+ * Details on #MHD_HTTP_OK.
+ */
+ struct
+ {
+
+ /**
+ * Version-sorted array of meta data we downloaded.
+ */
+ const struct ANASTASIS_MetaDataEntry *metas;
+
+ /**
+ * Number of entries in @e metas.
+ */
+ size_t metas_length;
+
+ } ok;
+
+ } details;
};
@@ -201,13 +260,11 @@ struct ANASTASIS_MetaDownloadDetails
* Callback to process a GET /policy/$POL/meta request
*
* @param cls closure
- * @param http_status HTTP status code for this request
* @param dd the response details
*/
typedef void
(*ANASTASIS_PolicyMetaLookupCallback) (
void *cls,
- unsigned int http_status,
const struct ANASTASIS_MetaDownloadDetails *dd);
@@ -247,30 +304,57 @@ ANASTASIS_policy_meta_lookup_cancel (
*/
struct ANASTASIS_DownloadDetails
{
- /**
- * Signature (already verified).
- */
- struct ANASTASIS_AccountSignatureP sig;
/**
- * Hash over @e policy and @e policy_size.
+ * HTTP status returned.
*/
- struct GNUNET_HashCode curr_policy_hash;
+ unsigned int http_status;
/**
- * The backup we downloaded.
+ * Taler-specific error code, #TALER_EC_NONE on success.
*/
- const void *policy;
+ enum TALER_ErrorCode ec;
/**
- * Number of bytes in @e backup.
+ * Details depending on @e http_status.
*/
- size_t policy_size;
+ union
+ {
+
+ /**
+ * Details on #MHD_HTTP_OK.
+ */
+ struct
+ {
+
+ /**
+ * Signature (already verified).
+ */
+ struct ANASTASIS_AccountSignatureP sig;
+
+ /**
+ * Hash over @e policy and @e policy_size.
+ */
+ struct GNUNET_HashCode curr_policy_hash;
+
+ /**
+ * The backup we downloaded.
+ */
+ const void *policy;
+
+ /**
+ * Number of bytes in @e backup.
+ */
+ size_t policy_size;
+
+ /**
+ * Policy version returned by the service.
+ */
+ uint32_t version;
+ } ok;
+
+ } details;
- /**
- * Policy version returned by the service.
- */
- uint32_t version;
};
@@ -284,12 +368,10 @@ struct ANASTASIS_PolicyLookupOperation;
* Callback to process a GET /policy request
*
* @param cls closure
- * @param http_status HTTP status code for this request
* @param dd the response details
*/
typedef void
(*ANASTASIS_PolicyLookupCallback) (void *cls,
- unsigned int http_status,
const struct ANASTASIS_DownloadDetails *dd);
diff --git a/src/include/anastasis_testing_lib.h b/src/include/anastasis_testing_lib.h
index b5036ff..62cde06 100644
--- a/src/include/anastasis_testing_lib.h
+++ b/src/include/anastasis_testing_lib.h
@@ -130,15 +130,15 @@
op (truth, const struct ANASTASIS_Truth *) \
op (policy, const struct ANASTASIS_Policy *) \
op (provider_salt, const struct ANASTASIS_CRYPTO_ProviderSaltP) \
- op (core_secret, const void *) \
+ op (core_secret, const void) \
op (truth_key, const struct ANASTASIS_CRYPTO_TruthKeyP) \
op (account_pub, const struct ANASTASIS_CRYPTO_AccountPublicKeyP) \
op (account_priv, const struct ANASTASIS_CRYPTO_AccountPrivateKeyP) \
op (payment_secret, const struct ANASTASIS_PaymentSecretP) \
op (truth_uuid, const struct ANASTASIS_CRYPTO_TruthUUIDP) \
op (eks, const struct ANASTASIS_CRYPTO_EncryptedKeyShareP) \
- op (code, const char *) \
- op (filename, const char *)
+ op (code, const char) \
+ op (filename, const char)
/**
@@ -552,7 +552,7 @@ enum ANASTASIS_TESTING_SecretShareOption
* @param id_data ID data to generate user identifier
* @param core_secret core secret to backup/recover
* @param core_secret_size size of @a core_secret
- * @param http_status expected HTTP status.
+ * @param want_status expected status.
* @param sso secret share options
* @param ... NULL-terminated list of policy create commands
* @return the command
@@ -566,7 +566,7 @@ ANASTASIS_TESTING_cmd_secret_share (
const json_t *id_data,
const void *core_secret,
size_t core_secret_size,
- unsigned int http_status,
+ enum ANASTASIS_ShareStatus want_status,
enum ANASTASIS_TESTING_SecretShareOption sso,
...);
diff --git a/src/include/platform.h b/src/include/platform.h
index 7667460..0fd6672 100644
--- a/src/include/platform.h
+++ b/src/include/platform.h
@@ -26,10 +26,10 @@
/* Include our configuration header */
#ifndef HAVE_USED_CONFIG_H
-# define HAVE_USED_CONFIG_H
-# ifdef HAVE_CONFIG_H
-# include "anastasis_config.h"
-# endif
+#define HAVE_USED_CONFIG_H
+#ifdef HAVE_CONFIG_H
+#include "anastasis_config.h"
+#endif
#endif
@@ -69,8 +69,210 @@
/* Include the features available for GNU source */
#define _GNU_SOURCE
-/* Include GNUnet's platform file */
-#include <gnunet/platform.h>
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef __clang__
+#undef HAVE_STATIC_ASSERT
+#endif
+
+/**
+ * These may be expensive, but good for debugging...
+ */
+#define ALLOW_EXTRA_CHECKS GNUNET_YES
+
+/**
+ * For strptime (glibc2 needs this).
+ */
+#ifndef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 499
+#endif
+
+#ifndef _REENTRANT
+#define _REENTRANT
+#endif
+
+/* configuration options */
+
+#define VERBOSE_STATS 0
+
+#include <netdb.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+#if HAVE_NETINET_IP_H
+#include <netinet/ip.h> /* superset of previous */
+#endif
+#include <arpa/inet.h>
+#include <netinet/tcp.h>
+#include <pwd.h>
+#include <sys/ioctl.h>
+#include <sys/wait.h>
+#include <grp.h>
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <errno.h>
+#include <signal.h>
+#include <libgen.h>
+#ifdef HAVE_MALLOC_H
+#include <malloc.h> /* for mallinfo on GNU */
+#endif
+#include <unistd.h> /* KLB_FIX */
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <dirent.h> /* KLB_FIX */
+#include <fcntl.h>
+#include <math.h>
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <time.h>
+#ifdef BSD
+#include <net/if.h>
+#endif
+#if defined(BSD) && defined(__FreeBSD__) && defined(__FreeBSD_kernel__)
+#include <semaphore.h>
+#endif
+#ifdef DARWIN
+#include <dlfcn.h>
+#include <semaphore.h>
+#include <net/if.h>
+#endif
+#if defined(__linux__) || defined(GNU)
+#include <net/if.h>
+#endif
+#ifdef SOLARIS
+#include <sys/sockio.h>
+#include <sys/filio.h>
+#include <sys/loadavg.h>
+#include <semaphore.h>
+#endif
+#if HAVE_UCRED_H
+#include <ucred.h>
+#endif
+#if HAVE_SYS_UCRED_H
+#include <sys/ucred.h>
+#endif
+#if HAVE_IFADDRS_H
+#include <ifaddrs.h>
+#endif
+#include <errno.h>
+#include <limits.h>
+
+#if HAVE_VFORK_H
+#include <vfork.h>
+#endif
+
+#include <ctype.h>
+#if HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+
+#if HAVE_ENDIAN_H
+#include <endian.h>
+#endif
+#if HAVE_SYS_ENDIAN_H
+#include <sys/endian.h>
+#endif
+
+#define DIR_SEPARATOR '/'
+#define DIR_SEPARATOR_STR "/"
+#define PATH_SEPARATOR ':'
+#define PATH_SEPARATOR_STR ":"
+#define NEWLINE "\n"
+
+#include <locale.h>
+#include "gettext.h"
+/**
+ * GNU gettext support macro.
+ */
+#define _(String) dgettext (PACKAGE, String)
+#define LIBEXTRACTOR_GETTEXT_DOMAIN "libextractor"
+
+#include <sys/mman.h>
+
+/* FreeBSD_kernel is not defined on the now discontinued kFreeBSD */
+#if defined(BSD) && defined(__FreeBSD__) && defined(__FreeBSD_kernel__)
+#define __BYTE_ORDER BYTE_ORDER
+#define __BIG_ENDIAN BIG_ENDIAN
+#endif
+
+#ifdef DARWIN
+#define __BYTE_ORDER BYTE_ORDER
+#define __BIG_ENDIAN BIG_ENDIAN
+/* not available on darwin, override configure */
+#undef HAVE_STAT64
+#undef HAVE_MREMAP
+#endif
+
+#if ! HAVE_ATOLL
+long long
+atoll (const char *nptr);
+
+#endif
+
+#if ENABLE_NLS
+#include "langinfo.h"
+#endif
+
+#ifndef SIZE_MAX
+#define SIZE_MAX ((size_t) (-1))
+#endif
+
+#ifndef O_LARGEFILE
+#define O_LARGEFILE 0
+#endif
+
+/**
+ * AI_NUMERICSERV not defined in windows. Then we just do without.
+ */
+#ifndef AI_NUMERICSERV
+#define AI_NUMERICSERV 0
+#endif
+
+
+#if defined(__sparc__)
+#define MAKE_UNALIGNED(val) ({ __typeof__((val)) __tmp; memmove (&__tmp, &(val), \
+ sizeof((val))); \
+ __tmp; })
+#else
+#define MAKE_UNALIGNED(val) val
+#endif
+
+/**
+ * The termination signal
+ */
+#define GNUNET_TERM_SIG SIGTERM
+
+
+#ifndef PATH_MAX
+/**
+ * Assumed maximum path length.
+ */
+#define PATH_MAX 4096
+#endif
+
+#if HAVE_THREAD_LOCAL_GCC
+#define ANASTASIS_THREAD_LOCAL __thread
+#else
+#define ANASTASIS_THREAD_LOCAL
+#endif
+
/* Do not use shortcuts for gcrypt mpi */
#define GCRYPT_NO_MPI_MACROS 1
diff --git a/src/lib/anastasis_meta.c b/src/lib/anastasis_meta.c
index 7812f6b..ae20db5 100644
--- a/src/lib/anastasis_meta.c
+++ b/src/lib/anastasis_meta.c
@@ -55,20 +55,17 @@ struct ANASTASIS_VersionCheck
* Function called with results from a GET /policy/$POL/meta request
*
* @param cls closure with the `struct ANASTASIS_VersionCheck *`
- * @param http_status HTTP status code for this request
* @param dd the response details
*/
static void
meta_cb (
void *cls,
- unsigned int http_status,
const struct ANASTASIS_MetaDownloadDetails *dd)
{
struct ANASTASIS_VersionCheck *vc = cls;
vc->plm = NULL;
- if ( (MHD_HTTP_OK != http_status) ||
- (NULL == dd) )
+ if (MHD_HTTP_OK != dd->http_status)
{
vc->mpc (vc->mpc_cls,
0,
@@ -78,9 +75,10 @@ meta_cb (
ANASTASIS_recovery_get_versions_cancel (vc);
return;
}
- for (size_t i = 0; i<dd->metas_length; i++)
+ for (size_t i = 0; i<dd->details.ok.metas_length; i++)
{
- const struct ANASTASIS_MetaDataEntry *meta = &dd->metas[i];
+ const struct ANASTASIS_MetaDataEntry *meta
+ = &dd->details.ok.metas[i];
const char *secret_name = NULL;
const struct GNUNET_HashCode *eph;
void *dec;
diff --git a/src/lib/anastasis_recovery.c b/src/lib/anastasis_recovery.c
index c9f8c0e..f164c93 100644
--- a/src/lib/anastasis_recovery.c
+++ b/src/lib/anastasis_recovery.c
@@ -612,23 +612,22 @@ ANASTASIS_challenge_abort (struct ANASTASIS_Challenge *c)
* Function called with the results of a #ANASTASIS_policy_lookup()
*
* @param cls closure
- * @param http_status HTTp status code.
* @param dd details about the lookup operation
*/
static void
policy_lookup_cb (void *cls,
- unsigned int http_status,
const struct ANASTASIS_DownloadDetails *dd)
{
struct ANASTASIS_Recovery *r = cls;
void *plaintext;
size_t size_plaintext;
json_error_t json_error;
- json_t *dec_policies;
- json_t *esc_methods;
+ const json_t *dec_policies;
+ const json_t *esc_methods;
+ json_t *recovery_document;
r->plo = NULL;
- switch (http_status)
+ switch (dd->http_status)
{
case MHD_HTTP_OK:
break;
@@ -660,7 +659,7 @@ policy_lookup_cb (void *cls,
default:
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Unexpected response code %u in %s:%u\n",
- http_status,
+ dd->http_status,
__FILE__,
__LINE__);
r->csc (r->csc_cls,
@@ -670,7 +669,7 @@ policy_lookup_cb (void *cls,
ANASTASIS_recovery_abort (r);
return;
}
- if (NULL == dd->policy)
+ if (NULL == dd->details.ok.policy)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"No recovery data available");
@@ -682,8 +681,8 @@ policy_lookup_cb (void *cls,
return;
}
ANASTASIS_CRYPTO_recovery_document_decrypt (&r->id,
- dd->policy,
- dd->policy_size,
+ dd->details.ok.policy,
+ dd->details.ok.policy_size,
&plaintext,
&size_plaintext);
if (size_plaintext < sizeof (uint32_t))
@@ -698,7 +697,6 @@ policy_lookup_cb (void *cls,
return;
}
{
- json_t *recovery_document;
uint32_t be_size;
uLongf pt_size;
char *pt;
@@ -761,10 +759,10 @@ policy_lookup_cb (void *cls,
{
const char *secret_name = NULL;
struct GNUNET_JSON_Specification spec[] = {
- GNUNET_JSON_spec_json ("policies",
- &dec_policies),
- GNUNET_JSON_spec_json ("escrow_methods",
- &esc_methods),
+ GNUNET_JSON_spec_array_const ("policies",
+ &dec_policies),
+ GNUNET_JSON_spec_array_const ("escrow_methods",
+ &esc_methods),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("secret_name",
&secret_name),
@@ -799,10 +797,9 @@ policy_lookup_cb (void *cls,
r->ri.secret_name = r->secret_name;
}
}
- json_decref (recovery_document);
}
- r->ri.version = dd->version;
+ r->ri.version = dd->details.ok.version;
r->ri.cs_len = json_array_size (esc_methods);
r->ri.dps_len = json_array_size (dec_policies);
r->ri.dps = GNUNET_new_array (r->ri.dps_len,
@@ -824,7 +821,7 @@ policy_lookup_cb (void *cls,
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_fixed_auto ("uuid",
&cs->ci.uuid),
- GNUNET_JSON_spec_string ("url",
+ TALER_JSON_spec_web_url ("url",
&url),
GNUNET_JSON_spec_string ("instructions",
&instructions),
@@ -848,13 +845,12 @@ policy_lookup_cb (void *cls,
NULL, NULL))
{
GNUNET_break_op (0);
- json_decref (esc_methods);
- json_decref (dec_policies);
r->csc (r->csc_cls,
ANASTASIS_RS_POLICY_MALFORMED_JSON,
NULL,
0);
ANASTASIS_recovery_abort (r);
+ json_decref (recovery_document);
return;
}
cs->url = GNUNET_strdup (url);
@@ -864,13 +860,11 @@ policy_lookup_cb (void *cls,
cs->instructions = GNUNET_strdup (instructions);
cs->ci.instructions = cs->instructions;
}
- json_decref (esc_methods);
for (unsigned int j = 0; j < r->ri.dps_len; j++)
{
struct DecryptionPolicy *dp = &r->dps[j];
-
- json_t *uuids = NULL;
+ const json_t *uuids;
json_t *uuid;
size_t n_index;
struct GNUNET_JSON_Specification spec[] = {
@@ -879,27 +873,25 @@ policy_lookup_cb (void *cls,
&dp->emk_size),
GNUNET_JSON_spec_fixed_auto ("master_salt",
&dp->master_salt),
- GNUNET_JSON_spec_json ("uuids",
- &uuids),
+ GNUNET_JSON_spec_array_const ("uuids",
+ &uuids),
GNUNET_JSON_spec_end ()
};
r->ri.dps[j] = &r->dps[j].pub_details;
- if ( (GNUNET_OK !=
- GNUNET_JSON_parse (json_array_get (dec_policies,
- j),
- spec,
- NULL, NULL)) ||
- (! json_is_array (uuids)) )
+ if (GNUNET_OK !=
+ GNUNET_JSON_parse (json_array_get (dec_policies,
+ j),
+ spec,
+ NULL, NULL))
{
GNUNET_break_op (0);
- json_decref (uuids);
- json_decref (dec_policies);
r->csc (r->csc_cls,
ANASTASIS_RS_POLICY_MALFORMED_JSON,
NULL,
0);
ANASTASIS_recovery_abort (r);
+ json_decref (recovery_document);
return;
}
@@ -925,13 +917,12 @@ policy_lookup_cb (void *cls,
sizeof (uuid))) )
{
GNUNET_break_op (0);
- json_decref (dec_policies);
- json_decref (uuids);
r->csc (r->csc_cls,
ANASTASIS_RS_POLICY_MALFORMED_JSON,
NULL,
0);
ANASTASIS_recovery_abort (r);
+ json_decref (recovery_document);
return;
}
for (unsigned int i = 0; i<r->ri.cs_len; i++)
@@ -947,21 +938,19 @@ policy_lookup_cb (void *cls,
if (! found)
{
GNUNET_break_op (0);
- json_decref (dec_policies);
- json_decref (uuids);
r->csc (r->csc_cls,
ANASTASIS_RS_POLICY_MALFORMED_JSON,
NULL,
0);
ANASTASIS_recovery_abort (r);
+ json_decref (recovery_document);
return;
}
}
- json_decref (uuids);
}
- json_decref (dec_policies);
r->pc (r->pc_cls,
&r->ri);
+ json_decref (recovery_document);
}
@@ -1134,7 +1123,7 @@ ANASTASIS_recovery_serialize (const struct ANASTASIS_Recovery *r)
*/
static enum GNUNET_GenericReturnValue
parse_cs_array (struct ANASTASIS_Recovery *r,
- json_t *cs_arr)
+ const json_t *cs_arr)
{
json_t *cs;
unsigned int n_index;
@@ -1161,7 +1150,7 @@ parse_cs_array (struct ANASTASIS_Recovery *r,
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_fixed_auto ("uuid",
&c->ci.uuid),
- GNUNET_JSON_spec_string ("url",
+ TALER_JSON_spec_web_url ("url",
&url),
GNUNET_JSON_spec_string ("instructions",
&instructions),
@@ -1220,7 +1209,7 @@ parse_cs_array (struct ANASTASIS_Recovery *r,
*/
static enum GNUNET_GenericReturnValue
parse_dps_array (struct ANASTASIS_Recovery *r,
- json_t *dps_arr)
+ const json_t *dps_arr)
{
json_t *dps;
unsigned int n_index;
@@ -1239,15 +1228,15 @@ parse_dps_array (struct ANASTASIS_Recovery *r,
json_array_foreach (dps_arr, n_index, dps)
{
struct DecryptionPolicy *dp = &r->dps[n_index];
- json_t *challenges;
+ const json_t *challenges;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_varsize ("encrypted_master_key",
&dp->emk,
&dp->emk_size),
GNUNET_JSON_spec_fixed_auto ("master_salt",
&dp->master_salt),
- GNUNET_JSON_spec_json ("challenges",
- &challenges),
+ GNUNET_JSON_spec_array_const ("challenges",
+ &challenges),
GNUNET_JSON_spec_end ()
};
const char *err_json_name;
@@ -1270,12 +1259,6 @@ parse_dps_array (struct ANASTASIS_Recovery *r,
}
GNUNET_assert (NULL != dp->emk);
GNUNET_assert (dp->emk_size > 0);
- if (! json_is_array (challenges))
- {
- GNUNET_break_op (0);
- GNUNET_JSON_parse_free (spec);
- return GNUNET_SYSERR;
- }
dp->pub_details.challenges_length = json_array_size (challenges);
dp->pub_details.challenges = GNUNET_new_array (
dp->pub_details.challenges_length,
@@ -1320,8 +1303,7 @@ parse_dps_array (struct ANASTASIS_Recovery *r,
}
}
}
- /* We don't free the spec, since we're still using dp->ems. */
- json_decref (challenges);
+ /* Do NOT free the spec: we are still using dp->ems. */
}
return GNUNET_OK;
}
@@ -1363,9 +1345,9 @@ ANASTASIS_recovery_deserialize (struct GNUNET_CURL_Context *ctx,
const char *err_json_name;
unsigned int err_line;
uint32_t version;
- json_t *dps_arr;
- json_t *cs_arr;
- json_t *id_data;
+ const json_t *dps_arr;
+ const json_t *cs_arr;
+ const json_t *id_data;
const char *provider_url;
const char *secret_name;
void *ecs;
@@ -1373,7 +1355,7 @@ ANASTASIS_recovery_deserialize (struct GNUNET_CURL_Context *ctx,
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_fixed_auto ("id",
&r->id),
- GNUNET_JSON_spec_string ("provider_url",
+ TALER_JSON_spec_web_url ("provider_url",
&provider_url),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("secret_name",
@@ -1381,12 +1363,12 @@ ANASTASIS_recovery_deserialize (struct GNUNET_CURL_Context *ctx,
NULL),
GNUNET_JSON_spec_uint32 ("version",
&version),
- GNUNET_JSON_spec_json ("decryption_policies",
- &dps_arr),
- GNUNET_JSON_spec_json ("challenges",
- &cs_arr),
- GNUNET_JSON_spec_json ("id_data",
- &id_data),
+ GNUNET_JSON_spec_array_const ("decryption_policies",
+ &dps_arr),
+ GNUNET_JSON_spec_array_const ("challenges",
+ &cs_arr),
+ GNUNET_JSON_spec_object_const ("id_data",
+ &id_data),
GNUNET_JSON_spec_varsize ("encrypted_core_secret",
&ecs,
&ecs_size),
@@ -1420,7 +1402,7 @@ ANASTASIS_recovery_deserialize (struct GNUNET_CURL_Context *ctx,
GNUNET_JSON_parse_free (spec);
return NULL;
}
- r->id_data = json_incref (id_data);
+ r->id_data = json_incref ((json_t *) id_data);
r->provider_url = GNUNET_strdup (provider_url);
if (NULL != secret_name)
r->secret_name = GNUNET_strdup (secret_name);
diff --git a/src/reducer/Makefile.am b/src/reducer/Makefile.am
index 6dad659..1536d21 100644
--- a/src/reducer/Makefile.am
+++ b/src/reducer/Makefile.am
@@ -16,6 +16,7 @@ libanastasisredux_la_LDFLAGS = \
-no-undefined
libanastasisredux_la_SOURCES = \
anastasis_api_discovery.c \
+ anastasis_api_providers.c \
anastasis_api_redux.c anastasis_api_redux.h \
anastasis_api_recovery_redux.c \
anastasis_api_backup_redux.c \
diff --git a/src/reducer/anastasis_api_backup_redux.c b/src/reducer/anastasis_api_backup_redux.c
index 2e73587..13b1dd6 100644
--- a/src/reducer/anastasis_api_backup_redux.c
+++ b/src/reducer/anastasis_api_backup_redux.c
@@ -1,6 +1,6 @@
/*
This file is part of Anastasis
- Copyright (C) 2020, 2021 Anastasis SARL
+ Copyright (C) 2020-2023 Anastasis SARL
Anastasis 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
@@ -353,7 +353,7 @@ add_authentication (json_t *state,
json_object_foreach (auth_providers, url, details)
{
- json_t *methods = NULL;
+ const json_t *methods = NULL;
json_t *method;
size_t index;
uint32_t size_limit_in_mb = 0;
@@ -371,8 +371,8 @@ add_authentication (json_t *state,
&http_status),
NULL),
GNUNET_JSON_spec_mark_optional (
- GNUNET_JSON_spec_json ("methods",
- &methods),
+ GNUNET_JSON_spec_array_const ("methods",
+ &methods),
NULL),
GNUNET_JSON_spec_end ()
};
@@ -411,7 +411,6 @@ add_authentication (json_t *state,
break;
}
}
- GNUNET_JSON_parse_free (ispec);
if (! challenge_size_ok (size_limit_in_mb,
challenge_size))
{
@@ -767,17 +766,20 @@ free_costs (struct Costs *costs)
* Check if providers @a p1 and @a p2 have equivalent
* methods and cost structures.
*
+ * @param pb policy builder with list of providers
+ * @param p1 name of provider to compare
+ * @param p2 name of provider to compare
* @return true if the providers are fully equivalent
*/
static bool
-equiv_provider (struct PolicyBuilder *pb,
+equiv_provider (const struct PolicyBuilder *pb,
const char *p1,
const char *p2)
{
- json_t *j1;
- json_t *j2;
- json_t *m1;
- json_t *m2;
+ const json_t *j1;
+ const json_t *j2;
+ const json_t *m1;
+ const json_t *m2;
struct TALER_Amount uc1;
struct TALER_Amount uc2;
@@ -794,8 +796,8 @@ equiv_provider (struct PolicyBuilder *pb,
{
struct GNUNET_JSON_Specification s1[] = {
- GNUNET_JSON_spec_json ("methods",
- &m1),
+ GNUNET_JSON_spec_array_const ("methods",
+ &m1),
TALER_JSON_spec_amount_any ("truth_upload_fee",
&uc1),
GNUNET_JSON_spec_end ()
@@ -813,8 +815,8 @@ equiv_provider (struct PolicyBuilder *pb,
{
struct GNUNET_JSON_Specification s2[] = {
- GNUNET_JSON_spec_json ("methods",
- &m2),
+ GNUNET_JSON_spec_array_const ("methods",
+ &m2),
TALER_JSON_spec_amount_any ("truth_upload_fee",
&uc2),
GNUNET_JSON_spec_end ()
@@ -933,7 +935,7 @@ eval_provider_selection (struct PolicyBuilder *pb,
pb->m_idx[i]);
const json_t *provider_cfg = json_object_get (pb->providers,
prov_sel[i]);
- json_t *provider_methods;
+ const json_t *provider_methods;
const char *method_type;
json_t *md;
size_t index;
@@ -943,8 +945,8 @@ eval_provider_selection (struct PolicyBuilder *pb,
struct GNUNET_JSON_Specification pspec[] = {
GNUNET_JSON_spec_uint32 ("storage_limit_in_megabytes",
&size_limit_in_mb),
- GNUNET_JSON_spec_json ("methods",
- &provider_methods),
+ GNUNET_JSON_spec_array_const ("methods",
+ &provider_methods),
TALER_JSON_spec_amount_any ("truth_upload_fee",
&upload_cost),
GNUNET_JSON_spec_end ()
@@ -1016,7 +1018,6 @@ eval_provider_selection (struct PolicyBuilder *pb,
GNUNET_break (0);
pb->ec = TALER_EC_ANASTASIS_REDUCER_STATE_INVALID;
pb->hint = "'methods' of provider";
- GNUNET_JSON_parse_free (pspec);
for (unsigned int i = 0; i<pb->req_methods; i++)
free_costs (policy_ent[i].usage_fee);
return;
@@ -1038,14 +1039,12 @@ eval_provider_selection (struct PolicyBuilder *pb,
{
/* Provider does not OFFER this method, combination not possible.
Cost is basically 'infinite', but we simply then skip this. */
- GNUNET_JSON_parse_free (pspec);
GNUNET_JSON_parse_free (mspec);
for (unsigned int i = 0; i<pb->req_methods; i++)
free_costs (policy_ent[i].usage_fee);
return;
}
GNUNET_JSON_parse_free (mspec);
- GNUNET_JSON_parse_free (pspec);
}
/* calculate provider diversity by counting number of different
@@ -1945,7 +1944,7 @@ add_policy (json_t *state,
const char *provider_url;
uint32_t method_idx;
const char *method_type;
- json_t *prov_methods;
+ const json_t *prov_methods;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_string ("provider",
&provider_url),
@@ -1982,8 +1981,8 @@ add_policy (json_t *state,
NULL),
GNUNET_JSON_spec_uint32 ("storage_limit_in_megabytes",
&limit),
- GNUNET_JSON_spec_json ("methods",
- &prov_methods),
+ GNUNET_JSON_spec_array_const ("methods",
+ &prov_methods),
GNUNET_JSON_spec_end ()
};
@@ -2016,17 +2015,6 @@ add_policy (json_t *state,
json_decref (methods);
continue;
}
- if (! json_is_array (prov_methods))
- {
- GNUNET_break (0);
- json_decref (methods);
- json_decref (prov_methods);
- ANASTASIS_redux_fail_ (cb,
- cb_cls,
- TALER_EC_ANASTASIS_REDUCER_INPUT_INVALID,
- "provider lacks authentication methods");
- return NULL;
- }
}
{
@@ -2038,7 +2026,6 @@ add_policy (json_t *state,
{
GNUNET_break (0);
json_decref (methods);
- json_decref (prov_methods);
ANASTASIS_redux_fail_ (cb,
cb_cls,
TALER_EC_ANASTASIS_REDUCER_INPUT_INVALID,
@@ -2051,7 +2038,6 @@ add_policy (json_t *state,
{
GNUNET_break (0);
json_decref (methods);
- json_decref (prov_methods);
ANASTASIS_redux_fail_ (cb,
cb_cls,
TALER_EC_ANASTASIS_REDUCER_INPUT_INVALID,
@@ -2083,7 +2069,6 @@ add_policy (json_t *state,
{
GNUNET_break (0);
json_decref (methods);
- json_decref (prov_methods);
ANASTASIS_redux_fail_ (cb,
cb_cls,
TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
@@ -2100,7 +2085,6 @@ add_policy (json_t *state,
{
GNUNET_break (0);
json_decref (methods);
- json_decref (prov_methods);
ANASTASIS_redux_fail_ (cb,
cb_cls,
TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
@@ -2111,7 +2095,6 @@ add_policy (json_t *state,
GNUNET_assert (0 ==
json_array_append (methods,
method));
- json_decref (prov_methods);
} /* end of json_array_foreach (arg_array, index, method) */
}
@@ -3130,23 +3113,25 @@ secret_share_result_cb (void *cls,
static void
share_secret (struct UploadContext *uc)
{
- json_t *user_id;
- json_t *core_secret;
- json_t *jpolicies;
- json_t *providers = NULL;
+ const json_t *user_id;
+ const json_t *core_secret;
+ const json_t *jpolicies;
+ const json_t *providers = NULL;
size_t policies_len;
const char *secret_name = NULL;
unsigned int pds_len;
struct GNUNET_TIME_Relative timeout = GNUNET_TIME_UNIT_ZERO;
struct GNUNET_JSON_Specification spec[] = {
- GNUNET_JSON_spec_json ("identity_attributes",
- &user_id),
- GNUNET_JSON_spec_json ("policies",
- &jpolicies),
- GNUNET_JSON_spec_json ("policy_providers",
- &providers),
- GNUNET_JSON_spec_json ("core_secret",
- &core_secret),
+ GNUNET_JSON_spec_object_const ("identity_attributes",
+ &user_id),
+ GNUNET_JSON_spec_array_const ("policies",
+ &jpolicies),
+ GNUNET_JSON_spec_mark_optional (
+ GNUNET_JSON_spec_array_const ("policy_providers",
+ &providers),
+ NULL),
+ GNUNET_JSON_spec_object_const ("core_secret",
+ &core_secret),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("secret_name",
&secret_name),
@@ -3198,40 +3183,32 @@ share_secret (struct UploadContext *uc)
}
}
- if ( (! json_is_object (user_id)) ||
- (! json_is_array (jpolicies)) ||
- (0 == json_array_size (jpolicies)) ||
- ( (NULL != providers) &&
- (! json_is_array (providers)) ) )
+ policies_len = json_array_size (jpolicies);
+ if (0 == policies_len)
{
ANASTASIS_redux_fail_ (uc->cb,
uc->cb_cls,
TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
"State parsing failed checks when preparing to share secret");
- GNUNET_JSON_parse_free (spec);
upload_cancel_cb (uc);
return;
}
- policies_len = json_array_size (jpolicies);
pds_len = json_array_size (providers);
-
if (0 == pds_len)
{
ANASTASIS_redux_fail_ (uc->cb,
uc->cb_cls,
TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
"no workable providers in state");
- GNUNET_JSON_parse_free (spec);
upload_cancel_cb (uc);
return;
}
-
{
struct ANASTASIS_Policy *vpolicies[policies_len];
const struct ANASTASIS_Policy *policies[policies_len];
- struct ANASTASIS_ProviderDetails pds[GNUNET_NZL (pds_len)];
+ struct ANASTASIS_ProviderDetails pds[pds_len];
/* initialize policies/vpolicies arrays */
memset (pds,
@@ -3253,7 +3230,6 @@ share_secret (struct UploadContext *uc)
uc->cb_cls,
TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
"'methods' must be an array");
- GNUNET_JSON_parse_free (spec);
upload_cancel_cb (uc);
return;
}
@@ -3267,13 +3243,13 @@ share_secret (struct UploadContext *uc)
{
const json_t *jmethod = json_array_get (jmethods,
j);
- json_t *jtruth = NULL;
+ const json_t *jtruth = NULL;
uint32_t truth_index;
const char *provider_url;
struct GNUNET_JSON_Specification ispec[] = {
GNUNET_JSON_spec_mark_optional (
- GNUNET_JSON_spec_json ("truth",
- &jtruth),
+ GNUNET_JSON_spec_object_const ("truth",
+ &jtruth),
NULL),
GNUNET_JSON_spec_string ("provider",
&provider_url),
@@ -3295,7 +3271,6 @@ share_secret (struct UploadContext *uc)
uc->cb_cls,
TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
"'truth' failed to decode");
- GNUNET_JSON_parse_free (spec);
upload_cancel_cb (uc);
return;
}
@@ -3312,8 +3287,6 @@ share_secret (struct UploadContext *uc)
uc->cb_cls,
TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
"'truth' failed to decode");
- GNUNET_JSON_parse_free (ispec);
- GNUNET_JSON_parse_free (spec);
upload_cancel_cb (uc);
return;
}
@@ -3351,13 +3324,10 @@ share_secret (struct UploadContext *uc)
uc->cb_cls,
TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
"'truth' failed to decode");
- GNUNET_JSON_parse_free (ispec);
- GNUNET_JSON_parse_free (spec);
upload_cancel_cb (uc);
return;
}
}
- GNUNET_JSON_parse_free (ispec);
ctruths[j] = truths[j];
}
p = ANASTASIS_policy_create (ctruths,
@@ -3401,7 +3371,6 @@ share_secret (struct UploadContext *uc)
for (unsigned int i = 0; i<policies_len; i++)
ANASTASIS_policy_destroy (vpolicies[i]);
upload_cancel_cb (uc);
- GNUNET_JSON_parse_free (spec);
return;
}
}
@@ -3432,7 +3401,6 @@ share_secret (struct UploadContext *uc)
for (unsigned int i = 0; i<policies_len; i++)
ANASTASIS_policy_destroy (vpolicies[i]);
}
- GNUNET_JSON_parse_free (spec);
if (NULL == uc->ss)
{
GNUNET_break (0);
@@ -4718,6 +4686,11 @@ ANASTASIS_backup_action_ (json_t *state,
},
{
ANASTASIS_BACKUP_STATE_AUTHENTICATIONS_EDITING,
+ "poll_providers",
+ &ANASTASIS_REDUX_poll_providers_
+ },
+ {
+ ANASTASIS_BACKUP_STATE_AUTHENTICATIONS_EDITING,
"back",
&ANASTASIS_back_generic_decrement_
},
diff --git a/src/reducer/anastasis_api_providers.c b/src/reducer/anastasis_api_providers.c
new file mode 100644
index 0000000..82243f5
--- /dev/null
+++ b/src/reducer/anastasis_api_providers.c
@@ -0,0 +1,300 @@
+/*
+ This file is part of Anastasis
+ Copyright (C) 2020, 2021, 2022 Anastasis SARL
+
+ Anastasis 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.
+
+ Anastasis 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
+ Anastasis; see the file COPYING.GPL. If not, see <http://www.gnu.org/licenses/>
+*/
+/**
+ * @file reducer/anastasis_api_providers.c
+ * @brief anastasis provider synchronization logic
+ * @author Christian Grothoff
+ */
+
+#include <platform.h>
+#include <jansson.h>
+#include "anastasis_redux.h"
+#include "anastasis_error_codes.h"
+#include "anastasis_api_redux.h"
+
+
+/**
+ * Main data structure for sync_providers().
+ */
+struct MasterSync;
+
+
+/**
+ * Data structure for one provider we are syncing /config with.
+ */
+struct SyncEntry
+{
+ /**
+ * Kept in a DLL.
+ */
+ struct SyncEntry *next;
+
+ /**
+ * Kept in a DLL.
+ */
+ struct SyncEntry *prev;
+
+ /**
+ * Sync operation we are part of.
+ */
+ struct MasterSync *ms;
+
+ /**
+ * Redux action for this provider.
+ */
+ struct ANASTASIS_ReduxAction *ra;
+};
+
+
+/**
+ * Main data structure for sync_providers().
+ */
+struct MasterSync
+{
+ /**
+ * Our own sync action we expose externally.
+ */
+ struct ANASTASIS_ReduxAction ra;
+ /**
+ * Head of DLL with entries per provider.
+ */
+ struct SyncEntry *se_head;
+ /**
+ * Tail of DLL with entries per provider.
+ */
+ struct SyncEntry *se_tail;
+
+ /**
+ * Function to call with the result.
+ */
+ ANASTASIS_ActionCallback cb;
+
+ /**
+ * Closure for @e cb.
+ */
+ void *cb_cls;
+
+};
+
+
+/**
+ * Free @a cls data structure.
+ *
+ * @param[in] cls data structure to free, must be a `struct MasterSync *`
+ */
+static void
+clean_sync (void *cls)
+{
+ struct MasterSync *ms = cls;
+ struct SyncEntry *se;
+
+ while (NULL != (se = ms->se_head))
+ {
+ GNUNET_CONTAINER_DLL_remove (ms->se_head,
+ ms->se_tail,
+ se);
+ se->ra->cleanup (se->ra->cleanup_cls);
+ GNUNET_free (se);
+ }
+ GNUNET_free (ms);
+}
+
+
+/**
+ * Function called when we have made progress on any of the
+ * providers we are trying to sync with.
+ *
+ * @param cls closure
+ * @param error error code, #TALER_EC_NONE if @a new_bs is the new successful state
+ * @param new_state the new state of the operation (client should json_incref() to keep an alias)
+ */
+static void
+sync_progress (void *cls,
+ enum TALER_ErrorCode error,
+ json_t *new_state)
+{
+ struct SyncEntry *se = cls;
+ struct MasterSync *ms = se->ms;
+
+ GNUNET_CONTAINER_DLL_remove (ms->se_head,
+ ms->se_tail,
+ se);
+ GNUNET_free (se);
+ ms->cb (ms->cb_cls,
+ error,
+ new_state);
+ clean_sync (ms);
+}
+
+
+struct ANASTASIS_ReduxAction *
+ANASTASIS_REDUX_sync_providers_ (json_t *state,
+ const json_t *arguments,
+ ANASTASIS_ActionCallback cb,
+ void *cb_cls)
+{
+ json_t *rd;
+ json_t *cs_arr;
+ struct MasterSync *ms;
+
+ rd = json_object_get (state,
+ "recovery_document");
+ if (NULL == rd)
+ {
+ GNUNET_break (0);
+ ANASTASIS_redux_fail_ (cb,
+ cb_cls,
+ TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
+ "'recovery_document' missing");
+ return NULL;
+ }
+ cs_arr = json_object_get (rd,
+ "challenges");
+ if (! json_is_array (cs_arr))
+ {
+ GNUNET_break_op (0);
+ ANASTASIS_redux_fail_ (cb,
+ cb_cls,
+ TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
+ "'recovery_document' must be an array");
+ return NULL;
+ }
+ ms = GNUNET_new (struct MasterSync);
+ ms->cb = cb;
+ ms->cb_cls = cb_cls;
+ {
+ json_t *cs;
+ unsigned int n_index;
+
+ json_array_foreach (cs_arr, n_index, cs)
+ {
+ const char *provider_url;
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_string ("url",
+ &provider_url),
+ GNUNET_JSON_spec_end ()
+ };
+ struct ANASTASIS_CRYPTO_ProviderSaltP provider_salt;
+ struct SyncEntry *se;
+
+ if (GNUNET_OK !=
+ GNUNET_JSON_parse (cs,
+ spec,
+ NULL, NULL))
+ {
+ GNUNET_break_op (0);
+ ANASTASIS_redux_fail_ (cb,
+ cb_cls,
+ TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
+ "'recovery_document' missing");
+ clean_sync (ms);
+ return NULL;
+ }
+ if (GNUNET_OK ==
+ ANASTASIS_reducer_lookup_salt (state,
+ provider_url,
+ &provider_salt))
+ continue; /* provider already ready */
+ se = GNUNET_new (struct SyncEntry);
+ se->ms = ms;
+ GNUNET_CONTAINER_DLL_insert (ms->se_head,
+ ms->se_tail,
+ se);
+ se->ra = ANASTASIS_REDUX_add_provider_to_state_ (provider_url,
+ state,
+ &sync_progress,
+ se);
+ }
+ }
+ if (NULL == ms->se_head)
+ {
+ /* everything already synced */
+ clean_sync (ms);
+ ANASTASIS_redux_fail_ (cb,
+ cb_cls,
+ TALER_EC_ANASTASIS_REDUCER_PROVIDERS_ALREADY_SYNCED,
+ "already in sync");
+ return NULL;
+ }
+ ms->ra.cleanup = &clean_sync;
+ ms->ra.cleanup_cls = ms;
+ return &ms->ra;
+}
+
+
+struct ANASTASIS_ReduxAction *
+ANASTASIS_REDUX_poll_providers_ (json_t *state,
+ const json_t *arguments,
+ ANASTASIS_ActionCallback cb,
+ void *cb_cls)
+{
+ json_t *ap;
+ const char *url;
+ json_t *obj;
+ struct MasterSync *ms;
+
+ ap = json_object_get (state,
+ "authentication_providers");
+ if (NULL == ap)
+ {
+ GNUNET_break (0);
+ ANASTASIS_redux_fail_ (cb,
+ cb_cls,
+ TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
+ "'authentication_providers' missing");
+ return NULL;
+ }
+ ms = GNUNET_new (struct MasterSync);
+ ms->cb = cb;
+ ms->cb_cls = cb_cls;
+ json_object_foreach (ap, url, obj)
+ {
+ struct ANASTASIS_CRYPTO_ProviderSaltP provider_salt;
+ struct SyncEntry *se;
+ struct ANASTASIS_ReduxAction *ra;
+
+ if (GNUNET_OK ==
+ ANASTASIS_reducer_lookup_salt (state,
+ url,
+ &provider_salt))
+ continue;
+ se = GNUNET_new (struct SyncEntry);
+ se->ms = ms;
+ GNUNET_CONTAINER_DLL_insert (ms->se_head,
+ ms->se_tail,
+ se);
+ ra = ANASTASIS_REDUX_add_provider_to_state_ (url,
+ state,
+ &sync_progress,
+ se);
+ if (NULL == ra)
+ return NULL; /* sync_progress already called! */
+ se->ra = ra;
+ }
+ if (NULL == ms->se_head)
+ {
+ /* everything already synced */
+ clean_sync (ms);
+ ANASTASIS_redux_fail_ (cb,
+ cb_cls,
+ TALER_EC_ANASTASIS_REDUCER_ACTION_INVALID,
+ "already in sync");
+ return NULL;
+ }
+ ms->ra.cleanup = &clean_sync;
+ ms->ra.cleanup_cls = ms;
+ return &ms->ra;
+}
diff --git a/src/reducer/anastasis_api_recovery_redux.c b/src/reducer/anastasis_api_recovery_redux.c
index 22be38d..e795c55 100644
--- a/src/reducer/anastasis_api_recovery_redux.c
+++ b/src/reducer/anastasis_api_recovery_redux.c
@@ -2013,301 +2013,6 @@ select_challenge (json_t *state,
/**
- * Main data structure for sync_providers().
- */
-struct MasterSync;
-
-
-/**
- * Data structure for one provider we are syncing /config with.
- */
-struct SyncEntry
-{
- /**
- * Kept in a DLL.
- */
- struct SyncEntry *next;
-
- /**
- * Kept in a DLL.
- */
- struct SyncEntry *prev;
-
- /**
- * Sync operation we are part of.
- */
- struct MasterSync *ms;
-
- /**
- * Redux action for this provider.
- */
- struct ANASTASIS_ReduxAction *ra;
-};
-
-/**
- * Main data structure for sync_providers().
- */
-struct MasterSync
-{
- /**
- * Our own sync action we expose externally.
- */
- struct ANASTASIS_ReduxAction ra;
- /**
- * Head of DLL with entries per provider.
- */
- struct SyncEntry *se_head;
- /**
- * Tail of DLL with entries per provider.
- */
- struct SyncEntry *se_tail;
-
- /**
- * Function to call with the result.
- */
- ANASTASIS_ActionCallback cb;
-
- /**
- * Closure for @e cb.
- */
- void *cb_cls;
-
-};
-
-
-/**
- * Free @a cls data structure.
- *
- * @param[in] cls data structure to free, must be a `struct MasterSync *`
- */
-static void
-clean_sync (void *cls)
-{
- struct MasterSync *ms = cls;
- struct SyncEntry *se;
-
- while (NULL != (se = ms->se_head))
- {
- GNUNET_CONTAINER_DLL_remove (ms->se_head,
- ms->se_tail,
- se);
- se->ra->cleanup (se->ra->cleanup_cls);
- GNUNET_free (se);
- }
- GNUNET_free (ms);
-}
-
-
-/**
- * Function called when we have made progress on any of the
- * providers we are trying to sync with.
- *
- * @param cls closure
- * @param error error code, #TALER_EC_NONE if @a new_bs is the new successful state
- * @param new_state the new state of the operation (client should json_incref() to keep an alias)
- */
-static void
-sync_progress (void *cls,
- enum TALER_ErrorCode error,
- json_t *new_state)
-{
- struct SyncEntry *se = cls;
- struct MasterSync *ms = se->ms;
-
- GNUNET_CONTAINER_DLL_remove (ms->se_head,
- ms->se_tail,
- se);
- GNUNET_free (se);
- ms->cb (ms->cb_cls,
- error,
- new_state);
- clean_sync (ms);
-}
-
-
-/**
- * Check if we have information on all providers involved in
- * a recovery procedure, and if not, try to obtain it. Upon
- * success, call @a cb with the updated provider status data.
- *
- * @param[in] state we are in
- * @param arguments our arguments with the solution
- * @param cb functiont o call with the new state
- * @param cb_cls closure for @a cb
- * @return handle to cancel challenge selection step
- */
-static struct ANASTASIS_ReduxAction *
-sync_providers (json_t *state,
- const json_t *arguments,
- ANASTASIS_ActionCallback cb,
- void *cb_cls)
-{
- json_t *rd;
- json_t *cs_arr;
- struct MasterSync *ms;
-
- rd = json_object_get (state,
- "recovery_document");
- if (NULL == rd)
- {
- GNUNET_break (0);
- ANASTASIS_redux_fail_ (cb,
- cb_cls,
- TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
- "'recovery_document' missing");
- return NULL;
- }
- cs_arr = json_object_get (rd,
- "challenges");
- if (! json_is_array (cs_arr))
- {
- GNUNET_break_op (0);
- ANASTASIS_redux_fail_ (cb,
- cb_cls,
- TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
- "'recovery_document' must be an array");
- return NULL;
- }
- ms = GNUNET_new (struct MasterSync);
- ms->cb = cb;
- ms->cb_cls = cb_cls;
- {
- json_t *cs;
- unsigned int n_index;
-
- json_array_foreach (cs_arr, n_index, cs)
- {
- const char *provider_url;
- struct GNUNET_JSON_Specification spec[] = {
- GNUNET_JSON_spec_string ("url",
- &provider_url),
- GNUNET_JSON_spec_end ()
- };
- struct ANASTASIS_CRYPTO_ProviderSaltP provider_salt;
- struct SyncEntry *se;
-
- if (GNUNET_OK !=
- GNUNET_JSON_parse (cs,
- spec,
- NULL, NULL))
- {
- GNUNET_break_op (0);
- ANASTASIS_redux_fail_ (cb,
- cb_cls,
- TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
- "'recovery_document' missing");
- clean_sync (ms);
- return NULL;
- }
- if (GNUNET_OK ==
- ANASTASIS_reducer_lookup_salt (state,
- provider_url,
- &provider_salt))
- continue; /* provider already ready */
- se = GNUNET_new (struct SyncEntry);
- se->ms = ms;
- GNUNET_CONTAINER_DLL_insert (ms->se_head,
- ms->se_tail,
- se);
- se->ra = ANASTASIS_REDUX_add_provider_to_state_ (provider_url,
- state,
- &sync_progress,
- se);
- }
- }
- if (NULL == ms->se_head)
- {
- /* everything already synced */
- clean_sync (ms);
- ANASTASIS_redux_fail_ (cb,
- cb_cls,
- TALER_EC_ANASTASIS_REDUCER_PROVIDERS_ALREADY_SYNCED,
- "already in sync");
- return NULL;
- }
- ms->ra.cleanup = &clean_sync;
- ms->ra.cleanup_cls = ms;
- return &ms->ra;
-}
-
-
-/**
- * Try to obtain configuration information on all configured
- * providers. Upon success, call @a cb with the updated provider
- * status data.
- *
- * @param[in] state we are in
- * @param arguments our arguments with the solution
- * @param cb functiont o call with the new state
- * @param cb_cls closure for @a cb
- * @return handle to cancel challenge selection step
- */
-static struct ANASTASIS_ReduxAction *
-poll_providers (json_t *state,
- const json_t *arguments,
- ANASTASIS_ActionCallback cb,
- void *cb_cls)
-{
- json_t *ap;
- const char *url;
- json_t *obj;
- struct MasterSync *ms;
-
- ap = json_object_get (state,
- "authentication_providers");
- if (NULL == ap)
- {
- GNUNET_break (0);
- ANASTASIS_redux_fail_ (cb,
- cb_cls,
- TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
- "'authentication_providers' missing");
- return NULL;
- }
- ms = GNUNET_new (struct MasterSync);
- ms->cb = cb;
- ms->cb_cls = cb_cls;
- json_object_foreach (ap, url, obj)
- {
- struct ANASTASIS_CRYPTO_ProviderSaltP provider_salt;
- struct SyncEntry *se;
- struct ANASTASIS_ReduxAction *ra;
-
- if (GNUNET_OK ==
- ANASTASIS_reducer_lookup_salt (state,
- url,
- &provider_salt))
- continue;
- se = GNUNET_new (struct SyncEntry);
- se->ms = ms;
- GNUNET_CONTAINER_DLL_insert (ms->se_head,
- ms->se_tail,
- se);
- ra = ANASTASIS_REDUX_add_provider_to_state_ (url,
- state,
- &sync_progress,
- se);
- if (NULL == ra)
- return NULL; /* sync_progress already called! */
- se->ra = ra;
- }
- if (NULL == ms->se_head)
- {
- /* everything already synced */
- clean_sync (ms);
- ANASTASIS_redux_fail_ (cb,
- cb_cls,
- TALER_EC_ANASTASIS_REDUCER_ACTION_INVALID,
- "already in sync");
- return NULL;
- }
- ms->ra.cleanup = &clean_sync;
- ms->ra.cleanup_cls = ms;
- return &ms->ra;
-}
-
-
-/**
* The user pressed "back" during challenge solving.
* Transition back to selecting another challenge.
*
@@ -2603,12 +2308,12 @@ done_secret_selecting (json_t *state,
void *cb_cls)
{
uint32_t mask;
- json_t *pa;
+ const json_t *pa;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_uint32 ("attribute_mask",
&mask),
- GNUNET_JSON_spec_json ("providers",
- &pa),
+ GNUNET_JSON_spec_array_const ("providers",
+ &pa),
GNUNET_JSON_spec_end ()
};
struct ANASTASIS_CRYPTO_ProviderSaltP provider_salt;
@@ -2743,7 +2448,6 @@ done_secret_selecting (json_t *state,
pd->ra.cleanup_cls = pd;
return &pd->ra;
}
-
}
}
@@ -2833,7 +2537,7 @@ ANASTASIS_recovery_action_ (json_t *state,
{
ANASTASIS_RECOVERY_STATE_SECRET_SELECTING,
"poll_providers",
- &poll_providers
+ &ANASTASIS_REDUX_poll_providers_
},
{
ANASTASIS_RECOVERY_STATE_SECRET_SELECTING,
@@ -2853,7 +2557,7 @@ ANASTASIS_recovery_action_ (json_t *state,
{
ANASTASIS_RECOVERY_STATE_CHALLENGE_SELECTING,
"sync_providers",
- &sync_providers
+ &ANASTASIS_REDUX_sync_providers_
},
{
ANASTASIS_RECOVERY_STATE_CHALLENGE_SELECTING,
diff --git a/src/reducer/anastasis_api_redux.c b/src/reducer/anastasis_api_redux.c
index 2271942..4b5ad7b 100644
--- a/src/reducer/anastasis_api_redux.c
+++ b/src/reducer/anastasis_api_redux.c
@@ -1,6 +1,6 @@
/*
This file is part of Anastasis
- Copyright (C) 2020, 2021 Anastasis SARL
+ Copyright (C) 2020, 2021, 2022 Anastasis SARL
Anastasis 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
@@ -36,6 +36,12 @@
*/
#define CONFIG_GENERIC_TIMEOUT GNUNET_TIME_UNIT_MINUTES
+/**
+ * How long do we wait in a more "synchronous"
+ * scenaro for a /config reply from an Anastasis provider.
+ */
+#define CONFIG_FAST_TIMEOUT GNUNET_TIME_UNIT_SECONDS
+
#define GENERATE_STRING(STRING) #STRING,
static const char *generic_strings[] = {
@@ -132,6 +138,21 @@ struct ConfigRequest
struct ConfigReduxWaiting *w_tail;
/**
+ * When did we start?
+ */
+ struct GNUNET_TIME_Absolute start_time;
+
+ /**
+ * When do we time out?
+ */
+ struct GNUNET_TIME_Absolute timeout_at;
+
+ /**
+ * How long do we wait before trying again?
+ */
+ struct GNUNET_TIME_Relative backoff;
+
+ /**
* Obtained status code.
*/
unsigned int http_status;
@@ -545,44 +566,70 @@ notify_waiting (struct ConfigRequest *cr)
w->state);
abort_provider_config_cb (w);
}
+}
+
+/**
+ * Notify anyone waiting on @a cr that the request is done
+ * (successful or failed).
+ *
+ * @param[in,out] cls request that completed
+ */
+static void
+notify_waiting_cb (void *cls)
+{
+ struct ConfigRequest *cr = cls;
+
+ cr->tt = NULL;
+ notify_waiting (cr);
}
/**
+ * Function called when it is time to retry a
+ * failed /config request.
+ *
+ * @param cls the `struct ConfigRequest *` to retry.
+ */
+static void
+retry_config (void *cls);
+
+
+/**
* Function called with the results of a #ANASTASIS_get_config().
*
* @param cls closure
- * @param http_status HTTP status of the request
* @param acfg anastasis configuration
*/
static void
config_cb (void *cls,
- unsigned int http_status,
const struct ANASTASIS_Config *acfg)
{
struct ConfigRequest *cr = cls;
cr->co = NULL;
- GNUNET_SCHEDULER_cancel (cr->tt);
- cr->tt = NULL;
- cr->http_status = http_status;
- if (MHD_HTTP_OK != http_status)
+ if (NULL != cr->tt)
+ {
+ GNUNET_SCHEDULER_cancel (cr->tt);
+ cr->tt = NULL;
+ }
+ cr->http_status = acfg->http_status;
+ if (MHD_HTTP_OK != acfg->http_status)
{
- if (0 == http_status)
+ if (0 == acfg->http_status)
cr->ec = TALER_EC_ANASTASIS_GENERIC_PROVIDER_UNREACHABLE;
else
cr->ec = TALER_EC_ANASTASIS_REDUCER_PROVIDER_CONFIG_FAILED;
}
- if ( (MHD_HTTP_OK == http_status) &&
+ if ( (MHD_HTTP_OK == acfg->http_status) &&
(NULL == acfg) )
{
cr->http_status = MHD_HTTP_NOT_FOUND;
cr->ec = TALER_EC_ANASTASIS_REDUCER_PROVIDER_CONFIG_FAILED;
}
- else if (NULL != acfg)
+ else
{
- if (0 == acfg->storage_limit_in_megabytes)
+ if (0 == acfg->details.ok.storage_limit_in_megabytes)
{
cr->http_status = 0;
cr->ec = TALER_EC_ANASTASIS_REDUCER_PROVIDER_INVALID_CONFIG;
@@ -591,26 +638,36 @@ config_cb (void *cls,
{
cr->ec = TALER_EC_NONE;
GNUNET_free (cr->business_name);
- cr->business_name = GNUNET_strdup (acfg->business_name);
+ cr->business_name = GNUNET_strdup (acfg->details.ok.business_name);
for (unsigned int i = 0; i<cr->methods_length; i++)
GNUNET_free (cr->methods[i].type);
GNUNET_free (cr->methods);
- cr->methods = GNUNET_new_array (acfg->methods_length,
+ cr->methods = GNUNET_new_array (acfg->details.ok.methods_length,
struct AuthorizationMethodConfig);
- for (unsigned int i = 0; i<acfg->methods_length; i++)
+ for (unsigned int i = 0; i<acfg->details.ok.methods_length; i++)
{
- cr->methods[i].type = GNUNET_strdup (acfg->methods[i].type);
- cr->methods[i].usage_fee = acfg->methods[i].usage_fee;
+ cr->methods[i].type = GNUNET_strdup (acfg->details.ok.methods[i].type);
+ cr->methods[i].usage_fee = acfg->details.ok.methods[i].usage_fee;
}
- cr->methods_length = acfg->methods_length;
- cr->storage_limit_in_megabytes = acfg->storage_limit_in_megabytes;
- cr->annual_fee = acfg->annual_fee;
- cr->truth_upload_fee = acfg->truth_upload_fee;
- cr->liability_limit = acfg->liability_limit;
- cr->provider_salt = acfg->provider_salt;
+ cr->methods_length = acfg->details.ok.methods_length;
+ cr->storage_limit_in_megabytes =
+ acfg->details.ok.storage_limit_in_megabytes;
+ cr->annual_fee = acfg->details.ok.annual_fee;
+ cr->truth_upload_fee = acfg->details.ok.truth_upload_fee;
+ cr->liability_limit = acfg->details.ok.liability_limit;
+ cr->provider_salt = acfg->details.ok.provider_salt;
}
}
notify_waiting (cr);
+ if (MHD_HTTP_OK != acfg->http_status)
+ {
+ cr->backoff = GNUNET_TIME_STD_BACKOFF (cr->backoff);
+ GNUNET_assert (NULL == cr->tt);
+ GNUNET_assert (NULL != cr->url);
+ cr->tt = GNUNET_SCHEDULER_add_delayed (cr->backoff,
+ &retry_config,
+ cr);
+ }
}
@@ -625,22 +682,57 @@ config_request_timeout (void *cls)
struct ConfigRequest *cr = cls;
cr->tt = NULL;
- ANASTASIS_config_cancel (cr->co);
- cr->co = NULL;
+ if (NULL != cr->co)
+ {
+ ANASTASIS_config_cancel (cr->co);
+ cr->co = NULL;
+ }
cr->http_status = 0;
cr->ec = TALER_EC_GENERIC_TIMEOUT;
notify_waiting (cr);
+ cr->backoff = GNUNET_TIME_STD_BACKOFF (cr->backoff);
+ GNUNET_assert (NULL == cr->tt);
+ GNUNET_assert (NULL != cr->url);
+ cr->tt = GNUNET_SCHEDULER_add_delayed (cr->backoff,
+ &retry_config,
+ cr);
+}
+
+
+static void
+retry_config (void *cls)
+{
+ struct ConfigRequest *cr = cls;
+
+ cr->tt = NULL;
+ if (NULL != cr->co)
+ {
+ ANASTASIS_config_cancel (cr->co);
+ cr->co = NULL;
+ }
+ cr->timeout_at = GNUNET_TIME_relative_to_absolute (CONFIG_GENERIC_TIMEOUT);
+ GNUNET_assert (NULL == cr->tt);
+ cr->tt = GNUNET_SCHEDULER_add_at (cr->timeout_at,
+ &config_request_timeout,
+ cr);
+ cr->co = ANASTASIS_get_config (ANASTASIS_REDUX_ctx_,
+ cr->url,
+ &config_cb,
+ cr);
+ GNUNET_break (NULL != cr->co);
}
/**
* Schedule job to obtain Anastasis provider configuration at @a url.
*
+ * @param timeout how long to wait for a reply
* @param url base URL of Anastasis provider
* @return check config handle
*/
static struct ConfigRequest *
-check_config (const char *url)
+check_config (struct GNUNET_TIME_Relative timeout,
+ const char *url)
{
struct ConfigRequest *cr;
@@ -650,12 +742,34 @@ check_config (const char *url)
cr->url))
continue;
if (NULL != cr->co)
+ {
+ struct GNUNET_TIME_Relative duration;
+ struct GNUNET_TIME_Relative left;
+ struct GNUNET_TIME_Relative xleft;
+
+ duration = GNUNET_TIME_absolute_get_duration (cr->start_time);
+ left = GNUNET_TIME_relative_subtract (timeout,
+ duration);
+ xleft = GNUNET_TIME_absolute_get_remaining (cr->timeout_at);
+ if (GNUNET_TIME_relative_cmp (left,
+ <,
+ xleft))
+ {
+ /* new timeout is shorter! */
+ cr->timeout_at = GNUNET_TIME_relative_to_absolute (left);
+ GNUNET_SCHEDULER_cancel (cr->tt);
+ cr->tt = GNUNET_SCHEDULER_add_at (cr->timeout_at,
+ &config_request_timeout,
+ cr);
+ }
return cr; /* already on it */
+ }
break;
}
if (NULL == cr)
{
cr = GNUNET_new (struct ConfigRequest);
+ cr->start_time = GNUNET_TIME_absolute_get ();
cr->url = GNUNET_strdup (url);
GNUNET_CONTAINER_DLL_insert (cr_head,
cr_tail,
@@ -663,6 +777,12 @@ check_config (const char *url)
}
if (MHD_HTTP_OK == cr->http_status)
return cr;
+ cr->timeout_at = GNUNET_TIME_relative_to_absolute (timeout);
+ if (NULL != cr->tt)
+ GNUNET_SCHEDULER_cancel (cr->tt);
+ cr->tt = GNUNET_SCHEDULER_add_at (cr->timeout_at,
+ &config_request_timeout,
+ cr);
cr->co = ANASTASIS_get_config (ANASTASIS_REDUX_ctx_,
cr->url,
&config_cb,
@@ -672,9 +792,6 @@ check_config (const char *url)
GNUNET_break (0);
return NULL;
}
- cr->tt = GNUNET_SCHEDULER_add_delayed (CONFIG_GENERIC_TIMEOUT,
- &config_request_timeout,
- cr);
return cr;
}
@@ -761,6 +878,9 @@ begin_provider_config_check (const char *cc,
cc)) )
{
/* skip */
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Skipping provider restricted to country `%s'\n",
+ restricted);
continue;
}
if ( (NULL == restricted) &&
@@ -780,7 +900,8 @@ begin_provider_config_check (const char *cc,
json_object_set_new (pl,
url,
prov));
- check_config (url);
+ check_config (CONFIG_GENERIC_TIMEOUT,
+ url);
}
GNUNET_assert (0 ==
json_object_set_new (state,
@@ -1144,7 +1265,8 @@ ANASTASIS_REDUX_add_provider_to_state_ (const char *url,
struct ConfigRequest *cr;
struct ConfigReduxWaiting *w;
- cr = check_config (url);
+ cr = check_config (CONFIG_FAST_TIMEOUT,
+ url);
w = GNUNET_new (struct ConfigReduxWaiting);
w->cr = cr;
w->state = json_incref (state);
@@ -1157,8 +1279,10 @@ ANASTASIS_REDUX_add_provider_to_state_ (const char *url,
w);
if (NULL == cr->co)
{
- notify_waiting (cr);
- return NULL;
+ if (NULL != cr->tt)
+ GNUNET_SCHEDULER_cancel (cr->tt);
+ cr->tt = GNUNET_SCHEDULER_add_now (&notify_waiting_cb,
+ cr);
}
return &w->ra;
}
diff --git a/src/reducer/anastasis_api_redux.h b/src/reducer/anastasis_api_redux.h
index cc59713..03eef33 100644
--- a/src/reducer/anastasis_api_redux.h
+++ b/src/reducer/anastasis_api_redux.h
@@ -108,6 +108,42 @@ ANASTASIS_REDUX_load_continents_ (void);
/**
+ * Try to obtain configuration information on all configured
+ * providers. Upon success, call @a cb with the updated provider
+ * status data.
+ *
+ * @param[in] state we are in
+ * @param arguments our arguments with the solution
+ * @param cb functiont o call with the new state
+ * @param cb_cls closure for @a cb
+ * @return handle to cancel challenge selection step
+ */
+struct ANASTASIS_ReduxAction *
+ANASTASIS_REDUX_poll_providers_ (json_t *state,
+ const json_t *arguments,
+ ANASTASIS_ActionCallback cb,
+ void *cb_cls);
+
+
+/**
+ * Check if we have information on all providers involved in
+ * a recovery procedure, and if not, try to obtain it. Upon
+ * success, call @a cb with the updated provider status data.
+ *
+ * @param[in] state we are in
+ * @param arguments our arguments with the solution
+ * @param cb functiont o call with the new state
+ * @param cb_cls closure for @a cb
+ * @return handle to cancel challenge selection step
+ */
+struct ANASTASIS_ReduxAction *
+ANASTASIS_REDUX_sync_providers_ (json_t *state,
+ const json_t *arguments,
+ ANASTASIS_ActionCallback cb,
+ void *cb_cls);
+
+
+/**
* Returns the enum value to a string value of a state.
*
* @param state_string string to convert
diff --git a/src/restclient/Makefile.am b/src/restclient/Makefile.am
index 9bee2dd..1a4d83c 100644
--- a/src/restclient/Makefile.am
+++ b/src/restclient/Makefile.am
@@ -29,9 +29,10 @@ libanastasisrest_la_LIBADD = \
-lgnunetutil \
-ljansson \
-ltalerjson \
- -ltalerutil \
+ -ltalercurl \
-ltalermerchant \
-ltalerjson \
+ -ltalerutil \
$(XLIB)
if HAVE_LIBCURL
diff --git a/src/restclient/anastasis_api_config.c b/src/restclient/anastasis_api_config.c
index 5dcc7ec..fff4774 100644
--- a/src/restclient/anastasis_api_config.c
+++ b/src/restclient/anastasis_api_config.c
@@ -86,6 +86,10 @@ handle_config_finished (void *cls,
{
struct ANASTASIS_ConfigOperation *co = cls;
const json_t *json = response;
+ struct ANASTASIS_Config acfg = {
+ .http_status = response_code,
+ .response = json
+ };
co->job = NULL;
switch (response_code)
@@ -99,27 +103,29 @@ handle_config_finished (void *cls,
case MHD_HTTP_OK:
{
const char *name;
- struct ANASTASIS_Config acfg;
- json_t *methods;
+ const json_t *methods;
+ struct TALER_JSON_ProtocolVersion pv;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_string ("name",
&name),
GNUNET_JSON_spec_string ("business_name",
- &acfg.business_name),
+ &acfg.details.ok.business_name),
GNUNET_JSON_spec_string ("version",
- &acfg.version),
- GNUNET_JSON_spec_json ("methods",
- &methods),
+ &acfg.details.ok.version),
+ TALER_JSON_spec_version ("version",
+ &pv),
+ GNUNET_JSON_spec_array_const ("methods",
+ &methods),
GNUNET_JSON_spec_uint32 ("storage_limit_in_megabytes",
- &acfg.storage_limit_in_megabytes),
+ &acfg.details.ok.storage_limit_in_megabytes),
TALER_JSON_spec_amount_any ("annual_fee",
- &acfg.annual_fee),
+ &acfg.details.ok.annual_fee),
TALER_JSON_spec_amount_any ("truth_upload_fee",
- &acfg.truth_upload_fee),
+ &acfg.details.ok.truth_upload_fee),
TALER_JSON_spec_amount_any ("liability_limit",
- &acfg.liability_limit),
+ &acfg.details.ok.liability_limit),
GNUNET_JSON_spec_fixed_auto ("provider_salt",
- &acfg.provider_salt),
+ &acfg.details.ok.provider_salt),
GNUNET_JSON_spec_end ()
};
@@ -132,67 +138,44 @@ handle_config_finished (void *cls,
json_dumpf (json,
stderr,
JSON_INDENT (2));
- response_code = 0;
+ acfg.http_status = 0;
+ acfg.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
break;
}
if (0 != strcmp (name,
"anastasis"))
{
GNUNET_JSON_parse_free (spec);
- response_code = 0;
+ acfg.http_status = 0;
+ acfg.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
break;
}
+ if ( (ANASTASIS_PROTOCOL_CURRENT < pv.current) &&
+ (ANASTASIS_PROTOCOL_CURRENT < pv.current - pv.age) )
{
- unsigned int age;
- unsigned int revision;
- unsigned int current;
- char dummy;
-
- if (3 != sscanf (acfg.version,
- "%u:%u:%u%c",
- &current,
- &revision,
- &age,
- &dummy))
- {
- GNUNET_break_op (0);
- response_code = 0;
- GNUNET_JSON_parse_free (spec);
- break;
- }
- if ( (ANASTASIS_PROTOCOL_CURRENT < current) &&
- (ANASTASIS_PROTOCOL_CURRENT < current - age) )
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Provider protocol version too new\n");
- response_code = 0;
- GNUNET_JSON_parse_free (spec);
- break;
- }
- if ( (ANASTASIS_PROTOCOL_CURRENT > current) &&
- (ANASTASIS_PROTOCOL_CURRENT - ANASTASIS_PROTOCOL_AGE > current) )
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Provider protocol version too old\n");
- GNUNET_break_op (0);
- response_code = 0;
- GNUNET_JSON_parse_free (spec);
- break;
- }
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Provider protocol version too new\n");
+ acfg.http_status = 0;
+ acfg.ec = TALER_EC_GENERIC_VERSION_MALFORMED;
+ break;
}
- if (! json_is_array (methods))
+ if ( (ANASTASIS_PROTOCOL_CURRENT > pv.current) &&
+ (ANASTASIS_PROTOCOL_CURRENT - ANASTASIS_PROTOCOL_AGE > pv.current) )
{
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Provider protocol version too old\n");
GNUNET_break_op (0);
- GNUNET_JSON_parse_free (spec);
- response_code = 0;
+ acfg.http_status = 0;
+ acfg.ec = TALER_EC_GENERIC_VERSION_MALFORMED;
break;
}
- acfg.methods_length = json_array_size (methods);
+ acfg.details.ok.methods_length = json_array_size (methods);
{
struct ANASTASIS_AuthorizationMethodConfig mcfg[GNUNET_NZL (
- acfg.methods_length)];
+ acfg.details.ok.
+ methods_length)];
- for (unsigned int i = 0; i<acfg.methods_length; i++)
+ for (unsigned int i = 0; i<acfg.details.ok.methods_length; i++)
{
struct ANASTASIS_AuthorizationMethodConfig *m = &mcfg[i];
struct GNUNET_JSON_Specification spec[] = {
@@ -210,19 +193,17 @@ handle_config_finished (void *cls,
NULL, NULL)) )
{
GNUNET_break_op (0);
- GNUNET_JSON_parse_free (spec);
- response_code = 0;
+ acfg.http_status = 0;
+ acfg.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
goto end;
}
}
- acfg.methods = mcfg;
+ acfg.details.ok.methods = mcfg;
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Good backend found at `%s'\n",
co->url);
co->cb (co->cb_cls,
- MHD_HTTP_OK,
&acfg);
- GNUNET_JSON_parse_free (spec);
ANASTASIS_config_cancel (co);
return;
}
@@ -248,8 +229,7 @@ handle_config_finished (void *cls,
}
end:
co->cb (co->cb_cls,
- response_code,
- NULL);
+ &acfg);
ANASTASIS_config_cancel (co);
}
diff --git a/src/restclient/anastasis_api_curl_defaults.c b/src/restclient/anastasis_api_curl_defaults.c
index 33665e0..f64347b 100644
--- a/src/restclient/anastasis_api_curl_defaults.c
+++ b/src/restclient/anastasis_api_curl_defaults.c
@@ -20,6 +20,7 @@
* @author Florian Dold
*/
#include "platform.h"
+#include <taler/taler_curl_lib.h>
#include "anastasis_api_curl_defaults.h"
CURL *
@@ -34,20 +35,12 @@ ANASTASIS_curl_easy_get_ (const char *url)
curl_easy_setopt (eh,
CURLOPT_URL,
url));
- GNUNET_assert (CURLE_OK ==
- curl_easy_setopt (eh,
- CURLOPT_FOLLOWLOCATION,
- 1L));
+ TALER_curl_set_secure_redirect_policy (eh,
+ url);
GNUNET_assert (CURLE_OK ==
curl_easy_setopt (eh,
CURLOPT_TCP_FASTOPEN,
1L));
- /* limit MAXREDIRS to 5 as a simple security measure against
- a potential infinite loop caused by a malicious target */
- GNUNET_assert (CURLE_OK ==
- curl_easy_setopt (eh,
- CURLOPT_MAXREDIRS,
- 5L));
/* Enable compression (using whatever curl likes), see
https://curl.se/libcurl/c/CURLOPT_ACCEPT_ENCODING.html */
GNUNET_break (CURLE_OK ==
diff --git a/src/restclient/anastasis_api_policy_lookup.c b/src/restclient/anastasis_api_policy_lookup.c
index 42db90d..b3132ef 100644
--- a/src/restclient/anastasis_api_policy_lookup.c
+++ b/src/restclient/anastasis_api_policy_lookup.c
@@ -106,6 +106,9 @@ handle_policy_lookup_finished (void *cls,
size_t data_size)
{
struct ANASTASIS_PolicyLookupOperation *plo = cls;
+ struct ANASTASIS_DownloadDetails dd = {
+ .http_status = response_code
+ };
plo->job = NULL;
switch (response_code)
@@ -117,7 +120,6 @@ handle_policy_lookup_finished (void *cls,
break;
case MHD_HTTP_OK:
{
- struct ANASTASIS_DownloadDetails dd;
struct ANASTASIS_UploadSignaturePS usp = {
.purpose.purpose = htonl (TALER_SIGNATURE_ANASTASIS_POLICY_UPLOAD),
.purpose.size = htonl (sizeof (usp)),
@@ -133,18 +135,17 @@ handle_policy_lookup_finished (void *cls,
&plo->account_pub.pub))
{
GNUNET_break_op (0);
- response_code = 0;
+ dd.http_status = 0;
+ dd.ec = -1; // FIXME: needs new code in Gana!
break;
}
/* Success, call callback with all details! */
- memset (&dd, 0, sizeof (dd));
- dd.sig = plo->account_sig;
- dd.curr_policy_hash = usp.new_recovery_data_hash;
- dd.policy = data;
- dd.policy_size = data_size;
- dd.version = plo->version;
+ dd.details.ok.sig = plo->account_sig;
+ dd.details.ok.curr_policy_hash = usp.new_recovery_data_hash;
+ dd.details.ok.policy = data;
+ dd.details.ok.policy_size = data_size;
+ dd.details.ok.version = plo->version;
plo->cb (plo->cb_cls,
- response_code,
&dd);
plo->cb = NULL;
ANASTASIS_policy_lookup_cancel (plo);
@@ -167,12 +168,10 @@ handle_policy_lookup_finished (void *cls,
"Unexpected response code %u\n",
(unsigned int) response_code);
GNUNET_break (0);
- response_code = 0;
break;
}
plo->cb (plo->cb_cls,
- response_code,
- NULL);
+ &dd);
plo->cb = NULL;
ANASTASIS_policy_lookup_cancel (plo);
}
diff --git a/src/restclient/anastasis_api_policy_meta_lookup.c b/src/restclient/anastasis_api_policy_meta_lookup.c
index 3d1482f..cf381fd 100644
--- a/src/restclient/anastasis_api_policy_meta_lookup.c
+++ b/src/restclient/anastasis_api_policy_meta_lookup.c
@@ -90,6 +90,10 @@ handle_policy_meta_lookup_finished (void *cls,
{
struct ANASTASIS_PolicyMetaLookupOperation *plo = cls;
const json_t *json = response;
+ struct ANASTASIS_MetaDownloadDetails mdd = {
+ .http_status = response_code,
+ .response = json
+ };
plo->job = NULL;
switch (response_code)
@@ -116,10 +120,6 @@ handle_policy_meta_lookup_finished (void *cls,
{
struct ANASTASIS_MetaDataEntry metas[GNUNET_NZL (mlen)];
void *md[GNUNET_NZL (mlen)];
- struct ANASTASIS_MetaDownloadDetails mdd = {
- .metas = metas,
- .metas_length = mlen
- };
size_t off = 0;
const char *label;
const json_t *val;
@@ -127,6 +127,8 @@ handle_policy_meta_lookup_finished (void *cls,
memset (md,
0,
sizeof (md));
+ mdd.details.ok.metas = metas;
+ mdd.details.ok.metas_length = mlen;
json_object_foreach ((json_t *) json,
label,
val)
@@ -148,6 +150,8 @@ handle_policy_meta_lookup_finished (void *cls,
&dummy))
{
GNUNET_break (0);
+ mdd.http_status = 0;
+ mdd.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
break;
}
if (GNUNET_OK !=
@@ -156,6 +160,8 @@ handle_policy_meta_lookup_finished (void *cls,
NULL, NULL))
{
GNUNET_break_op (0);
+ mdd.http_status = 0;
+ mdd.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
break;
}
metas[off].version = (uint32_t) ver;
@@ -165,13 +171,13 @@ handle_policy_meta_lookup_finished (void *cls,
if (off < mlen)
{
GNUNET_break (0);
- response_code = 0;
+ mdd.http_status = 0;
+ mdd.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
for (size_t i = 0; i<off; i++)
GNUNET_free (md[i]);
break;
}
plo->cb (plo->cb_cls,
- response_code,
&mdd);
for (size_t i = 0; i<off; i++)
GNUNET_free (md[i]);
@@ -197,15 +203,13 @@ handle_policy_meta_lookup_finished (void *cls,
"Unexpected response code %u\n",
(unsigned int) response_code);
GNUNET_break (0);
- response_code = 0;
break;
}
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"HTTP status for policy meta lookup is %u\n",
(unsigned int) response_code);
plo->cb (plo->cb_cls,
- response_code,
- NULL);
+ &mdd);
plo->cb = NULL;
ANASTASIS_policy_meta_lookup_cancel (plo);
}
diff --git a/src/restclient/anastasis_api_policy_store.c b/src/restclient/anastasis_api_policy_store.c
index 5cfcfcb..3afee7d 100644
--- a/src/restclient/anastasis_api_policy_store.c
+++ b/src/restclient/anastasis_api_policy_store.c
@@ -417,7 +417,7 @@ ANASTASIS_policy_store (
val = GNUNET_STRINGS_data_to_string_alloc (&usp.new_recovery_data_hash,
sizeof (struct GNUNET_HashCode));
GNUNET_asprintf (&hdr,
- "%s: %s",
+ "%s: \"%s\"",
MHD_HTTP_HEADER_IF_NONE_MATCH,
val);
GNUNET_free (val);
diff --git a/src/restclient/anastasis_api_truth_challenge.c b/src/restclient/anastasis_api_truth_challenge.c
index aa9119c..7a39db5 100644
--- a/src/restclient/anastasis_api_truth_challenge.c
+++ b/src/restclient/anastasis_api_truth_challenge.c
@@ -124,7 +124,7 @@ handle_truth_challenge_finished (void *cls,
const char *ct;
const char *tan_hint = NULL;
const char *filename = NULL;
- json_t *wire_details = NULL;
+ const json_t *wire_details = NULL;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_string (
"challenge_type",
@@ -138,8 +138,8 @@ handle_truth_challenge_finished (void *cls,
&filename),
NULL),
GNUNET_JSON_spec_mark_optional (
- GNUNET_JSON_spec_json ("wire_details",
- &wire_details),
+ GNUNET_JSON_spec_object_const ("wire_details",
+ &wire_details),
NULL),
GNUNET_JSON_spec_end ()
};
@@ -204,7 +204,6 @@ handle_truth_challenge_finished (void *cls,
NULL, NULL))
{
GNUNET_break_op (0);
- GNUNET_JSON_parse_free (spec);
tcd.http_status = 0;
tcd.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
break;
@@ -212,7 +211,6 @@ handle_truth_challenge_finished (void *cls,
tcd.details.success.cs = ANASTASIS_CS_WIRE_FUNDS;
tco->cb (tco->cb_cls,
&tcd);
- GNUNET_JSON_parse_free (spec);
ANASTASIS_truth_challenge_cancel (tco);
return;
}
diff --git a/src/restclient/anastasis_api_truth_store.c b/src/restclient/anastasis_api_truth_store.c
index c1cf634..855ad5a 100644
--- a/src/restclient/anastasis_api_truth_store.c
+++ b/src/restclient/anastasis_api_truth_store.c
@@ -169,10 +169,18 @@ handle_truth_store_finished (void *cls,
ud.ec = TALER_JSON_get_error_code2 (data,
data_size);
break;
+ case MHD_HTTP_BAD_GATEWAY:
+ ud.ec = TALER_JSON_get_error_code2 (data,
+ data_size);
+ break;
default:
- GNUNET_break (0);
ud.ec = TALER_JSON_get_error_code2 (data,
data_size);
+ GNUNET_break (0);
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Unexpected HTTP status code %u/%d\n",
+ (unsigned int) response_code,
+ ud.ec);
break;
}
tso->cb (tso->cb_cls,
diff --git a/src/stasis/Makefile.am b/src/stasis/Makefile.am
index 140f65e..0197f0e 100644
--- a/src/stasis/Makefile.am
+++ b/src/stasis/Makefile.am
@@ -16,9 +16,9 @@ endif
sqldir = $(prefix)/share/anastasis/sql/
sql_DATA = \
- stasis-0000.sql \
+ versioning.sql \
stasis-0001.sql \
- drop0001.sql
+ drop.sql
pkgcfgdir = $(prefix)/share/anastasis/config.d/
@@ -59,16 +59,16 @@ libanastasisdb_la_LDFLAGS = \
libanastasis_plugin_db_postgres_la_SOURCES = \
plugin_anastasis_postgres.c
-libanastasis_plugin_db_postgres_la_LIBADD = \
- $(LTLIBINTL)
libanastasis_plugin_db_postgres_la_LDFLAGS = \
+ $(ANASTASIS_PLUGIN_LDFLAGS)
+libanastasis_plugin_db_postgres_la_LIBADD = \
+ $(LTLIBINTL) \
$(top_builddir)/src/util/libanastasisutil.la \
- $(ANASTASIS_PLUGIN_LDFLAGS) \
- -lgnunetpq \
- -lpq \
-ltalerpq \
-ltalerutil \
+ -lgnunetpq \
-lgnunetutil \
+ -lpq \
$(XLIB)
check_PROGRAMS = \
@@ -83,7 +83,6 @@ test_anastasis_db_postgres_LDFLAGS = \
-lgnunetpq \
-ltalerutil \
-ltalerpq \
- -luuid \
$(XLIB)
AM_TESTS_ENVIRONMENT=export ANASTASIS_PREFIX=$${ANASTASIS_PREFIX:-@libdir@};export PATH=$${ANASTASIS_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
diff --git a/src/stasis/drop0001.sql b/src/stasis/drop.sql
index c7697c0..357fa9d 100644
--- a/src/stasis/drop0001.sql
+++ b/src/stasis/drop.sql
@@ -1,6 +1,6 @@
--
-- This file is part of ANASTASIS
--- Copyright (C) 2014--2020 Anastasis Systems SA
+-- Copyright (C) 2014--2022 Anastasis Systems SA
--
-- ANASTASIS 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
@@ -17,22 +17,15 @@
-- Everything in one big transaction
BEGIN;
--- This script DROPs all of the tables we create.
---
--- Unlike the other SQL files, it SHOULD be updated to reflect the
--- latest requirements for dropping tables.
-
--- Drops for 0001.sql
-DROP TABLE IF EXISTS anastasis_truth CASCADE;
-DROP TABLE IF EXISTS anastasis_user CASCADE;
-DROP TABLE IF EXISTS anastasis_recdoc_payment;
-DROP TABLE IF EXISTS anastasis_recoverydocument;
-DROP TABLE IF EXISTS anastasis_challengecode;
-DROP TABLE IF EXISTS anastasis_challenge_payment;
-DROP TABLE IF EXISTS anastasis_auth_iban_in;
+WITH xpatches AS (
+ SELECT patch_name
+ FROM _v.patches
+ WHERE starts_with(patch_name,'stasis-')
+)
+ SELECT _v.unregister_patch(xpatches.patch_name)
+ FROM xpatches;
--- Unregister patch (0001.sql)
-SELECT _v.unregister_patch('stasis-0001');
+DROP SCHEMA anastasis CASCADE;
-- And we're out of here...
COMMIT;
diff --git a/src/stasis/plugin_anastasis_postgres.c b/src/stasis/plugin_anastasis_postgres.c
index 3b1136d..9f4b969 100644
--- a/src/stasis/plugin_anastasis_postgres.c
+++ b/src/stasis/plugin_anastasis_postgres.c
@@ -83,16 +83,19 @@ postgres_drop_tables (void *cls)
{
struct PostgresClosure *pg = cls;
struct GNUNET_PQ_Context *conn;
+ enum GNUNET_GenericReturnValue ret;
conn = GNUNET_PQ_connect_with_cfg (pg->cfg,
"stasis-postgres",
- "drop",
+ NULL,
NULL,
NULL);
if (NULL == conn)
return GNUNET_SYSERR;
+ ret = GNUNET_PQ_exec_sql (conn,
+ "drop");
GNUNET_PQ_disconnect (conn);
- return GNUNET_OK;
+ return ret;
}
@@ -107,11 +110,15 @@ postgres_create_tables (void *cls)
{
struct PostgresClosure *pc = cls;
struct GNUNET_PQ_Context *conn;
+ struct GNUNET_PQ_ExecuteStatement es[] = {
+ GNUNET_PQ_make_execute ("SET search_path TO anastasis;"),
+ GNUNET_PQ_EXECUTE_STATEMENT_END
+ };
conn = GNUNET_PQ_connect_with_cfg (pc->cfg,
"stasis-postgres",
"stasis-",
- NULL,
+ es,
NULL);
if (NULL == conn)
return GNUNET_SYSERR;
@@ -136,54 +143,44 @@ prepare_statements (void *cls)
"(user_id"
",expiration_date"
") VALUES "
- "($1, $2);",
- 2),
+ "($1, $2);"),
GNUNET_PQ_make_prepare ("do_commit",
- "COMMIT",
- 0),
+ "COMMIT"),
GNUNET_PQ_make_prepare ("user_select",
"SELECT"
" expiration_date "
"FROM anastasis_user"
" WHERE user_id=$1"
- " FOR UPDATE;",
- 1),
+ " FOR UPDATE;"),
GNUNET_PQ_make_prepare ("user_update",
"UPDATE anastasis_user"
" SET "
" expiration_date=$1"
- " WHERE user_id=$2;",
- 2),
+ " WHERE user_id=$2;"),
GNUNET_PQ_make_prepare ("recdoc_payment_insert",
"INSERT INTO anastasis_recdoc_payment "
"(user_id"
",post_counter"
- ",amount_val"
- ",amount_frac"
+ ",amount"
",payment_identifier"
",creation_date"
") VALUES "
- "($1, $2, $3, $4, $5, $6);",
- 6),
+ "($1, $2, $3, $4, $5);"),
GNUNET_PQ_make_prepare ("challenge_payment_insert",
"INSERT INTO anastasis_challenge_payment "
"(truth_uuid"
- ",amount_val"
- ",amount_frac"
+ ",amount"
",payment_identifier"
",creation_date"
") VALUES "
- "($1, $2, $3, $4, $5);",
- 5),
+ "($1, $2, $3, $4);"),
GNUNET_PQ_make_prepare ("truth_payment_insert",
"INSERT INTO anastasis_truth_payment "
"(truth_uuid"
- ",amount_val"
- ",amount_frac"
+ ",amount"
",expiration"
") VALUES "
- "($1, $2, $3, $4);",
- 4),
+ "($1, $2, $3);"),
GNUNET_PQ_make_prepare ("recdoc_payment_done",
"UPDATE anastasis_recdoc_payment "
"SET"
@@ -193,8 +190,7 @@ prepare_statements (void *cls)
" AND"
" user_id=$2"
" AND"
- " paid=FALSE;",
- 2),
+ " paid=FALSE;"),
GNUNET_PQ_make_prepare ("challenge_refund_update",
"UPDATE anastasis_challenge_payment "
"SET"
@@ -204,8 +200,7 @@ prepare_statements (void *cls)
" AND"
" paid=TRUE"
" AND"
- " truth_uuid=$2;",
- 2),
+ " truth_uuid=$2;"),
GNUNET_PQ_make_prepare ("challenge_payment_done",
"UPDATE anastasis_challenge_payment "
"SET"
@@ -217,43 +212,36 @@ prepare_statements (void *cls)
" AND"
" truth_uuid=$2"
" AND"
- " paid=FALSE;",
- 2),
+ " paid=FALSE;"),
GNUNET_PQ_make_prepare ("recdoc_payment_select",
"SELECT"
" creation_date"
",post_counter"
- ",amount_val"
- ",amount_frac"
+ ",amount"
",paid"
" FROM anastasis_recdoc_payment"
- " WHERE payment_identifier=$1;",
- 1),
+ " WHERE payment_identifier=$1;"),
GNUNET_PQ_make_prepare ("truth_payment_select",
"SELECT"
" expiration"
" FROM anastasis_truth_payment"
" WHERE truth_uuid=$1"
- " AND expiration>$2;",
- 2),
+ " AND expiration>$2;"),
GNUNET_PQ_make_prepare ("challenge_payment_select",
"SELECT"
" creation_date"
- ",amount_val"
- ",amount_frac"
+ ",amount"
",paid"
" FROM anastasis_challenge_payment"
" WHERE payment_identifier=$1"
" AND truth_uuid=$2"
" AND refunded=FALSE"
- " AND counter>0;",
- 1),
+ " AND counter>0;"),
GNUNET_PQ_make_prepare ("challenge_pending_payment_select",
"SELECT"
" creation_date"
",payment_identifier"
- ",amount_val"
- ",amount_frac"
+ ",amount"
" FROM anastasis_challenge_payment"
" WHERE"
" paid=FALSE"
@@ -262,29 +250,24 @@ prepare_statements (void *cls)
" AND"
" truth_uuid=$1"
" AND"
- " creation_date > $2;",
- 1),
+ " creation_date > $2;"),
GNUNET_PQ_make_prepare ("recdoc_payments_select",
"SELECT"
" user_id"
",payment_identifier"
- ",amount_val"
- ",amount_frac"
+ ",amount"
" FROM anastasis_recdoc_payment"
- " WHERE paid=FALSE;",
- 0),
+ " WHERE paid=FALSE;"),
GNUNET_PQ_make_prepare ("gc_accounts",
"DELETE FROM anastasis_user "
"WHERE"
- " expiration_date < $1;",
- 1),
+ " expiration_date < $1;"),
GNUNET_PQ_make_prepare ("gc_recdoc_pending_payments",
"DELETE FROM anastasis_recdoc_payment "
"WHERE"
" paid=FALSE"
" AND"
- " creation_date < $1;",
- 1),
+ " creation_date < $1;"),
GNUNET_PQ_make_prepare ("gc_challenge_pending_payments",
"DELETE FROM anastasis_challenge_payment "
"WHERE"
@@ -292,8 +275,7 @@ prepare_statements (void *cls)
" OR"
" refunded=TRUE)"
" AND"
- " creation_date < $1;",
- 1),
+ " creation_date < $1;"),
GNUNET_PQ_make_prepare ("truth_insert",
"INSERT INTO anastasis_truth "
"(truth_uuid"
@@ -303,29 +285,24 @@ prepare_statements (void *cls)
",truth_mime"
",expiration"
") VALUES "
- "($1, $2, $3, $4, $5, $6);",
- 6),
+ "($1, $2, $3, $4, $5, $6);"),
GNUNET_PQ_make_prepare ("test_auth_iban_payment",
"SELECT"
- " credit_val"
- ",credit_frac"
+ " credit"
",wire_subject"
" FROM anastasis_auth_iban_in"
" WHERE debit_account_details=$1"
- " AND execution_date>=$2;",
- 2),
+ " AND execution_date>=$2;"),
GNUNET_PQ_make_prepare ("store_auth_iban_payment_details",
"INSERT INTO anastasis_auth_iban_in "
"(wire_reference"
",wire_subject"
- ",credit_val"
- ",credit_frac"
+ ",credit"
",debit_account_details"
",credit_account_details"
",execution_date"
") VALUES "
- "($1, $2, $3, $4, $5, $6, $7);",
- 7),
+ "($1, $2, $3, $4, $5, $6);"),
GNUNET_PQ_make_prepare ("recovery_document_insert",
"INSERT INTO anastasis_recoverydocument "
"(user_id"
@@ -336,16 +313,14 @@ prepare_statements (void *cls)
",recovery_meta_data"
",creation_date"
") VALUES "
- "($1, $2, $3, $4, $5, $6, $7);",
- 7),
+ "($1, $2, $3, $4, $5, $6, $7);"),
GNUNET_PQ_make_prepare ("truth_select",
"SELECT "
" method_name"
",encrypted_truth"
",truth_mime"
" FROM anastasis_truth"
- " WHERE truth_uuid=$1;",
- 1),
+ " WHERE truth_uuid=$1;"),
GNUNET_PQ_make_prepare ("recoverydocument_select_meta",
"SELECT "
" version"
@@ -355,8 +330,7 @@ prepare_statements (void *cls)
" WHERE user_id=$1"
" AND version < $2"
" ORDER BY version DESC"
- " LIMIT 1000;",
- 2),
+ " LIMIT 1000;"),
GNUNET_PQ_make_prepare ("latest_recoverydocument_select",
"SELECT "
" version"
@@ -366,8 +340,7 @@ prepare_statements (void *cls)
" FROM anastasis_recoverydocument"
" WHERE user_id=$1"
" ORDER BY version DESC"
- " LIMIT 1;",
- 1),
+ " LIMIT 1;"),
GNUNET_PQ_make_prepare ("latest_recovery_version_select",
"SELECT"
" version"
@@ -377,8 +350,7 @@ prepare_statements (void *cls)
" JOIN anastasis_user USING (user_id)"
" WHERE user_id=$1"
" ORDER BY version DESC"
- " LIMIT 1;",
- 1),
+ " LIMIT 1;"),
GNUNET_PQ_make_prepare ("recoverydocument_select",
"SELECT "
" account_sig"
@@ -386,30 +358,26 @@ prepare_statements (void *cls)
",recovery_data"
" FROM anastasis_recoverydocument"
" WHERE user_id=$1"
- " AND version=$2;",
- 2),
+ " AND version=$2;"),
GNUNET_PQ_make_prepare ("postcounter_select",
"SELECT"
" post_counter"
" FROM anastasis_recdoc_payment"
" WHERE user_id=$1"
- " AND payment_identifier=$2;",
- 2),
+ " AND payment_identifier=$2;"),
GNUNET_PQ_make_prepare ("postcounter_update",
"UPDATE"
" anastasis_recdoc_payment"
" SET"
" post_counter=$1"
" WHERE user_id =$2"
- " AND payment_identifier=$3;",
- 3),
+ " AND payment_identifier=$3;"),
GNUNET_PQ_make_prepare ("key_share_select",
"SELECT "
"key_share_data "
"FROM "
"anastasis_truth "
- "WHERE truth_uuid =$1;",
- 1),
+ "WHERE truth_uuid =$1;"),
GNUNET_PQ_make_prepare ("challengecode_insert",
"INSERT INTO anastasis_challengecode "
"(truth_uuid"
@@ -418,8 +386,7 @@ prepare_statements (void *cls)
",expiration_date"
",retry_counter"
") VALUES "
- "($1, $2, $3, $4, $5);",
- 5),
+ "($1, $2, $3, $4, $5);"),
GNUNET_PQ_make_prepare ("challengecode_select",
"SELECT "
" code"
@@ -427,8 +394,7 @@ prepare_statements (void *cls)
" FROM anastasis_challengecode"
" WHERE truth_uuid=$1"
" AND expiration_date > $2"
- " AND retry_counter != 0;",
- 2),
+ " AND retry_counter != 0;"),
GNUNET_PQ_make_prepare ("challengecode_set_satisfied",
"UPDATE anastasis_challengecode"
" SET satisfied=TRUE"
@@ -440,16 +406,14 @@ prepare_statements (void *cls)
" WHERE truth_uuid=$1"
" AND code=$2"
" ORDER BY creation_date DESC"
- " LIMIT 1);",
- 2),
+ " LIMIT 1);"),
GNUNET_PQ_make_prepare ("challengecode_test_satisfied",
"SELECT 1 FROM anastasis_challengecode"
" WHERE truth_uuid=$1"
" AND satisfied=TRUE"
" AND code=$2"
" AND creation_date >= $3"
- " LIMIT 1;",
- 3),
+ " LIMIT 1;"),
GNUNET_PQ_make_prepare ("challengecode_select_meta",
"SELECT "
" code"
@@ -460,22 +424,19 @@ prepare_statements (void *cls)
" AND expiration_date > $2"
" AND creation_date > $3"
" ORDER BY creation_date DESC"
- " LIMIT 1;",
- 2),
+ " LIMIT 1;"),
GNUNET_PQ_make_prepare ("challengecode_update_retry",
"UPDATE anastasis_challengecode"
" SET retry_counter=retry_counter - 1"
" WHERE truth_uuid=$1"
" AND code=$2"
- " AND retry_counter != 0;",
- 1),
+ " AND retry_counter != 0;"),
GNUNET_PQ_make_prepare ("challengepayment_dec_counter",
"UPDATE anastasis_challenge_payment"
" SET counter=counter - 1"
" WHERE truth_uuid=$1"
" AND payment_identifier=$2"
- " AND counter > 0;",
- 2),
+ " AND counter > 0;"),
GNUNET_PQ_make_prepare ("challengecode_mark_sent",
"UPDATE anastasis_challengecode"
" SET retransmission_date=$3"
@@ -487,21 +448,18 @@ prepare_statements (void *cls)
" WHERE truth_uuid=$1"
" AND code=$2"
" ORDER BY creation_date DESC"
- " LIMIT 1);",
- 3),
+ " LIMIT 1);"),
GNUNET_PQ_make_prepare ("get_last_auth_iban_payment",
"SELECT "
" wire_reference"
" FROM anastasis_auth_iban_in"
" WHERE credit_account_details=$1"
" ORDER BY wire_reference DESC"
- " LIMIT 1;",
- 1),
+ " LIMIT 1;"),
GNUNET_PQ_make_prepare ("gc_challengecodes",
"DELETE FROM anastasis_challengecode "
"WHERE "
- "expiration_date < $1;",
- 1),
+ "expiration_date < $1;"),
GNUNET_PQ_PREPARED_STATEMENT_END
};
@@ -559,10 +517,14 @@ internal_setup (struct PostgresClosure *pg,
"SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE;"),
GNUNET_PQ_make_try_execute ("SET enable_sort=OFF;"),
GNUNET_PQ_make_try_execute ("SET enable_seqscan=OFF;"),
+ GNUNET_PQ_make_execute ("SET search_path TO anastasis;"),
GNUNET_PQ_EXECUTE_STATEMENT_END
};
#else
- struct GNUNET_PQ_ExecuteStatement *es = NULL;
+ struct GNUNET_PQ_ExecuteStatement es[] = {
+ GNUNET_PQ_make_execute ("SET search_path TO anastasis;"),
+ GNUNET_PQ_EXECUTE_STATEMENT_END
+ };
#endif
struct GNUNET_PQ_Context *db_conn;
@@ -1432,7 +1394,8 @@ postgres_record_recdoc_payment (
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (account_pub),
GNUNET_PQ_query_param_uint32 (&post_counter),
- TALER_PQ_query_param_amount (amount),
+ TALER_PQ_query_param_amount (pg->conn,
+ amount),
GNUNET_PQ_query_param_auto_from_type (payment_secret),
GNUNET_PQ_query_param_timestamp (&now),
GNUNET_PQ_query_param_end
@@ -1535,7 +1498,8 @@ postgres_record_truth_upload_payment (
duration);
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (uuid),
- TALER_PQ_query_param_amount (amount),
+ TALER_PQ_query_param_amount (pg->conn,
+ amount),
GNUNET_PQ_query_param_timestamp (&exp),
GNUNET_PQ_query_param_end
};
@@ -1602,7 +1566,8 @@ postgres_record_challenge_payment (
struct GNUNET_TIME_Timestamp now = GNUNET_TIME_timestamp_get ();
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (truth_uuid),
- TALER_PQ_query_param_amount (amount),
+ TALER_PQ_query_param_amount (pg->conn,
+ amount),
GNUNET_PQ_query_param_auto_from_type (payment_secret),
GNUNET_PQ_query_param_timestamp (&now),
GNUNET_PQ_query_param_end
@@ -1669,7 +1634,8 @@ postgres_record_auth_iban_payment (
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_uint64 (&wire_reference),
GNUNET_PQ_query_param_string (wire_subject),
- TALER_PQ_query_param_amount (amount),
+ TALER_PQ_query_param_amount (pg->conn,
+ amount),
GNUNET_PQ_query_param_string (debit_account),
GNUNET_PQ_query_param_string (credit_account),
GNUNET_PQ_query_param_timestamp (&execution_date),
diff --git a/src/stasis/stasis-0001.sql b/src/stasis/stasis-0001.sql
index fe0ab63..fe08cdc 100644
--- a/src/stasis/stasis-0001.sql
+++ b/src/stasis/stasis-0001.sql
@@ -1,6 +1,6 @@
--
-- This file is part of Anastasis
--- Copyright (C) 2020, 2021, 2022 Anastasis SARL SA
+-- Copyright (C) 2020, 2021, 2022, 2023 Anastasis SARL SA
--
-- ANASTASIS 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
@@ -20,20 +20,31 @@ BEGIN;
-- Check patch versioning is in place.
SELECT _v.register_patch('stasis-0001', NULL, NULL);
+CREATE SCHEMA anastasis;
+COMMENT ON SCHEMA anastasis IS 'anastasis backend data';
+
+SET search_path TO anastasis;
+
+
+CREATE TYPE taler_amount
+ AS
+ (val INT8
+ ,frac INT4
+ );
+COMMENT ON TYPE taler_amount
+ IS 'Stores an amount, fraction is in units of 1/100000000 of the base value';
+
CREATE TABLE IF NOT EXISTS anastasis_truth_payment
(truth_uuid BYTEA PRIMARY KEY CHECK(LENGTH(truth_uuid)=32),
- amount_val INT8 NOT NULL,
- amount_frac INT4 NOT NULL,
+ amount taler_amount NOT NULL,
expiration INT8 NOT NULL);
COMMENT ON TABLE anastasis_truth_payment
IS 'Records about payments for truth uploads';
COMMENT ON COLUMN anastasis_truth_payment.truth_uuid
IS 'Identifier of the truth';
-COMMENT ON COLUMN anastasis_truth_payment.amount_val
+COMMENT ON COLUMN anastasis_truth_payment.amount
IS 'Amount we were paid';
-COMMENT ON COLUMN anastasis_truth_payment.amount_frac
- IS 'Amount we were paid fraction';
COMMENT ON COLUMN anastasis_truth_payment.expiration
IS 'At which date will the truth payment expire';
@@ -41,9 +52,9 @@ COMMENT ON COLUMN anastasis_truth_payment.expiration
CREATE TABLE IF NOT EXISTS anastasis_truth
(truth_uuid BYTEA PRIMARY KEY CHECK(LENGTH(truth_uuid)=32),
key_share_data BYTEA CHECK(LENGTH(key_share_data)=72) NOT NULL,
- method_name VARCHAR NOT NULL,
+ method_name TEXT NOT NULL,
encrypted_truth BYTEA NOT NULL,
- truth_mime VARCHAR NOT NULL,
+ truth_mime TEXT NOT NULL,
expiration INT8 NOT NULL);
COMMENT ON TABLE anastasis_truth
IS 'Truth data is needed to authenticate clients during recovery';
@@ -76,8 +87,7 @@ CREATE TABLE IF NOT EXISTS anastasis_recdoc_payment
(payment_id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
user_id BYTEA NOT NULL REFERENCES anastasis_user(user_id),
post_counter INT4 NOT NULL DEFAULT 0 CHECK(post_counter >= 0),
- amount_val INT8 NOT NULL,
- amount_frac INT4 NOT NULL,
+ amount taler_amount NOT NULL,
payment_identifier BYTEA NOT NULL CHECK(LENGTH(payment_identifier)=32),
creation_date INT8 NOT NULL,
paid BOOLEAN NOT NULL DEFAULT FALSE);
@@ -89,10 +99,8 @@ COMMENT ON COLUMN anastasis_recdoc_payment.user_id
IS 'Link to the corresponding user who paid';
COMMENT ON COLUMN anastasis_recdoc_payment.post_counter
IS 'For how many posts does the user pay';
-COMMENT ON COLUMN anastasis_recdoc_payment.amount_val
+COMMENT ON COLUMN anastasis_recdoc_payment.amount
IS 'Amount we were paid';
-COMMENT ON COLUMN anastasis_recdoc_payment.amount_frac
- IS 'Amount we were paid fraction';
COMMENT ON COLUMN anastasis_recdoc_payment.payment_identifier
IS 'Payment identifier which the user has to provide';
COMMENT ON COLUMN anastasis_recdoc_payment.creation_date
@@ -104,8 +112,7 @@ COMMENT ON COLUMN anastasis_recdoc_payment.paid
CREATE TABLE IF NOT EXISTS anastasis_challenge_payment
(payment_id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
truth_uuid BYTEA CHECK(LENGTH(truth_uuid)=32) NOT NULL,
- amount_val INT8 NOT NULL,
- amount_frac INT4 NOT NULL,
+ amount taler_amount NOT NULL,
payment_identifier BYTEA NOT NULL CHECK(LENGTH(payment_identifier)=32),
creation_date INT8 NOT NULL,
counter INT4 NOT NULL DEFAULT 3,
@@ -118,10 +125,8 @@ COMMENT ON COLUMN anastasis_challenge_payment.payment_id
IS 'Serial number which identifies the payment';
COMMENT ON COLUMN anastasis_challenge_payment.truth_uuid
IS 'Link to the corresponding challenge which is paid';
-COMMENT ON COLUMN anastasis_challenge_payment.amount_val
+COMMENT ON COLUMN anastasis_challenge_payment.amount
IS 'Amount we were paid';
-COMMENT ON COLUMN anastasis_challenge_payment.amount_frac
- IS 'Amount we were paid fraction';
COMMENT ON COLUMN anastasis_challenge_payment.payment_identifier
IS 'Payment identifier which the user has to provide';
COMMENT ON COLUMN anastasis_challenge_payment.counter
@@ -203,8 +208,7 @@ CREATE TABLE IF NOT EXISTS anastasis_auth_iban_in
(auth_in_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
,wire_reference INT8 NOT NULL PRIMARY KEY
,wire_subject TEXT NOT NULL
- ,credit_val INT8 NOT NULL
- ,credit_frac INT4 NOT NULL
+ ,credit taler_amount NOT NULL
,debit_account_details TEXT NOT NULL
,credit_account_details TEXT NOT NULL
,execution_date INT8 NOT NULL
@@ -215,6 +219,8 @@ COMMENT ON COLUMN anastasis_auth_iban_in.wire_reference
IS 'Unique number identifying the wire transfer in LibEuFin/Nexus';
COMMENT ON COLUMN anastasis_auth_iban_in.wire_subject
IS 'For authentication, this contains the code, but also additional text';
+COMMENT ON COLUMN anastasis_auth_iban_in.credit
+ IS 'Amount we were credited';
COMMENT ON COLUMN anastasis_auth_iban_in.execution_date
IS 'Used both for (theoretical) garbage collection and to see if the transfer happened on time';
COMMENT ON COLUMN anastasis_auth_iban_in.credit_account_details
diff --git a/src/stasis/stasis-0000.sql b/src/stasis/versioning.sql
index 116f409..444cf95 100644
--- a/src/stasis/stasis-0000.sql
+++ b/src/stasis/versioning.sql
@@ -146,12 +146,13 @@
BEGIN;
+
-- This file adds versioning support to database it will be loaded to.
-- It requires that PL/pgSQL is already loaded - will raise exception otherwise.
-- All versioning "stuff" (tables, functions) is in "_v" schema.
-- All functions are defined as 'RETURNS SETOF INT4' to be able to make them to RETURN literally nothing (0 rows).
--- >> RETURNS VOID<< IS similar, but it still outputs "empty line" in psql when calling.
+-- >> RETURNS VOID<< IS similar, but it still outputs "empty line" in psql when calling
CREATE SCHEMA IF NOT EXISTS _v;
COMMENT ON SCHEMA _v IS 'Schema for versioning data and functionality.';
diff --git a/src/testing/.gitignore b/src/testing/.gitignore
index a6eb294..9ac5ba4 100644
--- a/src/testing/.gitignore
+++ b/src/testing/.gitignore
@@ -1,3 +1,6 @@
test_anastasis
test_anastasisrest_api
-test_anastasis_api_home/.local/share/taler/crypto-*
+test_anastasis_api_home/taler/exchange-secmod-*
+test_anastasis_api_home/taler/auditor/
+test_anastasis_api_home/taler/exchange/offline-keys/secm_tofus.pub
+test_anastasis_api.conf.edited
diff --git a/src/testing/Makefile.am b/src/testing/Makefile.am
index fec971a..22162d3 100644
--- a/src/testing/Makefile.am
+++ b/src/testing/Makefile.am
@@ -38,7 +38,6 @@ libanastasistesting_la_LIBADD = \
-lgnunetjson \
-lgnunetutil \
-ljansson \
- -luuid \
-ltalertesting \
$(XLIB)
@@ -72,9 +71,8 @@ test_anastasis_LDADD = \
EXTRA_DIST = \
test_anastasis_api.conf \
- test_anastasis_api_home/.config/taler/exchange/account-2.json \
- test_anastasis_api_home/.local/share/taler/exchange/offline-keys/master.priv \
+ test_anastasis_api_home/taler/exchange/offline-keys/master.priv \
sms_authentication.sh
MOSTLYCLEANFILES = \
- test_anastasis_api_home/.local/share/taler/exchange/offline-keys/secm_tofus.pub
+ test_anastasis_api_home/taler/exchange/offline-keys/secm_tofus.pub
diff --git a/src/testing/test_anastasis.c b/src/testing/test_anastasis.c
index 4fa3fb9..f28d9a9 100644
--- a/src/testing/test_anastasis.c
+++ b/src/testing/test_anastasis.c
@@ -1,6 +1,6 @@
/*
This file is part of Anastasis
- Copyright (C) 2020, 2021 Anastasis SARL
+ Copyright (C) 2020-2023 Anastasis SARL
Anastasis 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
@@ -52,34 +52,29 @@
#define MERCHANT_ACCOUNT_NAME "3"
/**
- * Configuration of the bank.
+ * Credentials for the test.
*/
-static struct TALER_TESTING_BankConfiguration bc;
-
-/**
- * Configuration of the exchange.
- */
-static struct TALER_TESTING_ExchangeConfiguration ec;
+static struct TALER_TESTING_Credentials cred;
/**
* Payto URI of the customer (payer).
*/
-static char *payer_payto;
+static const char *payer_payto;
/**
* Payto URI of the exchange (escrow account).
*/
-static char *exchange_payto;
+static const char *exchange_payto;
/**
* Payto URI of the merchant (receiver).
*/
-static char *merchant_payto;
+static const char *merchant_payto;
/**
* Merchant base URL.
*/
-static char *merchant_url;
+static const char *merchant_url;
/**
* Anastasis base URL.
@@ -92,11 +87,6 @@ static char *anastasis_url;
static char *file_secret;
/**
- * Merchant process.
- */
-static struct GNUNET_OS_Process *merchantd;
-
-/**
* Anastasis process.
*/
static struct GNUNET_OS_Process *anastasisd;
@@ -135,7 +125,7 @@ cmd_transfer_to_exchange (const char *label,
{
return TALER_TESTING_cmd_admin_add_incoming (label,
amount,
- &bc.exchange_auth,
+ &cred.ba,
payer_payto);
}
@@ -328,28 +318,29 @@ run (void *cls,
struct TALER_TESTING_Command commands[] = {
/* general setup */
- TALER_TESTING_cmd_auditor_add ("add-auditor-OK",
- MHD_HTTP_NO_CONTENT,
- false),
- TALER_TESTING_cmd_wire_add ("add-wire-account",
- "payto://x-taler-bank/localhost/2",
- MHD_HTTP_NO_CONTENT,
- false),
- TALER_TESTING_cmd_exec_offline_sign_keys ("offline-sign-future-keys",
- CONFIG_FILE),
- TALER_TESTING_cmd_exec_offline_sign_fees ("offline-sign-fees",
- CONFIG_FILE,
- "EUR:0.01",
- "EUR:0.01",
- "EUR:0.01"),
- TALER_TESTING_cmd_check_keys_pull_all_keys ("refetch /keys",
- 1),
+ TALER_TESTING_cmd_run_fakebank ("run-fakebank",
+ cred.cfg,
+ "exchange-account-exchange"),
+ TALER_TESTING_cmd_system_start ("start-taler",
+ CONFIG_FILE,
+ "-em",
+ "-u", "exchange-account-exchange",
+ NULL),
+ TALER_TESTING_cmd_get_exchange ("get-exchange",
+ cred.cfg,
+ NULL,
+ true,
+ true),
TALER_TESTING_cmd_merchant_post_instances ("instance-create-default",
merchant_url,
"default",
- merchant_payto,
- "EUR",
MHD_HTTP_NO_CONTENT),
+ TALER_TESTING_cmd_merchant_post_account (
+ "instance-create-default-account",
+ merchant_url,
+ merchant_payto,
+ NULL, NULL,
+ MHD_HTTP_OK),
TALER_TESTING_cmd_batch ("pay",
pay),
TALER_TESTING_cmd_batch ("anastasis",
@@ -357,9 +348,8 @@ run (void *cls,
TALER_TESTING_cmd_end ()
};
- TALER_TESTING_run_with_fakebank (is,
- commands,
- bc.exchange_auth.wire_gateway_url);
+ TALER_TESTING_run (is,
+ commands);
}
@@ -367,19 +357,7 @@ int
main (int argc,
char *const *argv)
{
- unsigned int ret;
- /* These environment variables get in the way... */
- unsetenv ("XDG_DATA_HOME");
- unsetenv ("XDG_CONFIG_HOME");
-
- GNUNET_log_setup ("test-anastasis",
- "DEBUG",
- NULL);
- if (GNUNET_OK !=
- TALER_TESTING_prepare_fakebank (CONFIG_FILE,
- "exchange-account-exchange",
- &bc))
- return 77;
+ int ret;
{
char dir[] = "/tmp/test-anastasis-file-XXXXXX";
@@ -394,73 +372,42 @@ main (int argc,
"%s/.secret",
dir);
}
- id_data = ANASTASIS_TESTING_make_id_data_example (
- "MaxMuster123456789");
- payer_payto = ("payto://x-taler-bank/localhost/" USER_ACCOUNT_NAME);
- exchange_payto = ("payto://x-taler-bank/localhost/" EXCHANGE_ACCOUNT_NAME);
- merchant_payto = ("payto://x-taler-bank/localhost/" MERCHANT_ACCOUNT_NAME);
- if (NULL ==
- (merchant_url = TALER_TESTING_prepare_merchant (CONFIG_FILE)))
- return 77;
- TALER_TESTING_cleanup_files (CONFIG_FILE);
+ id_data = ANASTASIS_TESTING_make_id_data_example ("MaxMuster123456789");
+ payer_payto =
+ "payto://x-taler-bank/localhost/" USER_ACCOUNT_NAME
+ "?receiver-name=62";
+ exchange_payto =
+ "payto://x-taler-bank/localhost/" EXCHANGE_ACCOUNT_NAME
+ "?receiver-name=exchange";
+ merchant_payto =
+ "payto://x-taler-bank/localhost/" MERCHANT_ACCOUNT_NAME
+ "?receiver-name=merchant";
+ merchant_url = "http://localhost:8080/";
if (NULL ==
(anastasis_url = ANASTASIS_TESTING_prepare_anastasis (CONFIG_FILE)))
return 77;
- TALER_TESTING_cleanup_files (CONFIG_FILE);
-
- switch (TALER_TESTING_prepare_exchange (CONFIG_FILE,
- GNUNET_YES,
- &ec))
+ if (NULL == (anastasisd =
+ ANASTASIS_TESTING_run_anastasis (CONFIG_FILE,
+ anastasis_url)))
{
- case GNUNET_SYSERR:
- GNUNET_break (0);
- return 1;
- case GNUNET_NO:
- return 77;
- case GNUNET_OK:
- if (NULL == (merchantd =
- TALER_TESTING_run_merchant (CONFIG_FILE,
- merchant_url)))
- {
- GNUNET_break (0);
- return 1;
- }
- if (NULL == (anastasisd =
- ANASTASIS_TESTING_run_anastasis (CONFIG_FILE,
- anastasis_url)))
- {
- GNUNET_break (0);
- GNUNET_OS_process_kill (merchantd,
- SIGTERM);
- GNUNET_OS_process_wait (merchantd);
- GNUNET_OS_process_destroy (merchantd);
-
- return 1;
- }
- ret = TALER_TESTING_setup_with_exchange (&run,
- NULL,
- CONFIG_FILE);
-
- GNUNET_OS_process_kill (merchantd,
- SIGTERM);
- GNUNET_OS_process_kill (anastasisd,
- SIGTERM);
- GNUNET_OS_process_wait (merchantd);
- GNUNET_OS_process_wait (anastasisd);
- GNUNET_OS_process_destroy (merchantd);
- GNUNET_OS_process_destroy (anastasisd);
- GNUNET_free (merchant_url);
- GNUNET_free (anastasis_url);
-
- if (GNUNET_OK != ret)
- return 1;
- break;
- default:
GNUNET_break (0);
return 1;
}
- return 0;
+ ret = TALER_TESTING_main (argv,
+ "INFO",
+ CONFIG_FILE,
+ "exchange-account-exchange",
+ TALER_TESTING_BS_FAKEBANK,
+ &cred,
+ &run,
+ NULL);
+ GNUNET_OS_process_kill (anastasisd,
+ SIGTERM);
+ GNUNET_OS_process_wait (anastasisd);
+ GNUNET_OS_process_destroy (anastasisd);
+ GNUNET_free (anastasis_url);
+ return ret;
}
diff --git a/src/testing/test_anastasis_api.c b/src/testing/test_anastasis_api.c
index 4d85fed..7d7e2ac 100644
--- a/src/testing/test_anastasis_api.c
+++ b/src/testing/test_anastasis_api.c
@@ -52,34 +52,29 @@
#define MERCHANT_ACCOUNT_NAME "3"
/**
- * Configuration of the bank.
+ * Test credentials.
*/
-static struct TALER_TESTING_BankConfiguration bc;
-
-/**
- * Configuration of the exchange.
- */
-static struct TALER_TESTING_ExchangeConfiguration ec;
+static struct TALER_TESTING_Credentials cred;
/**
* Payto URI of the customer (payer).
*/
-static char *payer_payto;
+static const char *payer_payto;
/**
* Payto URI of the exchange (escrow account).
*/
-static char *exchange_payto;
+static const char *exchange_payto;
/**
* Payto URI of the merchant (receiver).
*/
-static char *merchant_payto;
+static const char *merchant_payto;
/**
* Merchant base URL.
*/
-static char *merchant_url;
+static const char *merchant_url;
/**
* Anastasis base URL.
@@ -87,11 +82,6 @@ static char *merchant_url;
static char *anastasis_url;
/**
- * Merchant process.
- */
-static struct GNUNET_OS_Process *merchantd;
-
-/**
* Anastasis process.
*/
static struct GNUNET_OS_Process *anastasisd;
@@ -129,7 +119,7 @@ cmd_transfer_to_exchange (const char *label,
{
return TALER_TESTING_cmd_admin_add_incoming (label,
amount,
- &bc.exchange_auth,
+ &cred.ba,
payer_payto);
}
@@ -276,28 +266,29 @@ run (void *cls,
struct TALER_TESTING_Command commands[] = {
/* general setup */
- TALER_TESTING_cmd_auditor_add ("add-auditor-OK",
- MHD_HTTP_NO_CONTENT,
- false),
- TALER_TESTING_cmd_wire_add ("add-wire-account",
- "payto://x-taler-bank/localhost/2",
- MHD_HTTP_NO_CONTENT,
- false),
- TALER_TESTING_cmd_exec_offline_sign_keys ("offline-sign-future-keys",
- CONFIG_FILE),
- TALER_TESTING_cmd_exec_offline_sign_fees ("offline-sign-fees",
- CONFIG_FILE,
- "EUR:0.01",
- "EUR:0.01",
- "EUR:0.01"),
- TALER_TESTING_cmd_check_keys_pull_all_keys ("refetch /keys",
- 1),
+ TALER_TESTING_cmd_run_fakebank ("run-fakebank",
+ cred.cfg,
+ "exchange-account-exchange"),
+ TALER_TESTING_cmd_system_start ("start-taler",
+ CONFIG_FILE,
+ "-em",
+ "-u", "exchange-account-exchange",
+ NULL),
+ TALER_TESTING_cmd_get_exchange ("get-exchange",
+ cred.cfg,
+ NULL,
+ true,
+ true),
TALER_TESTING_cmd_merchant_post_instances ("instance-create-default",
merchant_url,
"default",
- merchant_payto,
- "EUR",
MHD_HTTP_NO_CONTENT),
+ TALER_TESTING_cmd_merchant_post_account (
+ "instance-create-default-account",
+ merchant_url,
+ merchant_payto,
+ NULL, NULL,
+ MHD_HTTP_OK),
ANASTASIS_TESTING_cmd_config ("salt-request-1",
anastasis_url,
MHD_HTTP_OK),
@@ -310,9 +301,8 @@ run (void *cls,
TALER_TESTING_cmd_end ()
};
- TALER_TESTING_run_with_fakebank (is,
- commands,
- bc.exchange_auth.wire_gateway_url);
+ TALER_TESTING_run (is,
+ commands);
}
@@ -322,17 +312,6 @@ main (int argc,
{
int ret;
- /* These environment variables get in the way... */
- unsetenv ("XDG_DATA_HOME");
- unsetenv ("XDG_CONFIG_HOME");
- GNUNET_log_setup ("test-anastasis-api",
- "DEBUG",
- NULL);
- if (GNUNET_OK !=
- TALER_TESTING_prepare_fakebank (CONFIG_FILE,
- "exchange-account-exchange",
- &bc))
- return 77;
{
char dir[] = "/tmp/test-anastasis-file-XXXXXX";
@@ -347,73 +326,41 @@ main (int argc,
"%s/.secret",
dir);
}
- payer_payto = ("payto://x-taler-bank/localhost/" USER_ACCOUNT_NAME);
- exchange_payto = ("payto://x-taler-bank/localhost/" EXCHANGE_ACCOUNT_NAME);
- merchant_payto = ("payto://x-taler-bank/localhost/" MERCHANT_ACCOUNT_NAME);
- if (NULL ==
- (merchant_url = TALER_TESTING_prepare_merchant (CONFIG_FILE)))
- return 77;
- TALER_TESTING_cleanup_files (CONFIG_FILE);
+ payer_payto =
+ "payto://x-taler-bank/localhost/" USER_ACCOUNT_NAME
+ "?receiver-name=62";
+ exchange_payto =
+ "payto://x-taler-bank/localhost/" EXCHANGE_ACCOUNT_NAME
+ "?receiver-name=exchange";
+ merchant_payto =
+ "payto://x-taler-bank/localhost/" MERCHANT_ACCOUNT_NAME
+ "?receiver-name=merchant";
+ merchant_url = "http://localhost:8080/";
if (NULL ==
(anastasis_url = ANASTASIS_TESTING_prepare_anastasis (CONFIG_FILE)))
return 77;
- TALER_TESTING_cleanup_files (CONFIG_FILE);
-
- switch (TALER_TESTING_prepare_exchange (CONFIG_FILE,
- GNUNET_YES,
- &ec))
+ if (NULL == (anastasisd =
+ ANASTASIS_TESTING_run_anastasis (CONFIG_FILE,
+ anastasis_url)))
{
- case GNUNET_SYSERR:
- GNUNET_break (0);
- return 1;
- case GNUNET_NO:
- return 77;
- case GNUNET_OK:
- if (NULL == (merchantd =
- TALER_TESTING_run_merchant (CONFIG_FILE,
- merchant_url)))
- {
- GNUNET_break (0);
- return 1;
- }
- if (NULL == (anastasisd =
- ANASTASIS_TESTING_run_anastasis (CONFIG_FILE,
- anastasis_url)))
- {
- GNUNET_break (0);
- GNUNET_OS_process_kill (merchantd,
- SIGTERM);
- GNUNET_OS_process_wait (merchantd);
- GNUNET_OS_process_destroy (merchantd);
- return 1;
- }
- ret = TALER_TESTING_setup_with_exchange (&run,
- NULL,
- CONFIG_FILE);
- GNUNET_OS_process_kill (merchantd,
- SIGTERM);
- GNUNET_OS_process_kill (anastasisd,
- SIGTERM);
- GNUNET_OS_process_wait (merchantd);
- GNUNET_OS_process_wait (anastasisd);
- GNUNET_OS_process_destroy (merchantd);
- GNUNET_OS_process_destroy (anastasisd);
- GNUNET_free (merchant_url);
- GNUNET_free (anastasis_url);
-
- if (GNUNET_OK != ret)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Test failed in interpreter\n");
- return 1;
- }
- break;
- default:
GNUNET_break (0);
return 1;
}
- return 0;
+ ret = TALER_TESTING_main (argv,
+ "INFO",
+ CONFIG_FILE,
+ "exchange-account-exchange",
+ TALER_TESTING_BS_FAKEBANK,
+ &cred,
+ &run,
+ NULL);
+ GNUNET_OS_process_kill (anastasisd,
+ SIGTERM);
+ GNUNET_OS_process_wait (anastasisd);
+ GNUNET_OS_process_destroy (anastasisd);
+ GNUNET_free (anastasis_url);
+ return ret;
}
diff --git a/src/testing/test_anastasis_api.conf b/src/testing/test_anastasis_api.conf
index 3dfc6ba..53801d4 100644
--- a/src/testing/test_anastasis_api.conf
+++ b/src/testing/test_anastasis_api.conf
@@ -1,231 +1,125 @@
# This file is in the public domain.
#
[PATHS]
-# Persistent data storage for the testcase
TALER_TEST_HOME = test_anastasis_api_home/
-TALER_RUNTIME_DIR = ${TMPDIR:-${TMP:-/tmp}}/${USER:-}/taler-system-runtime/
-
-# Persistent data storage
-TALER_DATA_HOME = $TALER_TEST_HOME/.local/share/taler/
-
-# Configuration files
-TALER_CONFIG_HOME = $TALER_TEST_HOME/.config/taler/
-
-# Cached data, no big deal if lost
-TALER_CACHE_HOME = $TALER_TEST_HOME/.cache/taler/
+TALER_HOME = ${TALER_TEST_HOME:-${HOME:-${USERPROFILE}}}
+TALER_DATA_HOME = ${TALER_TEST_HOME:-${XDG_DATA_HOME:-${TALER_HOME}/.local/share/}/.local/share/}taler/
+TALER_CONFIG_HOME = ${TALER_TEST_HOME:-${XDG_CONFIG_HOME:-${TALER_HOME}/.config/}/.config/}taler/
+TALER_CACHE_HOME = ${TALER_TEST_HOME:-${XDG_CACHE_HOME:-${TALER_HOME}/.cache/}/.cache/}taler/
+TALER_RUNTIME_DIR = ${TMPDIR:-${TMP:-/tmp}}/taler-system-runtime/
[taler]
-# What currency do we use?
-#currency = EUR
-currency = EUR
-#CURRENCY_ROUND_UNIT = EUR:0.01
-#CURRENCY_ROUND_UNIT = EUR:0.01
+CURRENCY = EUR
+CURRENCY_ROUND_UNIT = EUR:0.01
[taler-helper-crypto-rsa]
-# Reduce from 1 year to speed up test
LOOKAHEAD_SIGN = 12 days
[taler-helper-crypto-eddsa]
-# Reduce from 1 year to speed up test
LOOKAHEAD_SIGN = 12 days
-# Reduce from 12 weeks to ensure we have multiple
DURATION = 7 days
-
[bank]
HTTP_PORT = 8082
-#BASE_URL = https://bank.test.taler.net/
+BASE_URL = http://localhost:8082/
-##########################################
-# Configuration for Anastasis #
-##########################################
+[libeufin-bank]
+CURRENCY = EUR
+WIRE_TYPE = iban
+IBAN_PAYTO_BIC = SANDBOXX
+DEFAULT_CUSTOMER_DEBT_LIMIT = EUR:200
+DEFAULT_ADMIN_DEBT_LIMIT = EUR:2000
+REGISTRATION_BONUS_ENABLED = yes
+REGISTRATION_BONUS = EUR:100
+SUGGESTED_WITHDRAWAL_EXCHANGE = http://localhost:8081/
+SERVE = tcp
+PORT = 8082
[anastasis]
PORT = 8086
-
DB = postgres
-
BUSINESS_NAME = "Checker's Test Inc."
-
-# Upload limit
UPLOAD_LIMIT_MB = 1
-
ANNUAL_POLICY_UPLOAD_LIMIT = 64
-
INSURANCE = EUR:0
-
PROVIDER_SALT = salty
-
-
-# Annual fee we charge.
-#ANNUAL_FEE = EUR:4.99
ANNUAL_FEE = EUR:4.99
-
TRUTH_UPLOAD_FEE = EUR:0.0
-
-# Base URL of anastasis.
-# BASE_URL = http://localhost:8086/
+BASE_URL = http://localhost:8086/
[anastasis-merchant-backend]
-# Where does our payment backend run? Must match PORT under [merchant]
PAYMENT_BACKEND_URL = http://localhost:8080/
-# Authentication costs
[authorization-question]
-# Cost of authentication by question
COST = EUR:0
[authorization-file]
-# Cost of authentication by file (only for testing purposes)
COST = EUR:1
[authorization-email]
-# Cost of authentication by E-Mail
COST = EUR:0
[authorization-sms]
-# Cost of authentication by SMS
COST = EUR:0
-
-# Command which is executed for the sms authentication
COMMAND = ./sms_authentication.sh
-
-
-
-# This specifies which database the postgres backend uses.
[stasis-postgres]
CONFIG = postgres:///anastasischeck
-##########################################
-# Configuration for the merchant backend #
-##########################################
-
[merchant]
-
-# Which port do we run the backend on? (HTTP server)
PORT = 8080
-
-# How quickly do we want the exchange to send us our money?
-# Used only if the frontend does not specify a value.
WIRE_TRANSFER_DELAY = 0 s
-
-# Which plugin (backend) do we use for the DB.
DB = postgres
-# Default choice for maximum wire fee.
-DEFAULT_MAX_WIRE_FEE = EUR:0.10
-
-# Default choice for maximum deposit fee.
-DEFAULT_MAX_DEPOSIT_FEE = EUR:0.10
-
-
-# This specifies which database the postgres backend uses.
[merchantdb-postgres]
CONFIG = postgres:///talercheck
-# Sections starting with "exchange-" specify trusted exchanges
-# (by the merchant)
[merchant-exchange-default]
MASTER_KEY = T1VVFQZZARQ1CMF4BN58EE7SKTW5AV2BS18S87ZEGYS4S29J6DNG
EXCHANGE_BASE_URL = http://localhost:8081/
-#MASTER_KEY = DY95EXAHQ2BKM2WK9YHZHYG1R7PPMMJPY14FNGP662DAKE35AKQG
-#EXCHANGE_BASE_URL = https://exchange.test.taler.net/
-#CURRENCY = EUR
CURRENCY = EUR
-# only fixes skips.
[auditor]
-BASE_URL = http://the.auditor/
-#BASE_URL = https://auditor.test.taler.net/
-#AUDITOR_KEY = DSDASDXAMDAARMNAD53ZA4AFAHA2QADAMAHHASWDAWXN84SDAA11
-# If currency does not match [TALER] section, the auditor
-# will be ignored!
-CURRENCY = EUR
-
-# Where do we store the auditor's private key?
-AUDITOR_PRIV_FILE = ${TALER_DATA_HOME}/auditor/offline-keys/auditor.priv
-
-# Auditors must be in sections "auditor-", the rest of the section
-# name could be anything.
-[auditor-ezb]
-# Informal name of the auditor. Just for the user.
-NAME = European Central Bank
-
-# URL of the auditor (especially for in the future, when the
-# auditor offers an automated issue reporting system).
-# Not really used today.
-URL = http://taler.ezb.eu/
-
-# This is the important bit: the signing key of the auditor.
-PUBLIC_KEY = 9QXF7XY7E9VPV47B5Z806NDFSX2VJ79SVHHD29QEQ3BG31ANHZ60
-
-# Which currency is this auditor trusted for?
-CURRENCY = EUR
-
-
-###################################################
-# Configuration for the exchange for the testcase #
-###################################################
+PORT = 8083
+BASE_URL = "http://localhost:8083/"
[exchange]
-# How to access our database
+AML_THRESHOLD = EUR:1000000
DB = postgres
-
-# HTTP port the exchange listens to
PORT = 8081
-
-# how long are the signatures with the signkey valid?
SIGNKEY_LEGAL_DURATION = 2 years
-
-# Our public key
MASTER_PUBLIC_KEY = T1VVFQZZARQ1CMF4BN58EE7SKTW5AV2BS18S87ZEGYS4S29J6DNG
-
-# Base URL of the exchange.
BASE_URL = "http://localhost:8081/"
-#BASE_URL = https://exchange.test.taler.net/
-
-# Network configuration for the normal API/service HTTP server
-# serve via tcp socket (on PORT)
SERVE = tcp
+STEFAN_ABS = "EUR:5"
[exchange-offline]
-
-# Where do we store the offline master private key of the exchange?
MASTER_PRIV_FILE = ${TALER_DATA_HOME}/exchange/offline-keys/master.priv
-# Where do we store the TOFU key material?
SECM_TOFU_FILE = ${TALER_DATA_HOME}/exchange/offline-keys/secm_tofus.pub
-
[taler-exchange-secmod-eddsa]
-# Where do we store the generated private keys.
KEY_DIR = ${TALER_DATA_HOME}/exchange-secmod-eddsa/keys
[taler-exchange-secmod-rsa]
-# Where do we store the generated private keys.
KEY_DIR = ${TALER_DATA_HOME}/exchange-secmod-rsa/keys
+[taler-exchange-secmod-cs]
+KEY_DIR = ${TALER_DATA_HOME}/exchange-secmod-cs/keys
-[exchangedb-postgres]
-CONFIG = "postgres:///talercheck"
-[auditordb-postgres]
+[exchangedb-postgres]
CONFIG = "postgres:///talercheck"
-# Account of the EXCHANGE
[exchange-account-exchange]
-# What is the exchange's bank account (with the "Taler Bank" demo system)?
-PAYTO_URI = "payto://x-taler-bank/localhost:8082/2"
+PAYTO_URI = "payto://x-taler-bank/localhost:8082/2?receiver-name=exchange"
ENABLE_DEBIT = YES
ENABLE_CREDIT = YES
[exchange-accountcredentials-exchange]
-WIRE_GATEWAY_URL = "http://localhost:8082/2/"
+WIRE_GATEWAY_URL = "http://localhost:8082/accounts/2/taler-wire-gateway/"
WIRE_GATEWAY_AUTH_METHOD = NONE
-
-
[coin_eur_ct_1]
value = EUR:0.01
duration_withdraw = 7 days
diff --git a/src/testing/test_anastasis_api_home/.config/taler/exchange/account-2.json b/src/testing/test_anastasis_api_home/.config/taler/exchange/account-2.json
deleted file mode 100644
index f798275..0000000
--- a/src/testing/test_anastasis_api_home/.config/taler/exchange/account-2.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "payto_uri": "payto://x-taler-bank/localhost:8082/2",
- "master_sig": "AM32QB4RYMWK548PE63PJXJMWSA001TFFWTZZPSSD8HQ8JE4D5V5X8WTSYSX59ANF4YRTRMF5Q4Q12CE2KTA8KQ03CM11YDTK75SJ20"}
diff --git a/src/testing/test_anastasis_api_home/.local/share/taler/exchange/offline-keys/master.priv b/src/testing/test_anastasis_api_home/taler/exchange-offline/master.priv
index c20942d..c20942d 100644
--- a/src/testing/test_anastasis_api_home/.local/share/taler/exchange/offline-keys/master.priv
+++ b/src/testing/test_anastasis_api_home/taler/exchange-offline/master.priv
diff --git a/src/testing/test_anastasis_api_home/taler/exchange/offline-keys/master.priv b/src/testing/test_anastasis_api_home/taler/exchange/offline-keys/master.priv
new file mode 100644
index 0000000..c20942d
--- /dev/null
+++ b/src/testing/test_anastasis_api_home/taler/exchange/offline-keys/master.priv
@@ -0,0 +1 @@
+k;d_U}A.w"!Gv_m"_ \ No newline at end of file
diff --git a/src/testing/testing_api_cmd_config.c b/src/testing/testing_api_cmd_config.c
index 92a8ae1..542e140 100644
--- a/src/testing/testing_api_cmd_config.c
+++ b/src/testing/testing_api_cmd_config.c
@@ -61,39 +61,26 @@ struct ConfigState
* Function called with the results of a #ANASTASIS_get_config().
*
* @param cls closure
- * @param http_status HTTP status of the request
* @param config config from the server
*/
static void
config_cb (void *cls,
- unsigned int http_status,
const struct ANASTASIS_Config *config)
{
struct ConfigState *ss = cls;
ss->so = NULL;
- if (http_status != ss->http_status)
+ if (config->http_status != ss->http_status)
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u to command %s in %s:%u\n",
- http_status,
- ss->is->commands[ss->is->ip].label,
- __FILE__,
- __LINE__);
- TALER_TESTING_interpreter_fail (ss->is);
+ TALER_TESTING_unexpected_status (ss->is,
+ config->http_status,
+ ss->http_status);
return;
}
- if (NULL == config)
+ if (GNUNET_OK == config->http_status)
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Config is NULL, command %s in %s:%u\n",
- ss->is->commands[ss->is->ip].label,
- __FILE__,
- __LINE__);
- TALER_TESTING_interpreter_fail (ss->is);
- return;
+ ss->provider_salt = config->details.ok.provider_salt;
}
- ss->provider_salt = config->provider_salt;
TALER_TESTING_interpreter_next (ss->is);
}
@@ -113,10 +100,11 @@ config_run (void *cls,
struct ConfigState *ss = cls;
ss->is = is;
- ss->so = ANASTASIS_get_config (is->ctx,
- ss->anastasis_url,
- &config_cb,
- ss);
+ ss->so = ANASTASIS_get_config (
+ TALER_TESTING_interpreter_get_context (is),
+ ss->anastasis_url,
+ &config_cb,
+ ss);
if (NULL == ss->so)
{
GNUNET_break (0);
diff --git a/src/testing/testing_api_cmd_policy_lookup.c b/src/testing/testing_api_cmd_policy_lookup.c
index 1f59b12..2d854c5 100644
--- a/src/testing/testing_api_cmd_policy_lookup.c
+++ b/src/testing/testing_api_cmd_policy_lookup.c
@@ -72,32 +72,26 @@ struct PolicyLookupState
* Function called with the results of a #ANASTASIS_policy_lookup().
*
* @param cls closure
- * @param http_status HTTP status of the request
* @param dd details about the lookup operation
*/
static void
policy_lookup_cb (void *cls,
- unsigned int http_status,
const struct ANASTASIS_DownloadDetails *dd)
{
struct PolicyLookupState *pls = cls;
pls->plo = NULL;
- if (http_status != pls->http_status)
+ if (dd->http_status != pls->http_status)
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u to command %s in %s:%u\n",
- http_status,
- pls->is->commands[pls->is->ip].label,
- __FILE__,
- __LINE__);
- TALER_TESTING_interpreter_fail (pls->is);
+ TALER_TESTING_unexpected_status (pls->is,
+ dd->http_status,
+ pls->http_status);
return;
}
if (NULL != pls->upload_reference)
{
- if ( (MHD_HTTP_OK == http_status) &&
- (0 != GNUNET_memcmp (&dd->curr_policy_hash,
+ if ( (MHD_HTTP_OK == dd->http_status) &&
+ (0 != GNUNET_memcmp (&dd->details.ok.curr_policy_hash,
pls->upload_hash)) )
{
GNUNET_break (0);
@@ -156,11 +150,12 @@ policy_lookup_run (void *cls,
}
pls->anastasis_pub = *anastasis_pub;
}
- pls->plo = ANASTASIS_policy_lookup (is->ctx,
- pls->anastasis_url,
- &pls->anastasis_pub,
- &policy_lookup_cb,
- pls);
+ pls->plo = ANASTASIS_policy_lookup (
+ TALER_TESTING_interpreter_get_context (is),
+ pls->anastasis_url,
+ &pls->anastasis_pub,
+ &policy_lookup_cb,
+ pls);
if (NULL == pls->plo)
{
GNUNET_break (0);
diff --git a/src/testing/testing_api_cmd_policy_store.c b/src/testing/testing_api_cmd_policy_store.c
index f23489d..edc753d 100644
--- a/src/testing/testing_api_cmd_policy_store.c
+++ b/src/testing/testing_api_cmd_policy_store.c
@@ -139,13 +139,9 @@ policy_store_cb (void *cls,
pss->pso = NULL;
if (ud->http_status != pss->http_status)
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u to command %s in %s:%u\n",
- ud->http_status,
- pss->is->commands[pss->is->ip].label,
- __FILE__,
- __LINE__);
- TALER_TESTING_interpreter_fail (pss->is);
+ TALER_TESTING_unexpected_status (pss->is,
+ ud->http_status,
+ pss->http_status);
return;
}
switch (ud->us)
@@ -276,7 +272,7 @@ policy_store_run (void *cls,
pss->recovery_data_size,
&pss->curr_hash);
pss->pso = ANASTASIS_policy_store (
- is->ctx,
+ TALER_TESTING_interpreter_get_context (is),
pss->anastasis_url,
&pss->anastasis_priv,
pss->recovery_data,
@@ -340,8 +336,7 @@ policy_store_traits (void *cls,
struct PolicyStoreState *pss = cls;
struct TALER_TESTING_Trait traits[] = {
TALER_TESTING_make_trait_claim_token (&pss->claim_token),
- TALER_TESTING_make_trait_order_id (
- (const char **) &pss->order_id),
+ TALER_TESTING_make_trait_order_id (pss->order_id),
ANASTASIS_TESTING_make_trait_hash (&pss->curr_hash),
ANASTASIS_TESTING_make_trait_account_pub (&pss->anastasis_pub),
ANASTASIS_TESTING_make_trait_account_priv (&pss->anastasis_priv),
diff --git a/src/testing/testing_api_cmd_truth_challenge.c b/src/testing/testing_api_cmd_truth_challenge.c
index f1384c4..c399345 100644
--- a/src/testing/testing_api_cmd_truth_challenge.c
+++ b/src/testing/testing_api_cmd_truth_challenge.c
@@ -100,13 +100,9 @@ truth_challenge_cb (void *cls,
ksls->tco = NULL;
if (tcd->http_status != ksls->expected_http_status)
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u to command %s in %s:%u\n",
- tcd->http_status,
- ksls->is->commands[ksls->is->ip].label,
- __FILE__,
- __LINE__);
- TALER_TESTING_interpreter_fail (ksls->is);
+ TALER_TESTING_unexpected_status (ksls->is,
+ tcd->http_status,
+ ksls->expected_http_status);
return;
}
switch (tcd->http_status)
@@ -268,13 +264,14 @@ truth_challenge_run (void *cls,
payment_secret = NULL;
}
- ksls->tco = ANASTASIS_truth_challenge (is->ctx,
- ksls->anastasis_url,
- truth_uuid,
- truth_key,
- payment_secret,
- &truth_challenge_cb,
- ksls);
+ ksls->tco = ANASTASIS_truth_challenge (
+ TALER_TESTING_interpreter_get_context (is),
+ ksls->anastasis_url,
+ truth_uuid,
+ truth_key,
+ payment_secret,
+ &truth_challenge_cb,
+ ksls);
if (NULL == ksls->tco)
{
GNUNET_break (0);
@@ -325,12 +322,9 @@ truth_challenge_traits (void *cls,
struct TALER_TESTING_Trait traits[] = {
ANASTASIS_TESTING_make_trait_payment_secret (
&ksls->payment_secret_response),
- TALER_TESTING_make_trait_payto_uri (
- (const char **) ksls->pay_uri),
- TALER_TESTING_make_trait_order_id (
- (const char **) &ksls->order_id),
- ANASTASIS_TESTING_make_trait_code (
- (const char **) &ksls->code),
+ TALER_TESTING_make_trait_payto_uri (ksls->pay_uri),
+ TALER_TESTING_make_trait_order_id (ksls->order_id),
+ ANASTASIS_TESTING_make_trait_code (ksls->code),
TALER_TESTING_trait_end ()
};
diff --git a/src/testing/testing_api_cmd_truth_solve.c b/src/testing/testing_api_cmd_truth_solve.c
index 5c12b3f..29157ed 100644
--- a/src/testing/testing_api_cmd_truth_solve.c
+++ b/src/testing/testing_api_cmd_truth_solve.c
@@ -127,13 +127,9 @@ truth_solve_cb (void *cls,
ksls->tso = NULL;
if (tsr->http_status != ksls->expected_http_status)
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u to command %s in %s:%u\n",
- tsr->http_status,
- ksls->is->commands[ksls->is->ip].label,
- __FILE__,
- __LINE__);
- TALER_TESTING_interpreter_fail (ksls->is);
+ TALER_TESTING_unexpected_status (ksls->is,
+ tsr->http_status,
+ ksls->expected_http_status);
return;
}
switch (tsr->http_status)
@@ -163,7 +159,7 @@ truth_solve_run (void *cls,
const struct ANASTASIS_CRYPTO_TruthKeyP *truth_key;
const struct ANASTASIS_CRYPTO_TruthUUIDP *truth_uuid;
const struct ANASTASIS_PaymentSecretP *payment_secret;
- const char **answerp;
+ const char *answer;
ksls->is = is;
if (NULL == ksls->upload_reference)
@@ -185,7 +181,7 @@ truth_solve_run (void *cls,
return;
}
{
- const char **fn;
+ const char *fn;
if (GNUNET_OK !=
ANASTASIS_TESTING_get_trait_filename (upload_cmd,
@@ -195,8 +191,8 @@ truth_solve_run (void *cls,
TALER_TESTING_interpreter_fail (ksls->is);
return;
}
- if (NULL != *fn)
- ksls->filename = GNUNET_strdup (*fn);
+ if (NULL != fn)
+ ksls->filename = GNUNET_strdup (fn);
}
if (GNUNET_OK !=
ANASTASIS_TESTING_get_trait_truth_uuid (upload_cmd,
@@ -242,13 +238,13 @@ truth_solve_run (void *cls,
}
if (GNUNET_OK !=
ANASTASIS_TESTING_get_trait_code (download_cmd,
- &answerp))
+ &answer))
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (ksls->is);
return;
}
- if (NULL == *answerp)
+ if (NULL == answer)
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (ksls->is);
@@ -258,9 +254,9 @@ truth_solve_run (void *cls,
else
{
/* answer is the answer */
- answerp = &ksls->answer;
+ answer = ksls->answer;
}
- if (NULL == answerp)
+ if (NULL == answer)
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (ksls->is);
@@ -291,18 +287,19 @@ truth_solve_run (void *cls,
{
struct GNUNET_HashCode h_answer;
- GNUNET_CRYPTO_hash (*answerp,
- strlen (*answerp),
+ GNUNET_CRYPTO_hash (answer,
+ strlen (answer),
&h_answer);
- ksls->tso = ANASTASIS_truth_solve (is->ctx,
- ksls->anastasis_url,
- truth_uuid,
- truth_key,
- payment_secret,
- GNUNET_TIME_UNIT_ZERO,
- &h_answer,
- &truth_solve_cb,
- ksls);
+ ksls->tso = ANASTASIS_truth_solve (
+ TALER_TESTING_interpreter_get_context (is),
+ ksls->anastasis_url,
+ truth_uuid,
+ truth_key,
+ payment_secret,
+ GNUNET_TIME_UNIT_ZERO,
+ &h_answer,
+ &truth_solve_cb,
+ ksls);
}
if (NULL == ksls->tso)
{
@@ -356,12 +353,9 @@ truth_solve_traits (void *cls,
struct TALER_TESTING_Trait traits[] = {
ANASTASIS_TESTING_make_trait_payment_secret (
&ksls->payment_secret_response),
- TALER_TESTING_make_trait_payto_uri (
- (const char **) ksls->pay_uri),
- TALER_TESTING_make_trait_order_id (
- (const char **) &ksls->order_id),
- ANASTASIS_TESTING_make_trait_code (
- (const char **) &ksls->code),
+ TALER_TESTING_make_trait_payto_uri (ksls->pay_uri),
+ TALER_TESTING_make_trait_order_id (ksls->order_id),
+ ANASTASIS_TESTING_make_trait_code (ksls->code),
TALER_TESTING_trait_end ()
};
diff --git a/src/testing/testing_api_cmd_truth_store.c b/src/testing/testing_api_cmd_truth_store.c
index 0972210..f7a6ece 100644
--- a/src/testing/testing_api_cmd_truth_store.c
+++ b/src/testing/testing_api_cmd_truth_store.c
@@ -125,16 +125,11 @@ truth_store_cb (void *cls,
struct TruthStoreState *tss = cls;
tss->tso = NULL;
- if ( (NULL == ud) ||
- (ud->http_status != tss->http_status) )
+ if (ud->http_status != tss->http_status)
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u to command %s in %s:%u\n",
- (NULL != ud) ? ud->http_status : 0,
- tss->is->commands[tss->is->ip].label,
- __FILE__,
- __LINE__);
- TALER_TESTING_interpreter_fail (tss->is);
+ TALER_TESTING_unexpected_status (tss->is,
+ ud->http_status,
+ tss->http_status);
return;
}
switch (ud->us)
@@ -273,7 +268,7 @@ truth_store_run (void *cls,
GNUNET_free (t);
}
tss->tso = ANASTASIS_truth_store (
- is->ctx,
+ TALER_TESTING_interpreter_get_context (is),
tss->anastasis_url,
&tss->uuid,
tss->method,
@@ -345,10 +340,8 @@ truth_store_traits (void *cls,
ANASTASIS_TESTING_make_trait_truth_key (&tss->key),
ANASTASIS_TESTING_make_trait_eks (&tss->encrypted_keyshare),
ANASTASIS_TESTING_make_trait_payment_secret (&tss->payment_secret_response),
- TALER_TESTING_make_trait_payto_uri (
- (const char **) &tss->pay_uri),
- ANASTASIS_TESTING_make_trait_filename (
- (const char **) &tss->filename),
+ TALER_TESTING_make_trait_payto_uri (tss->pay_uri),
+ ANASTASIS_TESTING_make_trait_filename (tss->filename),
TALER_TESTING_trait_end ()
};
diff --git a/src/testing/testing_cmd_challenge_answer.c b/src/testing/testing_cmd_challenge_answer.c
index 8e5e2d8..ad24861 100644
--- a/src/testing/testing_cmd_challenge_answer.c
+++ b/src/testing/testing_cmd_challenge_answer.c
@@ -249,7 +249,7 @@ challenge_answer_run (void *cls,
if (1 == cs->mode)
{
const struct TALER_TESTING_Command *ref;
- const char **answer;
+ const char *answer;
unsigned long long code;
char dummy;
@@ -270,7 +270,7 @@ challenge_answer_run (void *cls,
return;
}
if (1 !=
- sscanf (*answer,
+ sscanf (answer,
"%llu%c",
&code,
&dummy))
@@ -544,14 +544,11 @@ challenge_create_traits (void *cls,
{
struct ChallengeState *cs = cls;
struct TALER_TESTING_Trait traits[] = {
- ANASTASIS_TESTING_make_trait_code (
- (const char **) &cs->code),
+ ANASTASIS_TESTING_make_trait_code (cs->code),
ANASTASIS_TESTING_make_trait_payment_secret (
&cs->payment_order_req),
- TALER_TESTING_make_trait_payto_uri (
- (const char **) cs->payment_uri),
- TALER_TESTING_make_trait_order_id (
- (const char **) &cs->order_id),
+ TALER_TESTING_make_trait_payto_uri (cs->payment_uri),
+ TALER_TESTING_make_trait_order_id (cs->order_id),
TALER_TESTING_trait_end ()
};
diff --git a/src/testing/testing_cmd_recover_secret.c b/src/testing/testing_cmd_recover_secret.c
index 3b12012..1f3e832 100644
--- a/src/testing/testing_cmd_recover_secret.c
+++ b/src/testing/testing_cmd_recover_secret.c
@@ -74,7 +74,7 @@ struct RecoverSecretState
/**
* Coresecret to check if decryption worked
*/
- const void **core_secret;
+ const void *core_secret;
/**
* Task scheduled to wait for recovery to complete.
@@ -108,13 +108,19 @@ policy_lookup_cb (void *cls,
{
struct RecoverSecretState *rss = cls;
- rss->ri = (struct ANASTASIS_RecoveryInformation *) ri;
if (NULL == ri)
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (rss->is);
return;
}
+ if (0 == ri->cs_len)
+ {
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (rss->is);
+ return;
+ }
+ rss->ri = (struct ANASTASIS_RecoveryInformation *) ri;
TALER_TESTING_interpreter_next (rss->is);
}
@@ -146,7 +152,7 @@ core_secret_cb (void *cls,
return;
}
if (0 != memcmp (secret,
- *rss->core_secret,
+ rss->core_secret,
secret_size))
{
GNUNET_break (0);
@@ -188,9 +194,9 @@ recover_secret_run (void *cls,
if (NULL != rss->download_reference)
{
- ref = TALER_TESTING_interpreter_lookup_command
- (is,
- rss->download_reference);
+ ref = TALER_TESTING_interpreter_lookup_command (
+ is,
+ rss->download_reference);
if (NULL == ref)
{
GNUNET_break (0);
@@ -220,22 +226,23 @@ recover_secret_run (void *cls,
if (GNUNET_OK !=
ANASTASIS_TESTING_get_trait_core_secret (
ref,
- (const void ***) &rss->core_secret))
+ &rss->core_secret))
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (rss->is);
return;
}
}
- rss->recovery = ANASTASIS_recovery_begin (is->ctx,
- rss->id_data,
- rss->version,
- rss->anastasis_url,
- provider_salt,
- &policy_lookup_cb,
- rss,
- &core_secret_cb,
- rss);
+ rss->recovery = ANASTASIS_recovery_begin (
+ TALER_TESTING_interpreter_get_context (is),
+ rss->id_data,
+ rss->version,
+ rss->anastasis_url,
+ provider_salt,
+ &policy_lookup_cb,
+ rss,
+ &core_secret_cb,
+ rss);
if (NULL == rss->recovery)
{
GNUNET_break (0);
@@ -301,7 +308,7 @@ recover_secret_cleanup (void *cls,
* @param index index number of the object to extract.
* @return #GNUNET_OK on success
*/
-static int
+static enum GNUNET_GenericReturnValue
recover_secret_traits (void *cls,
const void **ret,
const char *trait,
diff --git a/src/testing/testing_cmd_secret_share.c b/src/testing/testing_cmd_secret_share.c
index 26a237d..3c401d2 100644
--- a/src/testing/testing_cmd_secret_share.c
+++ b/src/testing/testing_cmd_secret_share.c
@@ -135,14 +135,7 @@ secret_share_result_cb (void *cls,
sss->sso = NULL;
if (sr->ss != sss->want_status)
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u to command %s in %s:%u\n",
- sr->ss,
- sss->is->commands[sss->is->ip].label,
- __FILE__,
- __LINE__);
TALER_TESTING_interpreter_fail (sss->is);
- return;
}
switch (sr->ss)
{
@@ -225,7 +218,7 @@ secret_share_run (void *cls,
if (NULL != sss->prev_secret_share)
{
const struct TALER_TESTING_Command *ref;
- const char **order_id;
+ const char *order_id;
ref = TALER_TESTING_interpreter_lookup_command (is,
sss->prev_secret_share);
@@ -243,8 +236,7 @@ secret_share_run (void *cls,
TALER_TESTING_interpreter_fail (sss->is);
return;
}
- sss->payment_order_id = (char *) *order_id;
-
+ sss->payment_order_id = GNUNET_strdup (order_id);
if (NULL == sss->payment_order_id)
{
GNUNET_break (0);
@@ -296,19 +288,20 @@ secret_share_run (void *cls,
pds.provider_salt = *provider_salt;
}
- sss->sso = ANASTASIS_secret_share (is->ctx,
- sss->id_data,
- &pds,
- 1,
- policies,
- sss->cmd_label_array_length,
- false,
- GNUNET_TIME_UNIT_ZERO,
- &secret_share_result_cb,
- sss,
- "test-case",
- sss->core_secret,
- sss->core_secret_size);
+ sss->sso = ANASTASIS_secret_share (
+ TALER_TESTING_interpreter_get_context (is),
+ sss->id_data,
+ &pds,
+ 1,
+ policies,
+ sss->cmd_label_array_length,
+ false,
+ GNUNET_TIME_UNIT_ZERO,
+ &secret_share_result_cb,
+ sss,
+ "test-case",
+ sss->core_secret,
+ sss->core_secret_size);
if (NULL == sss->sso)
{
GNUNET_break (0);
@@ -366,9 +359,8 @@ secret_share_traits (void *cls,
struct SecretShareState *sss = cls;
struct TALER_TESTING_Trait traits[] = {
TALER_TESTING_make_trait_claim_token (&sss->token),
- ANASTASIS_TESTING_make_trait_core_secret (&sss->core_secret),
- TALER_TESTING_make_trait_order_id (
- (const char **) &sss->payment_order_id),
+ ANASTASIS_TESTING_make_trait_core_secret (sss->core_secret),
+ TALER_TESTING_make_trait_order_id (sss->payment_order_id),
TALER_TESTING_trait_end ()
};
diff --git a/src/testing/testing_cmd_truth_upload.c b/src/testing/testing_cmd_truth_upload.c
index 89ba790..2e3523b 100644
--- a/src/testing/testing_cmd_truth_upload.c
+++ b/src/testing/testing_cmd_truth_upload.c
@@ -208,19 +208,20 @@ truth_upload_run (void *cls,
ANASTASIS_CRYPTO_user_identifier_derive (tus->id_data,
provider_salt,
&user_id);
- tus->tuo = ANASTASIS_truth_upload (is->ctx,
- &user_id,
- tus->anastasis_url,
- tus->method,
- tus->instructions,
- tus->mime_type,
- provider_salt,
- tus->truth_data,
- tus->truth_data_size,
- false, /* force payment */
- GNUNET_TIME_UNIT_ZERO,
- &truth_upload_cb,
- tus);
+ tus->tuo = ANASTASIS_truth_upload (
+ TALER_TESTING_interpreter_get_context (is),
+ &user_id,
+ tus->anastasis_url,
+ tus->method,
+ tus->instructions,
+ tus->mime_type,
+ provider_salt,
+ tus->truth_data,
+ tus->truth_data_size,
+ false, /* force payment */
+ GNUNET_TIME_UNIT_ZERO,
+ &truth_upload_cb,
+ tus);
if (NULL == tus->tuo)
{
GNUNET_break (0);
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index 4e64c0e..29d2b13 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -26,6 +26,9 @@ anastasis-config: anastasis-config.in
chmod a-w+x $@.tmp && \
mv $@.tmp $@
+CLEANFILES = \
+ anastasis-config
+
bin_SCRIPTS = \
anastasis-config
diff --git a/src/util/anastasis-config.in b/src/util/anastasis-config.in
index 0e94921..6657540 100644
--- a/src/util/anastasis-config.in
+++ b/src/util/anastasis-config.in
@@ -7,6 +7,7 @@ if ! type gnunet-config >/dev/null; then
exit 1
fi
-GC=`which gnunet-config`
-export LD_PRELOAD=${LD_PRELOAD:-}:%libdir%/libanastasisutil.so
+GC=$(which gnunet-config)
+SO=$(ls %libdir%/libanastasisutil.so.* | sort -n | tail -n1)
+export LD_PRELOAD=${LD_PRELOAD:-}:${SO}
exec gnunet-config "$@"