From 5b64b92e3958628c951eaeb0510cdcae424436c7 Mon Sep 17 00:00:00 2001 From: Marten Rebane Date: Thu, 3 Sep 2026 15:56:45 +0300 Subject: [PATCH 1/2] Fix signing error message for Latvia and Lithuania --- .../SmartIdLib/Networking/Handler/ResponseHandler.swift | 2 +- .../Networking/Handler/ResponseHandlerTests.swift | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Modules/SmartIdLib/Sources/SmartIdLib/Networking/Handler/ResponseHandler.swift b/Modules/SmartIdLib/Sources/SmartIdLib/Networking/Handler/ResponseHandler.swift index 3ea5f91e..338152c6 100644 --- a/Modules/SmartIdLib/Sources/SmartIdLib/Networking/Handler/ResponseHandler.swift +++ b/Modules/SmartIdLib/Sources/SmartIdLib/Networking/Handler/ResponseHandler.swift @@ -82,7 +82,7 @@ struct ResponseHandler: ResponseHandlerProtocol { switch statusCode ?? -1 { case 400: throw SmartIdError.incorrectParameters - case 401: + case 401, 403: throw SmartIdError.invalidAccessRights case 404: throw SmartIdError.accountNotFound diff --git a/Modules/SmartIdLib/Tests/SmartIdLibTests/Networking/Handler/ResponseHandlerTests.swift b/Modules/SmartIdLib/Tests/SmartIdLibTests/Networking/Handler/ResponseHandlerTests.swift index fc5784a6..8f91650b 100644 --- a/Modules/SmartIdLib/Tests/SmartIdLibTests/Networking/Handler/ResponseHandlerTests.swift +++ b/Modules/SmartIdLib/Tests/SmartIdLibTests/Networking/Handler/ResponseHandlerTests.swift @@ -188,6 +188,15 @@ struct ResponseHandlerTests { } } + @Test + func handleNetworkError_throwsInvalidAccessRightsWhenUnacceptableStatusCode403Returned() { + let afError = AFError.responseValidationFailed(reason: .unacceptableStatusCode(code: 403)) + + #expect(throws: SmartIdError.invalidAccessRights) { + try handler.handleNetworkError(afError, statusCode: 403) + } + } + @Test func handleNetworkError_throwsIncorrectParametersWhenUnacceptableStatusCode400Returned() { let afError = AFError.responseValidationFailed(reason: .unacceptableStatusCode(code: 400)) From 11e25de7a2d1b9bbeb76bf7cf8706b77bc53f024 Mon Sep 17 00:00:00 2001 From: Marten Rebane Date: Wed, 23 Sep 2026 16:10:23 +0300 Subject: [PATCH 2/2] Fix opening URL when clicking on additional information button --- .../Supporting files/Localizable.xcstrings | 36 +++++++++---------- .../Container/Signing/NFC/NFCView.swift | 2 +- .../Util/Language/LanguageSettingsTests.swift | 27 ++++++++++++++ 3 files changed, 46 insertions(+), 19 deletions(-) diff --git a/RIADigiDoc/Supporting files/Localizable.xcstrings b/RIADigiDoc/Supporting files/Localizable.xcstrings index 25ba3fcc..f32c823c 100644 --- a/RIADigiDoc/Supporting files/Localizable.xcstrings +++ b/RIADigiDoc/Supporting files/Localizable.xcstrings @@ -3131,24 +3131,6 @@ } } }, - "Invalid Mobile-ID access rights url" : { - "comment" : "URL that user can open in browser to read more about signing large quantities of documents", - "extractionState" : "manual", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "https://www.id.ee/en/article/for-organisations-that-sign-large-quantities-of-documents-using-digidoc4-client/" - } - }, - "et" : { - "stringUnit" : { - "state" : "translated", - "value" : "https://www.id.ee/artikkel/asutustele-kus-allkirjastatakse-digidoc4-kliendi-kaudu-suuremates-kogustes-dokumente/" - } - } - } - }, "Invalid personal code" : { "comment" : "Shown in signing view when personal code is not correct", "extractionState" : "manual", @@ -3263,6 +3245,24 @@ } } }, + "Invalid signing access rights url" : { + "comment" : "URL that user can open in browser to read more about signing large quantities of documents", + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "https://www.id.ee/en/article/for-organisations-that-sign-large-quantities-of-documents-using-digidoc4-client/" + } + }, + "et" : { + "stringUnit" : { + "state" : "translated", + "value" : "https://www.id.ee/artikkel/asutustele-kus-allkirjastatakse-digidoc4-kliendi-kaudu-suuremates-kogustes-dokumente/" + } + } + } + }, "Invalid Web eID request" : { "comment" : "WebEid invalid request error message", "extractionState" : "manual", diff --git a/RIADigiDoc/UI/Component/Container/Signing/NFC/NFCView.swift b/RIADigiDoc/UI/Component/Container/Signing/NFC/NFCView.swift index 4a3b693b..4b89de27 100644 --- a/RIADigiDoc/UI/Component/Container/Signing/NFC/NFCView.swift +++ b/RIADigiDoc/UI/Component/Container/Signing/NFC/NFCView.swift @@ -140,7 +140,7 @@ struct NFCView: View { self.actionType = actionType self.pinType = pinType self._isWebEidAuthenticating = isWebEidAuthenticating - self.rememberMe = rememberMe + _rememberMe = State(wrappedValue: rememberMe) self.actionMethods = actionMethods self.cryptoContainer = cryptoContainer self.signedContainer = signedContainer diff --git a/RIADigiDocTests/Util/Language/LanguageSettingsTests.swift b/RIADigiDocTests/Util/Language/LanguageSettingsTests.swift index 814072e6..a23ae8cb 100644 --- a/RIADigiDocTests/Util/Language/LanguageSettingsTests.swift +++ b/RIADigiDocTests/Util/Language/LanguageSettingsTests.swift @@ -17,6 +17,7 @@ * */ +import Foundation import Testing struct LanguageSettingsTests { @@ -52,4 +53,30 @@ struct LanguageSettingsTests { #expect(await languageSettings.getSelectedLanguage() == testLanguageCode) #expect(mockDataStore.setSelectedLanguageCallCount == 1) } + + @Test(arguments: ["en", "et"]) + func localized_resolvesEveryInfoLinkKeyToWebUrl(languageCode: String) async throws { + let infoLinkKeys = [ + "ID card courier activate URL", + "Invalid signing access rights url", + "Main accessibility more info url", + "Main home menu help url", + "OCSP response not in valid time slot url", + "PIN1 locked URL", + "PIN2 locked URL", + "PUK blocked Thales URL", + "PUK blocked URL", + "Siva message url", + "Too many requests url" + ] + + mockDataStore.getSelectedLanguageHandler = { languageCode } + await languageSettings.setSelectedLanguage(newLanguageCode: languageCode) + + for key in infoLinkKeys { + let localizedUrl = await languageSettings.localized(key) + let url = try #require(URL(string: localizedUrl), "'\(key)' is not a URL in \(languageCode)") + #expect(url.scheme == "https", "'\(key)' is not an https URL in \(languageCode)") + } + } }