[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] 23/29: [age-withdraw] added handlers for age-withdraw t
From: |
gnunet |
Subject: |
[taler-exchange] 23/29: [age-withdraw] added handlers for age-withdraw to router |
Date: |
Mon, 03 Jul 2023 16:23:59 +0200 |
This is an automated email from the git hooks/post-receive script.
oec pushed a commit to branch master
in repository exchange.
commit 1be14a34161cd04c61f6df506bead0d8ca64b76d
Author: Özgür Kesim <oec-taler@kesim.org>
AuthorDate: Tue Jun 27 09:48:51 2023 +0200
[age-withdraw] added handlers for age-withdraw to router
---
src/exchange/taler-exchange-httpd.c | 52 +++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/src/exchange/taler-exchange-httpd.c
b/src/exchange/taler-exchange-httpd.c
index 348967f7..25af862b 100644
--- a/src/exchange/taler-exchange-httpd.c
+++ b/src/exchange/taler-exchange-httpd.c
@@ -30,6 +30,8 @@
#include "taler_kyclogic_lib.h"
#include "taler_templating_lib.h"
#include "taler_mhd_lib.h"
+#include "taler-exchange-httpd_age-withdraw.h"
+#include "taler-exchange-httpd_age-withdraw_reveal.h"
#include "taler-exchange-httpd_aml-decision.h"
#include "taler-exchange-httpd_auditors.h"
#include "taler-exchange-httpd_batch-deposit.h"
@@ -571,6 +573,46 @@ handle_get_aml (struct TEH_RequestContext *rc,
}
+/**
+ * Handle a "/age-withdraw/$ACH/reveal" POST request. Parses the "ACH"
+ * hash of the commitment from a previous call to
+ * /reserves/$reserve_pub/age-withdraw
+ *
+ * @param rc request context
+ * @param root uploaded JSON data
+ * @param args array of additional options
+ * @return MHD result code
+ */
+static MHD_RESULT
+handle_post_age_withdraw (struct TEH_RequestContext *rc,
+ const json_t *root,
+ const char *const args[2])
+{
+ struct TALER_AgeWithdrawCommitmentHashP ach;
+
+ if (0 != strcmp ("reveal", args[1]))
+ return r404 (rc->connection,
+ args[1]);
+
+ if (GNUNET_OK !=
+ GNUNET_STRINGS_string_to_data (args[0],
+ strlen (args[0]),
+ &ach,
+ sizeof (ach)))
+ {
+ GNUNET_break_op (0);
+ return TALER_MHD_reply_with_error (rc->connection,
+ MHD_HTTP_BAD_REQUEST,
+ TALER_EC_GENERIC_RESERVE_PUB_MALFORMED,
+ args[0]);
+ }
+
+ return TEH_handler_age_withdraw_reveal (rc,
+ &ach,
+ root);
+}
+
+
/**
* Signature of functions that handle operations on reserves.
*
@@ -617,6 +659,10 @@ handle_post_reserves (struct TEH_RequestContext *rc,
.op = "batch-withdraw",
.handler = &TEH_handler_batch_withdraw
},
+ {
+ .op = "age-withdraw",
+ .handler = &TEH_handler_age_withdraw
+ },
{
.op = "withdraw",
.handler = &TEH_handler_withdraw
@@ -1454,6 +1500,12 @@ handle_mhd_request (void *cls,
.handler.post = &handle_post_reserves,
.nargs = 2
},
+ {
+ .url = "age-withdraw",
+ .method = MHD_HTTP_METHOD_POST,
+ .handler.post = &handle_post_age_withdraw,
+ .nargs = 2
+ },
{
.url = "reserves-attest",
.method = MHD_HTTP_METHOD_GET,
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-exchange] 10/29: Merge branch 'master' into age-withdraw, (continued)
- [taler-exchange] 10/29: Merge branch 'master' into age-withdraw, gnunet, 2023/07/03
- [taler-exchange] 14/29: -comment updates, gnunet, 2023/07/03
- [taler-exchange] 19/29: added birthdate parser, gnunet, 2023/07/03
- [taler-exchange] 18/29: -fixed typos, gnunet, 2023/07/03
- [taler-exchange] 09/29: Merge branch 'master' into age-withdraw, gnunet, 2023/07/03
- [taler-exchange] 17/29: add exchange_do_age_withdraw.sql, gnunet, 2023/07/03
- [taler-exchange] 20/29: -fix parameter in stored procedures, gnunet, 2023/07/03
- [taler-exchange] 13/29: Merge branch 'master' into age-withdraw-merge, gnunet, 2023/07/03
- [taler-exchange] 16/29: -ruuid not needed, gnunet, 2023/07/03
- [taler-exchange] 15/29: -free spec, gnunet, 2023/07/03
- [taler-exchange] 23/29: [age-withdraw] added handlers for age-withdraw to router,
gnunet <=
- [taler-exchange] 29/29: Merge branch 'master' into age-withdraw, gnunet, 2023/07/03
- [taler-exchange] 28/29: [age-withdraw] added library function for age-withdraw, gnunet, 2023/07/03
- [taler-exchange] 27/29: added TALER_adult_age(struct TALER_AgeMask *mask), gnunet, 2023/07/03
- [taler-exchange] 12/29: [age-withdraw] age-withdraw commit- and reveal-handlers implemented, 12/n, gnunet, 2023/07/03
- [taler-exchange] 22/29: -rename variable, gnunet, 2023/07/03
- [taler-exchange] 25/29: [auditor] use the date for the report-directory, gnunet, 2023/07/03
- [taler-exchange] 26/29: -update author, gnunet, 2023/07/03
- [taler-exchange] 21/29: -fix typo, gnunet, 2023/07/03
- [taler-exchange] 24/29: [testing] start an oauth2 server which returns static birthdates, gnunet, 2023/07/03