gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: persist new_measure name to ensu


From: gnunet
Subject: [taler-exchange] branch master updated: persist new_measure name to ensure we can validate the signature later
Date: Mon, 05 Aug 2024 08:26:53 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 88a52ce02 persist new_measure name to ensure we can validate the 
signature later
88a52ce02 is described below

commit 88a52ce02d3317ecee8aa54a45825670cd5c3e85
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon Aug 5 08:26:44 2024 +0200

    persist new_measure name to ensure we can validate the signature later
---
 src/exchange/taler-exchange-httpd_aml-decision.c   | 1 +
 src/exchangedb/0005-legitimization_outcomes.sql    | 7 +++++++
 src/exchangedb/exchange_do_insert_aml_decision.sql | 5 ++++-
 src/exchangedb/pg_insert_aml_decision.c            | 6 +++++-
 src/exchangedb/pg_insert_aml_decision.h            | 2 ++
 src/exchangedb/pg_lookup_kyc_requirement_by_row.c  | 1 +
 src/include/taler_exchangedb_plugin.h              | 2 ++
 7 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_aml-decision.c 
b/src/exchange/taler-exchange-httpd_aml-decision.c
index 67e1246eb..5eeec080f 100644
--- a/src/exchange/taler-exchange-httpd_aml-decision.c
+++ b/src/exchange/taler-exchange-httpd_aml-decision.c
@@ -154,6 +154,7 @@ TEH_handler_post_aml_decision (
                                           properties,
                                           new_rules,
                                           to_investigate,
+                                          new_measure,
                                           jmeasures,
                                           justification,
                                           officer_pub,
diff --git a/src/exchangedb/0005-legitimization_outcomes.sql 
b/src/exchangedb/0005-legitimization_outcomes.sql
index 16e5b5890..1c7405c99 100644
--- a/src/exchangedb/0005-legitimization_outcomes.sql
+++ b/src/exchangedb/0005-legitimization_outcomes.sql
@@ -28,6 +28,7 @@ BEGIN
       ',decision_time INT8 NOT NULL'
       ',expiration_time INT8 NOT NULL'
       ',jproperties TEXT'
+      ',new_measure_name TEXT'
       ',to_investigate BOOL NOT NULL'
       ',is_active BOOL NOT NULL DEFAULT(TRUE)'
       ',jnew_rules TEXT'
@@ -59,6 +60,12 @@ BEGIN
     ,'legitimization_outcomes'
     ,partition_suffix
   );
+  PERFORM comment_partitioned_column(
+     'name of the measure to trigger immediately, NULL for none'
+    ,'new_measure_name'
+    ,'legitimization_outcomes'
+    ,partition_suffix
+  );
   PERFORM comment_partitioned_column(
      'time when the decision expires and the expiration jnew_rules should be 
applied'
     ,'expiration_time'
diff --git a/src/exchangedb/exchange_do_insert_aml_decision.sql 
b/src/exchangedb/exchange_do_insert_aml_decision.sql
index 9c86f13f3..e6bcf40f8 100644
--- a/src/exchangedb/exchange_do_insert_aml_decision.sql
+++ b/src/exchangedb/exchange_do_insert_aml_decision.sql
@@ -22,6 +22,7 @@ CREATE OR REPLACE FUNCTION exchange_do_insert_aml_decision(
   IN in_properties TEXT,
   IN in_new_rules TEXT,
   IN in_to_investigate BOOLEAN,
+  IN in_new_measure_name TEXT,
   IN in_jmeasures TEXT,
   IN in_justification TEXT,
   IN in_decider_pub BYTEA,
@@ -133,6 +134,7 @@ INSERT INTO legitimization_outcomes
   ,decision_time
   ,expiration_time
   ,jproperties
+  ,new_measure_name
   ,to_investigate
   ,jnew_rules
   )
@@ -141,6 +143,7 @@ INSERT INTO legitimization_outcomes
   ,in_decision_time
   ,in_expiration_time
   ,in_properties
+  ,in_new_measure_name
   ,in_to_investigate
   ,in_new_rules
   )
@@ -178,5 +181,5 @@ INSERT INTO kyc_alerts
 END $$;
 
 
-COMMENT ON FUNCTION exchange_do_insert_aml_decision(BYTEA, INT8, INT8, TEXT, 
TEXT, BOOLEAN, TEXT, TEXT, BYTEA, BYTEA, TEXT)
+COMMENT ON FUNCTION exchange_do_insert_aml_decision(BYTEA, INT8, INT8, TEXT, 
TEXT, BOOLEAN, TEXT, TEXT, TEXT, BYTEA, BYTEA, TEXT)
   IS 'Checks whether the AML officer is eligible to make AML decisions and if 
so inserts the decision into the table';
diff --git a/src/exchangedb/pg_insert_aml_decision.c 
b/src/exchangedb/pg_insert_aml_decision.c
index f33aa0a01..281f18541 100644
--- a/src/exchangedb/pg_insert_aml_decision.c
+++ b/src/exchangedb/pg_insert_aml_decision.c
@@ -36,6 +36,7 @@ TEH_PG_insert_aml_decision (
   const json_t *properties,
   const json_t *new_rules,
   bool to_investigate,
+  const char *new_measure_name,
   const json_t *jmeasures,
   const char *justification,
   const struct TALER_AmlOfficerPublicKeyP *decider_pub,
@@ -61,6 +62,9 @@ TEH_PG_insert_aml_decision (
     : GNUNET_PQ_query_param_null (),
     TALER_PQ_query_param_json (new_rules),
     GNUNET_PQ_query_param_bool (to_investigate),
+    NULL != new_measure_name
+    ? TALER_PQ_query_param_string (new_measure_name)
+    : GNUNET_PQ_query_param_null (),
     NULL != jmeasures
     ? TALER_PQ_query_param_json (jmeasures)
     : GNUNET_PQ_query_param_null (),
@@ -88,7 +92,7 @@ TEH_PG_insert_aml_decision (
            ",out_account_unknown"
            ",out_last_date"
            " FROM exchange_do_insert_aml_decision"
-           "($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11);");
+           "($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12);");
   qs = GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
                                                  "do_insert_aml_decision",
                                                  params,
diff --git a/src/exchangedb/pg_insert_aml_decision.h 
b/src/exchangedb/pg_insert_aml_decision.h
index ab75845ff..cdb8d66b3 100644
--- a/src/exchangedb/pg_insert_aml_decision.h
+++ b/src/exchangedb/pg_insert_aml_decision.h
@@ -37,6 +37,7 @@
  * @param properties JSON object with properties to set for the account
  * @param new_rules JSON array with new AML/KYC rules
  * @param to_investigate true if AML staff should look more into this account
+ * @param new_measure_name name of the @a jmeasures measure that was 
triggered, or NULL for none
  * @param jmeasures a JSON with LegitimizationMeasures to apply to the
  *    account, or NULL to not apply any measure right now
  * @param justification human-readable text justifying the decision
@@ -57,6 +58,7 @@ TEH_PG_insert_aml_decision (
   const json_t *properties,
   const json_t *new_rules,
   bool to_investigate,
+  const char *new_measure_name,
   const json_t *jmeasures,
   const char *justification,
   const struct TALER_AmlOfficerPublicKeyP *decider_pub,
diff --git a/src/exchangedb/pg_lookup_kyc_requirement_by_row.c 
b/src/exchangedb/pg_lookup_kyc_requirement_by_row.c
index 65ce7aba5..17397a5d7 100644
--- a/src/exchangedb/pg_lookup_kyc_requirement_by_row.c
+++ b/src/exchangedb/pg_lookup_kyc_requirement_by_row.c
@@ -73,6 +73,7 @@ TEH_PG_lookup_kyc_requirement_by_row (
   // we probably want to join with THAT lo and not
   // the possibly dated lo for the given row.
   // Or: don't join at all with lo and simplify?
+  // What do we _really_ want here?
   PREPARE (pg,
            "lookup_kyc_requirement_by_row",
            "SELECT "
diff --git a/src/include/taler_exchangedb_plugin.h 
b/src/include/taler_exchangedb_plugin.h
index 3a6610f3d..21b6a0e21 100644
--- a/src/include/taler_exchangedb_plugin.h
+++ b/src/include/taler_exchangedb_plugin.h
@@ -7495,6 +7495,7 @@ struct TALER_EXCHANGEDB_Plugin
    * @param properties JSON object with properties to set for the account
    * @param new_rules JSON array with new AML/KYC rules
    * @param to_investigate true if AML staff should look more into this account
+   * @param new_measure_name name of the @a jmeasures measure that was 
triggered, or NULL for none
    * @param jmeasures a JSON with LegitimizationMeasures to apply to the
    *    account, or NULL to not apply any measure right now
    * @param justification human-readable text justifying the decision
@@ -7515,6 +7516,7 @@ struct TALER_EXCHANGEDB_Plugin
     const json_t *properties,
     const json_t *new_rules,
     bool to_investigate,
+    const char *new_measure_name,
     const json_t *jmeasures,
     const char *justification,
     const struct TALER_AmlOfficerPublicKeyP *decider_pub,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]