From 455a15aec61a1e6201ebf8d26a22672fdf9c97c4 Mon Sep 17 00:00:00 2001 From: Paul B Date: Wed, 2 Mar 2022 15:49:25 +0100 Subject: [PATCH] Fix: Release/1.3.1 (#131) * no message * added new UI * Ticketing solution logic update - Added model to handle QR scan from ticket service - Added blueprint of method to obtain list of auth services * Refactored list of service method * Implemented method to fetch list of services * added new UI * server list view controller * Access token for ticketing - Request implemented - Model for response added * added selected and deselected state * List of services implemented * Public key generation added * Small refactoring to avoid crash * AccessTokenRequest fixed - Filtering for certificates added * Selection code adjusted with model * Comment removed * fixed small UI bugs * Consent screen added - request for validation added * Fixed UI part of selection of cert * xnonce added * Fixed navigation in wallet app * Fixed navigation and cells. Added Certificate controller to navigation. * Added services controller * Remove obsolete sources * Removed unnecessary fields * minor fixes * Replaced x-buttons * Removed unnecessary code * Validation request added * Refactored ut8 string to base64decoded data * Code clean up * Identity services refactored * Code clean up * Validation Result view controller added * fixed QR class * Fixed navigation * Fixed navigation * Bug fix session #108 #111 #113 * Added remove certificate functionality * Added delete alert * Fixed deleting * Fixed reload bug in ListCertificates * Add Developer Team * Changed cert compare * Fixed certificates table with edit * Added 2 controller files to storyboard * Fixed crash on verification result if no validation info passed * Update project * Scan Moved from Core * Added viewers to storyboard * Added remove messages to ImageViewer and PDF * Fixed Remove action * Removed xibs from controllers * Minor fix storyboard * Removed last xib * Fixed deleting, crash with race and some textes * Fix public in Date extention * Added activity check * Fixed crash with reload table * Added flash of added item * Added OK button * Fixed rule cell * Updated buttons * Fixed Grant layout * Minor fix * Fix crash with adding certs * minor fix * Fix selecting of sertificates * Added new version * added logsto requests * remove print * Fixed posting certificates * Added delete button * Removed FloatingPanel, Added delete certificate button * Finalized remove certificate * Fixed layout * Fixed deleting calbacks * Removed FloatingPanel package * Removed FloatingPanel resources * removed unnecessary import directives * Aded common core * Removed errors with cert * Fixed wallet app after core mege * fix in project tree * Access token info added on Certificate list screen * fixed storyboards * minor fixes * Added activity indicator * Added config * Fixed navigation issues * Fixed classe names in storyboards * fixed fetch time * Fixed reloadingData * fixed storyboard - added reload cell * Added reload after dismissing * Fixed Scan of ticketing QR code * minor changes in project tree * Fixed page controller * removed selected country code * Fixed landscape orientation for iPad * refactor UI cells * increased build num * temp data * correct data * fixed project settings * Fixed issue - Certificate for Ticketing can not be found * Added loading to confirm validity * x5c type changed in PublicKeyJWK structure Replaced x5c type of String with [String] in order to follow backend changes * Refactor controller names and data managers * fixed crash in ticketing * Business data were removed from TicketingAcceptanceController controller * Fixed back buttons * added background * Added Alerts to the Ticketing * refactor project tree * Replaced UserDefaults storage with keyChain * removed queue from request * Updated localization strings * Changed in localizations * Removed keys from Localization file * Added Safe thread array. * Fixed string format * Added de-localization * Added localisations to resource files * Added app localised name * Fixed localizations * Added localized property. Added alert on save PDF, fixed alerts * Optimised loading on main screen * Fixed reload page on main screen * Fixed layout in Image and PDF cells * Fixed reload table on main screen * upgrade version num * Fixed Localized strings * Added one line to localization * Refactored Access Token functionality * Added error processing to the ticketing * Fix verification fields * Fixed search of validation data * Fixed main thread methods * Fixed incorrect alert messages * Updated localized strings * Fixed json logic * Added revocation to walllet * removed database * removed dismiss delegate (added timer) * feat: revocation * fix: revocation lookup * chore: version 1.3.1 * fix: exp bug * fix: certString contains revocation status Co-authored-by: Alexandr Chernyy Co-authored-by: Illia Vlasov Co-authored-by: Test Co-authored-by: ikhomiak Co-authored-by: IgorKhomiak --- DGCAWallet/Components/WalletCell.swift | 7 +- .../DataStorageManagement/DataStuctures.swift | 75 ++++++++++--------- .../LocalDataManager.swift | 2 +- DGCAWallet/Services/GatewayConnection.swift | 10 +-- .../Storyboards/Base.lproj/Main.storyboard | 2 +- 5 files changed, 50 insertions(+), 46 deletions(-) diff --git a/DGCAWallet/Components/WalletCell.swift b/DGCAWallet/Components/WalletCell.swift index 1236a6f..1dd23f3 100644 --- a/DGCAWallet/Components/WalletCell.swift +++ b/DGCAWallet/Components/WalletCell.swift @@ -35,12 +35,13 @@ class WalletCell: UITableViewCell { func setupCell(_ dated: DatedCertString) { guard let cert = dated.cert else { return } - typeLabel.text = cert.certTypeString nameLabel.text = cert.fullName dateLabel.text = String(format: "Scanned %@".localized, dated.date.localDateString) guard let cert = dated.cert else { return } - revocationLabel.isHidden = cert.isRevoked ?? true - revocationLabel.text = cert.isRevoked == true ? "Certificate revoked" : "" + if let isRevoked = cert.isRevoked { + revocationLabel.isHidden = !isRevoked + } + revocationLabel.text = "Certificate revoked" } } diff --git a/DGCAWallet/Models/DataStorageManagement/DataStuctures.swift b/DGCAWallet/Models/DataStorageManagement/DataStuctures.swift index a36398b..c3882dd 100644 --- a/DGCAWallet/Models/DataStorageManagement/DataStuctures.swift +++ b/DGCAWallet/Models/DataStorageManagement/DataStuctures.swift @@ -24,55 +24,58 @@ // // Created by Igor Khomiak on 11/3/21. // - + import Foundation import SwiftDGC import CertLogic class DatedCertString: Codable { - var isSelected: Bool = false - let date: Date - let certString: String - let storedTAN: String? - var cert: HCert? { - return try? HCert(from: certString) - } - - - init(date: Date, certString: String, storedTAN: String?) { - self.date = date - self.certString = certString - self.storedTAN = storedTAN - } + var isSelected: Bool = false + let date: Date + let certString: String + let storedTAN: String? + var cert: HCert? { + return try? HCert(from: certString) + } + + init(date: Date, certString: String, storedTAN: String?, isRevoked: Bool?) { + self.date = date + if isRevoked != nil && isRevoked == true { + self.certString = "x" + certString + } else { + self.certString = certString + } + self.storedTAN = storedTAN + } } class LocalData: Codable { - var encodedPublicKeys = [String: [String]]() - var certStrings = [DatedCertString]() - - var countryCodes = [CountryModel]() - var valueSets = [ValueSet]() - var rules = [Rule]() - - var resumeToken: String? - var lastFetchRaw: Date? - var lastFetch: Date { - get { - lastFetchRaw ?? Date.distantPast - } - set { - lastFetchRaw = newValue - } - } - var config = Config.load() - var lastLaunchedAppVersion = "0.0" + var encodedPublicKeys = [String: [String]]() + var certStrings = [DatedCertString]() + + var countryCodes = [CountryModel]() + var valueSets = [ValueSet]() + var rules = [Rule]() + + var resumeToken: String? + var lastFetchRaw: Date? + var lastFetch: Date { + get { + lastFetchRaw ?? Date.distantPast + } + set { + lastFetchRaw = newValue + } + } + var config = Config.load() + var lastLaunchedAppVersion = "0.0" } class ImageDataStorage: Codable { - var images = [SavedImage]() + var images = [SavedImage]() } class PdfDataStorage: Codable { - var pdfs = [SavedPDF]() + var pdfs = [SavedPDF]() } diff --git a/DGCAWallet/Models/DataStorageManagement/LocalDataManager.swift b/DGCAWallet/Models/DataStorageManagement/LocalDataManager.swift index 4262c10..d6e1ffe 100644 --- a/DGCAWallet/Models/DataStorageManagement/LocalDataManager.swift +++ b/DGCAWallet/Models/DataStorageManagement/LocalDataManager.swift @@ -46,7 +46,7 @@ class LocalDataManager { } func add(_ cert: HCert, with tan: String?, completion: @escaping DataCompletionHandler) { - localData.certStrings.append(DatedCertString(date: Date(), certString: cert.fullPayloadString, storedTAN: tan)) + localData.certStrings.append(DatedCertString(date: Date(), certString: cert.fullPayloadString, storedTAN: tan, isRevoked: cert.isRevoked)) storage.save(localData, completion: completion) } diff --git a/DGCAWallet/Services/GatewayConnection.swift b/DGCAWallet/Services/GatewayConnection.swift index 90e4c1e..abe87d1 100644 --- a/DGCAWallet/Services/GatewayConnection.swift +++ b/DGCAWallet/Services/GatewayConnection.swift @@ -141,9 +141,9 @@ class GatewayConnection: ContextConnection { let revokedHashes = response as [String] for revokedHash in revokedHashes { certs.forEach { date, cert in - if revokedHash.elementsEqual(cert.uvciHash!.toHexString()) || - revokedHash.elementsEqual(cert.signatureHash!.toHexString()) || - revokedHash.elementsEqual(cert.countryCodeUvciHash!.toHexString()) { + if revokedHash.elementsEqual(cert.uvciHash![0.. - +