donau

Donation authority for GNU Taler (experimental)
Log | Files | Refs | Submodules | README | LICENSE

commit fa9a7865afcc503b41b41bc940ee2c815963337c
parent 2db283d64894a8d7d6cb55441c8fdd6ff255d6b5
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Sat, 11 Jul 2026 21:47:34 +0200

respect case where authorization is disabled

Diffstat:
Msrc/donau/donau-httpd.c | 23+++++++++--------------
1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/src/donau/donau-httpd.c b/src/donau/donau-httpd.c @@ -290,23 +290,18 @@ proceed_with_handler (struct DH_RequestContext *rc, { const char *ah; - if (NULL == admin_bearer) - { - GNUNET_break_op (0); - return TALER_MHD_reply_with_error (rc->connection, - MHD_HTTP_FORBIDDEN, - TALER_EC_GENERIC_TOKEN_PERMISSION_INSUFFICIENT, - "authorization required"); - } ah = MHD_lookup_connection_value (rc->connection, MHD_HEADER_KIND, MHD_HTTP_HEADER_AUTHORIZATION); - if ( (NULL == ah) || - (0 != strncasecmp (ah, - "Bearer ", - strlen ("Bearer "))) || - (0 != strcmp (ah + strlen ("Bearer "), - admin_bearer)) ) + /* If 'admin_bearer' is not set, we do not require authorization; + should basically only apply for test systems */ + if ( (NULL != admin_bearer) && + ( (NULL == ah) || + (0 != strncasecmp (ah, + "Bearer ", + strlen ("Bearer "))) || + (0 != strcmp (ah + strlen ("Bearer "), + admin_bearer)) ) ) { GNUNET_break_op (0); return TALER_MHD_reply_with_error (rc->connection,