pg_authorize_start.h (3303B)
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_authorize_start.h 18 * @brief implementation of the authorize_start function for Postgres 19 * @author Christian Grothoff 20 * @author Bohdan Potuzhnyi 21 * @author Vlada Svirsh 22 */ 23 #ifndef PG_LOGIN_START_H 24 #define PG_LOGIN_START_H 25 26 #include <taler/taler_util.h> 27 #include <taler/taler_json_lib.h> 28 #include "challenger_database_plugin.h" 29 30 31 /** 32 * Set the user-provided address in a validation process. Updates 33 * the address and decrements the "addresses left" counter. If the 34 * address did not change, the operation is successful even without 35 * the counter change. 36 * 37 * @param cls 38 * @param nonce unique nonce to use to identify the validation 39 * @param client_id client that initiated the validation 40 * @param client_scope scope of the validation 41 * @param client_state state of the client 42 * @param client_redirect_uri where to redirect at the end, NULL to use a unique one registered for the client 43 * @param code_challenge PKCE code challenge 44 * @param code_challenge_method PKCE code challenge method enum 45 * @param[out] last_address set to the last address used 46 * @param[out] address_attempts_left set to number of address changing attempts left for this address 47 * @param[out] pin_transmissions_left set to number of times the PIN can still be re-requested 48 * @param[out] auth_attempts_left set to number of authentication attempts remaining 49 * @param[out] solved set to true if the challenge is already solved 50 * @param[out] last_tx_time set to the last time when we (presumably) send a PIN to @a last_address; 0 if never sent 51 * @return transaction status: 52 * #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT if the address was changed 53 * #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if we do not permit further changes to the address (attempts exhausted) 54 * #GNUNET_DB_STATUS_HARD_ERROR on failure 55 */ 56 enum GNUNET_DB_QueryStatus 57 CH_PG_authorize_start (void *cls, 58 const struct CHALLENGER_ValidationNonceP *nonce, 59 uint64_t client_id, 60 const char *client_scope, 61 const char *client_state, 62 const char *client_redirect_uri, 63 const char *code_challenge, 64 uint32_t code_challenge_method, 65 json_t **last_address, 66 uint32_t *address_attempts_left, 67 uint32_t *pin_transmissions_left, 68 uint32_t *auth_attempts_left, 69 bool *solved, 70 struct GNUNET_TIME_Absolute *last_tx_time); 71 72 73 #endif