summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-04-19 01:07:38 +0200
committerChristian Grothoff <christian@grothoff.org>2020-04-19 01:07:38 +0200
commitd5f14ec8e71bf4bc983535dc74b7af04d651da45 (patch)
treece6edf34c92cb3dae9062bc62f0bfcd394821cc7 /src
parente93a9431facf52909c79f61b978db339a8c9ac11 (diff)
downloadmerchant-d5f14ec8e71bf4bc983535dc74b7af04d651da45.tar.gz
merchant-d5f14ec8e71bf4bc983535dc74b7af04d651da45.tar.bz2
merchant-d5f14ec8e71bf4bc983535dc74b7af04d651da45.zip
start on DELETE instance
Diffstat (limited to 'src')
-rw-r--r--src/backend/Makefile.am2
-rw-r--r--src/backend/taler-merchant-httpd.c3
-rw-r--r--src/backenddb/plugin_merchantdb_postgres.c30
-rw-r--r--src/include/taler_merchantdb_plugin.h26
4 files changed, 60 insertions, 1 deletions
diff --git a/src/backend/Makefile.am b/src/backend/Makefile.am
index 025ac4cb..fb178799 100644
--- a/src/backend/Makefile.am
+++ b/src/backend/Makefile.am
@@ -23,6 +23,8 @@ taler_merchant_httpd_SOURCES = \
taler-merchant-httpd_config.c taler-merchant-httpd_config.h \
taler-merchant-httpd_exchanges.c taler-merchant-httpd_exchanges.h \
taler-merchant-httpd_mhd.c taler-merchant-httpd_mhd.h \
+ taler-merchant-httpd_private-delete-instances-ID.c \
+ taler-merchant-httpd_private-delete-instances-ID.h \
taler-merchant-httpd_private-get-instances.c \
taler-merchant-httpd_private-get-instances.h \
taler-merchant-httpd_private-get-instances-ID.c \
diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c
index 7f6d4dde..fead294d 100644
--- a/src/backend/taler-merchant-httpd.c
+++ b/src/backend/taler-merchant-httpd.c
@@ -28,6 +28,7 @@
#include "taler-merchant-httpd_config.h"
#include "taler-merchant-httpd_exchanges.h"
#include "taler-merchant-httpd_mhd.h"
+#include "taler-merchant-httpd_private-delete-instances-ID.h"
#include "taler-merchant-httpd_private-get-instances.h"
#include "taler-merchant-httpd_private-get-instances-ID.h"
#include "taler-merchant-httpd_private-post-instances.h"
@@ -735,13 +736,13 @@ url_handler (void *cls,
.method = MHD_HTTP_METHOD_GET,
.handler = &TMH_private_get_instances_ID
},
-#if 0
/* DELETE /instances/$ID/: */
{
.url_prefix = "/",
.method = MHD_HTTP_METHOD_DELETE,
.handler = &TMH_private_delete_instances_ID
},
+#if 0
/* PATCH /instances/$ID/: */
{
.url_prefix = "/",
diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c
index f9cdcad5..ecc47975 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -606,6 +606,36 @@ postgres_insert_account (
}
+/**
+ * Delete private key of an instance from our database.
+ *
+ * @param cls closure
+ * @param merchant_pub public key of the instance
+ * @return database result code
+ */
+static enum GNUNET_DB_QueryStatus
+postgres_delete_instance_private_key (
+ void *cls,
+ const struct TALER_MerchantPublicKeyP *merchant_pub)
+{
+}
+
+
+/**
+ * Purge an instance and all associated information from our database.
+ * Highly likely to cause undesired data loss. Use with caution.
+ *
+ * @param cls closure
+ * @param merchant_pub public key of the instance
+ * @return database result code
+ */
+static enum GNUNET_DB_QueryStatus
+postgres_purge_instance (void *cls,
+ const struct TALER_MerchantPublicKeyP *merchant_pub)
+{
+}
+
+
/* ********************* OLD API ************************** */
/**
diff --git a/src/include/taler_merchantdb_plugin.h b/src/include/taler_merchantdb_plugin.h
index 2d688dde..2bcf1987 100644
--- a/src/include/taler_merchantdb_plugin.h
+++ b/src/include/taler_merchantdb_plugin.h
@@ -384,6 +384,32 @@ struct TALER_MERCHANTDB_Plugin
const struct TALER_MERCHANTDB_AccountDetails *account_details);
+ /**
+ * Delete private key of an instance from our database.
+ *
+ * @param cls closure
+ * @param merchant_pub public key of the instance
+ * @return database result code
+ */
+ enum GNUNET_DB_QueryStatus
+ (*delete_instance_private_key)(
+ void *cls,
+ const struct TALER_MerchantPublicKeyP *merchant_pub);
+
+
+ /**
+ * Purge an instance and all associated information from our database.
+ * Highly likely to cause undesired data loss. Use with caution.
+ *
+ * @param cls closure
+ * @param merchant_pub public key of the instance
+ * @return database result code
+ */
+ enum GNUNET_DB_QueryStatus
+ (*purge_instance)(void *cls,
+ const struct TALER_MerchantPublicKeyP *merchant_pub);
+
+
/* ****************** OLD API ******************** */
/**