From 09dee79b1573d356898d142dcb49d081babd50de Mon Sep 17 00:00:00 2001 From: Marek Stransky Date: Wed, 6 Dec 2023 13:10:22 +0100 Subject: [PATCH 1/3] Rename proximity timestamps --- .../Model/Requests/WMTAuthorizationData.swift | 10 +++++----- .../Model/UserOperation/WMTProximityCheck.swift | 6 +++--- .../Operations/Service/WMTOperationsImpl.swift | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/WultraMobileTokenSDK/Operations/Model/Requests/WMTAuthorizationData.swift b/WultraMobileTokenSDK/Operations/Model/Requests/WMTAuthorizationData.swift index 9c3e48b..91f1936 100644 --- a/WultraMobileTokenSDK/Operations/Model/Requests/WMTAuthorizationData.swift +++ b/WultraMobileTokenSDK/Operations/Model/Requests/WMTAuthorizationData.swift @@ -34,7 +34,7 @@ class WMTAuthorizationData: Codable { self.proximityCheck = proximityCheck } - init(operation: WMTOperation, timestampSigned: Date = Date()) { + init(operation: WMTOperation, timestampSent: Date = Date()) { self.id = operation.id self.data = operation.data @@ -46,8 +46,8 @@ class WMTAuthorizationData: Codable { self.proximityCheck = WMTProximityCheckData( otp: proximityCheck.totp, type: proximityCheck.type, - timestampRequested: proximityCheck.timestampRequested, - timestampSigned: timestampSigned + timestampRecieved: proximityCheck.timestampRecieved, + timestampSent: timestampSent ) } } @@ -62,8 +62,8 @@ struct WMTProximityCheckData: Codable { let type: WMTProximityCheckType /// Timestamp when the operation was delivered to the app - let timestampRequested: Date + let timestampRecieved: Date /// Timestamp when the operation was signed - let timestampSigned: Date + let timestampSent: Date } diff --git a/WultraMobileTokenSDK/Operations/Model/UserOperation/WMTProximityCheck.swift b/WultraMobileTokenSDK/Operations/Model/UserOperation/WMTProximityCheck.swift index e05411e..471dc9d 100644 --- a/WultraMobileTokenSDK/Operations/Model/UserOperation/WMTProximityCheck.swift +++ b/WultraMobileTokenSDK/Operations/Model/UserOperation/WMTProximityCheck.swift @@ -28,12 +28,12 @@ public class WMTProximityCheck: Codable { public let type: WMTProximityCheckType /// Timestamp when the operation was scanned (qrCode) or delivered to the device (deeplink) - public let timestampRequested: Date + public let timestampRecieved: Date - public init(totp: String, type: WMTProximityCheckType, timestampRequested: Date = Date()) { + public init(totp: String, type: WMTProximityCheckType, timestampRecieved: Date = Date()) { self.totp = totp self.type = type - self.timestampRequested = timestampRequested + self.timestampRecieved = timestampRecieved } } diff --git a/WultraMobileTokenSDK/Operations/Service/WMTOperationsImpl.swift b/WultraMobileTokenSDK/Operations/Service/WMTOperationsImpl.swift index 9a6d98a..83cea61 100644 --- a/WultraMobileTokenSDK/Operations/Service/WMTOperationsImpl.swift +++ b/WultraMobileTokenSDK/Operations/Service/WMTOperationsImpl.swift @@ -243,7 +243,7 @@ class WMTOperationsImpl: WMTOperations, WMTService { return nil } - let data = WMTAuthorizationData(operation: operation, timestampSigned: currentServerDate ?? Date()) + let data = WMTAuthorizationData(operation: operation, timestampSent: currentServerDate ?? Date()) return networking.post(data: .init(data), signedWith: authentication, to: WMTOperationEndpoints.Authorize.endpoint) { response, error in self.processResult(response: response, error: error) { result in From 834a5b5ea1b5a7f2f9c4e5a448108ea1488c4d8f Mon Sep 17 00:00:00 2001 From: Marek Stransky Date: Wed, 6 Dec 2023 13:16:51 +0100 Subject: [PATCH 2/3] Fix typo --- .../Operations/Model/Requests/WMTAuthorizationData.swift | 4 ++-- .../Operations/Model/UserOperation/WMTProximityCheck.swift | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/WultraMobileTokenSDK/Operations/Model/Requests/WMTAuthorizationData.swift b/WultraMobileTokenSDK/Operations/Model/Requests/WMTAuthorizationData.swift index 91f1936..ab64089 100644 --- a/WultraMobileTokenSDK/Operations/Model/Requests/WMTAuthorizationData.swift +++ b/WultraMobileTokenSDK/Operations/Model/Requests/WMTAuthorizationData.swift @@ -46,7 +46,7 @@ class WMTAuthorizationData: Codable { self.proximityCheck = WMTProximityCheckData( otp: proximityCheck.totp, type: proximityCheck.type, - timestampRecieved: proximityCheck.timestampRecieved, + timestampReceived: proximityCheck.timestampReceived, timestampSent: timestampSent ) } @@ -62,7 +62,7 @@ struct WMTProximityCheckData: Codable { let type: WMTProximityCheckType /// Timestamp when the operation was delivered to the app - let timestampRecieved: Date + let timestampReceived: Date /// Timestamp when the operation was signed let timestampSent: Date diff --git a/WultraMobileTokenSDK/Operations/Model/UserOperation/WMTProximityCheck.swift b/WultraMobileTokenSDK/Operations/Model/UserOperation/WMTProximityCheck.swift index 471dc9d..6c23683 100644 --- a/WultraMobileTokenSDK/Operations/Model/UserOperation/WMTProximityCheck.swift +++ b/WultraMobileTokenSDK/Operations/Model/UserOperation/WMTProximityCheck.swift @@ -28,12 +28,12 @@ public class WMTProximityCheck: Codable { public let type: WMTProximityCheckType /// Timestamp when the operation was scanned (qrCode) or delivered to the device (deeplink) - public let timestampRecieved: Date + public let timestampReceived: Date - public init(totp: String, type: WMTProximityCheckType, timestampRecieved: Date = Date()) { + public init(totp: String, type: WMTProximityCheckType, timestampReceived: Date = Date()) { self.totp = totp self.type = type - self.timestampRecieved = timestampRecieved + self.timestampReceived = timestampReceived } } From e7e669f2b32fd75e417e047356358c949b5f84fb Mon Sep 17 00:00:00 2001 From: Marek Stransky Date: Wed, 6 Dec 2023 13:27:36 +0100 Subject: [PATCH 3/3] Change timestamp names in docs --- docs/Using-Operations-Service.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/Using-Operations-Service.md b/docs/Using-Operations-Service.md index 1fa0006..ff2c551 100644 --- a/docs/Using-Operations-Service.md +++ b/docs/Using-Operations-Service.md @@ -515,7 +515,7 @@ public class WMTProximityCheck: Codable { /// Type of the Proximity check public let type: WMTProximityCheckType /// Timestamp when the operation was scanned (QR Code) or delivered to the device (Deeplink) - public let timestampRequested: Date + public let timestampReceived: Date } ``` @@ -617,10 +617,10 @@ When the app is launched via a deeplink, preserve the data from the deeplink and Once the QR code is scanned or match from the deeplink is found, create a `WMTProximityCheck` with: - `totp`: The actual Time-Based One-Time Password. - `type`: Set to `WMTProximityCheckType.qrCode` or `WMTProximityCheckType.deeplink`. - - `timestampRequested`: The timestamp when the QR code was scanned (by default, it is created as the current timestamp). + - `timestampReceived`: The timestamp when the QR code was scanned (by default, it is created as the current timestamp). - Authorizing the WMTProximityCheck -When authorization, the SDK will by default add `timestampSigned` to the `WMTProximityCheck` object. This timestamp indicates when the operation was signed. +When authorization, the SDK will by default add `timestampSent` to the `WMTProximityCheck` object. This timestamp indicates when the operation was signed. ### WMTPACUtils - For convenience, utility class for parsing and extracting data from QR codes and deeplinks used in the PAC (Proximity Anti-fraud Check), is provided.