gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: expose new endpoint functions vi


From: gnunet
Subject: [taler-exchange] branch master updated: expose new endpoint functions via headers
Date: Mon, 30 Nov 2020 23:43:18 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 862054f6 expose new endpoint functions via headers
862054f6 is described below

commit 862054f6f2e9a08ccc051343d0dacde992ea1611
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon Nov 30 23:43:16 2020 +0100

    expose new endpoint functions via headers
---
 src/exchange/Makefile.am                           |   3 +-
 src/exchange/taler-exchange-httpd_auditors.c       |  10 +-
 src/exchange/taler-exchange-httpd_auditors.h       |  46 +++++++
 src/exchange/taler-exchange-httpd_management.h     | 141 +++++++++++++++++++++
 .../taler-exchange-httpd_management_auditors.c     |  10 +-
 ...exchange-httpd_management_auditors_AP_disable.c |  10 +-
 ...nge-httpd_management_denominations_HDP_revoke.c |  10 +-
 .../taler-exchange-httpd_management_post_keys.c    |   9 +-
 ...r-exchange-httpd_management_signkey_EP_revoke.c |   9 +-
 .../taler-exchange-httpd_management_wire.c         |   8 +-
 .../taler-exchange-httpd_management_wire_disable.c |   9 +-
 .../taler-exchange-httpd_management_wire_fees.c    |   8 +-
 12 files changed, 198 insertions(+), 75 deletions(-)

diff --git a/src/exchange/Makefile.am b/src/exchange/Makefile.am
index a2a9840f..bd7377a2 100644
--- a/src/exchange/Makefile.am
+++ b/src/exchange/Makefile.am
@@ -78,12 +78,13 @@ taler_exchange_transfer_LDADD = \
 
 taler_exchange_httpd_SOURCES = \
   taler-exchange-httpd.c taler-exchange-httpd.h \
-  taler-exchange-httpd_auditors.c \
+  taler-exchange-httpd_auditors.c taler-exchange-httpd_auditors.h \
   taler-exchange-httpd_db.c taler-exchange-httpd_db.h \
   taler-exchange-httpd_deposit.c taler-exchange-httpd_deposit.h \
   taler-exchange-httpd_deposits_get.c taler-exchange-httpd_deposits_get.h \
   taler-exchange-httpd_keystate.c taler-exchange-httpd_keystate.h \
   taler-exchange-httpd_link.c taler-exchange-httpd_link.h \
+  taler-exchange-httpd_management.h \
   taler-exchange-httpd_management_auditors.c \
   taler-exchange-httpd_management_auditors_AP_disable.c \
   taler-exchange-httpd_management_denominations_HDP_revoke.c \
diff --git a/src/exchange/taler-exchange-httpd_auditors.c 
b/src/exchange/taler-exchange-httpd_auditors.c
index 3833a201..60c633cf 100644
--- a/src/exchange/taler-exchange-httpd_auditors.c
+++ b/src/exchange/taler-exchange-httpd_auditors.c
@@ -27,6 +27,7 @@
 #include "taler_json_lib.h"
 #include "taler_mhd_lib.h"
 #include "taler_signatures.h"
+#include "taler-exchange-httpd_auditors.h"
 #include "taler-exchange-httpd_responses.h"
 
 
@@ -207,15 +208,6 @@ add_auditor_denom_sig (void *cls,
 }
 
 
-/**
- * Handle a "/auditors/$AUDITOR_PUB/$H_DENOM_PUB" request.
- *
- * @param connection the MHD connection to handle
- * @param root uploaded JSON data
- * @param auditor_pub public key of the auditor
- * @param h_denom_pub hash of the denomination public key
- * @return MHD result code
- */
 MHD_RESULT
 TEH_handler_management_denominations_auditors (
   struct MHD_Connection *connection,
diff --git a/src/exchange/taler-exchange-httpd_auditors.h 
b/src/exchange/taler-exchange-httpd_auditors.h
new file mode 100644
index 00000000..de180587
--- /dev/null
+++ b/src/exchange/taler-exchange-httpd_auditors.h
@@ -0,0 +1,46 @@
+/*
+  This file is part of TALER
+  Copyright (C) 2020 Taler Systems SA
+
+  TALER is free software; you can redistribute it and/or modify it under the
+  terms of the GNU Affero General Public License as published by the Free 
Software
+  Foundation; either version 3, or (at your option) any later version.
+
+  TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+  A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more 
details.
+
+  You should have received a copy of the GNU Affero General Public License 
along with
+  TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+*/
+/**
+ * @file taler-exchange-httpd_auditors.h
+ * @brief Handlers for the /auditors/ endpoints
+ * @author Christian Grothoff
+ */
+#ifndef TALER_EXCHANGE_HTTPD_AUDITORS_H
+#define TALER_EXCHANGE_HTTPD_AUDITORS_H
+
+#include <gnunet/gnunet_util_lib.h>
+#include <microhttpd.h>
+#include "taler-exchange-httpd.h"
+
+
+/**
+ * Handle a "/auditors/$AUDITOR_PUB/$H_DENOM_PUB" request.
+ *
+ * @param connection the MHD connection to handle
+ * @param root uploaded JSON data
+ * @param auditor_pub public key of the auditor
+ * @param h_denom_pub hash of the denomination public key
+ * @return MHD result code
+ */
+MHD_RESULT
+TEH_handler_management_denominations_auditors (
+  struct MHD_Connection *connection,
+  const struct TALER_AuditorPublicKeyP *auditor_pub,
+  const struct GNUNET_HashCode *h_denom_pub,
+  const json_t *root);
+
+
+#endif
diff --git a/src/exchange/taler-exchange-httpd_management.h 
b/src/exchange/taler-exchange-httpd_management.h
new file mode 100644
index 00000000..cd5c5d8a
--- /dev/null
+++ b/src/exchange/taler-exchange-httpd_management.h
@@ -0,0 +1,141 @@
+/*
+  This file is part of TALER
+  Copyright (C) 2020 Taler Systems SA
+
+  TALER is free software; you can redistribute it and/or modify it under the
+  terms of the GNU Affero General Public License as published by the Free 
Software
+  Foundation; either version 3, or (at your option) any later version.
+
+  TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+  A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more 
details.
+
+  You should have received a copy of the GNU Affero General Public License 
along with
+  TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+*/
+/**
+ * @file taler-exchange-httpd_management.h
+ * @brief Handlers for the /management/ endpoints
+ * @author Christian Grothoff
+ */
+#ifndef TALER_EXCHANGE_HTTPD_MANAGEMENT_H
+#define TALER_EXCHANGE_HTTPD_MANAGEMENT_H
+
+#include <gnunet/gnunet_util_lib.h>
+#include <microhttpd.h>
+#include "taler-exchange-httpd.h"
+
+/**
+ * Handle a "/management/auditors" request.
+ *
+ * @param connection the MHD connection to handle
+ * @param h_denom_pub hash of the public key of the denomination to revoke
+ * @param root uploaded JSON data
+ * @return MHD result code
+ */
+MHD_RESULT
+TEH_handler_management_auditors (
+  struct MHD_Connection *connection,
+  const struct GNUNET_HashCode *h_denom_pub,
+  const json_t *root);
+
+
+/**
+ * Handle a "/management/auditors/$AUDITOR_PUB/disable" request.
+ *
+ * @param connection the MHD connection to handle
+ * @param h_denom_pub hash of the public key of the denomination to revoke
+ * @param root uploaded JSON data
+ * @return MHD result code
+ */
+MHD_RESULT
+TEH_handler_management_auditors_AP_disable (
+  struct MHD_Connection *connection,
+  const struct GNUNET_HashCode *h_denom_pub,
+  const json_t *root);
+
+
+/**
+ * Handle a "/management/denominations/$HDP/revoke" request.
+ *
+ * @param connection the MHD connection to handle
+ * @param h_denom_pub hash of the public key of the denomination to revoke
+ * @param root uploaded JSON data
+ * @return MHD result code
+ */
+MHD_RESULT
+TEH_handler_management_denominations_HDP_revoke (
+  struct MHD_Connection *connection,
+  const struct GNUNET_HashCode *h_denom_pub,
+  const json_t *root);
+
+
+/**
+ * Handle a "/management/signkeys/$EP/revoke" request.
+ *
+ * @param connection the MHD connection to handle
+ * @param exchange_pub exchange online signing public key to revoke
+ * @param root uploaded JSON data
+ * @return MHD result code
+  */
+MHD_RESULT
+TEH_handler_management_signkeys_EP_revoke (
+  struct MHD_Connection *connection,
+  const struct TALER_ExchangePublicKeyP *exchange_pub,
+  const json_t *root);
+
+
+/**
+ * Handle a POST "/management/keys" request.
+ *
+ * @param connection the MHD connection to handle
+ * @param h_denom_pub hash of the public key of the denomination to revoke
+ * @param root uploaded JSON data
+ * @return MHD result code
+ */
+MHD_RESULT
+TEH_handler_management_post_keys (
+  struct MHD_Connection *connection,
+  const struct GNUNET_HashCode *h_denom_pub,
+  const json_t *root);
+
+/**
+ * Handle a "/management/wire" request.
+ *
+ * @param connection the MHD connection to handle
+ * @param root uploaded JSON data
+ * @return MHD result code
+ */
+MHD_RESULT
+TEH_handler_management_denominations_wire (
+  struct MHD_Connection *connection,
+  const json_t *root);
+
+
+/**
+ * Handle a "/management/wire" request.
+ *
+ * @param connection the MHD connection to handle
+ * @param root uploaded JSON data
+ * @return MHD result code
+ */
+MHD_RESULT
+TEH_handler_management_denominations_wire_disable (
+  struct MHD_Connection *connection,
+  const json_t *root);
+
+
+/**
+ * Handle a POST "/management/wire-fees" request.
+ *
+ * @param connection the MHD connection to handle
+ * @param root uploaded JSON data
+ * @return MHD result code
+ */
+MHD_RESULT
+TEH_handler_management_post_wire_fees (
+  struct MHD_Connection *connection,
+  const json_t *root);
+
+
+#endif
diff --git a/src/exchange/taler-exchange-httpd_management_auditors.c 
b/src/exchange/taler-exchange-httpd_management_auditors.c
index c794c987..02e4d4fa 100644
--- a/src/exchange/taler-exchange-httpd_management_auditors.c
+++ b/src/exchange/taler-exchange-httpd_management_auditors.c
@@ -26,7 +26,7 @@
 #include <pthread.h>
 #include "taler_json_lib.h"
 #include "taler_mhd_lib.h"
-#include "taler-exchange-httpd_refund.h"
+#include "taler-exchange-httpd_management.h"
 #include "taler-exchange-httpd_responses.h"
 #include "taler-exchange-httpd_keystate.h"
 
@@ -142,14 +142,6 @@ add_auditor (void *cls,
 }
 
 
-/**
- * Handle a "/management/auditors" request.
- *
- * @param connection the MHD connection to handle
- * @param h_denom_pub hash of the public key of the denomination to revoke
- * @param root uploaded JSON data
- * @return MHD result code
- */
 MHD_RESULT
 TEH_handler_management_auditors (
   struct MHD_Connection *connection,
diff --git a/src/exchange/taler-exchange-httpd_management_auditors_AP_disable.c 
b/src/exchange/taler-exchange-httpd_management_auditors_AP_disable.c
index 0a1d2c54..8904b444 100644
--- a/src/exchange/taler-exchange-httpd_management_auditors_AP_disable.c
+++ b/src/exchange/taler-exchange-httpd_management_auditors_AP_disable.c
@@ -26,7 +26,7 @@
 #include <pthread.h>
 #include "taler_json_lib.h"
 #include "taler_mhd_lib.h"
-#include "taler-exchange-httpd_refund.h"
+#include "taler-exchange-httpd_management.h"
 #include "taler-exchange-httpd_responses.h"
 #include "taler-exchange-httpd_keystate.h"
 
@@ -134,14 +134,6 @@ del_auditor (void *cls,
 }
 
 
-/**
- * Handle a "/management/auditors/$AUDITOR_PUB/disable" request.
- *
- * @param connection the MHD connection to handle
- * @param h_denom_pub hash of the public key of the denomination to revoke
- * @param root uploaded JSON data
- * @return MHD result code
- */
 MHD_RESULT
 TEH_handler_management_auditors_AP_disable (
   struct MHD_Connection *connection,
diff --git 
a/src/exchange/taler-exchange-httpd_management_denominations_HDP_revoke.c 
b/src/exchange/taler-exchange-httpd_management_denominations_HDP_revoke.c
index bd4b5f34..eade5cd1 100644
--- a/src/exchange/taler-exchange-httpd_management_denominations_HDP_revoke.c
+++ b/src/exchange/taler-exchange-httpd_management_denominations_HDP_revoke.c
@@ -26,19 +26,11 @@
 #include <pthread.h>
 #include "taler_json_lib.h"
 #include "taler_mhd_lib.h"
-#include "taler-exchange-httpd_refund.h"
+#include "taler-exchange-httpd_management.h"
 #include "taler-exchange-httpd_responses.h"
 #include "taler-exchange-httpd_keystate.h"
 
 
-/**
- * Handle a "/management/denominations/$HDP/revoke" request.
- *
- * @param connection the MHD connection to handle
- * @param h_denom_pub hash of the public key of the denomination to revoke
- * @param root uploaded JSON data
- * @return MHD result code
-  */
 MHD_RESULT
 TEH_handler_management_denominations_HDP_revoke (
   struct MHD_Connection *connection,
diff --git a/src/exchange/taler-exchange-httpd_management_post_keys.c 
b/src/exchange/taler-exchange-httpd_management_post_keys.c
index c663a8b4..ab4399bd 100644
--- a/src/exchange/taler-exchange-httpd_management_post_keys.c
+++ b/src/exchange/taler-exchange-httpd_management_post_keys.c
@@ -27,6 +27,7 @@
 #include "taler_json_lib.h"
 #include "taler_mhd_lib.h"
 #include "taler_signatures.h"
+#include "taler-exchange-httpd_management.h"
 #include "taler-exchange-httpd_responses.h"
 
 
@@ -319,14 +320,6 @@ add_keys (void *cls,
 }
 
 
-/**
- * Handle a POST "/management/keys" request.
- *
- * @param connection the MHD connection to handle
- * @param h_denom_pub hash of the public key of the denomination to revoke
- * @param root uploaded JSON data
- * @return MHD result code
- */
 MHD_RESULT
 TEH_handler_management_post_keys (
   struct MHD_Connection *connection,
diff --git a/src/exchange/taler-exchange-httpd_management_signkey_EP_revoke.c 
b/src/exchange/taler-exchange-httpd_management_signkey_EP_revoke.c
index bbe3ae10..63a4f0c6 100644
--- a/src/exchange/taler-exchange-httpd_management_signkey_EP_revoke.c
+++ b/src/exchange/taler-exchange-httpd_management_signkey_EP_revoke.c
@@ -26,18 +26,11 @@
 #include <pthread.h>
 #include "taler_json_lib.h"
 #include "taler_mhd_lib.h"
+#include "taler-exchange-httpd_management.h"
 #include "taler-exchange-httpd_responses.h"
 #include "taler-exchange-httpd_keystate.h"
 
 
-/**
- * Handle a "/management/signkeys/$EP/revoke" request.
- *
- * @param connection the MHD connection to handle
- * @param exchange_pub exchange online signing public key to revoke
- * @param root uploaded JSON data
- * @return MHD result code
-  */
 MHD_RESULT
 TEH_handler_management_signkeys_EP_revoke (
   struct MHD_Connection *connection,
diff --git a/src/exchange/taler-exchange-httpd_management_wire.c 
b/src/exchange/taler-exchange-httpd_management_wire.c
index 812570fc..b684a107 100644
--- a/src/exchange/taler-exchange-httpd_management_wire.c
+++ b/src/exchange/taler-exchange-httpd_management_wire.c
@@ -27,6 +27,7 @@
 #include "taler_json_lib.h"
 #include "taler_mhd_lib.h"
 #include "taler_signatures.h"
+#include "taler-exchange-httpd_management.h"
 #include "taler-exchange-httpd_responses.h"
 
 
@@ -136,13 +137,6 @@ add_wire (void *cls,
 }
 
 
-/**
- * Handle a "/management/wire" request.
- *
- * @param connection the MHD connection to handle
- * @param root uploaded JSON data
- * @return MHD result code
- */
 MHD_RESULT
 TEH_handler_management_denominations_wire (
   struct MHD_Connection *connection,
diff --git a/src/exchange/taler-exchange-httpd_management_wire_disable.c 
b/src/exchange/taler-exchange-httpd_management_wire_disable.c
index 19a30fc2..d869d54d 100644
--- a/src/exchange/taler-exchange-httpd_management_wire_disable.c
+++ b/src/exchange/taler-exchange-httpd_management_wire_disable.c
@@ -26,7 +26,7 @@
 #include <pthread.h>
 #include "taler_json_lib.h"
 #include "taler_mhd_lib.h"
-#include "taler-exchange-httpd_refund.h"
+#include "taler-exchange-httpd_management.h"
 #include "taler-exchange-httpd_responses.h"
 #include "taler-exchange-httpd_keystate.h"
 
@@ -132,13 +132,6 @@ del_wire (void *cls,
 }
 
 
-/**
- * Handle a "/management/wire" request.
- *
- * @param connection the MHD connection to handle
- * @param root uploaded JSON data
- * @return MHD result code
- */
 MHD_RESULT
 TEH_handler_management_denominations_wire_disable (
   struct MHD_Connection *connection,
diff --git a/src/exchange/taler-exchange-httpd_management_wire_fees.c 
b/src/exchange/taler-exchange-httpd_management_wire_fees.c
index c126f056..3ec262cf 100644
--- a/src/exchange/taler-exchange-httpd_management_wire_fees.c
+++ b/src/exchange/taler-exchange-httpd_management_wire_fees.c
@@ -27,6 +27,7 @@
 #include "taler_json_lib.h"
 #include "taler_mhd_lib.h"
 #include "taler_signatures.h"
+#include "taler-exchange-httpd_management.h"
 #include "taler-exchange-httpd_responses.h"
 
 
@@ -162,13 +163,6 @@ add_fee (void *cls,
 }
 
 
-/**
- * Handle a POST "/management/wire-fees" request.
- *
- * @param connection the MHD connection to handle
- * @param root uploaded JSON data
- * @return MHD result code
- */
 MHD_RESULT
 TEH_handler_management_post_wire_fees (
   struct MHD_Connection *connection,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]