diff --git a/lib/app/shared/enum/message/response_string/response_string.dart b/lib/app/shared/enum/message/response_string/response_string.dart index 5a69ea818..def9389b4 100644 --- a/lib/app/shared/enum/message/response_string/response_string.dart +++ b/lib/app/shared/enum/message/response_string/response_string.dart @@ -158,4 +158,8 @@ enum ResponseString { RESPONSE_STRING_statusListInvalidSignature, RESPONSE_STRING_theWalletIsSuspended, RESPONSE_STRING_couldNotFindTheAccountWithThisAddress, + RESPONSE_STRING_invalidRequestErrorDescription, + RESPONSE_STRING_invalidClientErrorDescription, + RESPONSE_STRING_vpFormatsNotSupportedErrorDescription, + RESPONSE_STRING_invalidPresentationDefinitionUriErrorDescription, } diff --git a/lib/app/shared/enum/message/response_string/response_string_extension.dart b/lib/app/shared/enum/message/response_string/response_string_extension.dart index e7339e07c..52e07c583 100644 --- a/lib/app/shared/enum/message/response_string/response_string_extension.dart +++ b/lib/app/shared/enum/message/response_string/response_string_extension.dart @@ -503,7 +503,21 @@ extension ResponseStringX on ResponseString { .RESPONSE_STRING_couldNotFindTheAccountWithThisAddress( injectedMessage ?? '', ); - ; + + case ResponseString.RESPONSE_STRING_invalidRequestErrorDescription: + return globalMessage.RESPONSE_STRING_invalidRequestErrorDescription; + + case ResponseString.RESPONSE_STRING_invalidClientErrorDescription: + return globalMessage.RESPONSE_STRING_invalidClientErrorDescription; + + case ResponseString.RESPONSE_STRING_vpFormatsNotSupportedErrorDescription: + return globalMessage + .RESPONSE_STRING_vpFormatsNotSupportedErrorDescription; + + case ResponseString + .RESPONSE_STRING_invalidPresentationDefinitionUriErrorDescription: + return globalMessage + .RESPONSE_STRING_invalidPresentationDefinitionUriErrorDescription; } } } diff --git a/lib/app/shared/helper_functions/helper_functions.dart b/lib/app/shared/helper_functions/helper_functions.dart index 70a1debe4..ee06a8ff3 100644 --- a/lib/app/shared/helper_functions/helper_functions.dart +++ b/lib/app/shared/helper_functions/helper_functions.dart @@ -1252,7 +1252,6 @@ MessageHandler getMessageHandler(dynamic e) { ResponseString getErrorResponseString(String errorString) { switch (errorString) { - case 'invalid_request': case 'invalid_request_uri': case 'invalid_request_object': return ResponseString.RESPONSE_STRING_invalidRequest; @@ -1282,7 +1281,6 @@ ResponseString getErrorResponseString(String errorString) { return ResponseString.RESPONSE_STRING_theWalletIsNotRegistered; case 'invalid_grant': - case 'invalid_client': case 'invalid_token': return ResponseString.RESPONSE_STRING_credentialIssuanceDenied; @@ -1302,6 +1300,20 @@ ResponseString getErrorResponseString(String errorString) { return ResponseString .RESPONSE_STRING_theIssuanceOfThisCredentialIsPending; + case 'invalid_request': + return ResponseString.RESPONSE_STRING_invalidRequestErrorDescription; + + case 'invalid_client': + return ResponseString.RESPONSE_STRING_invalidClientErrorDescription; + + case 'vp_formats_not_supported': + return ResponseString + .RESPONSE_STRING_vpFormatsNotSupportedErrorDescription; + + case 'invalid_presentation_definition_uri': + return ResponseString + .RESPONSE_STRING_invalidPresentationDefinitionUriErrorDescription; + default: return ResponseString.RESPONSE_STRING_thisRequestIsNotSupported; } diff --git a/lib/app/shared/message_handler/global_message.dart b/lib/app/shared/message_handler/global_message.dart index 04312da05..162f70b70 100644 --- a/lib/app/shared/message_handler/global_message.dart +++ b/lib/app/shared/message_handler/global_message.dart @@ -387,4 +387,16 @@ class GlobalMessage { String get RESPONSE_STRING_theWalletIsSuspended => l10n.theWalletIsSuspended; String RESPONSE_STRING_couldNotFindTheAccountWithThisAddress(String value) => l10n.couldNotFindTheAccountWithThisAddress(value); + + String get RESPONSE_STRING_invalidRequestErrorDescription => + l10n.invalidRequestErrorDescription; + + String get RESPONSE_STRING_invalidClientErrorDescription => + l10n.invalidClientErrorDescription; + + String get RESPONSE_STRING_vpFormatsNotSupportedErrorDescription => + l10n.vpFormatsNotSupportedErrorDescription; + + String get RESPONSE_STRING_invalidPresentationDefinitionUriErrorDescription => + l10n.invalidPresentationDefinitionUriErrorDescription; } diff --git a/lib/app/shared/message_handler/response_message.dart b/lib/app/shared/message_handler/response_message.dart index 1aad7608d..406748037 100644 --- a/lib/app/shared/message_handler/response_message.dart +++ b/lib/app/shared/message_handler/response_message.dart @@ -769,6 +769,33 @@ class ResponseMessage with MessageHandler { context, injectedMessage: injectedMessage, ); + + case ResponseString.RESPONSE_STRING_invalidRequestErrorDescription: + return ResponseString.RESPONSE_STRING_invalidRequestErrorDescription + .localise( + context, + ); + + case ResponseString.RESPONSE_STRING_invalidClientErrorDescription: + return ResponseString.RESPONSE_STRING_invalidClientErrorDescription + .localise( + context, + ); + + case ResponseString + .RESPONSE_STRING_vpFormatsNotSupportedErrorDescription: + return ResponseString + .RESPONSE_STRING_vpFormatsNotSupportedErrorDescription.localise( + context, + ); + + case ResponseString + .RESPONSE_STRING_invalidPresentationDefinitionUriErrorDescription: + return ResponseString + .RESPONSE_STRING_invalidPresentationDefinitionUriErrorDescription + .localise( + context, + ); } } return ''; diff --git a/lib/l10n/arb/app_en.arb b/lib/l10n/arb/app_en.arb index 07035c0e6..28e3e5275 100644 --- a/lib/l10n/arb/app_en.arb +++ b/lib/l10n/arb/app_en.arb @@ -1053,5 +1053,9 @@ "account": {} } }, - "cannotDeleteCurrentAccount": "Sorrry, you cannot delete current account" + "cannotDeleteCurrentAccount": "Sorrry, you cannot delete current account", + "invalidRequestErrorDescription": "The request contains more than one out of the following three options to communicate a requested Credential: a presentation_definition parameter, a presentation_definition_uri parameter, or a scope value representing a Presentation Definition. Requested Presentation Definition does not conform the specs.The Wallet does not support the client_id_scheme value passed in the Authorization Request.The Client Identifier passed in the request did not belong to the Client Identifier scheme indicated in the Authorization Request, or requirements of a certain scheme was violated.", + "invalidClientErrorDescription": "client_id is not conformed to client_id_scheme", + "vpFormatsNotSupportedErrorDescription": "The Wallet does not support any of the formats requested by the Verifier, such as those included in the vp_formats registration parameter.", + "invalidPresentationDefinitionUriErrorDescription": "The Presentation Definition URL cannot be reached." } diff --git a/lib/l10n/untranslated.json b/lib/l10n/untranslated.json index 7dadc0877..a27917283 100644 --- a/lib/l10n/untranslated.json +++ b/lib/l10n/untranslated.json @@ -21,7 +21,11 @@ "themeSettingsDescription", "couldNotFindTheAccountWithThisAddress", "deleteAccountMessage", - "cannotDeleteCurrentAccount" + "cannotDeleteCurrentAccount", + "invalidRequestErrorDescription", + "invalidClientErrorDescription", + "vpFormatsNotSupportedErrorDescription", + "invalidPresentationDefinitionUriErrorDescription" ], "es": [ @@ -46,7 +50,11 @@ "themeSettingsDescription", "couldNotFindTheAccountWithThisAddress", "deleteAccountMessage", - "cannotDeleteCurrentAccount" + "cannotDeleteCurrentAccount", + "invalidRequestErrorDescription", + "invalidClientErrorDescription", + "vpFormatsNotSupportedErrorDescription", + "invalidPresentationDefinitionUriErrorDescription" ], "fr": [ @@ -76,6 +84,10 @@ "themeSettingsDescription", "couldNotFindTheAccountWithThisAddress", "deleteAccountMessage", - "cannotDeleteCurrentAccount" + "cannotDeleteCurrentAccount", + "invalidRequestErrorDescription", + "invalidClientErrorDescription", + "vpFormatsNotSupportedErrorDescription", + "invalidPresentationDefinitionUriErrorDescription" ] }