diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-02-02 14:55:56 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-02-02 14:55:56 +0100 |
commit | 3898054b1070db0c6be0fa9f6772637069aa34e2 (patch) | |
tree | cbe917775e0a44ef4e3140d9d605194f20136c39 /src/exchange/taler-exchange-httpd_aml-decisions-get.c | |
parent | eab95d015412833c96568fb91d25aa23c53c45cd (diff) |
more work on KYC/AML decision inspection
Diffstat (limited to 'src/exchange/taler-exchange-httpd_aml-decisions-get.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_aml-decisions-get.c | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/src/exchange/taler-exchange-httpd_aml-decisions-get.c b/src/exchange/taler-exchange-httpd_aml-decisions-get.c index 9f2fae3b..7c4a137d 100644 --- a/src/exchange/taler-exchange-httpd_aml-decisions-get.c +++ b/src/exchange/taler-exchange-httpd_aml-decisions-get.c @@ -80,13 +80,12 @@ TEH_handler_aml_decisions_get ( const char *const args[]) { struct TALER_AmlOfficerSignatureP officer_sig; - bool frozen = false; - bool pending = false; - bool normal = false; + enum TALER_AmlDecisionState decision; int delta = -20; unsigned long long start = INT64_MAX; + const char *state_str = args[0]; - if (NULL != args[0]) + if (NULL == state_str) { GNUNET_break_op (0); return TALER_MHD_reply_with_error (rc->connection, @@ -94,6 +93,31 @@ TEH_handler_aml_decisions_get ( TALER_EC_GENERIC_ENDPOINT_UNKNOWN, args[0]); } + if (0 == strcmp (state_str, + "pending")) + decision = TALER_AML_PENDING; + else if (0 == strcmp (state_str, + "frozen")) + decision = TALER_AML_FROZEN; + if (0 == strcmp (state_str, + "normal")) + decision = TALER_AML_NORMAL; + else + { + GNUNET_break_op (0); + return TALER_MHD_reply_with_error (rc->connection, + MHD_HTTP_BAD_REQUEST, + TALER_EC_GENERIC_ENDPOINT_UNKNOWN, + state_str); + } + if (NULL != args[1]) + { + GNUNET_break_op (0); + return TALER_MHD_reply_with_error (rc->connection, + MHD_HTTP_BAD_REQUEST, + TALER_EC_GENERIC_ENDPOINT_UNKNOWN, + args[1]); + } { const char *sig_hdr; @@ -124,24 +148,6 @@ TEH_handler_aml_decisions_get ( p = MHD_lookup_connection_value (rc->connection, MHD_GET_ARGUMENT_KIND, - "frozen"); - if (NULL != p) - frozen = (0 == strcasecmp (p, - "yes")); - p = MHD_lookup_connection_value (rc->connection, - MHD_GET_ARGUMENT_KIND, - "pending"); - if (NULL != p) - pending = (0 == strcasecmp (p, - "yes")); - p = MHD_lookup_connection_value (rc->connection, - MHD_GET_ARGUMENT_KIND, - "normal"); - if (NULL != p) - normal = (0 == strcasecmp (p, - "yes")); - p = MHD_lookup_connection_value (rc->connection, - MHD_GET_ARGUMENT_KIND, "start"); if (NULL != p) { @@ -183,7 +189,6 @@ TEH_handler_aml_decisions_get ( { json_t *records; enum GNUNET_DB_QueryStatus qs; - enum TALER_AmlDecisionState decision = 42; // FIXME! records = json_array (); GNUNET_assert (NULL != records); |