pg_validate_login_address.h (2837B)
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_validate_login_address.h 18 * @brief implementation of the validate_login_address function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef PG_VALIDATE_LOGIN_ADDRESS_H 22 #define PG_VALIDATE_LOGIN_ADDRESS_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 client_scope scope of the validation 39 * @param client_state state of the client 40 * @param client_redirect_uri where to redirect at the end, NULL to use a unique one registered for the client 41 * @param[out] last_tx_time set to the last time when we (presumably) send a PIN to @a address; 0 if never sent 42 * @param[out] last_pin set to the PIN last send to @a address, 0 if never sent 43 * @param[in,out] pin_attempts_left set to number of PIN transmission attempts left for this address; input is value to be used if address is new, output is possibly different if address was not new 44 * @return transaction status: 45 * #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT if the address was changed 46 * #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if we do not permit further changes to the address (attempts exhausted) 47 * #GNUNET_DB_STATUS_HARD_ERROR on failure 48 */ 49 enum GNUNET_DB_QueryStatus 50 CH_PG_validate_login_address (void *cls, 51 const struct CHALLENGER_ValidationNonceP *nonce, 52 const char *address, 53 const char *client_scope, 54 const char *client_state, 55 const char *client_redirect_uri, 56 struct GNUNET_TIME_Absolute *last_tx_time, 57 uint32_t *last_pin, 58 uint32_t *pin_attempts_left); 59 60 61 #endif