aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-08-07 09:49:40 +0200
committerChristian Grothoff <christian@grothoff.org>2024-08-07 09:49:40 +0200
commitde42b35703ad010040bbbc932ca4aeaa0c582036 (patch)
tree76d1815a8262df4f09127c28d0224cb1a691ad51
parent5ae0c5e15be768f33ce195be95f4ef66484b4a50 (diff)
add API to return successor measure
-rw-r--r--src/include/taler_kyclogic_lib.h13
-rw-r--r--src/kyclogic/kyclogic_api.c19
2 files changed, 28 insertions, 4 deletions
diff --git a/src/include/taler_kyclogic_lib.h b/src/include/taler_kyclogic_lib.h
index 987cee4e2..f7fb9ed92 100644
--- a/src/include/taler_kyclogic_lib.h
+++ b/src/include/taler_kyclogic_lib.h
@@ -641,6 +641,19 @@ TALER_KYCLOGIC_rules_get_expiration (
/**
+ * Return successor measure for the given @a lrs
+ *
+ * @param lrs legitimization rules to inspect
+ * @return name of the successor measure;
+ * NULL to fall back to default rules;
+ * pointer will be valid as long as @a lrs is valid
+ */
+const char *
+TALER_KYCLOGIC_rules_get_successor (
+ const struct TALER_KYCLOGIC_LegitimizationRuleSet *lrs);
+
+
+/**
* Function called with the provider details and
* associated plugin closures for matching logics.
*
diff --git a/src/kyclogic/kyclogic_api.c b/src/kyclogic/kyclogic_api.c
index af801a55c..56affd010 100644
--- a/src/kyclogic/kyclogic_api.c
+++ b/src/kyclogic/kyclogic_api.c
@@ -171,7 +171,7 @@ struct TALER_KYCLOGIC_LegitimizationRuleSet
/**
* Name of the successor measure after expiration.
- * NULL for default rules.
+ * NULL to revert to default rules.
*/
char *successor_measure;
@@ -304,6 +304,14 @@ TALER_KYCLOGIC_rules_get_expiration (
}
+const char *
+TALER_KYCLOGIC_rules_get_successor (
+ const struct TALER_KYCLOGIC_LegitimizationRuleSet *lrs)
+{
+ return lrs->successor_measure;
+}
+
+
/**
* Lookup a KYC check by @a check_name
*
@@ -915,7 +923,8 @@ TALER_KYCLOGIC_rule_get_instant_measure (
json_t *
-TALER_KYCLOGIC_rule_to_measures (const struct TALER_KYCLOGIC_KycRule *r)
+TALER_KYCLOGIC_rule_to_measures (
+ const struct TALER_KYCLOGIC_KycRule *r)
{
const struct TALER_KYCLOGIC_LegitimizationRuleSet *lrs
= r->lrs;
@@ -1048,7 +1057,8 @@ TALER_KYCLOGIC_check_to_measures (
uint32_t
-TALER_KYCLOGIC_rule2priority (const struct TALER_KYCLOGIC_KycRule *r)
+TALER_KYCLOGIC_rule2priority (
+ const struct TALER_KYCLOGIC_KycRule *r)
{
return r->display_priority;
}
@@ -2192,7 +2202,8 @@ sort_by_timeframe (const void *p1,
enum GNUNET_GenericReturnValue
-TALER_KYCLOGIC_kyc_init (const struct GNUNET_CONFIGURATION_Handle *cfg)
+TALER_KYCLOGIC_kyc_init (
+ const struct GNUNET_CONFIGURATION_Handle *cfg)
{
struct SectionContext sc = {
.cfg = cfg,