exchange

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

commit 67b42cf8eb0ab06eaa1f4d21e0182f7062337994
parent 3b39ad1e7b01a3001372823c98603c45c25d520f
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon, 29 Jul 2024 18:15:30 +0200

DCE

Diffstat:
Msrc/auditor/Makefile.am | 19-------------------
Msrc/auditor/taler-auditor-httpd.c | 116-------------------------------------------------------------------------------
Msrc/auditor/taler-auditor-httpd_amount-arithmetic-inconsistency-upd.h | 19+++++++++----------
Msrc/auditor/taler-auditor-httpd_bad-sig-losses-del.h | 14+++++++-------
Msrc/auditor/taler-auditor-httpd_bad-sig-losses-get.h | 14+++++++-------
Msrc/auditor/taler-auditor-httpd_balances-get.h | 18+++++++++---------
Msrc/auditor/taler-auditor-httpd_closure-lags-del.h | 40++++++++++++++++++++--------------------
Msrc/auditor/taler-auditor-httpd_closure-lags-get.h | 39++++++++++++++++++++-------------------
Dsrc/auditor/taler-auditor-httpd_closure-lags-put.c | 158-------------------------------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_closure-lags-put.h | 58----------------------------------------------------------
Msrc/auditor/taler-auditor-httpd_closure-lags-upd.h | 18+++++++++---------
Msrc/auditor/taler-auditor-httpd_coin-inconsistency-del.h | 18++++++++++--------
Msrc/auditor/taler-auditor-httpd_coin-inconsistency-get.h | 19++++++++++---------
Dsrc/auditor/taler-auditor-httpd_coin-inconsistency-put.c | 159-------------------------------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_coin-inconsistency-put.h | 57---------------------------------------------------------
Msrc/auditor/taler-auditor-httpd_coin-inconsistency-upd.h | 18+++++++++---------
Msrc/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-del.h | 31+++++++++++--------------------
Msrc/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-get.h | 45+++++++++++++++++++--------------------------
Dsrc/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-put.c | 159-------------------------------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-put.h | 68--------------------------------------------------------------------
Msrc/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-upd.h | 30++++++++++--------------------
Msrc/auditor/taler-auditor-httpd_denomination-pending-del.h | 19++++++++++---------
Msrc/auditor/taler-auditor-httpd_denomination-pending-get.h | 39++++++++++++++++++++-------------------
Dsrc/auditor/taler-auditor-httpd_denomination-pending-put.c | 159-------------------------------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_denomination-pending-put.h | 58----------------------------------------------------------
Msrc/auditor/taler-auditor-httpd_denomination-pending-upd.h | 18+++++++++---------
Msrc/auditor/taler-auditor-httpd_denominations-without-sigs-del.h | 19++++++++++---------
Msrc/auditor/taler-auditor-httpd_denominations-without-sigs-get.h | 16++++++++--------
Dsrc/auditor/taler-auditor-httpd_denominations-without-sigs-put.c | 162-------------------------------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_denominations-without-sigs-put.h | 58----------------------------------------------------------
Msrc/auditor/taler-auditor-httpd_denominations-without-sigs-upd.h | 18+++++++++---------
Msrc/auditor/taler-auditor-httpd_deposit-confirmation-del.h | 13+++++++------
Msrc/auditor/taler-auditor-httpd_deposit-confirmation-get.h | 16+++++++++-------
Msrc/auditor/taler-auditor-httpd_deposit-confirmation-upd.h | 18+++++++++---------
Msrc/auditor/taler-auditor-httpd_deposit-confirmation.h | 16+++++++++-------
Msrc/auditor/taler-auditor-httpd_emergency-by-count-del.h | 20++++++++++----------
Msrc/auditor/taler-auditor-httpd_emergency-by-count-get.h | 35++++++++++++++++++-----------------
Dsrc/auditor/taler-auditor-httpd_emergency-by-count-put.c | 167-------------------------------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_emergency-by-count-put.h | 58----------------------------------------------------------
Msrc/auditor/taler-auditor-httpd_emergency-by-count-upd.h | 18+++++++++---------
Msrc/auditor/taler-auditor-httpd_emergency-del.h | 40++++++++++++++++++++--------------------
Msrc/auditor/taler-auditor-httpd_emergency-get.h | 35++++++++++++++++++-----------------
Dsrc/auditor/taler-auditor-httpd_emergency-put.c | 167-------------------------------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_emergency-put.h | 58----------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_fee-time-inconsistency-put.c | 159-------------------------------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_fee-time-inconsistency-put.h | 58----------------------------------------------------------
Msrc/auditor/taler-auditor-httpd_mhd.h | 2++
Dsrc/auditor/taler-auditor-httpd_misattribution-in-inconsistency-put.c | 156-------------------------------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_misattribution-in-inconsistency-put.h | 58----------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_purse-not-closed-inconsistencies-put.c | 159-------------------------------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_purse-not-closed-inconsistencies-put.h | 58----------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_refreshes-hanging-put.c | 154-------------------------------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_refreshes-hanging-put.h | 58----------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_reserve-balance-insufficient-inconsistency-put.c | 158-------------------------------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_reserve-balance-insufficient-inconsistency-put.h | 64----------------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-put.c | 158-------------------------------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-put.h | 67-------------------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_reserve-in-inconsistency-put.c | 162-------------------------------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_reserve-in-inconsistency-put.h | 58----------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_reserve-not-closed-inconsistency-put.c | 160-------------------------------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_reserve-not-closed-inconsistency-put.h | 58----------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_row-inconsistency-put.c | 157-------------------------------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_row-inconsistency-put.h | 57---------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_row-minor-inconsistencies-put.c | 155-------------------------------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_row-minor-inconsistencies-put.h | 58----------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_wire-format-inconsistency-put.c | 156-------------------------------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_wire-format-inconsistency-put.h | 58----------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_wire-out-inconsistency-put.c | 158-------------------------------------------------------------------------------
Dsrc/auditor/taler-auditor-httpd_wire-out-inconsistency-put.h | 58----------------------------------------------------------
Msrc/auditordb/pg_get_amount_arithmetic_inconsistency.h | 6+++---
Msrc/auditordb/pg_get_auditor_closure_lags.h | 4+++-
Msrc/auditordb/pg_get_bad_sig_losses.h | 9++++++---
Msrc/auditordb/pg_get_balances.h | 7+++++--
Msrc/auditordb/pg_get_coin_inconsistency.h | 6+++---
Msrc/auditordb/pg_get_denomination_key_validity_withdraw_inconsistency.h | 6+++---
Msrc/auditordb/pg_get_denomination_pending.h | 6+++---
Msrc/auditordb/pg_get_denominations_without_sigs.h | 6+++---
Msrc/auditordb/pg_get_deposit_confirmations.h | 4++--
Msrc/auditordb/pg_get_emergency.h | 6+++---
Msrc/auditordb/pg_get_emergency_by_count.h | 6+++---
Msrc/auditordb/pg_get_exchange_signkeys.h | 6+++---
Msrc/auditordb/pg_get_fee_time_inconsistency.h | 6+++---
Msrc/auditordb/pg_get_historic_denomination_revenue.h | 6+++---
Msrc/auditordb/pg_get_historic_reserve_summary.h | 6+++---
Msrc/auditordb/pg_get_misattribution_in_inconsistency.h | 6+++---
Msrc/auditordb/pg_get_purse_not_closed_inconsistencies.h | 6+++---
Msrc/auditordb/pg_get_purses.h | 6+++---
Msrc/auditordb/pg_get_refreshes_hanging.h | 6+++---
Msrc/auditordb/pg_get_reserve_balance_insufficient_inconsistency.h | 6+++---
Msrc/auditordb/pg_get_reserve_balance_summary_wrong_inconsistency.h | 6+++---
Msrc/auditordb/pg_get_reserve_in_inconsistency.h | 6+++---
Msrc/auditordb/pg_get_reserve_not_closed_inconsistency.h | 6+++---
Msrc/auditordb/pg_get_reserves.h | 6+++---
Msrc/auditordb/pg_get_row_inconsistency.h | 6+++---
Msrc/auditordb/pg_get_row_minor_inconsistencies.h | 6+++---
Msrc/auditordb/pg_get_wire_format_inconsistency.h | 4++--
Msrc/auditordb/pg_get_wire_out_inconsistency.h | 4++--
97 files changed, 413 insertions(+), 4699 deletions(-)

diff --git a/src/auditor/Makefile.am b/src/auditor/Makefile.am @@ -173,31 +173,22 @@ taler_auditor_httpd_SOURCES = \ taler-auditor-httpd_coin-inconsistency-del.c taler-auditor-httpd_coin-inconsistency-del.h \ taler-auditor-httpd_row-inconsistency-del.c taler-auditor-httpd_row-inconsistency-del.h \ taler-auditor-httpd_amount-arithmetic-inconsistency-upd.c taler-auditor-httpd_amount-arithmetic-inconsistency-upd.h \ - taler-auditor-httpd_coin-inconsistency-put.c taler-auditor-httpd_coin-inconsistency-put.h \ - taler-auditor-httpd_row-inconsistency-put.c taler-auditor-httpd_row-inconsistency-put.h \ - taler-auditor-httpd_emergency-put.c taler-auditor-httpd_emergency-put.h \ taler-auditor-httpd_emergency-get.c taler-auditor-httpd_emergency-get.h \ taler-auditor-httpd_emergency-del.c taler-auditor-httpd_emergency-del.h \ - taler-auditor-httpd_emergency-by-count-put.c taler-auditor-httpd_emergency-by-count-put.h \ taler-auditor-httpd_emergency-by-count-get.c taler-auditor-httpd_emergency-by-count-get.h \ taler-auditor-httpd_emergency-by-count-del.c taler-auditor-httpd_emergency-by-count-del.h \ - taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-put.c taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-put.h \ taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-get.c taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-get.h \ taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-del.c taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-del.h \ - taler-auditor-httpd_purse-not-closed-inconsistencies-put.c taler-auditor-httpd_purse-not-closed-inconsistencies-put.h \ taler-auditor-httpd_purse-not-closed-inconsistencies-get.c taler-auditor-httpd_purse-not-closed-inconsistencies-get.h \ taler-auditor-httpd_purse-not-closed-inconsistencies-del.c taler-auditor-httpd_purse-not-closed-inconsistencies-del.h \ - taler-auditor-httpd_reserve-balance-insufficient-inconsistency-put.c taler-auditor-httpd_reserve-balance-insufficient-inconsistency-put.h \ taler-auditor-httpd_reserve-balance-insufficient-inconsistency-get.c taler-auditor-httpd_reserve-balance-insufficient-inconsistency-get.h \ taler-auditor-httpd_reserve-balance-insufficient-inconsistency-del.c taler-auditor-httpd_reserve-balance-insufficient-inconsistency-del.h \ taler-auditor-httpd_bad-sig-losses-get.c taler-auditor-httpd_bad-sig-losses-get.h \ taler-auditor-httpd_bad-sig-losses-del.c taler-auditor-httpd_bad-sig-losses-del.h \ taler-auditor-httpd_bad-sig-losses-upd.c taler-auditor-httpd_bad-sig-losses-upd.h \ - taler-auditor-httpd_closure-lags-put.c taler-auditor-httpd_closure-lags-put.h \ taler-auditor-httpd_closure-lags-get.c taler-auditor-httpd_closure-lags-get.h \ taler-auditor-httpd_closure-lags-del.c taler-auditor-httpd_closure-lags-del.h \ taler-auditor-httpd_progress-get.c taler-auditor-httpd_progress-get.h \ - taler-auditor-httpd_refreshes-hanging-put.c taler-auditor-httpd_refreshes-hanging-put.h \ taler-auditor-httpd_refreshes-hanging-get.c taler-auditor-httpd_refreshes-hanging-get.h \ taler-auditor-httpd_refreshes-hanging-del.c taler-auditor-httpd_refreshes-hanging-del.h \ taler-auditor-httpd_emergency-by-count-upd.c taler-auditor-httpd_emergency-by-count-upd.h \ @@ -210,47 +201,37 @@ taler_auditor_httpd_SOURCES = \ taler-auditor-httpd_emergency-upd.c taler-auditor-httpd_emergency-upd.h \ taler-auditor-httpd_closure-lags-upd.c taler-auditor-httpd_closure-lags-upd.h \ taler-auditor-httpd_reserve-in-inconsistency-del.c taler-auditor-httpd_reserve-in-inconsistency-del.h \ - taler-auditor-httpd_reserve-in-inconsistency-put.c taler-auditor-httpd_reserve-in-inconsistency-put.h \ taler-auditor-httpd_reserve-in-inconsistency-get.c taler-auditor-httpd_reserve-in-inconsistency-get.h \ taler-auditor-httpd_reserve-in-inconsistency-upd.c taler-auditor-httpd_reserve-in-inconsistency-upd.h \ taler-auditor-httpd_reserve-not-closed-inconsistency-del.c taler-auditor-httpd_reserve-not-closed-inconsistency-del.h \ - taler-auditor-httpd_reserve-not-closed-inconsistency-put.c taler-auditor-httpd_reserve-not-closed-inconsistency-put.h \ taler-auditor-httpd_reserve-not-closed-inconsistency-get.c taler-auditor-httpd_reserve-not-closed-inconsistency-get.h \ taler-auditor-httpd_reserve-not-closed-inconsistency-upd.c taler-auditor-httpd_reserve-not-closed-inconsistency-upd.h \ taler-auditor-httpd_denominations-without-sigs-del.c taler-auditor-httpd_denominations-without-sigs-del.h \ - taler-auditor-httpd_denominations-without-sigs-put.c taler-auditor-httpd_denominations-without-sigs-put.h \ taler-auditor-httpd_denominations-without-sigs-get.c taler-auditor-httpd_denominations-without-sigs-get.h \ taler-auditor-httpd_denominations-without-sigs-upd.c taler-auditor-httpd_denominations-without-sigs-upd.h \ taler-auditor-httpd_misattribution-in-inconsistency-del.c taler-auditor-httpd_misattribution-in-inconsistency-del.h \ - taler-auditor-httpd_misattribution-in-inconsistency-put.c taler-auditor-httpd_misattribution-in-inconsistency-put.h \ taler-auditor-httpd_misattribution-in-inconsistency-get.c taler-auditor-httpd_misattribution-in-inconsistency-get.h \ taler-auditor-httpd_misattribution-in-inconsistency-upd.c taler-auditor-httpd_misattribution-in-inconsistency-upd.h \ taler-auditor-httpd_reserves-get.c taler-auditor-httpd_reserves-get.h \ taler-auditor-httpd_purses-get.c taler-auditor-httpd_purses-get.h \ taler-auditor-httpd_historic-denomination-revenue-get.c taler-auditor-httpd_historic-denomination-revenue-get.h \ taler-auditor-httpd_denomination-pending-del.c taler-auditor-httpd_denomination-pending-del.h \ - taler-auditor-httpd_denomination-pending-put.c taler-auditor-httpd_denomination-pending-put.h \ taler-auditor-httpd_denomination-pending-get.c taler-auditor-httpd_denomination-pending-get.h \ taler-auditor-httpd_denomination-pending-upd.c taler-auditor-httpd_denomination-pending-upd.h \ taler-auditor-httpd_historic-reserve-summary-get.c taler-auditor-httpd_historic-reserve-summary-get.h \ taler-auditor-httpd_wire-format-inconsistency-del.c taler-auditor-httpd_wire-format-inconsistency-del.h \ - taler-auditor-httpd_wire-format-inconsistency-put.c taler-auditor-httpd_wire-format-inconsistency-put.h \ taler-auditor-httpd_wire-format-inconsistency-get.c taler-auditor-httpd_wire-format-inconsistency-get.h \ taler-auditor-httpd_wire-format-inconsistency-upd.c taler-auditor-httpd_wire-format-inconsistency-upd.h \ taler-auditor-httpd_wire-out-inconsistency-del.c taler-auditor-httpd_wire-out-inconsistency-del.h \ - taler-auditor-httpd_wire-out-inconsistency-put.c taler-auditor-httpd_wire-out-inconsistency-put.h \ taler-auditor-httpd_wire-out-inconsistency-get.c taler-auditor-httpd_wire-out-inconsistency-get.h \ taler-auditor-httpd_wire-out-inconsistency-upd.c taler-auditor-httpd_wire-out-inconsistency-upd.h \ taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-del.c taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-del.h \ - taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-put.c taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-put.h \ taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-get.c taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-get.h \ taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-upd.c taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-upd.h \ taler-auditor-httpd_row-minor-inconsistencies-del.c taler-auditor-httpd_row-minor-inconsistencies-del.h \ - taler-auditor-httpd_row-minor-inconsistencies-put.c taler-auditor-httpd_row-minor-inconsistencies-put.h \ taler-auditor-httpd_row-minor-inconsistencies-get.c taler-auditor-httpd_row-minor-inconsistencies-get.h \ taler-auditor-httpd_row-minor-inconsistencies-upd.c taler-auditor-httpd_row-minor-inconsistencies-upd.h \ taler-auditor-httpd_fee-time-inconsistency-del.c taler-auditor-httpd_fee-time-inconsistency-del.h \ - taler-auditor-httpd_fee-time-inconsistency-put.c taler-auditor-httpd_fee-time-inconsistency-put.h \ taler-auditor-httpd_fee-time-inconsistency-get.c taler-auditor-httpd_fee-time-inconsistency-get.h \ taler-auditor-httpd_fee-time-inconsistency-upd.c taler-auditor-httpd_fee-time-inconsistency-upd.h \ taler-auditor-httpd_balances-get.c taler-auditor-httpd_balances-get.h \ diff --git a/src/auditor/taler-auditor-httpd.c b/src/auditor/taler-auditor-httpd.c @@ -37,33 +37,25 @@ #include "taler-auditor-httpd_amount-arithmetic-inconsistency-del.h" #include "taler-auditor-httpd_amount-arithmetic-inconsistency-upd.h" #include "taler-auditor-httpd_coin-inconsistency-get.h" -#include "taler-auditor-httpd_coin-inconsistency-put.h" #include "taler-auditor-httpd_coin-inconsistency-del.h" #include "taler-auditor-httpd_row-inconsistency-get.h" -#include "taler-auditor-httpd_row-inconsistency-put.h" #include "taler-auditor-httpd_row-inconsistency-del.h" #include "taler-auditor-httpd_emergency-get.h" -#include "taler-auditor-httpd_emergency-put.h" #include "taler-auditor-httpd_emergency-del.h" #include "taler-auditor-httpd_emergency-by-count-get.h" -#include "taler-auditor-httpd_emergency-by-count-put.h" #include "taler-auditor-httpd_emergency-by-count-del.h" #include \ "taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-get.h" #include \ - "taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-put.h" -#include \ "taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-del.h" #include "taler-auditor-httpd_purse-not-closed-inconsistencies-get.h" -#include "taler-auditor-httpd_purse-not-closed-inconsistencies-put.h" #include "taler-auditor-httpd_purse-not-closed-inconsistencies-del.h" #include "taler-auditor-httpd_reserve-balance-insufficient-inconsistency-get.h" -#include "taler-auditor-httpd_reserve-balance-insufficient-inconsistency-put.h" #include "taler-auditor-httpd_reserve-balance-insufficient-inconsistency-del.h" #include "taler-auditor-httpd_bad-sig-losses-get.h" @@ -71,13 +63,11 @@ #include "taler-auditor-httpd_bad-sig-losses-upd.h" #include "taler-auditor-httpd_closure-lags-get.h" -#include "taler-auditor-httpd_closure-lags-put.h" #include "taler-auditor-httpd_closure-lags-del.h" #include "taler-auditor-httpd_progress-get.h" #include "taler-auditor-httpd_refreshes-hanging-get.h" -#include "taler-auditor-httpd_refreshes-hanging-put.h" #include "taler-auditor-httpd_refreshes-hanging-del.h" #include "taler-auditor-httpd_mhd.h" @@ -96,22 +86,18 @@ #include "taler-auditor-httpd_row-minor-inconsistencies-upd.h" #include "taler-auditor-httpd_reserve-in-inconsistency-del.h" -#include "taler-auditor-httpd_reserve-in-inconsistency-put.h" #include "taler-auditor-httpd_reserve-in-inconsistency-get.h" #include "taler-auditor-httpd_reserve-in-inconsistency-upd.h" #include "taler-auditor-httpd_reserve-not-closed-inconsistency-del.h" -#include "taler-auditor-httpd_reserve-not-closed-inconsistency-put.h" #include "taler-auditor-httpd_reserve-not-closed-inconsistency-get.h" #include "taler-auditor-httpd_reserve-not-closed-inconsistency-upd.h" #include "taler-auditor-httpd_denominations-without-sigs-del.h" -#include "taler-auditor-httpd_denominations-without-sigs-put.h" #include "taler-auditor-httpd_denominations-without-sigs-get.h" #include "taler-auditor-httpd_denominations-without-sigs-upd.h" #include "taler-auditor-httpd_misattribution-in-inconsistency-del.h" -#include "taler-auditor-httpd_misattribution-in-inconsistency-put.h" #include "taler-auditor-httpd_misattribution-in-inconsistency-get.h" #include "taler-auditor-httpd_misattribution-in-inconsistency-upd.h" @@ -122,32 +108,26 @@ #include "taler-auditor-httpd_historic-reserve-summary-get.h" #include "taler-auditor-httpd_denomination-pending-del.h" -#include "taler-auditor-httpd_denomination-pending-put.h" #include "taler-auditor-httpd_denomination-pending-get.h" #include "taler-auditor-httpd_denomination-pending-upd.h" #include "taler-auditor-httpd_wire-format-inconsistency-del.h" -#include "taler-auditor-httpd_wire-format-inconsistency-put.h" #include "taler-auditor-httpd_wire-format-inconsistency-get.h" #include "taler-auditor-httpd_wire-format-inconsistency-upd.h" #include "taler-auditor-httpd_wire-out-inconsistency-del.h" -#include "taler-auditor-httpd_wire-out-inconsistency-put.h" #include "taler-auditor-httpd_wire-out-inconsistency-get.h" #include "taler-auditor-httpd_wire-out-inconsistency-upd.h" #include "taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-del.h" -#include "taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-put.h" #include "taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-get.h" #include "taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-upd.h" #include "taler-auditor-httpd_row-minor-inconsistencies-del.h" -#include "taler-auditor-httpd_row-minor-inconsistencies-put.h" #include "taler-auditor-httpd_row-minor-inconsistencies-get.h" #include "taler-auditor-httpd_row-minor-inconsistencies-upd.h" #include "taler-auditor-httpd_fee-time-inconsistency-del.h" -#include "taler-auditor-httpd_fee-time-inconsistency-put.h" #include "taler-auditor-httpd_fee-time-inconsistency-get.h" #include "taler-auditor-httpd_fee-time-inconsistency-upd.h" @@ -457,10 +437,6 @@ handle_mhd_request (void *cls, "application/json", NULL, 0, &TAH_COIN_INCONSISTENCY_handler_get, MHD_HTTP_OK, true }, - { "/monitoring/coin-inconsistency", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_COIN_INCONSISTENCY_PUT_handler, MHD_HTTP_OK, true }, { "/monitoring/coin-inconsistency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, @@ -473,10 +449,6 @@ handle_mhd_request (void *cls, "application/json", NULL, 0, &TAH_ROW_INCONSISTENCY_handler_get, MHD_HTTP_OK, true }, - { "/monitoring/row-inconsistency", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_ROW_INCONSISTENCY_PUT_handler, MHD_HTTP_OK, true }, { "/monitoring/row-inconsistency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, @@ -505,11 +477,6 @@ handle_mhd_request (void *cls, NULL, 0, &TAH_CLOSURE_LAGS_handler_get, MHD_HTTP_OK, true }, - { "/monitoring/closure-lags", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_CLOSURE_LAGS_PUT_handler, - MHD_HTTP_OK, true }, { "/monitoring/closure-lags", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, @@ -525,11 +492,6 @@ handle_mhd_request (void *cls, NULL, 0, &TAH_EMERGENCY_handler_get, MHD_HTTP_OK, true }, - { "/monitoring/emergency", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_EMERGENCY_PUT_handler, - MHD_HTTP_OK, true }, { "/monitoring/emergency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, @@ -545,11 +507,6 @@ handle_mhd_request (void *cls, NULL, 0, &TAH_REFRESHES_HANGING_handler_get, MHD_HTTP_OK, true }, - { "/monitoring/refreshes-hanging", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_REFRESHES_HANGING_PUT_handler, - MHD_HTTP_OK, true }, { "/monitoring/refreshes-hanging", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, @@ -567,12 +524,6 @@ handle_mhd_request (void *cls, &TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_get, MHD_HTTP_OK, true }, { "/monitoring/denomination-key-validity-withdraw-inconsistency", - MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_PUT_handler, - MHD_HTTP_OK, true }, - { "/monitoring/denomination-key-validity-withdraw-inconsistency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, @@ -596,12 +547,6 @@ handle_mhd_request (void *cls, &TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_get, MHD_HTTP_OK, true }, { "/monitoring/reserve-balance-insufficient-inconsistency", - MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_put, - MHD_HTTP_OK, true }, - { "/monitoring/reserve-balance-insufficient-inconsistency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, @@ -618,11 +563,6 @@ handle_mhd_request (void *cls, NULL, 0, &TAH_PURSE_NOT_CLOSED_INCONSISTENCIES_handler_get, MHD_HTTP_OK, true }, - { "/monitoring/purse-not-closed-inconsistencies", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_PURSE_NOT_CLOSED_INCONSISTENCIES_PUT_handler, - MHD_HTTP_OK, true }, { "/monitoring/purse-not-closed-inconsistencies", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, @@ -638,11 +578,6 @@ handle_mhd_request (void *cls, NULL, 0, &TAH_EMERGENCY_BY_COUNT_handler_get, MHD_HTTP_OK, true }, - { "/monitoring/emergency-by-count", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_EMERGENCY_BY_COUNT_PUT_handler, - MHD_HTTP_OK, true }, { "/monitoring/emergency-by-count", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, @@ -658,11 +593,6 @@ handle_mhd_request (void *cls, NULL, 0, &TAH_RESERVE_IN_INCONSISTENCY_handler_get, MHD_HTTP_OK, true }, - { "/monitoring/reserve-in-inconsistency", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_RESERVE_IN_INCONSISTENCY_handler_put, - MHD_HTTP_OK, true }, { "/monitoring/reserve-in-inconsistency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, @@ -678,11 +608,6 @@ handle_mhd_request (void *cls, NULL, 0, &TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_get, MHD_HTTP_OK, true }, - { "/monitoring/reserve-not-closed-inconsistency", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_put, - MHD_HTTP_OK, true }, { "/monitoring/reserve-not-closed-inconsistency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, @@ -698,11 +623,6 @@ handle_mhd_request (void *cls, NULL, 0, &TAH_DENOMINATIONS_WITHOUT_SIGS_handler_get, MHD_HTTP_OK, true }, - { "/monitoring/denominations-without-sigs", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_DENOMINATIONS_WITHOUT_SIGS_handler_put, - MHD_HTTP_OK, true }, { "/monitoring/denominations-without-sigs", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, @@ -718,11 +638,6 @@ handle_mhd_request (void *cls, NULL, 0, &TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_get, MHD_HTTP_OK, true }, - { "/monitoring/misattribution-in-inconsistency", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_put, - MHD_HTTP_OK, true }, { "/monitoring/misattribution-in-inconsistency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, @@ -753,11 +668,6 @@ handle_mhd_request (void *cls, NULL, 0, &TAH_DENOMINATION_PENDING_handler_get, MHD_HTTP_OK, true }, - { "/monitoring/denomination-pending", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_DENOMINATION_PENDING_handler_put, - MHD_HTTP_OK, true }, { "/monitoring/denomination-pending", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, @@ -773,11 +683,6 @@ handle_mhd_request (void *cls, NULL, 0, &TAH_WIRE_FORMAT_INCONSISTENCY_handler_get, MHD_HTTP_OK, true }, - { "/monitoring/wire-format-inconsistency", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_WIRE_FORMAT_INCONSISTENCY_handler_put, - MHD_HTTP_OK, true }, { "/monitoring/wire-format-inconsistency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, @@ -793,11 +698,6 @@ handle_mhd_request (void *cls, NULL, 0, &TAH_WIRE_OUT_INCONSISTENCY_handler_get, MHD_HTTP_OK, true }, - { "/monitoring/wire-out-inconsistency", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_WIRE_OUT_INCONSISTENCY_handler_put, - MHD_HTTP_OK, true }, { "/monitoring/wire-out-inconsistency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, @@ -815,12 +715,6 @@ handle_mhd_request (void *cls, &TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_get, MHD_HTTP_OK, true }, { "/monitoring/reserve-balance-summary-wrong-inconsistency", - MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_put, - MHD_HTTP_OK, true }, - { "/monitoring/reserve-balance-summary-wrong-inconsistency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, @@ -837,11 +731,6 @@ handle_mhd_request (void *cls, NULL, 0, &TAH_ROW_MINOR_INCONSISTENCIES_handler_get, MHD_HTTP_OK, true }, - { "/monitoring/row-minor-inconsistencies", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_ROW_MINOR_INCONSISTENCIES_handler_put, - MHD_HTTP_OK, true }, { "/monitoring/row-minor-inconsistencies", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, @@ -857,11 +746,6 @@ handle_mhd_request (void *cls, NULL, 0, &TAH_FEE_TIME_INCONSISTENCY_handler_get, MHD_HTTP_OK, true }, - { "/monitoring/fee-time-inconsistency", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_FEE_TIME_INCONSISTENCY_handler_put, - MHD_HTTP_OK, true }, { "/monitoring/fee-time-inconsistency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, diff --git a/src/auditor/taler-auditor-httpd_amount-arithmetic-inconsistency-upd.h b/src/auditor/taler-auditor-httpd_amount-arithmetic-inconsistency-upd.h @@ -22,13 +22,12 @@ #include "taler-auditor-httpd.h" MHD_RESULT -TAH_AMOUNT_ARITHMETIC_INCONSISTENCY_handler_update (struct - TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - -#endif // SRC_TALER_AUDITOR_HTTPD_AMOUNT_ARITHMETIC_INCONSISTENCY_UPD_H +TAH_AMOUNT_ARITHMETIC_INCONSISTENCY_handler_update ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); + +#endif diff --git a/src/auditor/taler-auditor-httpd_bad-sig-losses-del.h b/src/auditor/taler-auditor-httpd_bad-sig-losses-del.h @@ -46,13 +46,13 @@ TEAH_BAD_SIG_LOSSES_DELETE_done (void); * @return MHD result code */ MHD_RESULT -TAH_BAD_SIG_LOSSES_handler_delete (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); +TAH_BAD_SIG_LOSSES_handler_delete ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); #endif diff --git a/src/auditor/taler-auditor-httpd_bad-sig-losses-get.h b/src/auditor/taler-auditor-httpd_bad-sig-losses-get.h @@ -46,13 +46,13 @@ TEAH_BAD_SIG_LOSSES_GET_done (void); * @return MHD result code */ MHD_RESULT -TAH_BAD_SIG_LOSSES_handler_get (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); +TAH_BAD_SIG_LOSSES_handler_get ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); #endif diff --git a/src/auditor/taler-auditor-httpd_balances-get.h b/src/auditor/taler-auditor-httpd_balances-get.h @@ -15,7 +15,7 @@ */ - #ifndef SRC_TALER_AUDITOR_HTTPD_BALANCES_GET_H +#ifndef SRC_TALER_AUDITOR_HTTPD_BALANCES_GET_H #define SRC_TALER_AUDITOR_HTTPD_BALANCES_GET_H #include <gnunet/gnunet_util_lib.h> @@ -45,13 +45,13 @@ TEAH_BAD_BALANCES_GET_done (void); * @return MHD result code */ MHD_RESULT -TAH_BALANCES_handler_get (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); +TAH_BALANCES_handler_get ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); -#endif // SRC_TALER_AUDITOR_HTTPD_BALANCES_GET_H +#endif diff --git a/src/auditor/taler-auditor-httpd_closure-lags-del.h b/src/auditor/taler-auditor-httpd_closure-lags-del.h @@ -35,24 +35,24 @@ void TEAH_CLOSURE_LAGS_DELETE_done (void); /** -* Handle a "/closure-lags" request. Parses the JSON, and, if -* successful, checks the signatures and stores the result in the DB. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ + * Handle a "/closure-lags" request. Parses the JSON, and, if + * successful, checks the signatures and stores the result in the DB. + * + * @param rh context of the handler + * @param connection the MHD connection to handle + * @param[in,out] connection_cls the connection's closure (can be updated) + * @param upload_data upload data + * @param[in,out] upload_data_size number of bytes (left) in @a upload_data + * @param args NULL-terminated array of remaining parts of the URI broken up at '/' + * @return MHD result code + */ MHD_RESULT -TAH_CLOSURE_LAGS_handler_delete (struct - TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - -#endif // SRC_TALER_AUDITOR_HTTPD_CLOSURE_LAGS_DEL_H +TAH_CLOSURE_LAGS_handler_delete ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); + +#endif diff --git a/src/auditor/taler-auditor-httpd_closure-lags-get.h b/src/auditor/taler-auditor-httpd_closure-lags-get.h @@ -29,29 +29,30 @@ void TEAH_CLOSURE_LAGS_GET_init (void); /** -* Shut down subsystem. -*/ + * Shut down subsystem. + */ void TEAH_CLOSURE_LAGS_GET_done (void); /** -* Handle a "/closure-lags" request. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ + * Handle a "/closure-lags" request. + * + * @param rh context of the handler + * @param connection the MHD connection to handle + * @param[in,out] connection_cls the connection's closure (can be updated) + * @param upload_data upload data + * @param[in,out] upload_data_size number of bytes (left) in @a upload_data + * @param args NULL-terminated array of remaining parts of the URI broken up at '/' + * @return MHD result code + */ MHD_RESULT -TAH_CLOSURE_LAGS_handler_get (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); +TAH_CLOSURE_LAGS_handler_get ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); -#endif // SRC_TALER_AUDITOR_HTTPD_CLOSURE_LAGS_GET_H +#endif diff --git a/src/auditor/taler-auditor-httpd_closure-lags-put.c b/src/auditor/taler-auditor-httpd_closure-lags-put.c @@ -1,158 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#include "platform.h" -#include <gnunet/gnunet_util_lib.h> -#include <gnunet/gnunet_json_lib.h> -#include <jansson.h> -#include <microhttpd.h> -#include <pthread.h> -#include "taler_json_lib.h" -#include "taler_mhd_lib.h" -#include "taler-auditor-httpd.h" -#include "taler-auditor-httpd_closure-lags-put.h" - -/** -* We have parsed the JSON information about the closure-lags, do some -* basic sanity checks and then execute the -* transaction. -* -* @param connection the MHD connection to handle -* @param dc information about the closure-lags -* @return MHD result code -*/ -static MHD_RESULT -process_inconsistency ( - struct MHD_Connection *connection, - const struct TALER_AUDITORDB_ClosureLags *dc) -{ - - enum GNUNET_DB_QueryStatus qs; - - if (GNUNET_SYSERR == - TAH_plugin->preflight (TAH_plugin->cls)) - { - GNUNET_break (0); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_SETUP_FAILED, - NULL); - } - - /* execute transaction */ - qs = TAH_plugin->insert_auditor_closure_lags (TAH_plugin->cls, - dc); - if (0 > qs) - { - GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); - TALER_LOG_WARNING ( - "Failed to store /closure-lags in database"); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_STORE_FAILED, - "closure-lags"); - } - return TALER_MHD_REPLY_JSON_PACK (connection, - MHD_HTTP_OK, - GNUNET_JSON_pack_string ("status", - "CLOSURE_LAGS_OK")); -} - - -MHD_RESULT -TAH_CLOSURE_LAGS_PUT_handler ( - struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) -{ - - struct TALER_AUDITORDB_ClosureLags dc; - - struct GNUNET_TIME_Timestamp d = { 0 }; - - struct GNUNET_JSON_Specification spec[] = { - - TALER_JSON_spec_amount ("amount", TAH_currency, &dc.amount), - GNUNET_JSON_spec_timestamp ("deadline", &d), - GNUNET_JSON_spec_fixed_auto ("wtid", &dc.wtid), - GNUNET_JSON_spec_string ("account", (const char **) &dc.account), - - GNUNET_JSON_spec_end () - }; - - - json_t *json; - - (void) rh; - (void) connection_cls; - (void) upload_data; - (void) upload_data_size; - { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json); - return MHD_NO; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json); - return MHD_YES; /* failure */ - } - } - - dc.deadline = d.abs_time; - - MHD_RESULT res; - res = process_inconsistency (connection, &dc); - GNUNET_JSON_parse_free (spec); - - json_decref (json); - return res; - -} - - -void -TEAH_CLOSURE_LAGS_PUT_init (void) -{ - -} - - -void -TEAH_CLOSURE_LAGS_PUT_done (void) -{ - -} diff --git a/src/auditor/taler-auditor-httpd_closure-lags-put.h b/src/auditor/taler-auditor-httpd_closure-lags-put.h @@ -1,58 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#ifndef SRC_TALER_AUDITOR_HTTPD_CLOSURE_LAGS_PUT_H -#define SRC_TALER_AUDITOR_HTTPD_CLOSURE_LAGS_PUT_H - -#include <microhttpd.h> -#include "taler-auditor-httpd.h" - -/** -* Initialize subsystem. -*/ -void -TEAH_CLOSURE_LAGS_PUT_init (void); - -/** -* Shut down subsystem. -*/ -void -TEAH_CLOSURE_LAGS_PUT_done (void); - - -/** -* Handle a "/closure-lags" request. Parses the JSON, and, if -* successful, checks the signatures and stores the result in the DB. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ -MHD_RESULT -TAH_CLOSURE_LAGS_PUT_handler (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - - -#endif // SRC_TALER_AUDITOR_HTTPD_CLOSURE_LAGS_PUT_H diff --git a/src/auditor/taler-auditor-httpd_closure-lags-upd.h b/src/auditor/taler-auditor-httpd_closure-lags-upd.h @@ -23,12 +23,12 @@ #include "taler-auditor-httpd.h" MHD_RESULT -TAH_CLOSURE_LAGS_handler_update (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - -#endif // SRC_TALER_AUDITOR_HTTPD_CLOSURE_LAGS_UPD_H +TAH_CLOSURE_LAGS_handler_update ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); + +#endif diff --git a/src/auditor/taler-auditor-httpd_coin-inconsistency-del.h b/src/auditor/taler-auditor-httpd_coin-inconsistency-del.h @@ -43,15 +43,17 @@ TEAH_COIN_INCONSISTENCY_DELETE_done (void); * @param[in,out] connection_cls the connection's closure (can be updated) * @param upload_data upload data * @param[in,out] upload_data_size number of bytes (left) in @a upload_data + * @param args NULL-terminated array of remaining parts of the URI broken up at '/' * @return MHD result code - */ + */ MHD_RESULT -TAH_COIN_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); +TAH_COIN_INCONSISTENCY_handler_delete ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); -#endif // SRC_TALER_AUDITOR_HTTPD_COIN_INCONSISTENCY_DEL_H +#endif diff --git a/src/auditor/taler-auditor-httpd_coin-inconsistency-get.h b/src/auditor/taler-auditor-httpd_coin-inconsistency-get.h @@ -41,16 +41,17 @@ TEAH_COIN_INCONSISTENCY_GET_done (void); * @param[in,out] connection_cls the connection's closure (can be updated) * @param upload_data upload data * @param[in,out] upload_data_size number of bytes (left) in @a upload_data + * @param args NULL-terminated array of remaining parts of the URI broken up at '/' * @return MHD result code - */ + */ MHD_RESULT -TAH_COIN_INCONSISTENCY_handler_get (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); +TAH_COIN_INCONSISTENCY_handler_get ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); -#endif // SRC_TALER_AUDITOR_HTTPD_COIN_INCONSISTENCY_GET_H +#endif diff --git a/src/auditor/taler-auditor-httpd_coin-inconsistency-put.c b/src/auditor/taler-auditor-httpd_coin-inconsistency-put.c @@ -1,158 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#include "platform.h" -#include <gnunet/gnunet_util_lib.h> -#include <gnunet/gnunet_json_lib.h> -#include <jansson.h> -#include <microhttpd.h> -#include <pthread.h> -#include "taler_json_lib.h" -#include "taler_mhd_lib.h" -#include "taler-auditor-httpd.h" -#include "taler-auditor-httpd_coin-inconsistency-put.h" - -/** - * We have parsed the JSON information about the deposit, do some - * basic sanity checks (especially that the signature on the coin is - * valid, and that this type of coin exists) and then execute the - * deposit. - * - * @param connection the MHD connection to handle - * @param dc information about the deposit confirmation - * @param es information about the exchange's signing key - * @return MHD result code - */ -static MHD_RESULT -process_inconsistency ( - struct MHD_Connection *connection, - const struct TALER_AUDITORDB_CoinInconsistency *dc) -{ - - enum GNUNET_DB_QueryStatus qs; - - if (GNUNET_SYSERR == - TAH_plugin->preflight (TAH_plugin->cls)) - { - GNUNET_break (0); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_SETUP_FAILED, - NULL); - } - - /* execute transaction */ - qs = TAH_plugin->insert_coin_inconsistency (TAH_plugin->cls, - dc); - if (0 > qs) - { - GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); - TALER_LOG_WARNING ( - "Failed to store /insert-coin in database\n"); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_STORE_FAILED, - "insert coin"); - } - return TALER_MHD_REPLY_JSON_PACK (connection, - MHD_HTTP_OK, - GNUNET_JSON_pack_string ("status", - "INSERT_COIN_OK")); -} - - -MHD_RESULT -TAH_COIN_INCONSISTENCY_PUT_handler ( - struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) -{ - - struct TALER_AUDITORDB_CoinInconsistency dc; - - struct GNUNET_JSON_Specification spec[] = { - - GNUNET_JSON_spec_string ("operation", (const char **) &dc.operation), - TALER_JSON_spec_amount ("exchange_amount", TAH_currency, - &dc.exchange_amount), - TALER_JSON_spec_amount ("auditor_amount", TAH_currency,&dc.auditor_amount), - GNUNET_JSON_spec_fixed_auto ("coin_pub", &dc.coin_pub), - GNUNET_JSON_spec_bool ("profitable", &dc.profitable), - - GNUNET_JSON_spec_end () - }; - - json_t *json; - - (void) rh; - (void) connection_cls; - (void) upload_data; - (void) upload_data_size; - { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json); - return MHD_NO; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json); - return MHD_YES; /* failure */ - } - } - - MHD_RESULT res; - - res = process_inconsistency (connection, &dc); - - GNUNET_JSON_parse_free (spec); - json_decref (json); - return res; - -} - - -void -TEAH_COIN_INCONSISTENCY_PUT_init (void) -{ - -} - - -void -TEAH_COIN_INCONSISTENCY_PUT_done (void) -{ - -} -\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_coin-inconsistency-put.h b/src/auditor/taler-auditor-httpd_coin-inconsistency-put.h @@ -1,57 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - -#ifndef SRC_TALER_AUDITOR_HTTPD_COIN_INCONSISTENCY_PUT_H -#define SRC_TALER_AUDITOR_HTTPD_COIN_INCONSISTENCY_PUT_H - - -#include <microhttpd.h> -#include "taler-auditor-httpd.h" - -/** - * Initialize subsystem. - */ -void -TEAH_COIN_INCONSISTENCY_PUT_init (void); - -/** - * Shut down subsystem. - */ -void -TEAH_COIN_INCONSISTENCY_PUT_done (void); - - -/** - * Handle a "/deposit-confirmation" request. Parses the JSON, and, if - * successful, checks the signatures and stores the result in the DB. - * - * @param rh context of the handler - * @param connection the MHD connection to handle - * @param[in,out] connection_cls the connection's closure (can be updated) - * @param upload_data upload data - * @param[in,out] upload_data_size number of bytes (left) in @a upload_data - * @return MHD result code - */ -MHD_RESULT -TAH_COIN_INCONSISTENCY_PUT_handler (struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - - -#endif // SRC_TALER_AUDITOR_HTTPD_COIN_INCONSISTENCY_PUT_H diff --git a/src/auditor/taler-auditor-httpd_coin-inconsistency-upd.h b/src/auditor/taler-auditor-httpd_coin-inconsistency-upd.h @@ -23,12 +23,12 @@ #include "taler-auditor-httpd.h" MHD_RESULT -TAH_COIN_INCONSISTENCY_handler_update (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - -#endif // SRC_TALER_AUDITOR_HTTPD_COIN_INCONSISTENCY_UPD_H +TAH_COIN_INCONSISTENCY_handler_update ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); + +#endif diff --git a/src/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-del.h b/src/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-del.h @@ -17,7 +17,7 @@ #ifndef \ SRC_TALER_AUDITOR_HTTPD_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_DEL_H #define \ - SRC_TALER_AUDITOR_HTTPD_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_DEL_H + SRC_TALER_AUDITOR_HTTPD_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_DEL_H #include <microhttpd.h> @@ -44,26 +44,17 @@ TEAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_DELETE_done (void); * @param[in,out] connection_cls the connection's closure (can be updated) * @param upload_data upload data * @param[in,out] upload_data_size number of bytes (left) in @a upload_data + * @param args NULL-terminated array of remaining parts of the URI broken up at '/' * @return MHD result code - */ + */ MHD_RESULT -TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_delete (struct - TAH_RequestHandler - *rh, - struct - MHD_Connection - * - connection, - void ** - connection_cls, - const char - * - upload_data, - size_t * - upload_data_size, - const char - *const - args[]); +TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_delete ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); -#endif // SRC_TALER_AUDITOR_HTTPD_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_DEL_H +#endif diff --git a/src/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-get.h b/src/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-get.h @@ -18,7 +18,7 @@ #ifndef \ SRC_TALER_AUDITOR_HTTPD_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_GET_H #define \ - SRC_TALER_AUDITOR_HTTPD_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_GET_H + SRC_TALER_AUDITOR_HTTPD_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_GET_H #include <gnunet/gnunet_util_lib.h> #include <microhttpd.h> @@ -37,31 +37,24 @@ void TEAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_GET_done (void); /** -* Handle a "/denomination-key-validity-withdraw-inconsistency" request. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ + * Handle a "/denomination-key-validity-withdraw-inconsistency" request. + * + * @param rh context of the handler + * @param connection the MHD connection to handle + * @param[in,out] connection_cls the connection's closure (can be updated) + * @param upload_data upload data + * @param[in,out] upload_data_size number of bytes (left) in @a upload_data + * @param args NULL-terminated array of remaining parts of the URI broken up at '/' + * @return MHD result code + */ MHD_RESULT -TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_get (struct - TAH_RequestHandler - *rh, - struct - MHD_Connection - * - connection, - void ** - connection_cls, - const char * - upload_data, - size_t * - upload_data_size, - const char * - const args[]); +TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_get ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char * const args[]); -#endif // SRC_TALER_AUDITOR_HTTPD_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_GET_H +#endif diff --git a/src/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-put.c b/src/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-put.c @@ -1,159 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#include "platform.h" -#include <gnunet/gnunet_util_lib.h> -#include <gnunet/gnunet_json_lib.h> -#include <jansson.h> -#include <microhttpd.h> -#include <pthread.h> -#include "taler_json_lib.h" -#include "taler_mhd_lib.h" -#include "taler-auditor-httpd.h" -#include \ - "taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-put.h" - -/** -* We have parsed the JSON information about the denomination-key-validity-withdraw-inconsistency, do some -* basic sanity checks and then execute the -* transaction. -* -* @param connection the MHD connection to handle -* @param dc information about the denomination-key-validity-withdraw-inconsistency -* @return MHD result code -*/ -static MHD_RESULT -process_inconsistency ( - struct MHD_Connection *connection, - const struct TALER_AUDITORDB_DenominationKeyValidityWithdrawInconsistency *dc) -{ - - enum GNUNET_DB_QueryStatus qs; - - if (GNUNET_SYSERR == - TAH_plugin->preflight (TAH_plugin->cls)) - { - GNUNET_break (0); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_SETUP_FAILED, - NULL); - } - - /* execute transaction */ - qs = TAH_plugin->insert_denomination_key_validity_withdraw_inconsistency ( - TAH_plugin->cls, - dc); - if (0 > qs) - { - GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); - TALER_LOG_WARNING ( - "Failed to store /denomination-key-validity-withdraw-inconsistency in database "); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_STORE_FAILED, - "denomination-key-validity-withdraw-inconsistency"); - } - return TALER_MHD_REPLY_JSON_PACK (connection, - MHD_HTTP_OK, - GNUNET_JSON_pack_string ("status", - "DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_OK")); -} - - -MHD_RESULT -TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_PUT_handler ( - struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) -{ - - struct TALER_AUDITORDB_DenominationKeyValidityWithdrawInconsistency dc; - - struct GNUNET_TIME_Timestamp ed = { 0 }; - - struct GNUNET_JSON_Specification spec[] = { - - GNUNET_JSON_spec_timestamp ("execution_date", &ed), - GNUNET_JSON_spec_fixed_auto ("reserve_pub", &dc.reserve_pub), - GNUNET_JSON_spec_fixed_auto ("denompub_h", &dc.denompub_h), - - GNUNET_JSON_spec_end () - }; - - - json_t *json; - - (void) rh; - (void) connection_cls; - (void) upload_data; - (void) upload_data_size; - { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json); - return MHD_NO; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json); - return MHD_YES; /* failure */ - } - } - - dc.execution_date = ed.abs_time; - - MHD_RESULT res; - res = process_inconsistency (connection, &dc); - GNUNET_JSON_parse_free (spec); - - json_decref (json); - return res; - -} - - -void -TEAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_PUT_init (void) -{ - -} - - -void -TEAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_PUT_done (void) -{ - -} diff --git a/src/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-put.h b/src/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-put.h @@ -1,68 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#ifndef \ - SRC_TALER_AUDITOR_HTTPD_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_PUT_H -#define \ - SRC_TALER_AUDITOR_HTTPD_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_PUT_H - -#include <microhttpd.h> -#include "taler-auditor-httpd.h" - -/** -* Initialize subsystem. -*/ -void -TEAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_PUT_init (void); - -/** -* Shut down subsystem. -*/ -void -TEAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_PUT_done (void); - - -/** -* Handle a "/denomination-key-validity-withdraw-inconsistency" request. Parses the JSON, and, if -* successful, checks the signatures and stores the result in the DB. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ -MHD_RESULT -TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_PUT_handler (struct - TAH_RequestHandler - *rh, - struct - MHD_Connection - * - connection, - void ** - connection_cls, - const char * - upload_data, - size_t * - upload_data_size, - const char * - const args[]); - - -#endif // SRC_TALER_AUDITOR_HTTPD_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_PUT_H diff --git a/src/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-upd.h b/src/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-upd.h @@ -18,29 +18,19 @@ #ifndef \ SRC_TALER_AUDITOR_HTTPD_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_UPD_H #define \ - SRC_TALER_AUDITOR_HTTPD_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_UPD_H + SRC_TALER_AUDITOR_HTTPD_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_UPD_H #include <microhttpd.h> #include "taler-auditor-httpd.h" MHD_RESULT -TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_update (struct - TAH_RequestHandler - *rh, - struct - MHD_Connection - * - connection, - void ** - connection_cls, - const char - * - upload_data, - size_t * - upload_data_size, - const char - *const - args[]); - -#endif // SRC_TALER_AUDITOR_HTTPD_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_UPD_H +TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_update ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); + +#endif diff --git a/src/auditor/taler-auditor-httpd_denomination-pending-del.h b/src/auditor/taler-auditor-httpd_denomination-pending-del.h @@ -43,16 +43,17 @@ TEAH_DENOMINATION_PENDING_DELETE_done (void); * @param[in,out] connection_cls the connection's closure (can be updated) * @param upload_data upload data * @param[in,out] upload_data_size number of bytes (left) in @a upload_data + * @param args NULL-terminated array of remaining parts of the URI broken up at '/' * @return MHD result code - */ + */ MHD_RESULT -TAH_DENOMINATION_PENDING_handler_delete (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); +TAH_DENOMINATION_PENDING_handler_delete ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); -#endif // SRC_TALER_AUDITOR_HTTPD_DENOMINATION_PENDING_DEL_H +#endif diff --git a/src/auditor/taler-auditor-httpd_denomination-pending-get.h b/src/auditor/taler-auditor-httpd_denomination-pending-get.h @@ -29,29 +29,30 @@ void TEAH_DENOMINATION_PENDING_GET_init (void); /** -* Shut down subsystem. -*/ + * Shut down subsystem. + */ void TEAH_BAD_DENOMINATION_PENDING_GET_done (void); /** -* Handle a "/denomination-pending" request. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ + * Handle a "/denomination-pending" request. + * + * @param rh context of the handler + * @param connection the MHD connection to handle + * @param[in,out] connection_cls the connection's closure (can be updated) + * @param upload_data upload data + * @param[in,out] upload_data_size number of bytes (left) in @a upload_data + * @param args NULL-terminated array of remaining parts of the URI broken up at '/' + * @return MHD result code + */ MHD_RESULT -TAH_DENOMINATION_PENDING_handler_get (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); +TAH_DENOMINATION_PENDING_handler_get ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); -#endif // SRC_TALER_AUDITOR_HTTPD_DENOMINATION_PENDING_GET_H +#endif diff --git a/src/auditor/taler-auditor-httpd_denomination-pending-put.c b/src/auditor/taler-auditor-httpd_denomination-pending-put.c @@ -1,159 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#include "platform.h" -#include <gnunet/gnunet_util_lib.h> -#include <gnunet/gnunet_json_lib.h> -#include <jansson.h> -#include <microhttpd.h> -#include <pthread.h> -#include "taler_json_lib.h" -#include "taler_mhd_lib.h" -#include "taler-auditor-httpd.h" -#include "taler-auditor-httpd_denomination-pending-put.h" - -/** -* We have parsed the JSON information about the denomination-pending, do some -* basic sanity checks and then execute the -* transaction. -* -* @param connection the MHD connection to handle -* @param dc information about the denomination-pending -* @return MHD result code -*/ -static MHD_RESULT -process_inconsistency ( - struct MHD_Connection *connection, - const struct TALER_AUDITORDB_DenominationPending *dc) -{ - - enum GNUNET_DB_QueryStatus qs; - - if (GNUNET_SYSERR == - TAH_plugin->preflight (TAH_plugin->cls)) - { - GNUNET_break (0); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_SETUP_FAILED, - NULL); - } - - /* execute transaction */ - qs = TAH_plugin->insert_denomination_pending (TAH_plugin->cls, - dc); - if (0 > qs) - { - GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); - TALER_LOG_WARNING ( - "Failed to store /denomination-pending in database"); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_STORE_FAILED, - "denomination-pending"); - } - return TALER_MHD_REPLY_JSON_PACK (connection, - MHD_HTTP_OK, - GNUNET_JSON_pack_string ("status", - "DENOMINATION_PENDING_OK")); -} - - -MHD_RESULT -TAH_DENOMINATION_PENDING_handler_put ( - struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) -{ - - struct TALER_AUDITORDB_DenominationPending dc; - - - struct GNUNET_JSON_Specification spec[] = { - - GNUNET_JSON_spec_fixed_auto ("denom_pub_hash", &dc.denom_pub_hash), - TALER_JSON_spec_amount ("denom_balance", TAH_currency, &dc.denom_balance), - TALER_JSON_spec_amount ("denom_loss", TAH_currency, &dc.denom_loss), - GNUNET_JSON_spec_int64 ("num_issued", &dc.num_issued), - TALER_JSON_spec_amount ("denom_risk", TAH_currency, &dc.denom_risk), - TALER_JSON_spec_amount ("recoup_loss", TAH_currency, &dc.recoup_loss), - - - GNUNET_JSON_spec_end () - }; - - - json_t *json; - - (void) rh; - (void) connection_cls; - (void) upload_data; - (void) upload_data_size; - { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json); - return MHD_NO; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json); - return MHD_YES; /* failure */ - } - } - - MHD_RESULT res; - - res = process_inconsistency (connection, &dc); - GNUNET_JSON_parse_free (spec); - - json_decref (json); - return res; - -} - - -void -TEAH_DENOMINATION_PENDING_PUT_init (void) -{ - -} - - -void -TEAH_DENOMINATION_PENDING_PUT_done (void) -{ - -} diff --git a/src/auditor/taler-auditor-httpd_denomination-pending-put.h b/src/auditor/taler-auditor-httpd_denomination-pending-put.h @@ -1,58 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#ifndef SRC_TALER_AUDITOR_HTTPD_DENOMINATION_PENDING_PUT_H -#define SRC_TALER_AUDITOR_HTTPD_DENOMINATION_PENDING_PUT_H - -#include <microhttpd.h> -#include "taler-auditor-httpd.h" - -/** -* Initialize subsystem. -*/ -void -TEAH_BAD_DENOMINATION_PENDING_init (void); - -/** -* Shut down subsystem. -*/ -void -TEAH_BAD_DENOMINATION_PENDING_done (void); - - -/** -* Handle a "/denomination-pending" request. Parses the JSON, and, if -* successful, checks the signatures and stores the result in the DB. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ -MHD_RESULT -TAH_DENOMINATION_PENDING_handler_put (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - - -#endif // SRC_TALER_AUDITOR_HTTPD_DENOMINATION_PENDING_PUT_H diff --git a/src/auditor/taler-auditor-httpd_denomination-pending-upd.h b/src/auditor/taler-auditor-httpd_denomination-pending-upd.h @@ -23,12 +23,12 @@ #include "taler-auditor-httpd.h" MHD_RESULT -TAH_DENOMINATION_PENDING_handler_update (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - -#endif // SRC_TALER_AUDITOR_HTTPD_DENOMINATION_PENDING_UPD_H +TAH_DENOMINATION_PENDING_handler_update ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); + +#endif diff --git a/src/auditor/taler-auditor-httpd_denominations-without-sigs-del.h b/src/auditor/taler-auditor-httpd_denominations-without-sigs-del.h @@ -43,16 +43,17 @@ TEAH_DENOMINATIONS_WITHOUT_SIGS_DELETE_done (void); * @param[in,out] connection_cls the connection's closure (can be updated) * @param upload_data upload data * @param[in,out] upload_data_size number of bytes (left) in @a upload_data + * @param args NULL-terminated array of remaining parts of the URI broken up at '/' * @return MHD result code - */ + */ MHD_RESULT -TAH_DENOMINATIONS_WITHOUT_SIGS_handler_delete (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); +TAH_DENOMINATIONS_WITHOUT_SIGS_handler_delete ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); -#endif // SRC_TALER_AUDITOR_HTTPD_DENOMINATIONS_WITHOUT_SIGS_DEL_H +#endif diff --git a/src/auditor/taler-auditor-httpd_denominations-without-sigs-get.h b/src/auditor/taler-auditor-httpd_denominations-without-sigs-get.h @@ -46,13 +46,13 @@ TEAH_BAD_DENOMINATIONS_WITHOUT_SIGS_GET_done (void); * @return MHD result code */ MHD_RESULT -TAH_DENOMINATIONS_WITHOUT_SIGS_handler_get (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); +TAH_DENOMINATIONS_WITHOUT_SIGS_handler_get ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); -#endif // SRC_TALER_AUDITOR_HTTPD_DENOMINATIONS_WITHOUT_SIGS_GET_H +#endif diff --git a/src/auditor/taler-auditor-httpd_denominations-without-sigs-put.c b/src/auditor/taler-auditor-httpd_denominations-without-sigs-put.c @@ -1,162 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#include "platform.h" -#include <gnunet/gnunet_util_lib.h> -#include <gnunet/gnunet_json_lib.h> -#include <jansson.h> -#include <microhttpd.h> -#include <pthread.h> -#include "taler_json_lib.h" -#include "taler_mhd_lib.h" -#include "taler-auditor-httpd.h" -#include "taler-auditor-httpd_denominations-without-sigs-put.h" - -/** -* We have parsed the JSON information about the denominations-without-sigs, do some -* basic sanity checks and then execute the -* transaction. -* -* @param connection the MHD connection to handle -* @param dc information about the denominations-without-sigs -* @return MHD result code -*/ -static MHD_RESULT -process_inconsistency ( - struct MHD_Connection *connection, - const struct TALER_AUDITORDB_DenominationsWithoutSigs *dc) -{ - - enum GNUNET_DB_QueryStatus qs; - - if (GNUNET_SYSERR == - TAH_plugin->preflight (TAH_plugin->cls)) - { - GNUNET_break (0); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_SETUP_FAILED, - NULL); - } - - /* execute transaction */ - qs = TAH_plugin->insert_denominations_without_sigs (TAH_plugin->cls, - dc); - if (0 > qs) - { - GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); - TALER_LOG_WARNING ( - "Failed to store /denominations-without-sigs in database"); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_STORE_FAILED, - "denominations-without-sigs"); - } - return TALER_MHD_REPLY_JSON_PACK (connection, - MHD_HTTP_OK, - GNUNET_JSON_pack_string ("status", - "DENOMINATIONS_WITHOUT_SIGS_OK")); -} - - -MHD_RESULT -TAH_DENOMINATIONS_WITHOUT_SIGS_handler_put ( - struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) -{ - - struct TALER_AUDITORDB_DenominationsWithoutSigs dc; - - struct GNUNET_TIME_Timestamp st = { 0 }; - struct GNUNET_TIME_Timestamp ed = { 0 }; - - struct GNUNET_JSON_Specification spec[] = { - - GNUNET_JSON_spec_fixed_auto ("denompub_h", &dc.denompub_h), - TALER_JSON_spec_amount ("value", TAH_currency, &dc.value), - GNUNET_JSON_spec_timestamp ("start_time", &st), - GNUNET_JSON_spec_timestamp ("end_time", &ed), - - - GNUNET_JSON_spec_end () - }; - - - json_t *json; - - (void) rh; - (void) connection_cls; - (void) upload_data; - (void) upload_data_size; - { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json); - return MHD_NO; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json); - return MHD_YES; /* failure */ - } - } - - MHD_RESULT res; - - dc.end_time = ed.abs_time; - dc.start_time = st.abs_time; - - res = process_inconsistency (connection, &dc); - GNUNET_JSON_parse_free (spec); - - json_decref (json); - return res; - -} - - -void -TEAH_DENOMINATIONS_WITHOUT_SIGS_PUT_init (void) -{ - -} - - -void -TEAH_DENOMINATIONS_WITHOUT_SIGS_PUT_done (void) -{ - -} diff --git a/src/auditor/taler-auditor-httpd_denominations-without-sigs-put.h b/src/auditor/taler-auditor-httpd_denominations-without-sigs-put.h @@ -1,58 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#ifndef SRC_TALER_AUDITOR_HTTPD_DENOMINATIONS_WITHOUT_SIGS_PUT_H -#define SRC_TALER_AUDITOR_HTTPD_DENOMINATIONS_WITHOUT_SIGS_PUT_H - -#include <microhttpd.h> -#include "taler-auditor-httpd.h" - -/** -* Initialize subsystem. -*/ -void -TEAH_BAD_DENOMINATIONS_WITHOUT_SIGS_init (void); - -/** -* Shut down subsystem. -*/ -void -TEAH_BAD_DENOMINATIONS_WITHOUT_SIGS_done (void); - - -/** -* Handle a "/denominations-without-sigs" request. Parses the JSON, and, if -* successful, checks the signatures and stores the result in the DB. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ -MHD_RESULT -TAH_DENOMINATIONS_WITHOUT_SIGS_handler_put (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - - -#endif // SRC_TALER_AUDITOR_HTTPD_DENOMINATIONS_WITHOUT_SIGS_PUT_H diff --git a/src/auditor/taler-auditor-httpd_denominations-without-sigs-upd.h b/src/auditor/taler-auditor-httpd_denominations-without-sigs-upd.h @@ -23,12 +23,12 @@ #include "taler-auditor-httpd.h" MHD_RESULT -TAH_DENOMINATIONS_WITHOUT_SIGS_handler_update (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - -#endif // SRC_TALER_AUDITOR_HTTPD_DENOMINATIONS_WITHOUT_SIGS_UPD_H +TAH_DENOMINATIONS_WITHOUT_SIGS_handler_update ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); + +#endif diff --git a/src/auditor/taler-auditor-httpd_deposit-confirmation-del.h b/src/auditor/taler-auditor-httpd_deposit-confirmation-del.h @@ -50,12 +50,13 @@ TEAH_DEPOSIT_CONFIRMATION_DELETE_done (void); * @return MHD result code */ MHD_RESULT -TAH_DEPOSIT_CONFIRMATION_handler_delete (struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); +TAH_DEPOSIT_CONFIRMATION_handler_delete ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); #endif diff --git a/src/auditor/taler-auditor-httpd_deposit-confirmation-get.h b/src/auditor/taler-auditor-httpd_deposit-confirmation-get.h @@ -45,15 +45,17 @@ TEAH_DEPOSIT_CONFIRMATION_GET_done (void); * @param[in,out] connection_cls the connection's closure (can be updated) * @param upload_data upload data * @param[in,out] upload_data_size number of bytes (left) in @a upload_data + * @param args NULL-terminated array of remaining parts of the URI broken up at '/' * @return MHD result code - */ + */ MHD_RESULT -TAH_DEPOSIT_CONFIRMATION_handler_get (struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); +TAH_DEPOSIT_CONFIRMATION_handler_get ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); #endif diff --git a/src/auditor/taler-auditor-httpd_deposit-confirmation-upd.h b/src/auditor/taler-auditor-httpd_deposit-confirmation-upd.h @@ -23,12 +23,12 @@ #include "taler-auditor-httpd.h" MHD_RESULT -TAH_DEPOSIT_CONFIRMATION_handler_update (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - -#endif // SRC_TALER_AUDITOR_HTTPD_DEPOSIT_CONFIRMATION_UPD_H +TAH_DEPOSIT_CONFIRMATION_handler_update ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); + +#endif diff --git a/src/auditor/taler-auditor-httpd_deposit-confirmation.h b/src/auditor/taler-auditor-httpd_deposit-confirmation.h @@ -47,15 +47,17 @@ TEAH_DEPOSIT_CONFIRMATION_done (void); * @param[in,out] connection_cls the connection's closure (can be updated) * @param upload_data upload data * @param[in,out] upload_data_size number of bytes (left) in @a upload_data + * @param args NULL-terminated array of remaining parts of the URI broken up at '/' * @return MHD result code - */ + */ MHD_RESULT -TAH_DEPOSIT_CONFIRMATION_handler (struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); +TAH_DEPOSIT_CONFIRMATION_handler ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); #endif diff --git a/src/auditor/taler-auditor-httpd_emergency-by-count-del.h b/src/auditor/taler-auditor-httpd_emergency-by-count-del.h @@ -43,16 +43,16 @@ TEAH_EMERGENCY_BY_COUNT_DELETE_done (void); * @param[in,out] connection_cls the connection's closure (can be updated) * @param upload_data upload data * @param[in,out] upload_data_size number of bytes (left) in @a upload_data + * @param args NULL-terminated array of remaining parts of the URI broken up at '/' * @return MHD result code */ MHD_RESULT -TAH_EMERGENCY_BY_COUNT_handler_delete (struct - TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - -#endif // SRC_TALER_AUDITOR_HTTPD_EMERGENCY_BY_COUNT_DEL_H +TAH_EMERGENCY_BY_COUNT_handler_delete ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); + +#endif diff --git a/src/auditor/taler-auditor-httpd_emergency-by-count-get.h b/src/auditor/taler-auditor-httpd_emergency-by-count-get.h @@ -35,23 +35,24 @@ void TEAH_EMERGENCY_BY_COUNT_GET_done (void); /** -* Handle a "/emergency-by-count" request. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ + * Handle a "/emergency-by-count" request. + * + * @param rh context of the handler + * @param connection the MHD connection to handle + * @param[in,out] connection_cls the connection's closure (can be updated) + * @param upload_data upload data + * @param[in,out] upload_data_size number of bytes (left) in @a upload_data + * @param args NULL-terminated array of remaining parts of the URI broken up at '/' + * @return MHD result code + */ MHD_RESULT -TAH_EMERGENCY_BY_COUNT_handler_get (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); +TAH_EMERGENCY_BY_COUNT_handler_get ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); -#endif // SRC_TALER_AUDITOR_HTTPD_EMERGENCY_BY_COUNT_GET_H +#endif diff --git a/src/auditor/taler-auditor-httpd_emergency-by-count-put.c b/src/auditor/taler-auditor-httpd_emergency-by-count-put.c @@ -1,167 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#include "platform.h" -#include <gnunet/gnunet_util_lib.h> -#include <gnunet/gnunet_json_lib.h> -#include <jansson.h> -#include <microhttpd.h> -#include <pthread.h> -#include "taler_json_lib.h" -#include "taler_mhd_lib.h" -#include "taler-auditor-httpd.h" -#include "taler-auditor-httpd_emergency-by-count-put.h" - -/** -* We have parsed the JSON information about the emergency-by-count, do some -* basic sanity checks and then execute the -* transaction. -* -* @param connection the MHD connection to handle -* @param dc information about the emergency-by-count -* @return MHD result code -*/ -static MHD_RESULT -process_inconsistency ( - struct MHD_Connection *connection, - const struct TALER_AUDITORDB_EmergenciesByCount *dc) -{ - - enum GNUNET_DB_QueryStatus qs; - - if (GNUNET_SYSERR == - TAH_plugin->preflight (TAH_plugin->cls)) - { - GNUNET_break (0); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_SETUP_FAILED, - NULL); - } - - /* execute transaction */ - qs = TAH_plugin->insert_emergency_by_count (TAH_plugin->cls, - dc); - if (0 > qs) - { - GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); - TALER_LOG_WARNING ( - "Failed to store /emergency-by-count in database\n"); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_STORE_FAILED, - "emergency-by-count"); - } - return TALER_MHD_REPLY_JSON_PACK (connection, - MHD_HTTP_OK, - GNUNET_JSON_pack_string ("status", - "EMERGENCY_BY_COUNT_OK")); -} - - -MHD_RESULT -TAH_EMERGENCY_BY_COUNT_PUT_handler ( - struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) -{ - - struct TALER_AUDITORDB_EmergenciesByCount dc; - - - struct GNUNET_TIME_Timestamp ts_s = { 0 }; - struct GNUNET_TIME_Timestamp ts_de = { 0 }; - - struct GNUNET_JSON_Specification spec[] = { - - GNUNET_JSON_spec_fixed_auto ("denompub_h", &dc.denompub_h), - GNUNET_JSON_spec_int64 ("num_issued", &dc.num_issued), - GNUNET_JSON_spec_int64 ("num_known", &dc.num_known), - TALER_JSON_spec_amount ("risk", TAH_currency, &dc.risk), - GNUNET_JSON_spec_timestamp ("start", &ts_s), - GNUNET_JSON_spec_timestamp ("deposit_end",&ts_de), - TALER_JSON_spec_amount ("value", TAH_currency, &dc.value), - - - GNUNET_JSON_spec_end () - }; - - - json_t *json; - - (void) rh; - (void) connection_cls; - (void) upload_data; - (void) upload_data_size; - { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json); - return MHD_NO; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json); - return MHD_YES; /* failure */ - } - } - - - dc.start = ts_de.abs_time; - dc.deposit_end = ts_de.abs_time; - - MHD_RESULT res; - - res = process_inconsistency (connection, &dc); - GNUNET_JSON_parse_free (spec); - - json_decref (json); - return res; - -} - - -void -TEAH_EMERGENCY_BY_COUNT_PUT_init (void) -{ - -} - - -void -TEAH_EMERGENCY_BY_COUNT_PUT_done (void) -{ - -} diff --git a/src/auditor/taler-auditor-httpd_emergency-by-count-put.h b/src/auditor/taler-auditor-httpd_emergency-by-count-put.h @@ -1,58 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#ifndef SRC_TALER_AUDITOR_HTTPD_EMERGENCY_BY_COUNT_PUT_H -#define SRC_TALER_AUDITOR_HTTPD_EMERGENCY_BY_COUNT_PUT_H - -#include <microhttpd.h> -#include "taler-auditor-httpd.h" - -/** -* Initialize subsystem. -*/ -void -TEAH_EMERGENCY_BY_COUNT_PUT_init (void); - -/** -* Shut down subsystem. -*/ -void -TEAH_EMERGENCY_BY_COUNT_PUT_done (void); - - -/** -* Handle a "/emergency-by-count" request. Parses the JSON, and, if -* successful, checks the signatures and stores the result in the DB. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ -MHD_RESULT -TAH_EMERGENCY_BY_COUNT_PUT_handler (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - - -#endif // SRC_TALER_AUDITOR_HTTPD_EMERGENCY_BY_COUNT_PUT_H diff --git a/src/auditor/taler-auditor-httpd_emergency-by-count-upd.h b/src/auditor/taler-auditor-httpd_emergency-by-count-upd.h @@ -23,12 +23,12 @@ #include "taler-auditor-httpd.h" MHD_RESULT -TAH_EMERGENCY_BY_COUNT_handler_update (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - -#endif // SRC_TALER_AUDITOR_HTTPD_EMERGENCY_BY_COUNT_UPD_H +TAH_EMERGENCY_BY_COUNT_handler_update ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); + +#endif diff --git a/src/auditor/taler-auditor-httpd_emergency-del.h b/src/auditor/taler-auditor-httpd_emergency-del.h @@ -35,24 +35,24 @@ void TEAH_EMERGENCY_DELETE_done (void); /** -* Handle a "/emergency" request. Parses the JSON, and, if -* successful, checks the signatures and stores the result in the DB. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ + * Handle a "/emergency" request. Parses the JSON, and, if + * successful, checks the signatures and stores the result in the DB. + * + * @param rh context of the handler + * @param connection the MHD connection to handle + * @param[in,out] connection_cls the connection's closure (can be updated) + * @param upload_data upload data + * @param[in,out] upload_data_size number of bytes (left) in @a upload_data + * @param args NULL-terminated array of remaining parts of the URI broken up at '/' + * @return MHD result code + */ MHD_RESULT -TAH_EMERGENCY_handler_delete (struct - TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - -#endif // SRC_TALER_AUDITOR_HTTPD_EMERGENCY_DEL_H +TAH_EMERGENCY_handler_delete ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); + +#endif diff --git a/src/auditor/taler-auditor-httpd_emergency-get.h b/src/auditor/taler-auditor-httpd_emergency-get.h @@ -35,23 +35,24 @@ void TEAH_EMERGENCY_GET_done (void); /** -* Handle a "/emergency" request. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ + * Handle a "/emergency" request. + * + * @param rh context of the handler + * @param connection the MHD connection to handle + * @param[in,out] connection_cls the connection's closure (can be updated) + * @param upload_data upload data + * @param[in,out] upload_data_size number of bytes (left) in @a upload_data + * @param args NULL-terminated array of remaining parts of the URI broken up at '/' + * @return MHD result code + */ MHD_RESULT -TAH_EMERGENCY_handler_get (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); +TAH_EMERGENCY_handler_get ( + struct TAH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]); -#endif // SRC_TALER_AUDITOR_HTTPD_EMERGENCY_GET_H +#endif diff --git a/src/auditor/taler-auditor-httpd_emergency-put.c b/src/auditor/taler-auditor-httpd_emergency-put.c @@ -1,167 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#include "platform.h" -#include <gnunet/gnunet_util_lib.h> -#include <gnunet/gnunet_json_lib.h> -#include <jansson.h> -#include <microhttpd.h> -#include <pthread.h> -#include "taler_json_lib.h" -#include "taler_mhd_lib.h" -#include "taler-auditor-httpd.h" -#include "taler-auditor-httpd_emergency-put.h" - -/** -* We have parsed the JSON information about the emergency, do some -* basic sanity checks and then execute the -* transaction. -* -* @param connection the MHD connection to handle -* @param dc information about the emergency -* @return MHD result code -*/ -static MHD_RESULT -process_inconsistency ( - struct MHD_Connection *connection, - const struct TALER_AUDITORDB_Emergency *dc) -{ - - enum GNUNET_DB_QueryStatus qs; - - if (GNUNET_SYSERR == - TAH_plugin->preflight (TAH_plugin->cls)) - { - GNUNET_break (0); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_SETUP_FAILED, - NULL); - } - - /* execute transaction */ - qs = TAH_plugin->insert_emergency (TAH_plugin->cls, - dc); - if (0 > qs) - { - GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); - TALER_LOG_WARNING ( - "Failed to store /emergency in database\n"); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_STORE_FAILED, - "emergency"); - } - return TALER_MHD_REPLY_JSON_PACK (connection, - MHD_HTTP_OK, - GNUNET_JSON_pack_string ("status", - "EMERGENCY_OK")); -} - - -MHD_RESULT -TAH_EMERGENCY_PUT_handler ( - struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) -{ - - struct TALER_AUDITORDB_Emergency dc; - - struct GNUNET_TIME_Timestamp ds = { 0 }; - struct GNUNET_TIME_Timestamp de = { 0 }; - - struct GNUNET_JSON_Specification spec[] = { - - - GNUNET_JSON_spec_fixed_auto ("denompub_h", &dc.denompub_h), - - TALER_JSON_spec_amount ("denom_risk",TAH_currency, &dc.denom_risk), - TALER_JSON_spec_amount ("denom_loss", TAH_currency,&dc.denom_loss), - - GNUNET_JSON_spec_timestamp ("deposit_start", &ds), - GNUNET_JSON_spec_timestamp ("deposit_end", &de), - - TALER_JSON_spec_amount ("value", TAH_currency,&dc.value), - - - GNUNET_JSON_spec_end () - }; - - - json_t *json; - - (void) rh; - (void) connection_cls; - (void) upload_data; - (void) upload_data_size; - { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json); - return MHD_NO; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json); - return MHD_YES; /* failure */ - } - } - - dc.deposit_start = ds.abs_time; - dc.deposit_end = de.abs_time; - - MHD_RESULT res; - res = process_inconsistency (connection, &dc); - GNUNET_JSON_parse_free (spec); - - json_decref (json); - return res; - -} - - -void -TEAH_EMERGENCY_PUT_init (void) -{ - -} - - -void -TEAH_EMERGENCY_PUT_done (void) -{ - -} diff --git a/src/auditor/taler-auditor-httpd_emergency-put.h b/src/auditor/taler-auditor-httpd_emergency-put.h @@ -1,58 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#ifndef SRC_TALER_AUDITOR_HTTPD_EMERGENCY_PUT_H -#define SRC_TALER_AUDITOR_HTTPD_EMERGENCY_PUT_H - -#include <microhttpd.h> -#include "taler-auditor-httpd.h" - -/** -* Initialize subsystem. -*/ -void -TEAH_EMERGENCY_PUT_init (void); - -/** -* Shut down subsystem. -*/ -void -TEAH_EMERGENCY_PUT_done (void); - - -/** -* Handle a "/emergency" request. Parses the JSON, and, if -* successful, checks the signatures and stores the result in the DB. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ -MHD_RESULT -TAH_EMERGENCY_PUT_handler (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - - -#endif // SRC_TALER_AUDITOR_HTTPD_EMERGENCY_PUT_H diff --git a/src/auditor/taler-auditor-httpd_fee-time-inconsistency-put.c b/src/auditor/taler-auditor-httpd_fee-time-inconsistency-put.c @@ -1,159 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#include "platform.h" -#include <gnunet/gnunet_util_lib.h> -#include <gnunet/gnunet_json_lib.h> -#include <jansson.h> -#include <microhttpd.h> -#include <pthread.h> -#include "taler_json_lib.h" -#include "taler_mhd_lib.h" -#include "taler-auditor-httpd.h" -#include "taler-auditor-httpd_fee-time-inconsistency-put.h" - -/** -* We have parsed the JSON information about the fee-time-inconsistency, do some -* basic sanity checks and then execute the -* transaction. -* -* @param connection the MHD connection to handle -* @param dc information about the fee-time-inconsistency -* @return MHD result code -*/ -static MHD_RESULT -process_inconsistency ( - struct MHD_Connection *connection, - const struct TALER_AUDITORDB_FeeTimeInconsistency *dc) -{ - - enum GNUNET_DB_QueryStatus qs; - - if (GNUNET_SYSERR == - TAH_plugin->preflight (TAH_plugin->cls)) - { - GNUNET_break (0); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_SETUP_FAILED, - NULL); - } - - /* execute transaction */ - qs = TAH_plugin->insert_fee_time_inconsistency (TAH_plugin->cls, - dc); - if (0 > qs) - { - GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); - TALER_LOG_WARNING ( - "Failed to store /fee-time-inconsistency in database\n"); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_STORE_FAILED, - "fee-time-inconsistency"); - } - return TALER_MHD_REPLY_JSON_PACK (connection, - MHD_HTTP_OK, - GNUNET_JSON_pack_string ("status", - "FEE_TIME_INCONSISTENCY_OK")); -} - - -MHD_RESULT -TAH_FEE_TIME_INCONSISTENCY_handler_put ( - struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) -{ - - struct TALER_AUDITORDB_FeeTimeInconsistency dc; - - struct GNUNET_TIME_Timestamp t = { 0 }; - - struct GNUNET_JSON_Specification spec[] = { - - GNUNET_JSON_spec_string ("type", (const char **) &dc.type), - GNUNET_JSON_spec_timestamp ("time", &t), - GNUNET_JSON_spec_string ("diagnostic", (const char **) &dc.diagnostic), - - - GNUNET_JSON_spec_end () - }; - - - json_t *json; - - (void) rh; - (void) connection_cls; - (void) upload_data; - (void) upload_data_size; - { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json); - return MHD_NO; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json); - return MHD_YES; /* failure */ - } - } - - dc.time = t.abs_time; - - MHD_RESULT res; - - res = process_inconsistency (connection, &dc); - GNUNET_JSON_parse_free (spec); - - json_decref (json); - return res; - -} - - -void -TEAH_FEE_TIME_INCONSISTENCY_PUT_init (void) -{ - -} - - -void -TEAH_FEE_TIME_INCONSISTENCY_PUT_done (void) -{ - -} diff --git a/src/auditor/taler-auditor-httpd_fee-time-inconsistency-put.h b/src/auditor/taler-auditor-httpd_fee-time-inconsistency-put.h @@ -1,58 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#ifndef SRC_TALER_AUDITOR_HTTPD_FEE_TIME_INCONSISTENCY_PUT_H -#define SRC_TALER_AUDITOR_HTTPD_FEE_TIME_INCONSISTENCY_PUT_H - -#include <microhttpd.h> -#include "taler-auditor-httpd.h" - -/** -* Initialize subsystem. -*/ -void -TEAH_FEE_TIME_INCONSISTENCY_PUT_init (void); - -/** -* Shut down subsystem. -*/ -void -TEAH_FEE_TIME_INCONSISTENCY_PUT_done (void); - - -/** -* Handle a "/fee-time-inconsistency" request. Parses the JSON, and, if -* successful, checks the signatures and stores the result in the DB. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ -MHD_RESULT -TAH_FEE_TIME_INCONSISTENCY_handler_put (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - - -#endif // SRC_TALER_AUDITOR_HTTPD_FEE_TIME_INCONSISTENCY_PUT_H diff --git a/src/auditor/taler-auditor-httpd_mhd.h b/src/auditor/taler-auditor-httpd_mhd.h @@ -37,6 +37,7 @@ * @param[in,out] connection_cls the connection's closure (can be updated) * @param upload_data upload data * @param[in,out] upload_data_size number of bytes (left) in @a upload_data + * @param args NULL-terminated array of remaining parts of the URI broken up at '/' * @return MHD result code */ MHD_RESULT @@ -57,6 +58,7 @@ TAH_MHD_handler_static_response (struct TAH_RequestHandler *rh, * @param[in,out] connection_cls the connection's closure (can be updated) * @param upload_data upload data * @param[in,out] upload_data_size number of bytes (left) in @a upload_data + * @param args NULL-terminated array of remaining parts of the URI broken up at '/' * @return MHD result code */ MHD_RESULT diff --git a/src/auditor/taler-auditor-httpd_misattribution-in-inconsistency-put.c b/src/auditor/taler-auditor-httpd_misattribution-in-inconsistency-put.c @@ -1,156 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#include "platform.h" -#include <gnunet/gnunet_util_lib.h> -#include <gnunet/gnunet_json_lib.h> -#include <jansson.h> -#include <microhttpd.h> -#include <pthread.h> -#include "taler_json_lib.h" -#include "taler_mhd_lib.h" -#include "taler-auditor-httpd.h" -#include "taler-auditor-httpd_misattribution-in-inconsistency-put.h" - -/** -* We have parsed the JSON information about the misattribution-in-inconsistency, do some -* basic sanity checks and then execute the -* transaction. -* -* @param connection the MHD connection to handle -* @param dc information about the misattribution-in-inconsistency -* @return MHD result code -*/ -static MHD_RESULT -process_inconsistency ( - struct MHD_Connection *connection, - const struct TALER_AUDITORDB_MisattributionInInconsistency *dc) -{ - - enum GNUNET_DB_QueryStatus qs; - - if (GNUNET_SYSERR == - TAH_plugin->preflight (TAH_plugin->cls)) - { - GNUNET_break (0); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_SETUP_FAILED, - NULL); - } - - /* execute transaction */ - qs = TAH_plugin->insert_misattribution_in_inconsistency (TAH_plugin->cls, - dc); - if (0 > qs) - { - GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); - TALER_LOG_WARNING ( - "Failed to store /misattribution-in-inconsistency in database"); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_STORE_FAILED, - "misattribution-in-inconsistency"); - } - return TALER_MHD_REPLY_JSON_PACK (connection, - MHD_HTTP_OK, - GNUNET_JSON_pack_string ("status", - "MISATTRIBUTION_IN_INCONSISTENCY_OK")); -} - - -MHD_RESULT -TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_put ( - struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) -{ - - struct TALER_AUDITORDB_MisattributionInInconsistency dc; - - - struct GNUNET_JSON_Specification spec[] = { - - TALER_JSON_spec_amount ("amount", TAH_currency, &dc.amount), - GNUNET_JSON_spec_int64 ("bank_row", &dc.bank_row), - GNUNET_JSON_spec_fixed_auto ("reserve_pub", &dc.reserve_pub), - - - GNUNET_JSON_spec_end () - }; - - - json_t *json; - - (void) rh; - (void) connection_cls; - (void) upload_data; - (void) upload_data_size; - { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json); - return MHD_NO; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json); - return MHD_YES; /* failure */ - } - } - - MHD_RESULT res; - - res = process_inconsistency (connection, &dc); - GNUNET_JSON_parse_free (spec); - - json_decref (json); - return res; - -} - - -void -TEAH_MISATTRIBUTION_IN_INCONSISTENCY_PUT_init (void) -{ - -} - - -void -TEAH_MISATTRIBUTION_IN_INCONSISTENCY_PUT_done (void) -{ - -} diff --git a/src/auditor/taler-auditor-httpd_misattribution-in-inconsistency-put.h b/src/auditor/taler-auditor-httpd_misattribution-in-inconsistency-put.h @@ -1,58 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#ifndef SRC_TALER_AUDITOR_HTTPD_MISATTRIBUTION_IN_INCONSISTENCY_PUT_H -#define SRC_TALER_AUDITOR_HTTPD_MISATTRIBUTION_IN_INCONSISTENCY_PUT_H - -#include <microhttpd.h> -#include "taler-auditor-httpd.h" - -/** -* Initialize subsystem. -*/ -void -TEAH_BAD_MISATTRIBUTION_IN_INCONSISTENCY_init (void); - -/** -* Shut down subsystem. -*/ -void -TEAH_BAD_MISATTRIBUTION_IN_INCONSISTENCY_done (void); - - -/** -* Handle a "/misattribution-in-inconsistency" request. Parses the JSON, and, if -* successful, checks the signatures and stores the result in the DB. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ -MHD_RESULT -TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_put (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - - -#endif // SRC_TALER_AUDITOR_HTTPD_MISATTRIBUTION_IN_INCONSISTENCY_PUT_H diff --git a/src/auditor/taler-auditor-httpd_purse-not-closed-inconsistencies-put.c b/src/auditor/taler-auditor-httpd_purse-not-closed-inconsistencies-put.c @@ -1,159 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#include "platform.h" -#include <gnunet/gnunet_util_lib.h> -#include <gnunet/gnunet_json_lib.h> -#include <jansson.h> -#include <microhttpd.h> -#include <pthread.h> -#include "taler_json_lib.h" -#include "taler_mhd_lib.h" -#include "taler-auditor-httpd.h" -#include "taler-auditor-httpd_purse-not-closed-inconsistencies-put.h" - -/** -* We have parsed the JSON information about the purse-not-closed-inconsistencies, do some -* basic sanity checks and then execute the -* transaction. -* -* @param connection the MHD connection to handle -* @param dc information about the purse-not-closed-inconsistencies -* @return MHD result code -*/ -static MHD_RESULT -process_inconsistency ( - struct MHD_Connection *connection, - const struct TALER_AUDITORDB_PurseNotClosedInconsistencies *dc) -{ - - enum GNUNET_DB_QueryStatus qs; - - if (GNUNET_SYSERR == - TAH_plugin->preflight (TAH_plugin->cls)) - { - GNUNET_break (0); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_SETUP_FAILED, - NULL); - } - - /* execute transaction */ - qs = TAH_plugin->insert_purse_not_closed_inconsistencies (TAH_plugin->cls, - dc); - if (0 > qs) - { - GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); - TALER_LOG_WARNING ( - "Failed to store /purse-not-closed-inconsistencies in database\n"); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_STORE_FAILED, - "purse-not-closed-inconsistencies"); - } - return TALER_MHD_REPLY_JSON_PACK (connection, - MHD_HTTP_OK, - GNUNET_JSON_pack_string ("status", - "PURSE_NOT_CLOSED_INCONSISTENCIES_OK")); -} - - -MHD_RESULT -TAH_PURSE_NOT_CLOSED_INCONSISTENCIES_PUT_handler ( - struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) -{ - - struct TALER_AUDITORDB_PurseNotClosedInconsistencies dc; - - struct GNUNET_TIME_Timestamp ed = { 0 }; - - struct GNUNET_JSON_Specification spec[] = { - - GNUNET_JSON_spec_fixed_auto ("purse_pub", &dc.purse_pub), - TALER_JSON_spec_amount ("amount", TAH_currency, &dc.amount), - GNUNET_JSON_spec_timestamp ("progress_offset", &ed), - - - GNUNET_JSON_spec_end () - }; - - - json_t *json; - - (void) rh; - (void) connection_cls; - (void) upload_data; - (void) upload_data_size; - { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json); - return MHD_NO; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json); - return MHD_YES; /* failure */ - } - } - - dc.expiration_date = ed.abs_time; - - MHD_RESULT res; - - res = process_inconsistency (connection, &dc); - GNUNET_JSON_parse_free (spec); - - json_decref (json); - return res; - -} - - -void -TEAH_PURSE_NOT_CLOSED_INCONSISTENCIES_PUT_init (void) -{ - -} - - -void -TEAH_PURSE_NOT_CLOSED_INCONSISTENCIES_PUT_done (void) -{ - -} diff --git a/src/auditor/taler-auditor-httpd_purse-not-closed-inconsistencies-put.h b/src/auditor/taler-auditor-httpd_purse-not-closed-inconsistencies-put.h @@ -1,58 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#ifndef SRC_TALER_AUDITOR_HTTPD_PURSE_NOT_CLOSED_INCONSISTENCIES_PUT_H -#define SRC_TALER_AUDITOR_HTTPD_PURSE_NOT_CLOSED_INCONSISTENCIES_PUT_H - -#include <microhttpd.h> -#include "taler-auditor-httpd.h" - -/** -* Initialize subsystem. -*/ -void -TEAH_PURSE_NOT_CLOSED_INCONSISTENCIES_PUT_init (void); - -/** -* Shut down subsystem. -*/ -void -TEAH_PURSE_NOT_CLOSED_INCONSISTENCIES_PUT_done (void); - - -/** -* Handle a "/purse-not-closed-inconsistencies" request. Parses the JSON, and, if -* successful, checks the signatures and stores the result in the DB. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ -MHD_RESULT -TAH_PURSE_NOT_CLOSED_INCONSISTENCIES_PUT_handler (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - - -#endif // SRC_TALER_AUDITOR_HTTPD_PURSE_NOT_CLOSED_INCONSISTENCIES_PUT_H diff --git a/src/auditor/taler-auditor-httpd_refreshes-hanging-put.c b/src/auditor/taler-auditor-httpd_refreshes-hanging-put.c @@ -1,154 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#include "platform.h" -#include <gnunet/gnunet_util_lib.h> -#include <gnunet/gnunet_json_lib.h> -#include <jansson.h> -#include <microhttpd.h> -#include <pthread.h> -#include "taler_json_lib.h" -#include "taler_mhd_lib.h" -#include "taler-auditor-httpd.h" -#include "taler-auditor-httpd_refreshes-hanging-put.h" - -/** -* We have parsed the JSON information about the refreshes-hanging, do some -* basic sanity checks and then execute the -* transaction. -* -* @param connection the MHD connection to handle -* @param dc information about the refreshes-hanging -* @return MHD result code -*/ -static MHD_RESULT -process_inconsistency ( - struct MHD_Connection *connection, - const struct TALER_AUDITORDB_RefreshesHanging *dc) -{ - - enum GNUNET_DB_QueryStatus qs; - - if (GNUNET_SYSERR == - TAH_plugin->preflight (TAH_plugin->cls)) - { - GNUNET_break (0); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_SETUP_FAILED, - NULL); - } - - /* execute transaction */ - qs = TAH_plugin->insert_refreshes_hanging (TAH_plugin->cls, - dc); - if (0 > qs) - { - GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); - TALER_LOG_WARNING ( - "Failed to store /refreshes-hanging in database\n"); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_STORE_FAILED, - "refreshes-hanging"); - } - return TALER_MHD_REPLY_JSON_PACK (connection, - MHD_HTTP_OK, - GNUNET_JSON_pack_string ("status", - "REFRESHES_HANGING_OK")); -} - - -MHD_RESULT -TAH_REFRESHES_HANGING_PUT_handler ( - struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) -{ - - struct TALER_AUDITORDB_RefreshesHanging dc; - - - struct GNUNET_JSON_Specification spec[] = { - - TALER_JSON_spec_amount ("amount", TAH_currency, &dc.amount), - GNUNET_JSON_spec_fixed_auto ("coin_pub", &dc.coin_pub), - - GNUNET_JSON_spec_end () - }; - - - json_t *json; - - (void) rh; - (void) connection_cls; - (void) upload_data; - (void) upload_data_size; - { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json); - return MHD_NO; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json); - return MHD_YES; /* failure */ - } - } - - MHD_RESULT res; - - res = process_inconsistency (connection, &dc); - GNUNET_JSON_parse_free (spec); - - json_decref (json); - return res; - -} - - -void -TEAH_REFRESHES_HANGING_PUT_init (void) -{ - -} - - -void -TEAH_REFRESHES_HANGING_PUT_done (void) -{ - -} diff --git a/src/auditor/taler-auditor-httpd_refreshes-hanging-put.h b/src/auditor/taler-auditor-httpd_refreshes-hanging-put.h @@ -1,58 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#ifndef SRC_TALER_AUDITOR_HTTPD_REFRESHES_HANGING_PUT_H -#define SRC_TALER_AUDITOR_HTTPD_REFRESHES_HANGING_PUT_H - -#include <microhttpd.h> -#include "taler-auditor-httpd.h" - -/** -* Initialize subsystem. -*/ -void -TEAH_REFRESHES_HANGING_PUT_init (void); - -/** -* Shut down subsystem. -*/ -void -TEAH_REFRESHES_HANGING_PUT_done (void); - - -/** -* Handle a "/refreshes-hanging" request. Parses the JSON, and, if -* successful, checks the signatures and stores the result in the DB. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ -MHD_RESULT -TAH_REFRESHES_HANGING_PUT_handler (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - - -#endif // SRC_TALER_AUDITOR_HTTPD_REFRESHES_HANGING_PUT_H diff --git a/src/auditor/taler-auditor-httpd_reserve-balance-insufficient-inconsistency-put.c b/src/auditor/taler-auditor-httpd_reserve-balance-insufficient-inconsistency-put.c @@ -1,158 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#include "platform.h" -#include <gnunet/gnunet_util_lib.h> -#include <gnunet/gnunet_json_lib.h> -#include <jansson.h> -#include <microhttpd.h> -#include <pthread.h> -#include "taler_json_lib.h" -#include "taler_mhd_lib.h" -#include "taler-auditor-httpd.h" -#include "taler-auditor-httpd_reserve-balance-insufficient-inconsistency-put.h" - -/** -* We have parsed the JSON information about the reserve-balance-insufficient-inconsistency, do some -* basic sanity checks and then execute the -* transaction. -* -* @param connection the MHD connection to handle -* @param dc information about the reserve-balance-insufficient-inconsistency -* @return MHD result code -*/ -static MHD_RESULT -process_inconsistency ( - struct MHD_Connection *connection, - const struct TALER_AUDITORDB_ReserveBalanceInsufficientInconsistency *dc) -{ - - enum GNUNET_DB_QueryStatus qs; - - if (GNUNET_SYSERR == - TAH_plugin->preflight (TAH_plugin->cls)) - { - GNUNET_break (0); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_SETUP_FAILED, - NULL); - } - - /* execute transaction */ - qs = TAH_plugin->insert_reserve_balance_insufficient_inconsistency ( - TAH_plugin->cls, - dc); - if (0 > qs) - { - GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); - TALER_LOG_WARNING ( - "Failed to store /reserve-balance-insufficient-inconsistency in database\n"); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_STORE_FAILED, - "reserve-balance-insufficient-inconsistency"); - } - return TALER_MHD_REPLY_JSON_PACK (connection, - MHD_HTTP_OK, - GNUNET_JSON_pack_string ("status", - "RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_OK")); -} - - -MHD_RESULT -TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_put ( - struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) -{ - - struct TALER_AUDITORDB_ReserveBalanceInsufficientInconsistency dc; - - - struct GNUNET_JSON_Specification spec[] = { - - GNUNET_JSON_spec_fixed_auto ("reserve_pub", &dc.reserve_pub), - GNUNET_JSON_spec_bool ("inconsistency_gain", &dc.inconsistency_gain), - TALER_JSON_spec_amount ("inconsistency_amount", TAH_currency, - &dc.inconsistency_amount), - - - GNUNET_JSON_spec_end () - }; - - - json_t *json; - - (void) rh; - (void) connection_cls; - (void) upload_data; - (void) upload_data_size; - { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json); - return MHD_NO; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json); - return MHD_YES; /* failure */ - } - } - - MHD_RESULT res; - - res = process_inconsistency (connection, &dc); - GNUNET_JSON_parse_free (spec); - - json_decref (json); - return res; - -} - - -void -TEAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_PUT_init (void) -{ - -} - - -void -TEAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_PUT_done (void) -{ - -} diff --git a/src/auditor/taler-auditor-httpd_reserve-balance-insufficient-inconsistency-put.h b/src/auditor/taler-auditor-httpd_reserve-balance-insufficient-inconsistency-put.h @@ -1,64 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#ifndef SRC_TALER_AUDITOR_HTTPD_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_PUT_H -#define SRC_TALER_AUDITOR_HTTPD_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_PUT_H - -#include <gnunet/gnunet_util_lib.h> -#include <microhttpd.h> -#include "taler-auditor-httpd.h" - -/** -* Initialize subsystem. -*/ -void -TEAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_PUT_init (void); - -/** -* Shut down subsystem. -*/ -void -TEAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_PUT_done (void); - -/** -* Handle a "/reserve-balance-insufficient-inconsistency" request. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ -MHD_RESULT -TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_put (struct - TAH_RequestHandler * - rh, - struct - MHD_Connection * - connection, - void ** - connection_cls, - const char * - upload_data, - size_t * - upload_data_size, - const char *const - args[]); - - -#endif // SRC_TALER_AUDITOR_HTTPD_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_PUT_H diff --git a/src/auditor/taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-put.c b/src/auditor/taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-put.c @@ -1,158 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#include "platform.h" -#include <gnunet/gnunet_util_lib.h> -#include <gnunet/gnunet_json_lib.h> -#include <jansson.h> -#include <microhttpd.h> -#include <pthread.h> -#include "taler_json_lib.h" -#include "taler_mhd_lib.h" -#include "taler-auditor-httpd.h" -#include "taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-put.h" - -/** -* We have parsed the JSON information about the reserve-balance-summary-wrong-inconsistency, do some -* basic sanity checks and then execute the -* transaction. -* -* @param connection the MHD connection to handle -* @param dc information about the reserve-balance-summary-wrong-inconsistency -* @return MHD result code -*/ -static MHD_RESULT -process_inconsistency ( - struct MHD_Connection *connection, - const struct TALER_AUDITORDB_ReserveBalanceSummaryWrongInconsistency *dc) -{ - - enum GNUNET_DB_QueryStatus qs; - - if (GNUNET_SYSERR == - TAH_plugin->preflight (TAH_plugin->cls)) - { - GNUNET_break (0); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_SETUP_FAILED, - NULL); - } - - /* execute transaction */ - qs = TAH_plugin->insert_reserve_balance_summary_wrong_inconsistency ( - TAH_plugin->cls, - dc); - if (0 > qs) - { - GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); - TALER_LOG_WARNING ( - "Failed to store /reserve-balance-summary-wrong-inconsistency in database"); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_STORE_FAILED, - "reserve-balance-summary-wrong-inconsistency"); - } - return TALER_MHD_REPLY_JSON_PACK (connection, - MHD_HTTP_OK, - GNUNET_JSON_pack_string ("status", - "RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_OK")); -} - - -MHD_RESULT -TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_put ( - struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) -{ - - struct TALER_AUDITORDB_ReserveBalanceSummaryWrongInconsistency dc; - - - struct GNUNET_JSON_Specification spec[] = { - - GNUNET_JSON_spec_fixed_auto ("reserve_pub", &dc.reserve_pub), - TALER_JSON_spec_amount ("exchange_amount", TAH_currency, - &dc.exchange_amount), - TALER_JSON_spec_amount ("auditor_amount", TAH_currency, &dc.auditor_amount), - - - GNUNET_JSON_spec_end () - }; - - - json_t *json; - - (void) rh; - (void) connection_cls; - (void) upload_data; - (void) upload_data_size; - { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json); - return MHD_NO; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json); - return MHD_YES; /* failure */ - } - } - - MHD_RESULT res; - - res = process_inconsistency (connection, &dc); - GNUNET_JSON_parse_free (spec); - - json_decref (json); - return res; - -} - - -void -TEAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_PUT_init (void) -{ - -} - - -void -TEAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_PUT_done (void) -{ - -} diff --git a/src/auditor/taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-put.h b/src/auditor/taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-put.h @@ -1,67 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#ifndef \ - SRC_TALER_AUDITOR_HTTPD_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_PUT_H -#define \ - SRC_TALER_AUDITOR_HTTPD_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_PUT_H - -#include <microhttpd.h> -#include "taler-auditor-httpd.h" - -/** -* Initialize subsystem. -*/ -void -TEAH_BAD_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_init (void); - -/** -* Shut down subsystem. -*/ -void -TEAH_BAD_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_done (void); - - -/** -* Handle a "/reserve-balance-summary-wrong-inconsistency" request. Parses the JSON, and, if -* successful, checks the signatures and stores the result in the DB. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ -MHD_RESULT -TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_put (struct - TAH_RequestHandler - *rh, - struct - MHD_Connection * - connection, - void ** - connection_cls, - const char * - upload_data, - size_t * - upload_data_size, - const char *const - args[]); - - -#endif // SRC_TALER_AUDITOR_HTTPD_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_PUT_H diff --git a/src/auditor/taler-auditor-httpd_reserve-in-inconsistency-put.c b/src/auditor/taler-auditor-httpd_reserve-in-inconsistency-put.c @@ -1,162 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#include "platform.h" -#include <gnunet/gnunet_util_lib.h> -#include <gnunet/gnunet_json_lib.h> -#include <jansson.h> -#include <microhttpd.h> -#include <pthread.h> -#include "taler_json_lib.h" -#include "taler_mhd_lib.h" -#include "taler-auditor-httpd.h" -#include "taler-auditor-httpd_reserve-in-inconsistency-put.h" - -/** -* We have parsed the JSON information about the reserve-in-inconsistency, do some -* basic sanity checks and then execute the -* transaction. -* -* @param connection the MHD connection to handle -* @param dc information about the reserve-in-inconsistency -* @return MHD result code -*/ -static MHD_RESULT -process_inconsistency ( - struct MHD_Connection *connection, - const struct TALER_AUDITORDB_ReserveInInconsistency *dc) -{ - - enum GNUNET_DB_QueryStatus qs; - - if (GNUNET_SYSERR == - TAH_plugin->preflight (TAH_plugin->cls)) - { - GNUNET_break (0); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_SETUP_FAILED, - NULL); - } - - /* execute transaction */ - qs = TAH_plugin->insert_reserve_in_inconsistency (TAH_plugin->cls, - dc); - if (0 > qs) - { - GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); - TALER_LOG_WARNING ( - "Failed to store /reserve-in-inconsistency in database"); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_STORE_FAILED, - "reserve-in-inconsistency"); - } - return TALER_MHD_REPLY_JSON_PACK (connection, - MHD_HTTP_OK, - GNUNET_JSON_pack_string ("status", - "RESERVE_IN_INCONSISTENCY_OK")); -} - - -MHD_RESULT -TAH_RESERVE_IN_INCONSISTENCY_handler_put ( - struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) -{ - - struct TALER_AUDITORDB_ReserveInInconsistency dc; - - struct GNUNET_TIME_Timestamp t = { 0 }; - - struct GNUNET_JSON_Specification spec[] = { - - TALER_JSON_spec_amount ("amount_exchange_expected", TAH_currency, - &dc.amount_exchange_expected), - TALER_JSON_spec_amount ("amount_wired", TAH_currency, &dc.amount_wired), - GNUNET_JSON_spec_fixed_auto ("reserve_pub", &dc.reserve_pub), - GNUNET_JSON_spec_timestamp ("timestamp", &t), - GNUNET_JSON_spec_fixed_auto ("account", &dc.account), - GNUNET_JSON_spec_fixed_auto ("diagnostic", &dc.diagnostic), - - - GNUNET_JSON_spec_end () - }; - - - json_t *json; - - (void) rh; - (void) connection_cls; - (void) upload_data; - (void) upload_data_size; - { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json); - return MHD_NO; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json); - return MHD_YES; /* failure */ - } - } - - dc.timestamp = t.abs_time; - - MHD_RESULT res; - res = process_inconsistency (connection, &dc); - GNUNET_JSON_parse_free (spec); - - json_decref (json); - return res; - -} - - -void -TEAH_RESERVE_IN_INCONSISTENCY_PUT_init (void) -{ - -} - - -void -TEAH_RESERVE_IN_INCONSISTENCY_PUT_done (void) -{ - -} diff --git a/src/auditor/taler-auditor-httpd_reserve-in-inconsistency-put.h b/src/auditor/taler-auditor-httpd_reserve-in-inconsistency-put.h @@ -1,58 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#ifndef SRC_TALER_AUDITOR_HTTPD_RESERVE_IN_INCONSISTENCY_PUT_H -#define SRC_TALER_AUDITOR_HTTPD_RESERVE_IN_INCONSISTENCY_PUT_H - -#include <microhttpd.h> -#include "taler-auditor-httpd.h" - -/** -* Initialize subsystem. -*/ -void -TEAH_BAD_RESERVE_IN_INCONSISTENCY_init (void); - -/** -* Shut down subsystem. -*/ -void -TEAH_BAD_RESERVE_IN_INCONSISTENCY_done (void); - - -/** -* Handle a "/reserve-in-inconsistency" request. Parses the JSON, and, if -* successful, checks the signatures and stores the result in the DB. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ -MHD_RESULT -TAH_RESERVE_IN_INCONSISTENCY_handler_put (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - - -#endif // SRC_TALER_AUDITOR_HTTPD_RESERVE_IN_INCONSISTENCY_PUT_H diff --git a/src/auditor/taler-auditor-httpd_reserve-not-closed-inconsistency-put.c b/src/auditor/taler-auditor-httpd_reserve-not-closed-inconsistency-put.c @@ -1,160 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#include "platform.h" -#include <gnunet/gnunet_util_lib.h> -#include <gnunet/gnunet_json_lib.h> -#include <jansson.h> -#include <microhttpd.h> -#include <pthread.h> -#include "taler_json_lib.h" -#include "taler_mhd_lib.h" -#include "taler-auditor-httpd.h" -#include "taler-auditor-httpd_reserve-not-closed-inconsistency-put.h" - -/** -* We have parsed the JSON information about the reserve-not-closed-inconsistency, do some -* basic sanity checks and then execute the -* transaction. -* -* @param connection the MHD connection to handle -* @param dc information about the reserve-not-closed-inconsistency -* @return MHD result code -*/ -static MHD_RESULT -process_inconsistency ( - struct MHD_Connection *connection, - const struct TALER_AUDITORDB_ReserveNotClosedInconsistency *dc) -{ - - enum GNUNET_DB_QueryStatus qs; - - if (GNUNET_SYSERR == - TAH_plugin->preflight (TAH_plugin->cls)) - { - GNUNET_break (0); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_SETUP_FAILED, - NULL); - } - - /* execute transaction */ - qs = TAH_plugin->insert_reserve_not_closed_inconsistency (TAH_plugin->cls, - dc); - if (0 > qs) - { - GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); - TALER_LOG_WARNING ( - "Failed to store /reserve-not-closed-inconsistency in database"); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_STORE_FAILED, - "reserve-not-closed-inconsistency"); - } - return TALER_MHD_REPLY_JSON_PACK (connection, - MHD_HTTP_OK, - GNUNET_JSON_pack_string ("status", - "RESERVE_NOT_CLOSED_INCONSISTENCY_OK")); -} - - -MHD_RESULT -TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_put ( - struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) -{ - - struct TALER_AUDITORDB_ReserveNotClosedInconsistency dc; - - struct GNUNET_TIME_Timestamp et = { 0 }; - - struct GNUNET_JSON_Specification spec[] = { - - GNUNET_JSON_spec_fixed_auto ("reserve_pub", &dc.reserve_pub), - TALER_JSON_spec_amount ("balance", TAH_currency, &dc.balance), - GNUNET_JSON_spec_timestamp ("expiration_time", &et), - GNUNET_JSON_spec_fixed_auto ("diagnostic", &dc.diagnostic), - - - GNUNET_JSON_spec_end () - }; - - - json_t *json; - - (void) rh; - (void) connection_cls; - (void) upload_data; - (void) upload_data_size; - { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json); - return MHD_NO; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json); - return MHD_YES; /* failure */ - } - } - - dc.expiration_time = et.abs_time; - - MHD_RESULT res; - - res = process_inconsistency (connection, &dc); - GNUNET_JSON_parse_free (spec); - - json_decref (json); - return res; - -} - - -void -TEAH_RESERVE_NOT_CLOSED_INCONSISTENCY_PUT_init (void) -{ - -} - - -void -TEAH_RESERVE_NOT_CLOSED_INCONSISTENCY_PUT_done (void) -{ - -} diff --git a/src/auditor/taler-auditor-httpd_reserve-not-closed-inconsistency-put.h b/src/auditor/taler-auditor-httpd_reserve-not-closed-inconsistency-put.h @@ -1,58 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#ifndef SRC_TALER_AUDITOR_HTTPD_RESERVE_NOT_CLOSED_INCONSISTENCY_PUT_H -#define SRC_TALER_AUDITOR_HTTPD_RESERVE_NOT_CLOSED_INCONSISTENCY_PUT_H - -#include <microhttpd.h> -#include "taler-auditor-httpd.h" - -/** -* Initialize subsystem. -*/ -void -TEAH_BAD_RESERVE_NOT_CLOSED_INCONSISTENCY_init (void); - -/** -* Shut down subsystem. -*/ -void -TEAH_BAD_RESERVE_NOT_CLOSED_INCONSISTENCY_done (void); - - -/** -* Handle a "/reserve-not-closed-inconsistency" request. Parses the JSON, and, if -* successful, checks the signatures and stores the result in the DB. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ -MHD_RESULT -TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_put (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - - -#endif // SRC_TALER_AUDITOR_HTTPD_RESERVE_NOT_CLOSED_INCONSISTENCY_PUT_H diff --git a/src/auditor/taler-auditor-httpd_row-inconsistency-put.c b/src/auditor/taler-auditor-httpd_row-inconsistency-put.c @@ -1,156 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - -#include "platform.h" -#include <gnunet/gnunet_util_lib.h> -#include <gnunet/gnunet_json_lib.h> -#include <jansson.h> -#include <microhttpd.h> -#include <pthread.h> -#include "taler_json_lib.h" -#include "taler_mhd_lib.h" -#include "taler-auditor-httpd.h" -#include "taler-auditor-httpd_row-inconsistency-put.h" - - -/** - * We have parsed the JSON information about the deposit, do some - * basic sanity checks (especially that the signature on the coin is - * valid, and that this type of coin exists) and then execute the - * deposit. - * - * @param connection the MHD connection to handle - * @param dc information about the deposit confirmation - * @param es information about the exchange's signing key - * @return MHD result code - */ -static MHD_RESULT -process_inconsistency ( - struct MHD_Connection *connection, - const struct TALER_AUDITORDB_RowInconsistency *dc) -{ - enum GNUNET_DB_QueryStatus qs; - - if (GNUNET_SYSERR == - TAH_plugin->preflight (TAH_plugin->cls)) - { - GNUNET_break (0); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_SETUP_FAILED, - NULL); - } - - /* execute transaction */ - qs = TAH_plugin->insert_row_inconsistency (TAH_plugin->cls, - dc); - - - if (0 > qs) - { - GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); - TALER_LOG_WARNING ( - "Failed to store /insert-row in database\n"); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_STORE_FAILED, - "insert row"); - } - return TALER_MHD_REPLY_JSON_PACK (connection, - MHD_HTTP_OK, - GNUNET_JSON_pack_string ("status", - "INSERT_ROW_OK")); -} - - -MHD_RESULT -TAH_ROW_INCONSISTENCY_PUT_handler ( - struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) -{ - - struct TALER_AUDITORDB_RowInconsistency dc; - - struct GNUNET_JSON_Specification spec[] = { - - GNUNET_JSON_spec_string ("row_table", (const char **) &dc.row_table), - GNUNET_JSON_spec_string ("diagnostic", (const char **) &dc.diagnostic), - GNUNET_JSON_spec_end () - - }; - - - json_t *json; - - (void) rh; - (void) connection_cls; - (void) upload_data; - (void) upload_data_size; - { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json); - return MHD_NO; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json); - return MHD_YES; /* failure */ - } - } - - MHD_RESULT res; - - res = process_inconsistency (connection, &dc); - - GNUNET_JSON_parse_free (spec); - json_decref (json); - return res; - -} - - -void -TEAH_ROW_INCONSISTENCY_PUT_init (void) -{ - -} - - -void -TEAH_ROW_INCONSISTENCY_PUT_done (void) -{ - -} -\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_row-inconsistency-put.h b/src/auditor/taler-auditor-httpd_row-inconsistency-put.h @@ -1,57 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - -#ifndef SRC_TALER_AUDITOR_HTTPD_ROW_INCONSISTENCY_PUT_H -#define SRC_TALER_AUDITOR_HTTPD_ROW_INCONSISTENCY_PUT_H - - -#include <microhttpd.h> -#include "taler-auditor-httpd.h" - -/** - * Initialize subsystem. - */ -void -TEAH_ROW_INCONSISTENCY_PUT_init (void); - -/** - * Shut down subsystem. - */ -void -TEAH_ROW_INCONSISTENCY_PUT_done (void); - - -/** - * Handle a "/deposit-confirmation" request. Parses the JSON, and, if - * successful, checks the signatures and stores the result in the DB. - * - * @param rh context of the handler - * @param connection the MHD connection to handle - * @param[in,out] connection_cls the connection's closure (can be updated) - * @param upload_data upload data - * @param[in,out] upload_data_size number of bytes (left) in @a upload_data - * @return MHD result code - */ -MHD_RESULT -TAH_ROW_INCONSISTENCY_PUT_handler (struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - - -#endif // SRC_TALER_AUDITOR_HTTPD_ROW_INCONSISTENCY_PUT_H diff --git a/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-put.c b/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-put.c @@ -1,155 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#include "platform.h" -#include <gnunet/gnunet_util_lib.h> -#include <gnunet/gnunet_json_lib.h> -#include <jansson.h> -#include <microhttpd.h> -#include <pthread.h> -#include "taler_json_lib.h" -#include "taler_mhd_lib.h" -#include "taler-auditor-httpd.h" -#include "taler-auditor-httpd_row-minor-inconsistencies-put.h" - -/** -* We have parsed the JSON information about the row-minor-inconsistencies, do some -* basic sanity checks and then execute the -* transaction. -* -* @param connection the MHD connection to handle -* @param dc information about the row-minor-inconsistencies -* @return MHD result code -*/ -static MHD_RESULT -process_inconsistency ( - struct MHD_Connection *connection, - const struct TALER_AUDITORDB_RowMinorInconsistencies *dc) -{ - - enum GNUNET_DB_QueryStatus qs; - - if (GNUNET_SYSERR == - TAH_plugin->preflight (TAH_plugin->cls)) - { - GNUNET_break (0); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_SETUP_FAILED, - NULL); - } - - /* execute transaction */ - qs = TAH_plugin->insert_row_minor_inconsistencies (TAH_plugin->cls, - dc); - if (0 > qs) - { - GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); - TALER_LOG_WARNING ( - "Failed to store /row-minor-inconsistencies in database"); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_STORE_FAILED, - "row-minor-inconsistencies"); - } - return TALER_MHD_REPLY_JSON_PACK (connection, - MHD_HTTP_OK, - GNUNET_JSON_pack_string ("status", - "ROW_MINOR_INCONSISTENCIES_OK")); -} - - -MHD_RESULT -TAH_ROW_MINOR_INCONSISTENCIES_handler_put ( - struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) -{ - - struct TALER_AUDITORDB_RowMinorInconsistencies dc; - - - struct GNUNET_JSON_Specification spec[] = { - - GNUNET_JSON_spec_fixed_auto ("row_table", &dc.row_table), - GNUNET_JSON_spec_fixed_auto ("diagnostic", &dc.diagnostic), - - - GNUNET_JSON_spec_end () - }; - - - json_t *json; - - (void) rh; - (void) connection_cls; - (void) upload_data; - (void) upload_data_size; - { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json); - return MHD_NO; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json); - return MHD_YES; /* failure */ - } - } - - MHD_RESULT res; - - res = process_inconsistency (connection, &dc); - GNUNET_JSON_parse_free (spec); - - json_decref (json); - return res; - -} - - -void -TEAH_ROW_MINOR_INCONSISTENCIES_PUT_init (void) -{ - -} - - -void -TEAH_ROW_MINOR_INCONSISTENCIES_PUT_done (void) -{ - -} diff --git a/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-put.h b/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-put.h @@ -1,58 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#ifndef SRC_TALER_AUDITOR_HTTPD_ROW_MINOR_INCONSISTENCIES_PUT_H -#define SRC_TALER_AUDITOR_HTTPD_ROW_MINOR_INCONSISTENCIES_PUT_H - -#include <microhttpd.h> -#include "taler-auditor-httpd.h" - -/** -* Initialize subsystem. -*/ -void -TEAH_BAD_ROW_MINOR_INCONSISTENCIES_init (void); - -/** -* Shut down subsystem. -*/ -void -TEAH_BAD_ROW_MINOR_INCONSISTENCIES_done (void); - - -/** -* Handle a "/row-minor-inconsistencies" request. Parses the JSON, and, if -* successful, checks the signatures and stores the result in the DB. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ -MHD_RESULT -TAH_ROW_MINOR_INCONSISTENCIES_handler_put (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - - -#endif // SRC_TALER_AUDITOR_HTTPD_ROW_MINOR_INCONSISTENCIES_PUT_H diff --git a/src/auditor/taler-auditor-httpd_wire-format-inconsistency-put.c b/src/auditor/taler-auditor-httpd_wire-format-inconsistency-put.c @@ -1,156 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#include "platform.h" -#include <gnunet/gnunet_util_lib.h> -#include <gnunet/gnunet_json_lib.h> -#include <jansson.h> -#include <microhttpd.h> -#include <pthread.h> -#include "taler_json_lib.h" -#include "taler_mhd_lib.h" -#include "taler-auditor-httpd.h" -#include "taler-auditor-httpd_wire-format-inconsistency-put.h" - -/** -* We have parsed the JSON information about the wire-format-inconsistency, do some -* basic sanity checks and then execute the -* transaction. -* -* @param connection the MHD connection to handle -* @param dc information about the wire-format-inconsistency -* @return MHD result code -*/ -static MHD_RESULT -process_inconsistency ( - struct MHD_Connection *connection, - const struct TALER_AUDITORDB_WireFormatInconsistency *dc) -{ - - enum GNUNET_DB_QueryStatus qs; - - if (GNUNET_SYSERR == - TAH_plugin->preflight (TAH_plugin->cls)) - { - GNUNET_break (0); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_SETUP_FAILED, - NULL); - } - - /* execute transaction */ - qs = TAH_plugin->insert_wire_format_inconsistency (TAH_plugin->cls, - dc); - if (0 > qs) - { - GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); - TALER_LOG_WARNING ( - "Failed to store /wire-format-inconsistency in database"); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_STORE_FAILED, - "wire-format-inconsistency"); - } - return TALER_MHD_REPLY_JSON_PACK (connection, - MHD_HTTP_OK, - GNUNET_JSON_pack_string ("status", - "WIRE_FORMAT_INCONSISTENCY_OK")); -} - - -MHD_RESULT -TAH_WIRE_FORMAT_INCONSISTENCY_handler_put ( - struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) -{ - - struct TALER_AUDITORDB_WireFormatInconsistency dc; - - - struct GNUNET_JSON_Specification spec[] = { - - TALER_JSON_spec_amount ("amount", TAH_currency, &dc.amount), - GNUNET_JSON_spec_int64 ("wire_offset", &dc.wire_offset), - GNUNET_JSON_spec_fixed_auto ("diagnostic", &dc.diagnostic), - - - GNUNET_JSON_spec_end () - }; - - - json_t *json; - - (void) rh; - (void) connection_cls; - (void) upload_data; - (void) upload_data_size; - { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json); - return MHD_NO; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json); - return MHD_YES; /* failure */ - } - } - - MHD_RESULT res; - - res = process_inconsistency (connection, &dc); - GNUNET_JSON_parse_free (spec); - - json_decref (json); - return res; - -} - - -void -TEAH_WIRE_FORMAT_INCONSISTENCY_PUT_init (void) -{ - -} - - -void -TEAH_WIRE_FORMAT_INCONSISTENCY_PUT_done (void) -{ - -} diff --git a/src/auditor/taler-auditor-httpd_wire-format-inconsistency-put.h b/src/auditor/taler-auditor-httpd_wire-format-inconsistency-put.h @@ -1,58 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#ifndef SRC_TALER_AUDITOR_HTTPD_WIRE_FORMAT_INCONSISTENCY_PUT_H -#define SRC_TALER_AUDITOR_HTTPD_WIRE_FORMAT_INCONSISTENCY_PUT_H - -#include <microhttpd.h> -#include "taler-auditor-httpd.h" - -/** -* Initialize subsystem. -*/ -void -TEAH_BAD_WIRE_FORMAT_INCONSISTENCY_init (void); - -/** -* Shut down subsystem. -*/ -void -TEAH_BAD_WIRE_FORMAT_INCONSISTENCY_done (void); - - -/** -* Handle a "/wire-format-inconsistency" request. Parses the JSON, and, if -* successful, checks the signatures and stores the result in the DB. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ -MHD_RESULT -TAH_WIRE_FORMAT_INCONSISTENCY_handler_put (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - - -#endif // SRC_TALER_AUDITOR_HTTPD_WIRE_FORMAT_INCONSISTENCY_PUT_H diff --git a/src/auditor/taler-auditor-httpd_wire-out-inconsistency-put.c b/src/auditor/taler-auditor-httpd_wire-out-inconsistency-put.c @@ -1,158 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#include "platform.h" -#include <gnunet/gnunet_util_lib.h> -#include <gnunet/gnunet_json_lib.h> -#include <jansson.h> -#include <microhttpd.h> -#include <pthread.h> -#include "taler_json_lib.h" -#include "taler_mhd_lib.h" -#include "taler-auditor-httpd.h" -#include "taler-auditor-httpd_wire-out-inconsistency-put.h" - -/** -* We have parsed the JSON information about the wire-out-inconsistency, do some -* basic sanity checks and then execute the -* transaction. -* -* @param connection the MHD connection to handle -* @param dc information about the wire-out-inconsistency -* @return MHD result code -*/ -static MHD_RESULT -process_inconsistency ( - struct MHD_Connection *connection, - const struct TALER_AUDITORDB_WireOutInconsistency *dc) -{ - - enum GNUNET_DB_QueryStatus qs; - - if (GNUNET_SYSERR == - TAH_plugin->preflight (TAH_plugin->cls)) - { - GNUNET_break (0); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_SETUP_FAILED, - NULL); - } - - /* execute transaction */ - qs = TAH_plugin->insert_wire_out_inconsistency (TAH_plugin->cls, - dc); - if (0 > qs) - { - GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); - TALER_LOG_WARNING ( - "Failed to store /wire-out-inconsistency in database"); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_GENERIC_DB_STORE_FAILED, - "wire-out-inconsistency"); - } - return TALER_MHD_REPLY_JSON_PACK (connection, - MHD_HTTP_OK, - GNUNET_JSON_pack_string ("status", - "WIRE_OUT_INCONSISTENCY_OK")); -} - - -MHD_RESULT -TAH_WIRE_OUT_INCONSISTENCY_handler_put ( - struct TAH_RequestHandler *rh, - struct MHD_Connection *connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) -{ - - struct TALER_AUDITORDB_WireOutInconsistency dc; - - - struct GNUNET_JSON_Specification spec[] = { - - GNUNET_JSON_spec_string ("destination_account", (const - char **) &dc. - destination_account), - TALER_JSON_spec_amount ("expected", TAH_currency, &dc.expected), - TALER_JSON_spec_amount ("claimed", TAH_currency, &dc.claimed), - - - GNUNET_JSON_spec_end () - }; - - - json_t *json; - - (void) rh; - (void) connection_cls; - (void) upload_data; - (void) upload_data_size; - { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json); - return MHD_NO; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json); - return MHD_YES; /* failure */ - } - } - - MHD_RESULT res; - - res = process_inconsistency (connection, &dc); - GNUNET_JSON_parse_free (spec); - - json_decref (json); - return res; - -} - - -void -TEAH_WIRE_OUT_INCONSISTENCY_PUT_init (void) -{ - -} - - -void -TEAH_WIRE_OUT_INCONSISTENCY_PUT_done (void) -{ - -} diff --git a/src/auditor/taler-auditor-httpd_wire-out-inconsistency-put.h b/src/auditor/taler-auditor-httpd_wire-out-inconsistency-put.h @@ -1,58 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -#ifndef SRC_TALER_AUDITOR_HTTPD_WIRE_OUT_INCONSISTENCY_PUT_H -#define SRC_TALER_AUDITOR_HTTPD_WIRE_OUT_INCONSISTENCY_PUT_H - -#include <microhttpd.h> -#include "taler-auditor-httpd.h" - -/** -* Initialize subsystem. -*/ -void -TEAH_BAD_WIRE_OUT_INCONSISTENCY_init (void); - -/** -* Shut down subsystem. -*/ -void -TEAH_BAD_WIRE_OUT_INCONSISTENCY_done (void); - - -/** -* Handle a "/wire-out-inconsistency" request. Parses the JSON, and, if -* successful, checks the signatures and stores the result in the DB. -* -* @param rh context of the handler -* @param connection the MHD connection to handle -* @param[in,out] connection_cls the connection's closure (can be updated) -* @param upload_data upload data -* @param[in,out] upload_data_size number of bytes (left) in @a upload_data -* @return MHD result code -*/ -MHD_RESULT -TAH_WIRE_OUT_INCONSISTENCY_handler_put (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]); - - -#endif // SRC_TALER_AUDITOR_HTTPD_WIRE_OUT_INCONSISTENCY_PUT_H diff --git a/src/auditordb/pg_get_amount_arithmetic_inconsistency.h b/src/auditordb/pg_get_amount_arithmetic_inconsistency.h @@ -24,8 +24,8 @@ * Get information about deposit confirmations from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb @@ -40,4 +40,4 @@ TAH_PG_get_amount_arithmetic_inconsistency ( TALER_AUDITORDB_AmountArithmeticInconsistencyCallback cb, void *cb_cls); -#endif // SRC_PG_GET_AMOUNT_ARITHMETIC_INCONSISTENCY_H +#endif diff --git a/src/auditordb/pg_get_auditor_closure_lags.h b/src/auditordb/pg_get_auditor_closure_lags.h @@ -28,6 +28,8 @@ * @param cls the @e cls of this struct with the plugin-specific state * @param start_id row/serial ID where to start the iteration (0 from * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb @@ -42,4 +44,4 @@ TAH_PG_get_auditor_closure_lags ( TALER_AUDITORDB_ClosureLagsCallback cb, void *cb_cls); -#endif // SRC_PG_GET_AUDITOR_CLOSURE_LAGS_H +#endif diff --git a/src/auditordb/pg_get_bad_sig_losses.h b/src/auditordb/pg_get_bad_sig_losses.h @@ -25,9 +25,12 @@ * Get information about bad signature losses from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? + * @param filter_spec_pub filter by @a op_spec_pub + * @param op_spec_pub public key to filter by; FIXME: replace by pointer + * @param op operation to filter by * @param cb function to call with results * @param cb_cls closure for @a cb * @return query result status @@ -44,4 +47,4 @@ TAH_PG_get_bad_sig_losses ( TALER_AUDITORDB_BadSigLossesCallback cb, void *cb_cls); -#endif // SRC_PG_GET_BAD_SIG_LOSSES_H +#endif diff --git a/src/auditordb/pg_get_balances.h b/src/auditordb/pg_get_balances.h @@ -22,18 +22,21 @@ #include "taler_json_lib.h" #include "taler_auditordb_plugin.h" + /** * Get information about balances from the database. * * @param cls the @e cls of this struct with the plugin-specific state * @param start_id row/serial ID where to start the iteration (0 from * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? + * @param balance_key key to look for * @param cb function to call with results * @param cb_cls closure for @a cb * @return query result status */ - enum GNUNET_DB_QueryStatus TAH_PG_get_balances ( void *cls, @@ -44,4 +47,4 @@ TAH_PG_get_balances ( TALER_AUDITORDB_BalancesCallback cb, void *cb_cls); -#endif // SRC_PG_GET_BALANCES_H +#endif diff --git a/src/auditordb/pg_get_coin_inconsistency.h b/src/auditordb/pg_get_coin_inconsistency.h @@ -24,8 +24,8 @@ * Get information about deposit confirmations from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb @@ -41,4 +41,4 @@ TAH_PG_get_coin_inconsistency ( void *cb_cls); -#endif // SRC_PG_GET_COIN_INCONSISTENCY_H +#endif diff --git a/src/auditordb/pg_get_denomination_key_validity_withdraw_inconsistency.h b/src/auditordb/pg_get_denomination_key_validity_withdraw_inconsistency.h @@ -24,8 +24,8 @@ * Get information about denominations key validity withdraw inconsistency from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb @@ -40,4 +40,4 @@ TAH_PG_get_denomination_key_validity_withdraw_inconsistency ( TALER_AUDITORDB_DenominationKeyValidityWithdrawInconsistencyCallback cb, void *cb_cls); -#endif // SRC_PG_GET_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_H +#endif diff --git a/src/auditordb/pg_get_denomination_pending.h b/src/auditordb/pg_get_denomination_pending.h @@ -26,8 +26,8 @@ * Get information about denomination-pending from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb @@ -42,4 +42,4 @@ TAH_PG_get_denomination_pending ( TALER_AUDITORDB_DenominationPendingCallback cb, void *cb_cls); -#endif // SRC_PG_GET_DENOMINATION_PENDING_H +#endif diff --git a/src/auditordb/pg_get_denominations_without_sigs.h b/src/auditordb/pg_get_denominations_without_sigs.h @@ -26,8 +26,8 @@ * Get information about denominations-without-sigs from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb @@ -42,4 +42,4 @@ TAH_PG_get_denominations_without_sigs ( TALER_AUDITORDB_DenominationsWithoutSigsCallback cb, void *cb_cls); -#endif // SRC_PG_GET_DENOMINATIONS_WITHOUT_SIGS_H +#endif diff --git a/src/auditordb/pg_get_deposit_confirmations.h b/src/auditordb/pg_get_deposit_confirmations.h @@ -30,8 +30,8 @@ * Get information about deposit confirmations from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb diff --git a/src/auditordb/pg_get_emergency.h b/src/auditordb/pg_get_emergency.h @@ -24,8 +24,8 @@ * Get information about emergency from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb @@ -40,4 +40,4 @@ TAH_PG_get_emergency ( TALER_AUDITORDB_EmergencyCallback cb, void *cb_cls); -#endif // SRC_PG_GET_EMERGENCY_H +#endif diff --git a/src/auditordb/pg_get_emergency_by_count.h b/src/auditordb/pg_get_emergency_by_count.h @@ -24,8 +24,8 @@ * Get information about emergency by count from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb @@ -40,4 +40,4 @@ TAH_PG_get_emergency_by_count ( TALER_AUDITORDB_EmergenciesByCountCallback cb, void *cb_cls); -#endif // SRC_PG_GET_EMERGENCY_BY_COUNT_H +#endif diff --git a/src/auditordb/pg_get_exchange_signkeys.h b/src/auditordb/pg_get_exchange_signkeys.h @@ -26,8 +26,8 @@ * Get information about exchange-signkeys from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb @@ -42,4 +42,4 @@ TAH_PG_get_exchange_signkeys ( TALER_AUDITORDB_ExchangeSignkeysCallback cb, void *cb_cls); -#endif // SRC_PG_GET_EXCHANGE_SIGNKEYS_H +#endif diff --git a/src/auditordb/pg_get_fee_time_inconsistency.h b/src/auditordb/pg_get_fee_time_inconsistency.h @@ -24,8 +24,8 @@ * Get information about fee time inconsistency from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb @@ -40,4 +40,4 @@ TAH_PG_get_fee_time_inconsistency ( TALER_AUDITORDB_FeeTimeInconsistencyCallback cb, void *cb_cls); -#endif // SRC_PG_GET_FEE_TIME_INCONSISTENCY_H +#endif diff --git a/src/auditordb/pg_get_historic_denomination_revenue.h b/src/auditordb/pg_get_historic_denomination_revenue.h @@ -26,8 +26,8 @@ * Get information about historic-denomination-revenue from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb @@ -42,4 +42,4 @@ TAH_PG_get_historic_denomination_revenue ( TALER_AUDITORDB_HistoricDenominationRevenueCallback cb, void *cb_cls); -#endif // SRC_PG_GET_HISTORIC_DENOMINATION_REVENUE_H +#endif diff --git a/src/auditordb/pg_get_historic_reserve_summary.h b/src/auditordb/pg_get_historic_reserve_summary.h @@ -26,8 +26,8 @@ * Get information about historic-reserve-summary from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb @@ -42,4 +42,4 @@ TAH_PG_get_historic_reserve_summary ( TALER_AUDITORDB_HistoricReserveSummaryCallback cb, void *cb_cls); -#endif // SRC_PG_GET_HISTORIC_RESERVE_SUMMARY_H +#endif diff --git a/src/auditordb/pg_get_misattribution_in_inconsistency.h b/src/auditordb/pg_get_misattribution_in_inconsistency.h @@ -26,8 +26,8 @@ * Get information about misattribution-in-inconsistency from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb @@ -42,4 +42,4 @@ TAH_PG_get_misattribution_in_inconsistency ( TALER_AUDITORDB_MisattributionInInconsistencyCallback cb, void *cb_cls); -#endif // SRC_PG_GET_MISATTRIBUTION_IN_INCONSISTENCY_H +#endif diff --git a/src/auditordb/pg_get_purse_not_closed_inconsistencies.h b/src/auditordb/pg_get_purse_not_closed_inconsistencies.h @@ -24,8 +24,8 @@ * Get information about purse not closed inconsistencies from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb @@ -40,4 +40,4 @@ TAH_PG_get_purse_not_closed_inconsistencies ( TALER_AUDITORDB_PurseNotClosedInconsistenciesCallback cb, void *cb_cls); -#endif // SRC_PG_GET_PURSE_NOT_CLOSED_INCONSISTENCIES_H +#endif diff --git a/src/auditordb/pg_get_purses.h b/src/auditordb/pg_get_purses.h @@ -26,8 +26,8 @@ * Get information about purses from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb @@ -42,4 +42,4 @@ TAH_PG_get_purses ( TALER_AUDITORDB_PursesCallback cb, void *cb_cls); -#endif // SRC_PG_GET_PURSES_H +#endif diff --git a/src/auditordb/pg_get_refreshes_hanging.h b/src/auditordb/pg_get_refreshes_hanging.h @@ -24,8 +24,8 @@ * Get information about hanging refreshes from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb @@ -40,4 +40,4 @@ TAH_PG_get_refreshes_hanging ( TALER_AUDITORDB_RefreshesHangingCallback cb, void *cb_cls); -#endif // SRC_PG_GET_REFRESHES_HANGING_H +#endif diff --git a/src/auditordb/pg_get_reserve_balance_insufficient_inconsistency.h b/src/auditordb/pg_get_reserve_balance_insufficient_inconsistency.h @@ -24,8 +24,8 @@ * Get information about reserve balance insufficient inconsistency from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb @@ -40,4 +40,4 @@ TAH_PG_get_reserve_balance_insufficient_inconsistency ( TALER_AUDITORDB_ReserveBalanceInsufficientInconsistencyCallback cb, void *cb_cls); -#endif // SRC_PG_GET_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_H +#endif diff --git a/src/auditordb/pg_get_reserve_balance_summary_wrong_inconsistency.h b/src/auditordb/pg_get_reserve_balance_summary_wrong_inconsistency.h @@ -26,8 +26,8 @@ * Get information about reserve-balance-summary-wrong-inconsistency from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb @@ -42,4 +42,4 @@ TAH_PG_get_reserve_balance_summary_wrong_inconsistency ( TALER_AUDITORDB_ReserveBalanceSummaryWrongInconsistencyCallback cb, void *cb_cls); -#endif // SRC_PG_GET_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_H +#endif diff --git a/src/auditordb/pg_get_reserve_in_inconsistency.h b/src/auditordb/pg_get_reserve_in_inconsistency.h @@ -26,8 +26,8 @@ * Get information about reserve-in-inconsistency from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb @@ -42,4 +42,4 @@ TAH_PG_get_reserve_in_inconsistency ( TALER_AUDITORDB_ReserveInInconsistencyCallback cb, void *cb_cls); -#endif // SRC_PG_GET_RESERVE_IN_INCONSISTENCY_H +#endif diff --git a/src/auditordb/pg_get_reserve_not_closed_inconsistency.h b/src/auditordb/pg_get_reserve_not_closed_inconsistency.h @@ -26,8 +26,8 @@ * Get information about reserve-not-closed-inconsistency from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb @@ -42,4 +42,4 @@ TAH_PG_get_reserve_not_closed_inconsistency ( TALER_AUDITORDB_ReserveNotClosedInconsistencyCallback cb, void *cb_cls); -#endif // SRC_PG_GET_RESERVE_NOT_CLOSED_INCONSISTENCY_H +#endif diff --git a/src/auditordb/pg_get_reserves.h b/src/auditordb/pg_get_reserves.h @@ -26,8 +26,8 @@ * Get information about reserves from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb @@ -42,4 +42,4 @@ TAH_PG_get_reserves ( TALER_AUDITORDB_ReservesCallback cb, void *cb_cls); -#endif // SRC_PG_GET_RESERVES_H +#endif diff --git a/src/auditordb/pg_get_row_inconsistency.h b/src/auditordb/pg_get_row_inconsistency.h @@ -24,8 +24,8 @@ * Get information about deposit confirmations from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb @@ -41,4 +41,4 @@ TAH_PG_get_row_inconsistency ( void *cb_cls); -#endif // SRC_PG_GET_ROW_INCONSISTENCY_H +#endif diff --git a/src/auditordb/pg_get_row_minor_inconsistencies.h b/src/auditordb/pg_get_row_minor_inconsistencies.h @@ -26,8 +26,8 @@ * Get information about row-minor-inconsistencies from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb @@ -42,4 +42,4 @@ TAH_PG_get_row_minor_inconsistencies ( TALER_AUDITORDB_RowMinorInconsistenciesCallback cb, void *cb_cls); -#endif // SRC_PG_GET_ROW_MINOR_INCONSISTENCIES_H +#endif diff --git a/src/auditordb/pg_get_wire_format_inconsistency.h b/src/auditordb/pg_get_wire_format_inconsistency.h @@ -26,8 +26,8 @@ * Get information about wire-format-inconsistency from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb diff --git a/src/auditordb/pg_get_wire_out_inconsistency.h b/src/auditordb/pg_get_wire_out_inconsistency.h @@ -26,8 +26,8 @@ * Get information about wire-out-inconsistency from the database. * * @param cls the @e cls of this struct with the plugin-specific state - * @param start_id row/serial ID where to start the iteration (0 from - * the start, exclusive, i.e. serial_ids must start from 1) + * @param limit number of records to return, negative for descending + * @param offset table row to start from, exclusive, direction determined by @a limit * @param return_suppressed should suppressed rows be returned anyway? * @param cb function to call with results * @param cb_cls closure for @a cb