validate_login_address.h (2921B)
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 src/include/challenger-database/validate_login_address.h 18 * @brief implementation of the validate_login_address function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef CHALLENGER_DATABASE_VALIDATE_LOGIN_ADDRESS_H 22 #define CHALLENGER_DATABASE_VALIDATE_LOGIN_ADDRESS_H 23 24 #include <taler/taler_util.h> 25 #include <taler/taler_json_lib.h> 26 27 struct CHALLENGERDB_PostgresContext; 28 /** 29 * Set the user-provided address in a validation process. Updates 30 * the address and decrements the "addresses left" counter. If the 31 * address did not change, the operation is successful even without 32 * the counter change. 33 * 34 * @param cls 35 * @param nonce unique nonce to use to identify the validation 36 * @param address the new address to validate 37 * @param client_scope scope of the validation 38 * @param client_state state of the client 39 * @param client_redirect_uri where to redirect at the end, NULL to use a unique one registered for the client 40 * @param[out] last_tx_time set to the last time when we (presumably) send a PIN to @a address; 0 if never sent 41 * @param[out] last_pin set to the PIN last send to @a address, 0 if never sent 42 * @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 43 * @return transaction status: 44 * #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT if the address was changed 45 * #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if we do not permit further changes to the address (attempts exhausted) 46 * #GNUNET_DB_STATUS_HARD_ERROR on failure 47 */ 48 enum GNUNET_DB_QueryStatus 49 CHALLENGERDB_validate_login_address (struct CHALLENGERDB_PostgresContext *ctx, 50 const struct CHALLENGER_ValidationNonceP *nonce, 51 const char *address, 52 const char *client_scope, 53 const char *client_state, 54 const char *client_redirect_uri, 55 struct GNUNET_TIME_Absolute *last_tx_time, 56 uint32_t *last_pin, 57 uint32_t *pin_attempts_left); 58 59 60 #endif