challenger

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

commit 3f892c826b141826238559e3e0423f8a83da0ecc
parent d63f2ce24fea5046edd690d475fe33dd1abb982b
Author: Christian Grothoff <christian@grothoff.org>
Date:   Thu,  5 Sep 2024 16:09:16 +0200

remove disabled templating logic from challenger

Diffstat:
Msrc/challenger/challenger-httpd_authorize.c | 7-------
Msrc/challenger/challenger-httpd_challenge.c | 36++++--------------------------------
Msrc/challenger/challenger-httpd_solve.c | 24++++--------------------
Msrc/challenger/challenger-httpd_spa.c | 4++++
Msrc/challengerdb/plugin_challengerdb_postgres.c | 8++++++++
5 files changed, 20 insertions(+), 59 deletions(-)

diff --git a/src/challenger/challenger-httpd_authorize.c b/src/challenger/challenger-httpd_authorize.c @@ -44,13 +44,6 @@ reply_error (struct CH_HandlerContext *hc, enum TALER_ErrorCode ec, const char *hint) { - if (0 == CH_get_output_type (hc->connection)) - return TALER_TEMPLATING_reply_error ( - hc->connection, - template, - http_status, - ec, - hint); return TALER_MHD_reply_with_error ( hc->connection, http_status, diff --git a/src/challenger/challenger-httpd_challenge.c b/src/challenger/challenger-httpd_challenge.c @@ -246,13 +246,6 @@ reply_error (struct ChallengeContext *bc, { struct CH_HandlerContext *hc = bc->hc; - if (0 == CH_get_output_type (hc->connection)) - return TALER_TEMPLATING_reply_error ( - hc->connection, - template, - http_status, - ec, - hint); return TALER_MHD_reply_with_error ( hc->connection, http_status, @@ -744,7 +737,6 @@ CH_handler_challenge (struct CH_HandlerContext *hc, { json_t *args; - enum GNUNET_GenericReturnValue ret; struct MHD_Response *resp; unsigned int http_status; MHD_RESULT res; @@ -767,30 +759,10 @@ CH_handler_challenge (struct CH_HandlerContext *hc, CH_validation_duration))) ); http_status = MHD_HTTP_OK; - if (0 == CH_get_output_type (hc->connection)) - { - ret = TALER_TEMPLATING_build (hc->connection, - &http_status, - "enter-tan-form", - NULL, - NULL, - args, - &resp); - json_decref (args); - if (GNUNET_SYSERR == ret) - { - GNUNET_break (0); - return MHD_NO; - } - GNUNET_break (GNUNET_OK == ret); - } - else - { - GNUNET_break (0 == - json_object_del (args, - "nonce")); - resp = TALER_MHD_make_json (args); - } + GNUNET_break (0 == + json_object_del (args, + "nonce")); + resp = TALER_MHD_make_json (args); GNUNET_break (MHD_YES == MHD_add_response_header (resp, MHD_HTTP_HEADER_CACHE_CONTROL, diff --git a/src/challenger/challenger-httpd_solve.c b/src/challenger/challenger-httpd_solve.c @@ -128,13 +128,6 @@ reply_error (struct SolveContext *bc, { struct CH_HandlerContext *hc = bc->hc; - if (0 == CH_get_output_type (hc->connection)) - return TALER_TEMPLATING_reply_error ( - hc->connection, - template, - http_status, - ec, - hint); return TALER_MHD_reply_with_error ( hc->connection, http_status, @@ -340,17 +333,9 @@ CH_handler_solve (struct CH_HandlerContext *hc, GNUNET_JSON_pack_bool ("no_challenge", no_challenge) ); - if (0 == CH_get_output_type (hc->connection)) - ret = TALER_TEMPLATING_reply (hc->connection, - MHD_HTTP_FORBIDDEN, - "invalid-pin", - NULL, - NULL, - details); - else - ret = TALER_MHD_reply_json (hc->connection, - details, - MHD_HTTP_FORBIDDEN); + ret = TALER_MHD_reply_json (hc->connection, + details, + MHD_HTTP_FORBIDDEN); json_decref (details); return ret; } @@ -468,6 +453,7 @@ CH_handler_solve (struct CH_HandlerContext *hc, else { json_t *args; + args = GNUNET_JSON_PACK ( GNUNET_JSON_pack_string ("type", "completed"), @@ -475,9 +461,7 @@ CH_handler_solve (struct CH_HandlerContext *hc, url) ); GNUNET_free (url); - response = TALER_MHD_make_json (args); - http_status = MHD_HTTP_OK; } diff --git a/src/challenger/challenger-httpd_spa.c b/src/challenger/challenger-httpd_spa.c @@ -339,6 +339,10 @@ CH_spa_init () * Nicely shut down. */ void __attribute__ ((destructor)) +get_spa_fini (void); + +/* Declaration to suppress compiler warning */ +void __attribute__ ((destructor)) get_spa_fini () { struct WebuiFile *w; diff --git a/src/challengerdb/plugin_challengerdb_postgres.c b/src/challengerdb/plugin_challengerdb_postgres.c @@ -346,6 +346,10 @@ postgres_create_tables (void *cls) * @return NULL on error, otherwise a `struct TALER_CHALLENGERDB_Plugin` */ void * +libchallenger_plugin_db_postgres_init (void *cls); + +/* Declaration to suppress compiler warning */ +void * libchallenger_plugin_db_postgres_init (void *cls) { struct GNUNET_CONFIGURATION_Handle *cfg = cls; @@ -422,6 +426,10 @@ libchallenger_plugin_db_postgres_init (void *cls) * @return NULL (always) */ void * +libchallenger_plugin_db_postgres_done (void *cls); + +/* Declaration to suppress compiler warning */ +void * libchallenger_plugin_db_postgres_done (void *cls) { struct CHALLENGER_DatabasePlugin *plugin = cls;