summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_private-post-instances-ID-auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-post-instances-ID-auth.c')
-rw-r--r--src/backend/taler-merchant-httpd_private-post-instances-ID-auth.c46
1 files changed, 40 insertions, 6 deletions
diff --git a/src/backend/taler-merchant-httpd_private-post-instances-ID-auth.c b/src/backend/taler-merchant-httpd_private-post-instances-ID-auth.c
index 8d8df93f..084310bb 100644
--- a/src/backend/taler-merchant-httpd_private-post-instances-ID-auth.c
+++ b/src/backend/taler-merchant-httpd_private-post-instances-ID-auth.c
@@ -37,19 +37,18 @@
/**
* Change the authentication settings of an instance.
*
- * @param rh context of the handler
+ * @param mi instance to modify settings of
* @param connection the MHD connection to handle
* @param[in,out] hc context with further information about the request
* @return MHD result code
*/
-MHD_RESULT
-TMH_private_post_instances_ID_auth (const struct TMH_RequestHandler *rh,
- struct MHD_Connection *connection,
- struct TMH_HandlerContext *hc)
+static MHD_RESULT
+post_instances_ID_auth (struct TMH_MerchantInstance *mi,
+ struct MHD_Connection *connection,
+ struct TMH_HandlerContext *hc)
{
struct TALER_MERCHANTDB_InstanceAuthSettings ias;
const char *auth_token = NULL;
- struct TMH_MerchantInstance *mi = hc->instance;
json_t *jauth = hc->request_body;
{
@@ -159,4 +158,39 @@ retry:
0);
}
+
+MHD_RESULT
+TMH_private_post_instances_ID_auth (const struct TMH_RequestHandler *rh,
+ struct MHD_Connection *connection,
+ struct TMH_HandlerContext *hc)
+{
+ struct TMH_MerchantInstance *mi = hc->instance;
+
+ return post_instances_ID_auth (mi,
+ connection,
+ hc);
+}
+
+
+MHD_RESULT
+TMH_private_post_instances_default_ID_auth (const struct TMH_RequestHandler *rh,
+ struct MHD_Connection *connection,
+ struct TMH_HandlerContext *hc)
+{
+ struct TMH_MerchantInstance *mi;
+
+ mi = TMH_lookup_instance (hc->infix);
+ if (NULL == mi)
+ {
+ return TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_NOT_FOUND,
+ TALER_EC_MERCHANT_GENERIC_INSTANCE_UNKNOWN,
+ hc->infix);
+ }
+ return post_instances_ID_auth (mi,
+ connection,
+ hc);
+}
+
+
/* end of taler-merchant-httpd_private-post-instances-ID-auth.c */