exchange

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

commit 6a994eb595f4aa7bb5b015560119ec99238579ab
parent 2798ee705e84032ad4ec3c3ae14a6edb1d823f7d
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon, 23 Mar 2026 18:31:45 +0100

merge b11169

Diffstat:
Mbootstrap | 2+-
Msrc/exchangedb/.gitignore | 2++
Asrc/exchangedb/0010-wire_accounts.sql | 39+++++++++++++++++++++++++++++++++++++++
Msrc/exchangedb/Makefile.am | 10+++++++++-
Dsrc/exchangedb/exchange-0009.sql | 44--------------------------------------------
Asrc/exchangedb/exchange-0010.sql.in | 24++++++++++++++++++++++++
6 files changed, 75 insertions(+), 46 deletions(-)

diff --git a/bootstrap b/bootstrap @@ -27,7 +27,7 @@ existence() } # Freeze SQL files that must no longer be edited. -for n in 0001 0002 0003 0004 0005 0006 0007 0008 0009 +for n in 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 do chmod -w src/exchangedb/exchange-$n.sql* chmod -w src/exchangedb/$n-*.sql &> /dev/null || true diff --git a/src/exchangedb/.gitignore b/src/exchangedb/.gitignore @@ -14,3 +14,5 @@ test-exchangedb-populate-link-data-postgres test-exchangedb-populate-ready-deposit-postgres test-exchangedb-populate-select-refunds-by-coin-postgres exchange-0004.sql +exchange-0010.sql +exchange-0009.sql diff --git a/src/exchangedb/0010-wire_accounts.sql b/src/exchangedb/0010-wire_accounts.sql @@ -0,0 +1,39 @@ +-- +-- This file is part of TALER +-- Copyright (C) 2026 Taler Systems SA +-- +-- TALER is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 3, or (at your option) any later version. +-- +-- TALER is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +-- A PARTICULAR PURPOSE. See the GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along with +-- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> +-- + +ALTER TABLE wire_accounts + ADD COLUMN open_banking_gateway + TEXT DEFAULT (NULL) + ,ADD COLUMN wire_transfer_gateway + TEXT DEFAULT (NULL) + ,ADD COLUMN sig_version + INT4 DEFAULT 33; -- all existing entries are <= v33 +COMMENT ON COLUMN wire_accounts.open_banking_gateway + IS 'URL of an open banking gateway that can be used to initiate wire transfers to this account; NULL if there is no such service.'; +COMMENT ON COLUMN wire_accounts.wire_transfer_gateway + IS 'URL of a wire transfer gateway that can be used to obtain (short) wire transfer subjects; NULL if there is no such service.'; +COMMENT ON COLUMN wire_accounts.sig_version + IS 'Protocol version used by the master_sig in this column. Used to tell which algorithm is needed to verify the signature.'; + +-- The master_sig changes in protocol v33, hence deactivate all old +-- signatures/accounts. +UPDATE wire_accounts + SET is_active=FALSE + WHERE sig_version<34; + +-- New signatures will follow protocol >= v34 +ALTER TABLE wire_accounts + ALTER COLUMN sig_version SET DEFAULT 34; diff --git a/src/exchangedb/Makefile.am b/src/exchangedb/Makefile.am @@ -29,7 +29,8 @@ sqlinputs = \ 0002-*.sql \ 0003-*.sql \ 0004-*.sql \ - 0009-*.sql + 0009-*.sql \ + 0010-*.sql sql_DATA = \ benchmark-0001.sql \ @@ -44,6 +45,7 @@ sql_DATA = \ exchange-0007.sql \ exchange-0008.sql \ exchange-0009.sql \ + exchange-0010.sql \ drop.sql \ procedures.sql \ tops-0001.sql @@ -59,6 +61,7 @@ CLEANFILES = \ exchange-0003.sql \ exchange-0004.sql \ exchange-0009.sql \ + exchange-0010.sql \ procedures.sql procedures.sql: procedures.sql.in exchange_do_*.sql exchange_statistics_*.sql exchange_trigger_*.sql @@ -86,6 +89,11 @@ exchange-0009.sql: exchange-0009.sql.in 0009-*.sql gcc -E -P -undef - < exchange-0009.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@ chmod ugo-w $@ +exchange-0010.sql: exchange-0010.sql.in 0010-*.sql + chmod +w $@ 2> /dev/null || true + gcc -E -P -undef - < exchange-0010.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@ + chmod ugo-w $@ + check_SCRIPTS = \ test_idempotency.sh diff --git a/src/exchangedb/exchange-0009.sql b/src/exchangedb/exchange-0009.sql @@ -1,44 +0,0 @@ --- --- This file is part of TALER --- Copyright (C) 2026 Taler Systems SA --- --- TALER is free software; you can redistribute it and/or modify it under the --- terms of the GNU General Public License as published by the Free Software --- Foundation; either version 3, or (at your option) any later version. --- --- TALER is distributed in the hope that it will be useful, but WITHOUT ANY --- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR --- A PARTICULAR PURPOSE. See the GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License along with --- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> --- - -BEGIN; - -SELECT _v.register_patch('exchange-0009', NULL, NULL); - -SET search_path TO exchange; - -ALTER TABLE wire_accounts - ADD COLUMN open_banking_gateway - TEXT DEFAULT (NULL) - ,ADD COLUMN wire_transfer_gateway - TEXT DEFAULT (NULL) - ,ADD COLUMN sig_version - INT4 DEFAULT 33; -COMMENT ON COLUMN wire_accounts.open_banking_gateway - IS 'URL of an open banking gateway that can be used to initiate wire transfers to this account; NULL if there is no such service.'; -COMMENT ON COLUMN wire_accounts.wire_transfer_gateway - IS 'URL of a wire transfer gateway that can be used to obtain (short) wire transfer subjects; NULL if there is no such service.'; -COMMENT ON COLUMN wire_accounts.sig_version - IS 'Protocol version used by the master_sig in this column. Used to tell which algorithm is needed to verify the signature.'; - --- The master_sig changes in protocol v33, hence deactivate all old --- signatures/accounts. -UPDATE wire_accounts - SET is_active=FALSE - ,sig_version=32; - - -COMMIT; diff --git a/src/exchangedb/exchange-0010.sql.in b/src/exchangedb/exchange-0010.sql.in @@ -0,0 +1,24 @@ +-- +-- This file is part of TALER +-- Copyright (C) 2026 Taler Systems SA +-- +-- TALER is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 3, or (at your option) any later version. +-- +-- TALER is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +-- A PARTICULAR PURPOSE. See the GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along with +-- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> +-- + +BEGIN; + +SELECT _v.register_patch('exchange-0010', NULL, NULL); +SET search_path TO exchange; + +#include "0010-wire_accounts.sql" + +COMMIT;