diff options
-rw-r--r-- | src/kyclogic/kyclogic_api.c | 19 | ||||
-rw-r--r-- | src/testing/test_exchange_api.conf | 65 |
2 files changed, 71 insertions, 13 deletions
diff --git a/src/kyclogic/kyclogic_api.c b/src/kyclogic/kyclogic_api.c index 5e694cecf..f3e244af0 100644 --- a/src/kyclogic/kyclogic_api.c +++ b/src/kyclogic/kyclogic_api.c @@ -1345,6 +1345,7 @@ add_check (const struct GNUNET_CONFIGURATION_Handle *cfg, "FALLBACK", &fallback)) { + /* FIXME: Allow NULL to fall back to default rules? */ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, section, "FALLBACK"); @@ -1696,6 +1697,7 @@ add_program (const struct GNUNET_CONFIGURATION_Handle *cfg, "FALLBACK", &fallback)) { + /* FIXME: Allow NULL to fall back to default rules? */ GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, section, "FALLBACK", @@ -1809,10 +1811,9 @@ add_measure (const struct GNUNET_CONFIGURATION_Handle *cfg, "CHECK_NAME", &check_name)) { - GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, + GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, section, - "CHECK_NAME", - "check name required"); + "CHECK_NAME"); goto fail; } if (GNUNET_OK != @@ -1821,10 +1822,9 @@ add_measure (const struct GNUNET_CONFIGURATION_Handle *cfg, "PROGRAM", &program)) { - GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, + GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, section, - "PROGRAM", - "program name required"); + "PROGRAM"); goto fail; } if (GNUNET_OK != @@ -1833,10 +1833,9 @@ add_measure (const struct GNUNET_CONFIGURATION_Handle *cfg, "CONTEXT", &context_str)) { - GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, + GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, section, - "CONTEXT", - "context required"); + "CONTEXT"); goto fail; } context = json_loads (context_str, @@ -1847,7 +1846,7 @@ add_measure (const struct GNUNET_CONFIGURATION_Handle *cfg, { GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, section, - "COMMAND", + "CONTEXT", err.text); goto fail; } diff --git a/src/testing/test_exchange_api.conf b/src/testing/test_exchange_api.conf index d4ce4457b..7f308b56f 100644 --- a/src/testing/test_exchange_api.conf +++ b/src/testing/test_exchange_api.conf @@ -110,14 +110,73 @@ KYC_OAUTH2_POST_URL = http://example.com/ KYC_OAUTH2_CONVERTER_HELPER = taler-exchange-kyc-oauth2-test-converter.sh CONVERTER = cat -[kyc-legitimization-close] +[kyc-check-oauth-test-id] +VOLUNTARY = NO +# We use an external provider +TYPE = LINK +DESCRIPTION = "Oauth2 dummy authentication" +DESCRIPTION_I18N = {} +# No context requirements +REQUIRES = +# Measure to execute if check failed. +FALLBACK = manual +# This check runs on oauth2 +PROVIDER_ID = test-oauth2 + +# If this "check" is triggered, we merely inform +# the user that their account has been frozen. The +# user cannot proceed manually. +[kyc-check-info-frozen] +VOLUNTARY = NO +TYPE = INFO +DESCRIPTION = "Your account is frozen pending investigation" +DESCRIPTION_I18N = {} +# No context requirements +REQUIRES = +FALLBACK = manual + +[aml-program-oauth-output-check] +DESCRIPTION = Validates the output from OAauth2 +COMMAND = cat +# What measure to take if the COMMAND failed. +FALLBACK = manual + +[kyc-measure-run-oauth] +# Get client ID via the OAuth test provider +CHECK_NAME = oauth-test-id +# AML program to run on the output of the OAuth provider +# to decide what to do next. +PROGRAM = taler-exchange-helper-measure-test-oauth-output +# Context to provide for check and program; empty. +CONTEXT = {} + +# This is a base-measure that is being triggered +# whenever something goes wrong. We freeze the +# account and ask AML staff to investigate. +[kyc-measure-manual] +CHECK_NAME = info-frozen +# AML program that freezes the account and flags +# it for investigation. +PROGRAM = taler-exchange-helper-measure-freeze +CONTEXT = {} + +# This rule requests that the users passes KYC +# when closing the reserve. +[kyc-rule-close] ENABLED = YES +# This is a public rule. +EXPOSED = YES +# All checks listed must be done (well, there is only one...) IS_AND_COMBINATOR = YES +# This happens if the reserve is closed. OPERATION_TYPE = CLOSE -REQUIRED_CHECKS = DUMMY +# Threshold is 0, so any amount. THRESHOLD = EUR:0 +# Timeframe doesn't exactly matter with a threshold of EUR:0. TIMEFRAME = 1d -NEXT_MEASURES = pass +# If the rule is triggered, ask the user to provide +# personal data via OAuth2 +NEXT_MEASURES = run-oauth [exchange-extension-age_restriction] ENABLED = YES |