commit 7b16fe78bdef2fadc07de67c3ce7dff9108fa2a3
parent e49d953f46e40c30f8c9cb585681e86e72ac18f2
Author: Casaburi Johannes <johannes.casaburi@students.bfh.ch>
Date: Mon, 8 Jan 2024 19:35:04 +0100
[db] rename activate sign keys
Diffstat:
5 files changed, 98 insertions(+), 98 deletions(-)
diff --git a/src/donaudb/Makefile.am b/src/donaudb/Makefile.am
@@ -79,7 +79,7 @@ libtaler_plugin_donaudb_postgres_la_SOURCES = \
pg_rollback.h pg_rollback.c \
pg_start_read_committed.h pg_start_read_committed.c \
pg_start_read_only.h pg_start_read_only.c \
- pg_activate_signing_key.c pg_activate_signing_key.h \
+ pg_insert_signing_key.c pg_insert_signing_key.h \
pg_lookup_signing_key.h pg_lookup_signing_key.c \
pg_add_donation_unit_key.c pg_add_donation_unit_key.h \
pg_lookup_donation_unit.c pg_lookup_donation_unit.h \
diff --git a/src/donaudb/pg_activate_signing_key.c b/src/donaudb/pg_activate_signing_key.c
@@ -1,55 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2022 Taler Systems SA
-
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU 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 CHARITYABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along with
- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
- */
-/**
- * @file donaudb/pg_activate_signing_key.c
- * @brief Implementation of the activate_signing_key function for Postgres
- * @author Johannes Casaburi
- */
-#include "taler/platform.h"
-#include "taler/taler_error_codes.h"
-#include "taler/taler_dbevents.h"
-#include "taler/taler_pq_lib.h"
-#include "pg_activate_signing_key.h"
-#include "pg_helper.h"
-
-enum GNUNET_DB_QueryStatus
-DH_PG_activate_signing_key (
- void *cls,
- const struct DONAU_DonauPublicKeyP *donau_pub,
- const struct DONAUDB_SignkeyMetaData *meta)
-{
- struct PostgresClosure *pg = cls;
- struct GNUNET_PQ_QueryParam iparams[] = {
- GNUNET_PQ_query_param_auto_from_type (donau_pub),
- GNUNET_PQ_query_param_timestamp (&meta->start),
- GNUNET_PQ_query_param_timestamp (&meta->expire_sign),
- GNUNET_PQ_query_param_timestamp (&meta->expire_legal),
- GNUNET_PQ_query_param_end
- };
-
- PREPARE (pg,
- "insert_signkey",
- "INSERT INTO donau_sign_keys "
- "(donau_pub"
- ",valid_from"
- ",expire_sign"
- ",expire_legal"
- ") VALUES "
- "($1, $2, $3, $4);");
- return GNUNET_PQ_eval_prepared_non_select (pg->conn,
- "insert_signkey",
- iparams);
-}
diff --git a/src/donaudb/pg_activate_signing_key.h b/src/donaudb/pg_activate_signing_key.h
@@ -1,42 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2022 Taler Systems SA
-
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU 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 CHARITYABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along with
- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
- */
-/**
- * @file donaudb/pg_activate_signing_key.h
- * @brief implementation of the activate_signing_key function for Postgres
- * @author Johannes Casaburi
- */
-#ifndef PG_ACTIVATE_SIGNING_KEY_H
-#define PG_ACTIVATE_SIGNING_KEY_H
-
-#include <taler/taler_util.h>
-#include "taler/taler_json_lib.h"
-#include "donaudb_plugin.h"
-
-/**
- * Add signing key.
- *
- * @param cls closure
- * @param donau_pub the donau online signing public key
- * @param meta meta data about @a donau_pub
- * @return transaction status code
- */
-enum GNUNET_DB_QueryStatus
-DH_PG_activate_signing_key (
- void *cls,
- const struct DONAU_DonauPublicKeyP *donau_pub,
- const struct DONAUDB_SignkeyMetaData *meta);
-
-#endif
diff --git a/src/donaudb/pg_insert_signing_key.c b/src/donaudb/pg_insert_signing_key.c
@@ -0,0 +1,55 @@
+/*
+ This file is part of TALER
+ Copyright (C) 2022 Taler Systems SA
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU 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 CHARITYABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+/**
+ * @file donaudb/pg_insert_signing_key.c
+ * @brief Implementation of the insert_signing_key function for Postgres
+ * @author Johannes Casaburi
+ */
+#include "taler/platform.h"
+#include "taler/taler_error_codes.h"
+#include "taler/taler_dbevents.h"
+#include "taler/taler_pq_lib.h"
+#include "pg_insert_signing_key.h"
+#include "pg_helper.h"
+
+enum GNUNET_DB_QueryStatus
+DH_PG_insert_signing_key (
+ void *cls,
+ const struct DONAU_DonauPublicKeyP *donau_pub,
+ const struct DONAUDB_SignkeyMetaData *meta)
+{
+ struct PostgresClosure *pg = cls;
+ struct GNUNET_PQ_QueryParam iparams[] = {
+ GNUNET_PQ_query_param_auto_from_type (donau_pub),
+ GNUNET_PQ_query_param_timestamp (&meta->start),
+ GNUNET_PQ_query_param_timestamp (&meta->expire_sign),
+ GNUNET_PQ_query_param_timestamp (&meta->expire_legal),
+ GNUNET_PQ_query_param_end
+ };
+
+ PREPARE (pg,
+ "insert_signkey",
+ "INSERT INTO donau_sign_keys "
+ "(donau_pub"
+ ",valid_from"
+ ",expire_sign"
+ ",expire_legal"
+ ") VALUES "
+ "($1, $2, $3, $4);");
+ return GNUNET_PQ_eval_prepared_non_select (pg->conn,
+ "insert_signkey",
+ iparams);
+}
diff --git a/src/donaudb/pg_insert_signing_key.h b/src/donaudb/pg_insert_signing_key.h
@@ -0,0 +1,42 @@
+/*
+ This file is part of TALER
+ Copyright (C) 2022 Taler Systems SA
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU 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 CHARITYABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+/**
+ * @file donaudb/pg_insert_signing_key.h
+ * @brief implementation of the insert_signing_key function for Postgres
+ * @author Johannes Casaburi
+ */
+#ifndef PG_INSERT_SIGNING_KEY_H
+#define PG_INSERT_SIGNING_KEY_H
+
+#include <taler/taler_util.h>
+#include "taler/taler_json_lib.h"
+#include "donaudb_plugin.h"
+
+/**
+ * Add signing key.
+ *
+ * @param cls closure
+ * @param donau_pub the donau online signing public key
+ * @param meta meta data about @a donau_pub
+ * @return transaction status code
+ */
+enum GNUNET_DB_QueryStatus
+DH_PG_insert_signing_key (
+ void *cls,
+ const struct DONAU_DonauPublicKeyP *donau_pub,
+ const struct DONAUDB_SignkeyMetaData *meta);
+
+#endif