diff options
author | priscilla <priscilla.huang@efrei.net> | 2022-11-29 08:20:03 -0500 |
---|---|---|
committer | priscilla <priscilla.huang@efrei.net> | 2022-11-29 08:20:27 -0500 |
commit | ad99fc41cd3059d2b954a0096304c2118ff57e11 (patch) | |
tree | 779a92ed388fdffe3bb370cb4b04b1224f974db8 /src/backend/taler-merchant-httpd.c | |
parent | 99211b460908a829711df078d87044fc302d7aaf (diff) |
update
Diffstat (limited to 'src/backend/taler-merchant-httpd.c')
-rw-r--r-- | src/backend/taler-merchant-httpd.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c index 95484c37..d16a55ee 100644 --- a/src/backend/taler-merchant-httpd.c +++ b/src/backend/taler-merchant-httpd.c @@ -34,12 +34,15 @@ #include "taler-merchant-httpd_get-orders-ID.h" #include "taler-merchant-httpd_get-tips-ID.h" #include "taler-merchant-httpd_mhd.h" +#include "taler-merchant-httpd_private-delete-webhooks-ID.h" #include "taler-merchant-httpd_private-delete-templates-ID.h" #include "taler-merchant-httpd_private-delete-instances-ID.h" #include "taler-merchant-httpd_private-delete-products-ID.h" #include "taler-merchant-httpd_private-delete-orders-ID.h" #include "taler-merchant-httpd_private-delete-reserves-ID.h" #include "taler-merchant-httpd_private-delete-transfers-ID.h" +#include "taler-merchant-httpd_private-get-webhooks.h" +#include "taler-merchant-httpd_private-get-webhooks-ID.h" #include "taler-merchant-httpd_private-get-templates.h" #include "taler-merchant-httpd_private-get-templates-ID.h" #include "taler-merchant-httpd_private-get-instances.h" @@ -54,10 +57,12 @@ #include "taler-merchant-httpd_private-get-tips-ID.h" #include "taler-merchant-httpd_private-get-tips.h" #include "taler-merchant-httpd_private-get-transfers.h" +#include "taler-merchant-httpd_private-patch-webhooks-ID.h" #include "taler-merchant-httpd_private-patch-templates-ID.h" #include "taler-merchant-httpd_private-patch-instances-ID.h" #include "taler-merchant-httpd_private-patch-orders-ID-forget.h" #include "taler-merchant-httpd_private-patch-products-ID.h" +#include "taler-merchant-httpd_private-post-webhooks.h" #include "taler-merchant-httpd_private-post-templates.h" #include "taler-merchant-httpd_private-post-instances.h" #include "taler-merchant-httpd_private-post-instances-ID-auth.h" @@ -1105,6 +1110,55 @@ url_handler (void *cls, }, { .url_prefix = NULL + }, + /* GET /webhooks: */ + { + .url_prefix = "/webhooks/", + .method = MHD_HTTP_METHOD_GET, + .handler = &TMH_private_get_webhooks + }, + /* POST /webhooks: */ + { + .url_prefix = "/webhooks/", + .method = MHD_HTTP_METHOD_POST, + .handler = &TMH_private_post_webhooks, + /* allow webhook data of up to 8 MB, that should be plenty; + note that exceeding #GNUNET_MAX_MALLOC_CHECKED (40 MB) + would require further changes to the allocation logic + in the code... */ + .max_upload = 1024 * 1024 * 8 + }, + /* GET /webhooks/$ID/: */ + { + .url_prefix = "/webhooks/", + .method = MHD_HTTP_METHOD_GET, + .have_id_segment = true, + .allow_deleted_instance = true, + .handler = &TMH_private_get_webhooks_ID + }, + /* DELETE /webhooks/$ID/: */ + { + .url_prefix = "/webhooks/", + .method = MHD_HTTP_METHOD_DELETE, + .have_id_segment = true, + .allow_deleted_instance = true, + .handler = &TMH_private_delete_webhooks_ID + }, + /* PATCH /webhooks/$ID/: */ + { + .url_prefix = "/webhooks/", + .method = MHD_HTTP_METHOD_PATCH, + .have_id_segment = true, + .allow_deleted_instance = true, + .handler = &TMH_private_patch_webhooks_ID, + /* allow webhook data of up to 8 MB, that should be plenty; + note that exceeding #GNUNET_MAX_MALLOC_CHECKED (40 MB) + would require further changes to the allocation logic + in the code... */ + .max_upload = 1024 * 1024 * 8 + }, + { + .url_prefix = NULL } }; struct TMH_HandlerContext *hc = *con_cls; |