merchant-0049.sql (1724B)
1 -- 2 -- This file is part of TALER 3 -- Copyright (C) 2026 Taler Systems SA 4 -- 5 -- TALER is free software; you can redistribute it and/or modify it under the 6 -- terms of the GNU General Public License as published by the Free Software 7 -- Foundation; either version 3, or (at your option) any later version. 8 -- 9 -- TALER is distributed in the hope that it will be useful, but WITHOUT ANY 10 -- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 -- A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 -- 13 -- You should have received a copy of the GNU General Public License along with 14 -- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 15 -- 16 17 -- @file merchant-0049.sql 18 -- @brief An MFA challenge has no code until a TAN was actually sent. 19 20 BEGIN; 21 22 SELECT _v.register_patch('merchant-0049', NULL, NULL); 23 24 SET search_path TO merchant; 25 26 ALTER TABLE tan_challenges 27 ALTER COLUMN code DROP NOT NULL; 28 29 COMMENT ON COLUMN tan_challenges.code 30 IS 'The TAN that was sent to the user; NULL while no TAN was sent, and then the challenge cannot be solved'; 31 32 -- Challenges created before this migration got a code that was stored 33 -- but not sent. Those that were never transmitted (retransmission_date 34 -- is still 0) must not be solvable with it. 35 UPDATE tan_challenges 36 SET code = NULL 37 WHERE retransmission_date = 0 38 AND confirmation_date IS NULL; 39 40 ALTER TABLE merchant_instances 41 ADD COLUMN earliest_password_reset INT8 NOT NULL DEFAULT 0; 42 43 COMMENT ON COLUMN merchant_instances.earliest_password_reset 44 IS 'Earliest time at which a password reset (forgot-password) may start new MFA challenges for this instance; limits how often the TAN can be guessed'; 45 46 47 COMMIT;