aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-09-05 11:51:41 +0200
committerChristian Grothoff <christian@grothoff.org>2024-09-05 11:51:50 +0200
commitd96a9b99d47383308cf8ea8cac5cb9e7705bc7cf (patch)
tree91d5781e238e5a659605dd6276c25279ce1e5250 /src/include
parent1b14d0a4591094acf1f5515d98ce98d493bf77a8 (diff)
implement #9124 and #9039
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_exchange_service.h14
-rw-r--r--src/include/taler_exchangedb_plugin.h37
-rw-r--r--src/include/taler_kyclogic_lib.h41
-rw-r--r--src/include/taler_pq_lib.h2
4 files changed, 77 insertions, 17 deletions
diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h
index f49c0826a..f6907138f 100644
--- a/src/include/taler_exchange_service.h
+++ b/src/include/taler_exchange_service.h
@@ -6395,8 +6395,10 @@ struct TALER_EXCHANGE_AccountRule
* decision is about
* @param decision_time when was the decision made
* @param successor_measure measure to activate after @a expiration_time if no rule applied
- * @param new_check new KYC check to provide to the user,
- * NULL for none
+ * @param new_measures space-separated list of measures
+ * to trigger immediately;
+ " "+" prefixed for AND combination;
+ * NULL for none
* @param expiration_time when do the new rules expire
* @param num_rules length of the @a rules array
* @param rules new rules for the account
@@ -6411,13 +6413,13 @@ struct TALER_EXCHANGE_AccountRule
* @return the request handle; NULL upon error
*/
struct TALER_EXCHANGE_AddAmlDecision *
-TALER_EXCHANGE_add_aml_decision (
+TALER_EXCHANGE_post_aml_decision (
struct GNUNET_CURL_Context *ctx,
const char *url,
const struct TALER_PaytoHashP *h_payto,
struct GNUNET_TIME_Timestamp decision_time,
const char *successor_measure,
- const char *new_check,
+ const char *new_measures,
struct GNUNET_TIME_Timestamp expiration_time,
unsigned int num_rules,
const struct TALER_EXCHANGE_AccountRule *rules,
@@ -6432,12 +6434,12 @@ TALER_EXCHANGE_add_aml_decision (
/**
- * Cancel #TALER_EXCHANGE_add_aml_decision() operation.
+ * Cancel #TALER_EXCHANGE_post_aml_decision() operation.
*
* @param rh handle of the operation to cancel
*/
void
-TALER_EXCHANGE_add_aml_decision_cancel (
+TALER_EXCHANGE_post_aml_decision_cancel (
struct TALER_EXCHANGE_AddAmlDecision *rh);
diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h
index 48671fc51..44e1b8cfb 100644
--- a/src/include/taler_exchangedb_plugin.h
+++ b/src/include/taler_exchangedb_plugin.h
@@ -7064,6 +7064,23 @@ struct TALER_EXCHANGEDB_Plugin
/**
+ * Lookup KYC rules by account access token.
+ *
+ * @param cls closure
+ * @param h_payto account payto hash to look under
+ * @param[out] jnew_rules set to active LegitimizationRuleSet
+ * @param[out] rowid row of the last legitimization outcome
+ * @return database transaction status
+ */
+ enum GNUNET_DB_QueryStatus
+ (*lookup_rules_by_access_token)(
+ void *cls,
+ const struct TALER_PaytoHashP *h_payto,
+ json_t **jnew_rules,
+ uint64_t *rowid);
+
+
+ /**
* Lookup KYC process meta data.
*
* @param cls closure
@@ -7612,6 +7629,26 @@ struct TALER_EXCHANGEDB_Plugin
/**
+ * Create new active legitimization measure.
+ *
+ *
+ * @param cls closure
+ * @param access_token access token that identifies the
+ * account the legitimization measures apply to
+ * @param jmeasures new legitimization measures
+ * @param[out] legitimization_measure_serial_id
+ * set to new row in legitimization_measures table
+ * @return database transaction status
+ */
+ enum GNUNET_DB_QueryStatus
+ (*insert_active_legitimization_measure) (
+ void *cls,
+ const struct TALER_AccountAccessTokenP *access_token,
+ const json_t *jmeasures,
+ uint64_t *legitimization_measure_serial_id);
+
+
+ /**
* Insert an AML decision. Inserts into AML history and insert or updates AML
* status.
*
diff --git a/src/include/taler_kyclogic_lib.h b/src/include/taler_kyclogic_lib.h
index 2387ac074..fdfd5e283 100644
--- a/src/include/taler_kyclogic_lib.h
+++ b/src/include/taler_kyclogic_lib.h
@@ -164,11 +164,6 @@ struct TALER_KYCLOGIC_KycCheck
unsigned int num_outputs;
/**
- * True if clients can voluntarily trigger this check.
- */
- bool voluntary;
-
- /**
* Type of the KYC check.
*/
enum TALER_KYCLOGIC_CheckType type;
@@ -383,6 +378,32 @@ TALER_KYCLOGIC_get_zero_limits (void);
/**
+ * Obtain set of all measures that
+ * could be triggered at an amount of zero and that
+ * thus might be requested before a client even
+ * has performed any operation.
+ *
+ * @param lrs rule set to investigate, NULL for default
+ * @return LegitimizationMeasures, NULL on error
+ */
+json_t *
+TALER_KYCLOGIC_zero_measures (
+ const struct TALER_KYCLOGIC_LegitimizationRuleSet *lrs);
+
+
+/**
+ * Obtain set of all voluntary measures that
+ * could be triggered by clients at will.
+ *
+ * @param lrs rule set to investigate, NULL for default
+ * @return array of MeasureInformation, never NULL
+ */
+json_t *
+TALER_KYCLOGIC_voluntary_measures (
+ const struct TALER_KYCLOGIC_LegitimizationRuleSet *lrs);
+
+
+/**
* Get human-readable name of KYC rule.
*
* @param r rule to convert
@@ -564,17 +585,17 @@ TALER_KYCLOGIC_measure_to_requirement (
/**
- * Lookup @a measure_name in @a lrs and create JSON
- * object with the corresponding LegitimizationMeasures.
+ * Lookup measures from @a measures_spec in @a lrs and create JSON object with
+ * the corresponding LegitimizationMeasures.
*
* @param lrs set of legitimization rules
- * @param measure_name name of a measure to trigger from @a lrs
+ * @param measures_spec space-separated set of a measures to trigger from @a lrs; "+"-prefixed if AND-cominbation applies
* @return JSON object of type LegitimizationMeasures
*/
json_t *
-TALER_KYCLOGIC_get_measure (
+TALER_KYCLOGIC_get_measures (
const struct TALER_KYCLOGIC_LegitimizationRuleSet *lrs,
- const char *measure_name);
+ const char *measures_spec);
/**
* Lookup the provider for the given @a check_name.
diff --git a/src/include/taler_pq_lib.h b/src/include/taler_pq_lib.h
index 860be0e4d..e9929a0e9 100644
--- a/src/include/taler_pq_lib.h
+++ b/src/include/taler_pq_lib.h
@@ -188,7 +188,7 @@ TALER_PQ_query_param_array_hash_code (
* `struct TALER_DenominationHashP`
*
* @param num number of elements in @e hash_codes
- * @param hashes array of GNUNET_HashCode
+ * @param denom_hs array of denomination hashes to encode
* @param db context for the db-connection
*/
struct GNUNET_PQ_QueryParam