diff options
author | Florian Dold <florian@dold.me> | 2024-10-21 15:06:28 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-10-21 15:21:30 +0200 |
commit | a7cb67227df85d63c9433981358dea406fd0346c (patch) | |
tree | 6f06aa2e5d42d1d3d2a8a0d7e6e8d68a4d742834 /src/kyclogic | |
parent | 3ecec2cb8a0e7def733025a8b2d08243aa7bff39 (diff) |
run immediate measures on POSTing AML decision
Diffstat (limited to 'src/kyclogic')
-rw-r--r-- | src/kyclogic/kyclogic_api.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/kyclogic/kyclogic_api.c b/src/kyclogic/kyclogic_api.c index 389d62285..72c93140c 100644 --- a/src/kyclogic/kyclogic_api.c +++ b/src/kyclogic/kyclogic_api.c @@ -1172,6 +1172,57 @@ TALER_KYCLOGIC_voluntary_measures ( } +const struct TALER_KYCLOGIC_Measure * +TALER_KYCLOGIC_get_instant_measure ( + const struct TALER_KYCLOGIC_LegitimizationRuleSet *lrs, + const char *measures_spec) +{ + char *nm; + const struct TALER_KYCLOGIC_Measure *ret = NULL; + + if ('+' == measures_spec[0]) + { + nm = GNUNET_strdup (&measures_spec[1]); + } + else + { + nm = GNUNET_strdup (measures_spec); + } + for (const char *tok = strtok (nm, " "); + NULL != tok; + tok = strtok (NULL, " ")) + { + const struct TALER_KYCLOGIC_Measure *ms; + + if (0 == strcasecmp ("verboten", + tok)) + { + continue; + } + ms = find_measure (lrs, + tok); + if (NULL == ms) + { + GNUNET_break (0); + continue; + } + if (0 == strcasecmp ("verboten", + ms->check_name)) + { + continue; + } + if (0 == strcasecmp ("SKIP", ms->check_name)) + { + ret = ms; + goto done; + } + } +done: + GNUNET_free (nm); + return ret; +} + + json_t * TALER_KYCLOGIC_get_measures ( const struct TALER_KYCLOGIC_LegitimizationRuleSet *lrs, |