exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 83bcc2d972deb6c68d5813243a6647f2d0abc930
parent ec87b4d4bc88f04328951065f369194d9f1a3dcd
Author: Christian Grothoff <christian@grothoff.org>
Date:   Thu,  6 Aug 2026 18:35:32 +0200

update gana

Diffstat:
Msrc/include/taler/taler_error_codes.h | 72++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
Msrc/util/taler_error_codes.c | 77++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
2 files changed, 140 insertions(+), 9 deletions(-)

diff --git a/src/include/taler/taler_error_codes.h b/src/include/taler/taler_error_codes.h @@ -5971,7 +5971,7 @@ enum TALER_ErrorCode /** - * The client is unknown or unauthorized. + * The service does not know a client with the given client identifier, or the given client secret does not match it. Used where no client has been authenticated yet. * Returned with an HTTP status code of #MHD_HTTP_NOT_FOUND (404). * (A value of 0 indicates that the error is generated client-side). */ @@ -5995,7 +5995,7 @@ enum TALER_ErrorCode /** - * The grant is unknown to the service (it could also have expired). + * The authorization grant is unknown to the service (it could also have been redeemed already or have expired). * Returned with an HTTP status code of #MHD_HTTP_BAD_REQUEST (400). * (A value of 0 indicates that the error is generated client-side). */ @@ -6011,8 +6011,8 @@ enum TALER_ErrorCode /** - * The service is not aware of the referenced validation process. - * Returned with an HTTP status code of #MHD_HTTP_BAD_REQUEST (400). + * The service is not aware of the referenced validation process, or it has expired. + * Returned with an HTTP status code of #MHD_HTTP_NOT_FOUND (404). * (A value of 0 indicates that the error is generated client-side). */ TALER_EC_CHALLENGER_GENERIC_VALIDATION_UNKNOWN = 9755, @@ -6059,6 +6059,70 @@ enum TALER_ErrorCode /** + * No challenge was ever transmitted for this validation, so it cannot be solved yet. The user must provide their address first. + * Returned with an HTTP status code of #MHD_HTTP_CONFLICT (409). + * (A value of 0 indicates that the error is generated client-side). + */ + TALER_EC_CHALLENGER_NO_CHALLENGE_TRANSMITTED = 9761, + + + /** + * An address field does not match the regular expression configured for it. The detail names the offending field. + * Returned with an HTTP status code of #MHD_HTTP_BAD_REQUEST (400). + * (A value of 0 indicates that the error is generated client-side). + */ + TALER_EC_CHALLENGER_ADDRESS_RESTRICTION_VIOLATED = 9762, + + + /** + * The address restriction configured for this field is missing its regular expression or the expression failed to compile. This is a server misconfiguration. + * Returned with an HTTP status code of #MHD_HTTP_INTERNAL_SERVER_ERROR (500). + * (A value of 0 indicates that the error is generated client-side). + */ + TALER_EC_CHALLENGER_ADDRESS_RESTRICTION_MALFORMED = 9763, + + + /** + * The number of times the address may be changed for this validation has been exhausted. The user must request a fresh nonce from the client. + * Returned with an HTTP status code of #MHD_HTTP_TOO_MANY_REQUESTS (429). + * (A value of 0 indicates that the error is generated client-side). + */ + TALER_EC_CHALLENGER_TOO_MANY_ADDRESS_CHANGES = 9764, + + + /** + * The number of times the challenge may be transmitted for this validation has been exhausted. The user may still try a different address if changes remain. + * Returned with an HTTP status code of #MHD_HTTP_TOO_MANY_REQUESTS (429). + * (A value of 0 indicates that the error is generated client-side). + */ + TALER_EC_CHALLENGER_TOO_MANY_PIN_TRANSMISSIONS = 9765, + + + /** + * The number of attempts to enter the PIN has been exhausted. The user may still request a retransmission or change the address. + * Returned with an HTTP status code of #MHD_HTTP_TOO_MANY_REQUESTS (429). + * (A value of 0 indicates that the error is generated client-side). + */ + TALER_EC_CHALLENGER_NO_PIN_ATTEMPTS_LEFT = 9766, + + + /** + * Authentication of the client failed: the client identifier and client secret presented do not match a registered client. Returned where the endpoint authenticates the client, so the reply challenges for credentials. + * Returned with an HTTP status code of #MHD_HTTP_UNAUTHORIZED (401). + * (A value of 0 indicates that the error is generated client-side). + */ + TALER_EC_CHALLENGER_CLIENT_AUTHENTICATION_FAILED = 9767, + + + /** + * The access token presented is malformed, unknown or expired. Malformed and unknown tokens are deliberately not distinguished. + * Returned with an HTTP status code of #MHD_HTTP_UNAUTHORIZED (401). + * (A value of 0 indicates that the error is generated client-side). + */ + TALER_EC_CHALLENGER_TOKEN_UNKNOWN = 9768, + + + /** * The request is invalid as the specified order is unpaid. The client should only call this endpoint after paying the order. * Returned with an HTTP status code of #MHD_HTTP_CONFLICT (409). * (A value of 0 indicates that the error is generated client-side). diff --git a/src/util/taler_error_codes.c b/src/util/taler_error_codes.c @@ -5724,7 +5724,8 @@ static const struct ErrorCodeAndHint code_hint_pairs[] = { { /* 9750 */ .ec = TALER_EC_CHALLENGER_GENERIC_CLIENT_UNKNOWN, - .hint = "The client is unknown or unauthorized.", + .hint = + "The service does not know a client with the given client identifier, or the given client secret does not match it. Used where no client has been authenticated yet.", .http_code = MHD_HTTP_NOT_FOUND }, @@ -5746,7 +5747,8 @@ static const struct ErrorCodeAndHint code_hint_pairs[] = { { /* 9753 */ .ec = TALER_EC_CHALLENGER_GRANT_UNKNOWN, - .hint = "The grant is unknown to the service (it could also have expired).", + .hint = + "The authorization grant is unknown to the service (it could also have been redeemed already or have expired).", .http_code = MHD_HTTP_BAD_REQUEST }, @@ -5760,8 +5762,9 @@ static const struct ErrorCodeAndHint code_hint_pairs[] = { { /* 9755 */ .ec = TALER_EC_CHALLENGER_GENERIC_VALIDATION_UNKNOWN, - .hint = "The service is not aware of the referenced validation process.", - .http_code = MHD_HTTP_BAD_REQUEST + .hint = + "The service is not aware of the referenced validation process, or it has expired.", + .http_code = MHD_HTTP_NOT_FOUND }, { @@ -5802,6 +5805,70 @@ static const struct ErrorCodeAndHint code_hint_pairs[] = { }, { + /* 9761 */ + .ec = TALER_EC_CHALLENGER_NO_CHALLENGE_TRANSMITTED, + .hint = + "No challenge was ever transmitted for this validation, so it cannot be solved yet. The user must provide their address first.", + .http_code = MHD_HTTP_CONFLICT + }, + + { + /* 9762 */ + .ec = TALER_EC_CHALLENGER_ADDRESS_RESTRICTION_VIOLATED, + .hint = + "An address field does not match the regular expression configured for it. The detail names the offending field.", + .http_code = MHD_HTTP_BAD_REQUEST + }, + + { + /* 9763 */ + .ec = TALER_EC_CHALLENGER_ADDRESS_RESTRICTION_MALFORMED, + .hint = + "The address restriction configured for this field is missing its regular expression or the expression failed to compile. This is a server misconfiguration.", + .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR + }, + + { + /* 9764 */ + .ec = TALER_EC_CHALLENGER_TOO_MANY_ADDRESS_CHANGES, + .hint = + "The number of times the address may be changed for this validation has been exhausted. The user must request a fresh nonce from the client.", + .http_code = MHD_HTTP_TOO_MANY_REQUESTS + }, + + { + /* 9765 */ + .ec = TALER_EC_CHALLENGER_TOO_MANY_PIN_TRANSMISSIONS, + .hint = + "The number of times the challenge may be transmitted for this validation has been exhausted. The user may still try a different address if changes remain.", + .http_code = MHD_HTTP_TOO_MANY_REQUESTS + }, + + { + /* 9766 */ + .ec = TALER_EC_CHALLENGER_NO_PIN_ATTEMPTS_LEFT, + .hint = + "The number of attempts to enter the PIN has been exhausted. The user may still request a retransmission or change the address.", + .http_code = MHD_HTTP_TOO_MANY_REQUESTS + }, + + { + /* 9767 */ + .ec = TALER_EC_CHALLENGER_CLIENT_AUTHENTICATION_FAILED, + .hint = + "Authentication of the client failed: the client identifier and client secret presented do not match a registered client. Returned where the endpoint authenticates the client, so the reply challenges for credentials.", + .http_code = MHD_HTTP_UNAUTHORIZED + }, + + { + /* 9768 */ + .ec = TALER_EC_CHALLENGER_TOKEN_UNKNOWN, + .hint = + "The access token presented is malformed, unknown or expired. Malformed and unknown tokens are deliberately not distinguished.", + .http_code = MHD_HTTP_UNAUTHORIZED + }, + + { /* 9800 */ .ec = TALER_EC_PAIVANA_PAYMENT_MISSING, .hint = @@ -5895,7 +5962,7 @@ static const struct ErrorCodeAndHint code_hint_pairs[] = { /** * The length of @e code_hint_pairs. */ -static const unsigned int code_hint_pairs_length = 761; +static const unsigned int code_hint_pairs_length = 769; const char *