diff options
author | Özgür Kesim <oec-taler@kesim.org> | 2022-01-08 14:40:20 +0100 |
---|---|---|
committer | Özgür Kesim <oec-taler@kesim.org> | 2022-01-08 14:40:20 +0100 |
commit | cc7d7707ab2bd43bc9e95c0eeec9ce95cdc0c523 (patch) | |
tree | 472e895b321e539f4675f016a285d6f6e6436b76 /src/lib | |
parent | b49fac3d5892f75a2eb7fbfbca0056965c6967c7 (diff) |
[age restriction] progress 10/n
More work towards support for extensions:
- Prepared statements and DB-plugin-functions for setting and retrieving
configurations from the database added.
- primitive "registry" of extensions for age restrictions and peer2peer
(stub)
- TALER_Extensions now with FP for parsing, setting and converting a
configuration.
- /management/extensions handler now verifies signature of the (opaque)
json object for all extensions.
- /management/extensions handler calls the FP in the corrensponding
TALER_Extension for parsing and setting the configuration of a
particular extension
More work towards age restriction:
- TALER_Extensions interfaces for config-parser, -setter and converter
implemented for age restriction
- DB event handler now retrieves config from database, parses it and
sets it (the age mask) in the global extension.
- load_age_mask now loads age mask from the global extension (and not
from the config file)
- add age_restricted_denoms to /keys response
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/exchange_api_management_post_extensions.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/src/lib/exchange_api_management_post_extensions.c b/src/lib/exchange_api_management_post_extensions.c index a2de2454c..862ff7117 100644 --- a/src/lib/exchange_api_management_post_extensions.c +++ b/src/lib/exchange_api_management_post_extensions.c @@ -153,32 +153,17 @@ TALER_EXCHANGE_management_post_extensions ( GNUNET_assert (NULL != extensions); for (unsigned int i = 0; i<pkd->num_extensions; i++) { - json_t *config; - const struct TALER_AgeMask *mask; + const json_t *config; const struct TALER_Extension *ext = &pkd->extensions[i]; - switch (ext->type) - { - // TODO: case TALER_Extension_Peer2Peer - case TALER_Extension_AgeRestriction: - mask = (const struct TALER_AgeMask *) (&ext->config); - config = GNUNET_JSON_PACK ( - GNUNET_JSON_pack_string ("extension", - ext->name), - GNUNET_JSON_pack_data_auto ("mask", - &mask->mask)); - GNUNET_assert (NULL != config); - break; - default: - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Extension not supported.\n"); - } + config = ext->config_to_json (ext); + GNUNET_assert (NULL != config); GNUNET_assert (0 == json_array_append_new ( extensions, GNUNET_JSON_PACK ( - GNUNET_JSON_pack_data_auto ("name", + GNUNET_JSON_pack_data_auto ("extension", &ext->name), GNUNET_JSON_pack_data_auto ("config", config) |