get_fountain_by_secret.h (2015B)
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 src/include/merchant-database/get_fountain_by_secret.h 18 * @brief implementation of the get_fountain_by_secret function for Postgres 19 * @author Bohdan Potuzhnyi 20 */ 21 #ifndef MERCHANT_DATABASE_GET_FOUNTAIN_BY_SECRET_H 22 #define MERCHANT_DATABASE_GET_FOUNTAIN_BY_SECRET_H 23 24 #include <taler/taler_util.h> 25 #include "merchantdb_lib.h" 26 27 28 struct TALER_MERCHANTDB_PostgresContext; 29 30 /** 31 * Look up a fountain by the hash of its bearer credential. Used to 32 * authenticate wallet requests to the public fountain endpoints; a 33 * result of #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS means the credential 34 * is unknown (or the fountain was deleted) and the request must be 35 * answered with HTTP 401. 36 * 37 * @param pg database context 38 * @param instance_id instance to look up the fountain in 39 * @param h_fountain_secret hash of the fountain's bearer credential 40 * @param[out] fountain_serial set to the serial of the fountain 41 * @param[out] poll_freq set to how often wallets should re-poll 42 * the fountain info 43 * @return database result code 44 */ 45 enum GNUNET_DB_QueryStatus 46 TALER_MERCHANTDB_get_fountain_by_secret ( 47 struct TALER_MERCHANTDB_PostgresContext *pg, 48 const char *instance_id, 49 const struct GNUNET_HashCode *h_fountain_secret, 50 uint64_t *fountain_serial, 51 struct GNUNET_TIME_Relative *poll_freq); 52 53 #endif