exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit b771198daedfa6f88230ac685bf1990c3ec9283a
parent ca98699ba49f692df84f294aef312a7837bfe246
Author: Florian Dold <dold@taler.net>
Date:   Mon, 31 Aug 2026 16:25:59 +0200

auditor: serve WebUI at /webui/ and accept omitted offsets

Diffstat:
Mcontrib/auditor-spa/index.html | 4++--
Asrc/auditor/README-testing.md | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/auditor/auditor-test-scenario.sh | 214+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/auditor/auditor-test-shell.sh | 173+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Msrc/auditor/meson.build | 2++
Msrc/auditor/taler-auditor-httpd.c | 9++++++---
Msrc/auditor/taler-auditor-httpd_get-monitoring-aml-holds.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-amount-arithmetic-inconsistency.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-bad-sig-losses.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-closure-lags.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-coin-inconsistency.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-denomination-key-validity-withdraw-inconsistency.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-denominations-without-sigs.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-deposit-confirmations.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-early-aggregation.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-emergency-by-count.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-emergency.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-fee-time-inconsistency.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-historic-denomination-revenue.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-historic-reserve-summary.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-kycauth-in-inconsistency.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-misattribution-in-inconsistency.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-pending-deposits.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-purse-not-closed-inconsistencies.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-purses.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-reserve-balance-insufficient-inconsistency.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-reserve-balance-summary-wrong-inconsistency.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-reserve-in-inconsistency.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-reserve-not-closed-inconsistency.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-reserves.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-row-inconsistency.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-row-minor-inconsistencies.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-wire-format-inconsistency.c | 2+-
Msrc/auditor/taler-auditor-httpd_get-monitoring-wire-out-inconsistency.c | 2+-
Msrc/auditor/taler-auditor-httpd_spa.c | 4++--
Msrc/auditor/taler-auditor-httpd_spa.h | 3+--
Msrc/auditor/test-auditor.sh | 11+++++++++++
Msrc/auditor/test-kyc.sh | 5+++++
Msrc/auditor/test-revocation.sh | 5+++++
39 files changed, 509 insertions(+), 37 deletions(-)

diff --git a/contrib/auditor-spa/index.html b/contrib/auditor-spa/index.html @@ -2,10 +2,10 @@ <html> <body> <h1>Taler Auditor Web UI not installed</h1> - <p>This is a fallback page shown when the Taler Exchange KYC Web UI is not + <p>This is a fallback page shown when the Taler Auditor Web UI is not available.</p> <p>Please make sure the package is installed and the - <code>SPA_DIR</code> option in the <code>[exchange]</code> section of + <code>SPA_DIR</code> option in the <code>[auditor]</code> section of the taler-auditor configuration is set correctly.</p> </body> </html> diff --git a/src/auditor/README-testing.md b/src/auditor/README-testing.md @@ -0,0 +1,60 @@ +# Testing the auditor WebUI with generated databases + +Run the helper from `build/src/auditor` as a normal, non-root user. It runs the +ordinary auditor test case, starts the generated PostgreSQL cluster, and opens +an interactive shell with the test environment configured: + +```shell +./auditor-test-shell.sh +``` + +Use the KYC-enabled sample instead with: + +```shell +./auditor-test-shell.sh kyc +``` + +The KYC fixture includes a completed KYC process and a payout that is +legitimately held for KYC. Both fixtures represent internally consistent +activity, so inconsistency lists should normally be empty. Their balance and +progress pages contain the values produced by the auditor helpers. + +Inside the shell, `CONF`, `PGDATA`, `PGHOST`, `DB`, and `REUSE_BASEDB_DIR` point +to the generated fixture. Start the auditor in the foreground with: + +```shell +taler-auditor-httpd -c "$CONF" -L INFO --no-authentication +``` + +`--no-authentication` is appropriate only for this local test setup. Open +<http://localhost:8083/webui/> to use the WebUI. + +## Show inconsistencies + +Inside the test shell, load several inconsistencies before starting the auditor: + +```shell +auditor-test-scenario.sh all +``` + +The individual scenarios are `bad-signature`, `reserve-credit`, and +`emergency`. Each command restores the original sample before introducing its +inconsistency, so use `all` to show them together. Restore clean reports with: + +```shell +auditor-test-scenario.sh clean +``` + +The scenarios run the real auditor helpers and leave their logs in +`$REUSE_BASEDB_DIR/scenario-logs/`. + +Leaving the shell stops the PostgreSQL instance started by the helper but keeps +the fixture directory. The helper prints its `REUSE_BASEDB_DIR`; reopen that +fixture without regenerating it using: + +```shell +REUSE_BASEDB_DIR=/tmp/taler-auditor-basedbXXXXXX \ + ./auditor-test-shell.sh +``` + +Remove that directory manually when the fixture is no longer needed. diff --git a/src/auditor/auditor-test-scenario.sh b/src/auditor/auditor-test-scenario.sh @@ -0,0 +1,214 @@ +#!/bin/bash +# +# This file is part of TALER +# Copyright (C) 2026 Taler Systems SA +# +# TALER is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 3, or (at your option) any later version. +# +# TALER is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>. + +set -eu +set -o pipefail + +DB=auditor-basedb +BANK_PID="" + +function usage() +{ + echo "Usage: $0 {clean|bad-signature|reserve-credit|emergency|all}" >&2 +} + +function cleanup() +{ + local status=$? + + trap - EXIT + if [ -n "$BANK_PID" ] + then + kill -TERM "$BANK_PID" 2> /dev/null || true + wait "$BANK_PID" 2> /dev/null || true + fi + exit "$status" +} + +function run_helper() +{ + local name=$1 + + shift + echo -n "Running $name auditor ... " + if "$@" \ + -L INFO \ + -c "$CONF" \ + -t \ + > "$LOG_DIR/$name.out" \ + 2> "$LOG_DIR/$name.err" + then + echo "DONE" + else + echo "FAILED (see $LOG_DIR/$name.err)" >&2 + return 1 + fi +} + +trap cleanup EXIT + +if [ "$#" -ne 1 ] +then + usage + exit 2 +fi +SCENARIO=$1 +case "$SCENARIO" in + clean|bad-signature|reserve-credit|emergency|all) + ;; + *) + usage + exit 2 + ;; +esac + +if [ -z "${REUSE_BASEDB_DIR:-}" ] +then + echo "Run this command inside auditor-test-shell.sh." >&2 + exit 1 +fi +if [ ! -d "$REUSE_BASEDB_DIR" ] +then + echo "REUSE_BASEDB_DIR is not a directory: $REUSE_BASEDB_DIR" >&2 + exit 1 +fi + +FIXTURE_ROOT=$(cd -- "$REUSE_BASEDB_DIR" && pwd -P) +CONF="$FIXTURE_ROOT/basedb/auditor-basedb.conf" +BASE_SQL="$FIXTURE_ROOT/basedb/auditor-basedb.sql" +PGHOST="$FIXTURE_ROOT/postgres/sockets" +LOG_DIR="$FIXTURE_ROOT/scenario-logs" +export CONF DB PGHOST + +if [ ! -f "$CONF" ] || [ ! -f "$BASE_SQL" ] +then + echo "The fixture does not contain the auditor base database and configuration." >&2 + exit 1 +fi +if [ ! -d "$PGHOST" ] +then + echo "The fixture PostgreSQL socket directory does not exist: $PGHOST" >&2 + exit 1 +fi +if ! pg_isready -q -h "$PGHOST" -d "$DB" +then + echo "The fixture PostgreSQL server is not running." >&2 + exit 1 +fi + +BANK_PORT=$(taler-exchange-config \ + -c "$CONF" \ + -s libeufin-bank \ + -o PORT) +BANK_URL="http://localhost:$BANK_PORT/" +if curl -fsS "$BANK_URL/config" > /dev/null 2>&1 +then + echo "libeufin-bank is already running on port $BANK_PORT; stop it first." >&2 + exit 1 +fi + +mkdir -p "$LOG_DIR" +echo "Restoring the clean auditor fixture ..." +dropdb --if-exists --force "$DB" +createdb -T template0 "$DB" +psql \ + -X \ + -q \ + -1 \ + -v ON_ERROR_STOP=1 \ + -d "$DB" \ + -f "$BASE_SQL" \ + > "$LOG_DIR/restore.out" \ + 2> "$LOG_DIR/restore.err" + +case "$SCENARIO" in + bad-signature|all) + psql -X -v ON_ERROR_STOP=1 -d "$DB" <<'EOF' +UPDATE exchange.batch_deposits + SET h_contract_terms = '\x12bb676444955c98789f219148aa31899d8c354a63330624d3d143222cf3bb8b8e16f69accd5a8773127059b804c1955696bf551dd7be62719870613332aa8d5' + WHERE batch_deposit_serial_id = + (SELECT batch_deposit_serial_id + FROM exchange.coin_deposits + WHERE (amount_with_fee).val = 3 + ORDER BY coin_deposit_serial_id + LIMIT 1); +EOF + ;; +esac + +case "$SCENARIO" in + reserve-credit|all) + psql -X -v ON_ERROR_STOP=1 -d "$DB" <<'EOF' +UPDATE exchange.reserves_in + SET credit.val = 5 + WHERE reserve_in_serial_id = 1; +EOF + ;; +esac + +case "$SCENARIO" in + emergency|all) + psql -X -v ON_ERROR_STOP=1 -d "$DB" \ + -c 'DELETE FROM exchange.withdraw;' + ;; +esac + +echo "Starting libeufin-bank ..." +libeufin-bank serve \ + -c "$CONF" \ + -L INFO \ + > "$LOG_DIR/libeufin-bank.out" \ + 2> "$LOG_DIR/libeufin-bank.err" & +BANK_PID=$! + +BANK_READY=0 +for attempt in $(seq 1 100) +do + : "$attempt" + if curl -fsS "$BANK_URL/config" > /dev/null 2>&1 + then + BANK_READY=1 + break + fi + sleep 0.2 +done +if [ 0 = "$BANK_READY" ] +then + echo "libeufin-bank did not become ready (see $LOG_DIR/libeufin-bank.err)." >&2 + exit 1 +fi + +taler-auditor-dbinit -r -c "$CONF" +run_helper aml taler-helper-auditor-aml -i +run_helper aggregation taler-helper-auditor-aggregation +run_helper coins taler-helper-auditor-coins +run_helper deposits taler-helper-auditor-deposits +run_helper reserves taler-helper-auditor-reserves -i +run_helper wire-credit taler-helper-auditor-wire-credit -i +run_helper wire-debit taler-helper-auditor-wire-debit -i +run_helper purses taler-helper-auditor-purses -i +run_helper transfer taler-helper-auditor-transfer -i + +kill -TERM "$BANK_PID" 2> /dev/null || true +wait "$BANK_PID" 2> /dev/null || true +BANK_PID="" + +if [ clean = "$SCENARIO" ] +then + echo "Clean auditor reports restored." +else + echo "Scenario '$SCENARIO' is ready. Start the auditor and refresh the WebUI." +fi diff --git a/src/auditor/auditor-test-shell.sh b/src/auditor/auditor-test-shell.sh @@ -0,0 +1,173 @@ +#!/bin/bash +# +# This file is part of TALER +# Copyright (C) 2026 Taler Systems SA +# +# TALER is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 3, or (at your option) any later version. +# +# TALER is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>. + +set -eu +set -o pipefail + +SCRIPT_DIR=$(cd -- "$(dirname -- "$0")" && pwd -P) +export PATH="$SCRIPT_DIR:$PATH" +TEST_LOG="" +STARTED_POSTGRES=0 +PG_CTL="" +PGDATA="" + +function usage() +{ + echo "Usage: $0 [ordinary|kyc]" >&2 +} + +function cleanup() +{ + local status=$? + + trap - EXIT + if [ 1 = "$STARTED_POSTGRES" ] + then + echo "Stopping PostgreSQL at $PGDATA ..." + "$PG_CTL" \ + -D "$PGDATA" \ + -m fast \ + -w \ + stop \ + > /dev/null \ + || { + echo "Failed to stop PostgreSQL at $PGDATA." >&2 + status=1 + } + fi + if [ -n "$TEST_LOG" ] + then + rm -f "$TEST_LOG" + fi + exit "$status" +} + +trap cleanup EXIT + +SAMPLE=${1:-ordinary} +if [ "$#" -gt 1 ] +then + usage + exit 2 +fi +case "$SAMPLE" in + ordinary) + TEST_SCRIPT=test-auditor.sh + ;; + kyc) + TEST_SCRIPT=test-kyc.sh + ;; + *) + usage + exit 2 + ;; +esac + +if [ 0 = "$(id -u)" ] +then + echo "This helper must be run as a non-root user." >&2 + exit 1 +fi + +if [ -n "${REUSE_BASEDB_DIR:-}" ] +then + if [ ! -d "$REUSE_BASEDB_DIR" ] + then + echo "REUSE_BASEDB_DIR is not a directory: $REUSE_BASEDB_DIR" >&2 + exit 1 + fi + FIXTURE_ROOT=$(cd -- "$REUSE_BASEDB_DIR" && pwd -P) + echo "Reusing auditor fixture $FIXTURE_ROOT" +else + TEST_LOG=$(mktemp "${TMPDIR:-/tmp}/taler-auditor-test-shell.XXXXXX.log") + echo "Generating the $SAMPLE auditor fixture ..." + ( + cd "$SCRIPT_DIR" + "./$TEST_SCRIPT" 1 + ) | tee "$TEST_LOG" + FIXTURE_ROOT=$(sed -n \ + 's/^export REUSE_BASEDB_DIR=//p' \ + "$TEST_LOG" \ + | tail -n 1) + if [ -z "$FIXTURE_ROOT" ] || [ ! -d "$FIXTURE_ROOT" ] + then + echo "The auditor test did not report a reusable fixture directory." >&2 + exit 1 + fi + FIXTURE_ROOT=$(cd -- "$FIXTURE_ROOT" && pwd -P) +fi + +export REUSE_BASEDB_DIR="$FIXTURE_ROOT" +export CONF="$FIXTURE_ROOT/basedb/auditor-basedb.conf" +export PGDATA="$FIXTURE_ROOT/postgres" +export PGHOST="$PGDATA/sockets" +export DB=auditor-basedb + +if [ ! -f "$CONF" ] +then + echo "Auditor configuration not found: $CONF" >&2 + exit 1 +fi +if [ ! -f "$PGDATA/PG_VERSION" ] || [ ! -d "$PGHOST" ] +then + echo "PostgreSQL fixture not found under $PGDATA" >&2 + exit 1 +fi + +PG_CTL=$(command -v pg_ctl || true) +if [ -z "$PG_CTL" ] && command -v pg_config > /dev/null 2>&1 +then + PG_CTL="$(pg_config --bindir)/pg_ctl" +fi +if [ ! -x "$PG_CTL" ] +then + echo "Could not find pg_ctl." >&2 + exit 1 +fi + +if "$PG_CTL" -D "$PGDATA" status > /dev/null 2>&1 +then + echo "PostgreSQL is already running; it will be left running on exit." +else + echo "Starting PostgreSQL at $PGDATA ..." + "$PG_CTL" \ + -D "$PGDATA" \ + -l "$FIXTURE_ROOT/postgres-shell.log" \ + -w \ + start \ + > /dev/null + STARTED_POSTGRES=1 +fi + +USER_SHELL=${SHELL:-/bin/bash} +if [ ! -x "$USER_SHELL" ] +then + echo "SHELL is not executable: $USER_SHELL" >&2 + exit 1 +fi + +echo +echo "Auditor test environment ready:" +echo " REUSE_BASEDB_DIR=$REUSE_BASEDB_DIR" +echo " CONF=$CONF" +echo " PGHOST=$PGHOST" +echo +echo 'Start the auditor with:' +echo " taler-auditor-httpd -c \"\$CONF\" -L INFO --no-authentication" +echo 'Leave this shell to stop the PostgreSQL instance started by the helper.' +echo + +"$USER_SHELL" -i diff --git a/src/auditor/meson.build b/src/auditor/meson.build @@ -367,6 +367,8 @@ test( EXTRA_DIST = [ 'taler-helper-auditor-render.py', 'auditor.conf', + 'auditor-test-scenario.sh', + 'auditor-test-shell.sh', 'setup.sh', 'test-sync-in.conf', 'test-sync-out.conf', diff --git a/src/auditor/taler-auditor-httpd.c b/src/auditor/taler-auditor-httpd.c @@ -347,7 +347,7 @@ handle_mhd_request (void *cls, .mime_type = "application/json", .handler = &TAH_put_deposit_confirmation, .response_code = MHD_HTTP_NO_CONTENT}, - { .url = "/spa", + { .url = "/webui", .method = MHD_HTTP_METHOD_GET, .handler = &TAH_spa_handler}, { .url = "/monitoring/deposit-confirmations", @@ -1251,6 +1251,8 @@ not_found: static enum GNUNET_GenericReturnValue auditor_serve_process_config (void) { + bool have_auditor_public_key = false; + if (NULL == (TAH_apg = TALER_AUDITORDB_connect (cfg))) { @@ -1333,10 +1335,11 @@ auditor_serve_process_config (void) return GNUNET_SYSERR; } GNUNET_free (pub); - return GNUNET_OK; + have_auditor_public_key = true; } } + if (! have_auditor_public_key) { /* Fall back to trying to read private key */ char *auditor_key_file; @@ -1391,7 +1394,7 @@ auditor_serve_process_config (void) else { GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Loading exchange AML SPA from default location\n"); + "Loading auditor SPA from default location\n"); } return GNUNET_OK; } diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-aml-holds.c b/src/auditor/taler-auditor-httpd_get-monitoring-aml-holds.c @@ -123,7 +123,7 @@ TAH_get_monitoring_aml_holds ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-amount-arithmetic-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-amount-arithmetic-inconsistency.c @@ -96,7 +96,7 @@ TAH_get_monitoring_amount_arithmetic_inconsistency ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-bad-sig-losses.c b/src/auditor/taler-auditor-httpd_get-monitoring-bad-sig-losses.c @@ -97,7 +97,7 @@ TAH_get_monitoring_bad_sig_losses ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-closure-lags.c b/src/auditor/taler-auditor-httpd_get-monitoring-closure-lags.c @@ -94,7 +94,7 @@ TAH_get_monitoring_closure_lags ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-coin-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-coin-inconsistency.c @@ -87,7 +87,7 @@ TAH_get_monitoring_coin_inconsistency ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-denomination-key-validity-withdraw-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-denomination-key-validity-withdraw-inconsistency.c @@ -99,7 +99,7 @@ TAH_get_monitoring_denomination_key_validity_withdraw_inconsistency ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-denominations-without-sigs.c b/src/auditor/taler-auditor-httpd_get-monitoring-denominations-without-sigs.c @@ -94,7 +94,7 @@ TAH_get_monitoring_denominations_without_sigs ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-deposit-confirmations.c b/src/auditor/taler-auditor-httpd_get-monitoring-deposit-confirmations.c @@ -137,7 +137,7 @@ TAH_get_monitoring_deposit_confirmations ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-early-aggregation.c b/src/auditor/taler-auditor-httpd_get-monitoring-early-aggregation.c @@ -88,7 +88,7 @@ TAH_get_monitoring_early_aggregation ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-emergency-by-count.c b/src/auditor/taler-auditor-httpd_get-monitoring-emergency-by-count.c @@ -99,7 +99,7 @@ TAH_get_monitoring_emergency_by_count ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-emergency.c b/src/auditor/taler-auditor-httpd_get-monitoring-emergency.c @@ -98,7 +98,7 @@ TAH_get_monitoring_emergency ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-fee-time-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-fee-time-inconsistency.c @@ -94,7 +94,7 @@ TAH_get_monitoring_fee_time_inconsistency ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-historic-denomination-revenue.c b/src/auditor/taler-auditor-httpd_get-monitoring-historic-denomination-revenue.c @@ -104,7 +104,7 @@ TAH_get_monitoring_historic_denomination_revenue ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-historic-reserve-summary.c b/src/auditor/taler-auditor-httpd_get-monitoring-historic-reserve-summary.c @@ -98,7 +98,7 @@ TAH_get_monitoring_historic_reserve_summary ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-kycauth-in-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-kycauth-in-inconsistency.c @@ -105,7 +105,7 @@ TAH_get_monitoring_kycauth_in_inconsistency ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-misattribution-in-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-misattribution-in-inconsistency.c @@ -92,7 +92,7 @@ TAH_get_monitoring_misattribution_in_inconsistency ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-pending-deposits.c b/src/auditor/taler-auditor-httpd_get-monitoring-pending-deposits.c @@ -98,7 +98,7 @@ TAH_get_monitoring_pending_deposits ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-purse-not-closed-inconsistencies.c b/src/auditor/taler-auditor-httpd_get-monitoring-purse-not-closed-inconsistencies.c @@ -91,7 +91,7 @@ TAH_get_monitoring_purse_not_closed_inconsistencies ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-purses.c b/src/auditor/taler-auditor-httpd_get-monitoring-purses.c @@ -95,7 +95,7 @@ TAH_get_monitoring_purses ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-reserve-balance-insufficient-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-reserve-balance-insufficient-inconsistency.c @@ -96,7 +96,7 @@ TAH_get_monitoring_reserve_balance_insufficient_inconsistency ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-reserve-balance-summary-wrong-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-reserve-balance-summary-wrong-inconsistency.c @@ -91,7 +91,7 @@ TAH_get_monitoring_reserve_balance_summary_wrong_inconsistency ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-reserve-in-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-reserve-in-inconsistency.c @@ -102,7 +102,7 @@ TAH_get_monitoring_reserve_in_inconsistency ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-reserve-not-closed-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-reserve-not-closed-inconsistency.c @@ -95,7 +95,7 @@ TAH_get_monitoring_reserve_not_closed_inconsistency ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-reserves.c b/src/auditor/taler-auditor-httpd_get-monitoring-reserves.c @@ -107,7 +107,7 @@ TAH_get_monitoring_reserves ( &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-row-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-row-inconsistency.c @@ -92,7 +92,7 @@ TAH_get_monitoring_row_inconsistency ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-row-minor-inconsistencies.c b/src/auditor/taler-auditor-httpd_get-monitoring-row-minor-inconsistencies.c @@ -92,7 +92,7 @@ TAH_get_monitoring_row_minor_inconsistencies ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-wire-format-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-wire-format-inconsistency.c @@ -94,7 +94,7 @@ TAH_get_monitoring_wire_format_inconsistency ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-wire-out-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-wire-out-inconsistency.c @@ -96,7 +96,7 @@ TAH_get_monitoring_wire_out_inconsistency ( "limit", &limit); if (limit < 0) - offset = INT64_MAX; + offset = TAH_SAFE_UINT64_MAX; else offset = 0; TAH_PARSE_SAFE_REQUEST_NUMBER (connection, diff --git a/src/auditor/taler-auditor-httpd_spa.c b/src/auditor/taler-auditor-httpd_spa.c @@ -15,7 +15,7 @@ */ /** * @file taler-auditor-httpd_spa.c - * @brief logic to load single page app (/spa) + * @brief logic to load single page app (/webui) * @author Christian Grothoff */ #include "platform.h" @@ -44,7 +44,7 @@ TAH_spa_handler ( const char *path = args[1]; GNUNET_assert (0 == strcmp (args[0], - "spa")); + "webui")); if (NULL == path) path = "index.html"; return TALER_MHD_spa_handler (spa, diff --git a/src/auditor/taler-auditor-httpd_spa.h b/src/auditor/taler-auditor-httpd_spa.h @@ -26,8 +26,7 @@ /** - * Return our single-page-app user interface - * for staff (see contrib/wallet-core/). + * Return our single-page-app user interface for staff under `/webui/`. * * @param rh request context * @param connection the MHD connection to handle diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh @@ -461,6 +461,17 @@ function run_auditor_httpd() { break done echo "... DONE." + wget "http://localhost:8083/webui/" \ + -o /dev/null \ + -O /dev/null \ + >/dev/null \ + || exit_fail "Auditor WebUI is not available under /webui/" + curl -sS -f \ + -H "Accept: application/json" \ + -H "Authorization: Bearer ${TALER_AUDITOR_TOKEN}" \ + -o /dev/null \ + "http://localhost:8083/monitoring/coin-inconsistencies" \ + || exit_fail "Auditor monitoring endpoint rejects default pagination" } diff --git a/src/auditor/test-kyc.sh b/src/auditor/test-kyc.sh @@ -425,6 +425,11 @@ function run_auditor_httpd() { break done echo "... DONE." + wget "http://localhost:8083/webui/" \ + -o /dev/null \ + -O /dev/null \ + >/dev/null \ + || exit_fail "Auditor WebUI is not available under /webui/" } diff --git a/src/auditor/test-revocation.sh b/src/auditor/test-revocation.sh @@ -209,6 +209,11 @@ function run_auditor_httpd() { break done echo "... DONE." + wget "http://localhost:8083/webui/" \ + -o /dev/null \ + -O /dev/null \ + >/dev/null \ + || exit_fail "Auditor WebUI is not available under /webui/" }