commit aff8be479312c5fa08ccfab0d10ac603fb1ee05f
parent 96c0fe1e71b2649c44f759d429579d2c830a6969
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date: Thu, 19 Jun 2025 14:48:34 +0200
more backwards compat for token, actually call it token again
Diffstat:
3 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c
@@ -341,8 +341,6 @@ permission_in_scope (const char *permission_required,
perms_tmp = get_scope_permissions (scope, &refreshable);
if (NULL == perms_tmp)
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Got scope: %u\n", scope);
GNUNET_break_op (0);
return false;
}
diff --git a/src/backend/taler-merchant-httpd_helper.c b/src/backend/taler-merchant-httpd_helper.c
@@ -613,35 +613,37 @@ TMH_check_auth_config (struct MHD_Connection *connection,
auth_wellformed = true;
}
else if (0 == strcmp (auth_method,
- "password"))
+ "token"))
{
- *auth_password = json_string_value (json_object_get (jauth,
- "password"));
- if (NULL == *auth_password)
+ json_t *pw_value;
+ pw_value = json_object_get (jauth, "password");
+ if (NULL == pw_value)
{
- GNUNET_break_op (0);
+ pw_value = json_object_get (jauth, "token");
}
- else
- {
- auth_wellformed = true;
- }
- }
- else if (0 == strcmp (auth_method,
- "token"))
- {
- const char *token = json_string_value (json_object_get (jauth,
- "token"));
- if ((NULL == token) ||
- (0 != strncasecmp (RFC_8959_PREFIX,
- token,
- strlen (RFC_8959_PREFIX))))
+ if (NULL == pw_value)
{
+ auth_wellformed = false;
GNUNET_break_op (0);
}
else
{
- *auth_password = token + strlen (RFC_8959_PREFIX);
- auth_wellformed = true;
+ *auth_password = json_string_value (pw_value);
+ if ((NULL != auth_password))
+ {
+ if (0 == strncasecmp (RFC_8959_PREFIX,
+ *auth_password,
+ strlen (RFC_8959_PREFIX)))
+ {
+ *auth_password = *auth_password + strlen (RFC_8959_PREFIX);
+ }
+ auth_wellformed = true;
+ }
+ else
+ {
+ auth_wellformed = false;
+ GNUNET_break_op (0);
+ }
}
}
diff --git a/src/backend/taler-merchant-httpd_private-get-instances-ID.c b/src/backend/taler-merchant-httpd_private-get-instances-ID.c
@@ -69,7 +69,7 @@ get_instances_ID (struct TMH_MerchantInstance *mi,
GNUNET_JSON_pack_string ("method",
GNUNET_is_zero (&mi->auth.auth_hash)
? "external"
- : "password"));
+ : "token"));
return TALER_MHD_REPLY_JSON_PACK (
connection,
MHD_HTTP_OK,