challenger

OAuth 2.0-based authentication service that validates user can receive messages at a certain address
Log | Files | Refs | Submodules | README | LICENSE

commit 071636870c6068def43433270d7e52393465f75f
parent 9400c4c722b5bbe0431282718c794bc5342a8f69
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Fri, 11 Apr 2025 14:59:29 +0200

fix #9725

Diffstat:
Msrc/challenger/challenger-httpd_authorize.c | 7+++++++
Msrc/challenger/challenger-httpd_setup.c | 15+++++++++++++++
2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/challenger/challenger-httpd_authorize.c b/src/challenger/challenger-httpd_authorize.c @@ -301,6 +301,13 @@ CH_handler_authorize (struct CH_HandlerContext *hc, json_t *args; struct MHD_Response *resp; MHD_RESULT res; + json_t *ro; + + ro = json_object_get (last_address, + "read_only"); + if ( (NULL != ro) && + (json_boolean_value (ro)) ) + address_attempts_left = 0; args = GNUNET_JSON_PACK ( GNUNET_JSON_pack_bool ("fix_address", diff --git a/src/challenger/challenger-httpd_setup.c b/src/challenger/challenger-httpd_setup.c @@ -114,6 +114,7 @@ CH_handler_setup (struct CH_HandlerContext *hc, } (void) upload_data; (void) upload_data_size; + { char dummy; @@ -138,7 +139,21 @@ CH_handler_setup (struct CH_HandlerContext *hc, TALER_EC_GENERIC_PARAMETER_MISSING, MHD_HTTP_HEADER_AUTHORIZATION); } + { + const json_t *ro; + ro = json_object_get (sc->root, + "read_only"); + if ( (NULL != ro) && + (! json_is_boolean (ro)) ) + { + GNUNET_break_op (0); + return TALER_MHD_reply_with_error (hc->connection, + MHD_HTTP_BAD_REQUEST, + TALER_EC_GENERIC_PARAMETER_MALFORMED, + "read_only"); + } + } for (unsigned int r = 0; r<MAX_RETRIES; r++) { enum GNUNET_DB_QueryStatus qs;