pg_challenge_set_address_and_pin.h (3024B)
1 /* 2 This file is part of Challenger 3 Copyright (C) 2023 Taler Systems SA 4 5 Challenger 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 Challenger 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 Challenger; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 15 */ 16 /** 17 * @file challengerdb/pg_challenge_set_address_and_pin.h 18 * @brief implementation of the challenge_set_address_and_pin function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef PG_CHALLENGE_SET_ADDRESS_AND_PIN_H 22 #define PG_CHALLENGE_SET_ADDRESS_AND_PIN_H 23 24 #include <taler/taler_util.h> 25 #include <taler/taler_json_lib.h> 26 #include "challenger_database_plugin.h" 27 28 29 /** 30 * Set the user-provided address in a validation process. Updates 31 * the address and decrements the "addresses left" counter. If the 32 * address did not change, the operation is successful even without 33 * the counter change. 34 * 35 * @param cls 36 * @param nonce unique nonce to use to identify the validation 37 * @param address the new address to validate 38 * @param validation_duration minimum time between transmissions 39 * @param[in,out] tan set to the PIN/TAN last send to @a address, input should be random PIN/TAN to use if address did not change 40 * @param[out] state set to client's OAuth2 state if available 41 * @param[out] last_tx_time set to the last time when we (presumably) send a PIN to @a address, input should be current time to use if the existing value for tx_time is past @a next_tx_time 42 * @param[out] pin_transmit set to true if we should transmit the @a last_pin to the @a address 43 * @param[out] auth_attempts_left set to number of attempts the user has left on this pin 44 * @param[out] client_redirect_uri redirection URI of the client (for reporting failures) 45 * @param[out] address_refused set to true if the address was refused (address change attempts exhausted) 46 * @param[out] solved set to true if the challenge is already solved 47 * @return transaction status: 48 * #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT if the address was changed 49 * #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if we do not permit further changes to the address (attempts exhausted) 50 * #GNUNET_DB_STATUS_HARD_ERROR on failure 51 */ 52 enum GNUNET_DB_QueryStatus 53 CH_PG_challenge_set_address_and_pin ( 54 void *cls, 55 const struct CHALLENGER_ValidationNonceP *nonce, 56 const json_t *address, 57 struct GNUNET_TIME_Relative validation_duration, 58 uint32_t *tan, 59 char **state, 60 struct GNUNET_TIME_Absolute *last_tx_time, 61 uint32_t *auth_attempts_left, 62 bool *pin_transmit, 63 char **client_redirect_uri, 64 bool *address_refused, 65 bool *solved); 66 67 #endif