Line data Source code
1 : /* 2 : This file is part of TALER 3 : Copyright (C) 2019, 2021 Taler Systems SA 4 : 5 : TALER is free software; you can redistribute it and/or modify it under the 6 : terms of the GNU Affero 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 Affero General Public License for more details. 12 : 13 : You should have received a copy of the GNU Affero General Public License along with 14 : TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 15 : */ 16 : /** 17 : * @file taler-exchange-httpd_terms.c 18 : * @brief Handle /terms requests to return the terms of service 19 : * @author Christian Grothoff 20 : */ 21 : #include "platform.h" 22 : #include <gnunet/gnunet_util_lib.h> 23 : #include <gnunet/gnunet_json_lib.h> 24 : #include <jansson.h> 25 : #include <microhttpd.h> 26 : #include "taler_mhd_lib.h" 27 : #include "taler-exchange-httpd_responses.h" 28 : 29 : /** 30 : * Our terms of service. 31 : */ 32 : static struct TALER_MHD_Legal *tos; 33 : 34 : 35 : /** 36 : * Our privacy policy. 37 : */ 38 : static struct TALER_MHD_Legal *pp; 39 : 40 : 41 : MHD_RESULT 42 0 : TEH_handler_terms (struct TEH_RequestContext *rc, 43 : const char *const args[]) 44 : { 45 : (void) args; 46 0 : return TALER_MHD_reply_legal (rc->connection, 47 : tos); 48 : } 49 : 50 : 51 : MHD_RESULT 52 0 : TEH_handler_privacy (struct TEH_RequestContext *rc, 53 : const char *const args[]) 54 : { 55 : (void) args; 56 0 : return TALER_MHD_reply_legal (rc->connection, 57 : pp); 58 : } 59 : 60 : 61 : void 62 0 : TEH_load_terms (const struct GNUNET_CONFIGURATION_Handle *cfg) 63 : { 64 0 : tos = TALER_MHD_legal_load (cfg, 65 : "exchange", 66 : "TERMS_DIR", 67 : "TERMS_ETAG"); 68 0 : if (NULL == tos) 69 0 : GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 70 : "Terms of service not configured\n"); 71 0 : pp = TALER_MHD_legal_load (cfg, 72 : "exchange", 73 : "PRIVACY_DIR", 74 : "PRIVACY_ETAG"); 75 0 : if (NULL == pp) 76 0 : GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 77 : "Privacy policy not configured\n"); 78 0 : } 79 : 80 : 81 : /* end of taler-exchange-httpd_terms.c */