diff --git a/VCL/VCL.xcodeproj/project.pbxproj b/VCL/VCL.xcodeproj/project.pbxproj index 0512049..17629c2 100644 --- a/VCL/VCL.xcodeproj/project.pbxproj +++ b/VCL/VCL.xcodeproj/project.pbxproj @@ -1814,7 +1814,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 148; + CURRENT_PROJECT_VERSION = 149; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -1834,7 +1834,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = VCL/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.0; - MARKETING_VERSION = 2.6.0; + MARKETING_VERSION = 2.6.3; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -1882,7 +1882,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 148; + CURRENT_PROJECT_VERSION = 149; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -1896,7 +1896,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = VCL/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.0; - MARKETING_VERSION = 2.6.0; + MARKETING_VERSION = 2.6.3; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; @@ -1914,7 +1914,7 @@ buildSettings = { CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 148; + CURRENT_PROJECT_VERSION = 149; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = 7DDDGP43MJ; DYLIB_COMPATIBILITY_VERSION = 1; @@ -1927,7 +1927,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.6.0; + MARKETING_VERSION = 2.6.3; PRODUCT_BUNDLE_IDENTIFIER = io.velocitycareerlabs.VCL; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1943,7 +1943,7 @@ buildSettings = { CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 148; + CURRENT_PROJECT_VERSION = 149; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = 7DDDGP43MJ; DYLIB_COMPATIBILITY_VERSION = 1; @@ -1956,7 +1956,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.6.0; + MARKETING_VERSION = 2.6.3; PRODUCT_BUNDLE_IDENTIFIER = io.velocitycareerlabs.VCL; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/VCL/VCL/api/entities/VCLCredentialManifest.swift b/VCL/VCL/api/entities/VCLCredentialManifest.swift index 3494f85..342ab57 100644 --- a/VCL/VCL/api/entities/VCLCredentialManifest.swift +++ b/VCL/VCL/api/entities/VCLCredentialManifest.swift @@ -37,24 +37,24 @@ public struct VCLCredentialManifest: Sendable { public var did: String { get { return iss } } public var issuerId: String { get { jwt.payload?[CodingKeys.KeyIssuer] as? String - ?? (jwt.payload?[CodingKeys.KeyIssuer] as? [String: Any])?[CodingKeys.KeyId] as? String + ?? (jwt.payload?[CodingKeys.KeyIssuer] as? [String: Sendable])?[CodingKeys.KeyId] as? String ?? "" } } public var aud: String { get { return retrieveAud() } } public var exchangeId: String { get { return jwt.payload?[CodingKeys.KeyExchangeId] as? String ?? "" } } - public var presentationDefinitionId: String { get { (jwt.payload?[CodingKeys.KeyPresentationDefinitionId] as? [String: Any])?[CodingKeys.KeyId] as? String ?? "" } } + public var presentationDefinitionId: String { get { (jwt.payload?[CodingKeys.KeyPresentationDefinitionId] as? [String: Sendable])?[CodingKeys.KeyId] as? String ?? "" } } public var finalizeOffersUri: String { get { - (jwt.payload?[VCLCredentialManifest.CodingKeys.KeyMetadata] as? [String: Any])?[VCLCredentialManifest.CodingKeys.KeyFinalizeOffersUri] as? String ?? "" } } + (jwt.payload?[VCLCredentialManifest.CodingKeys.KeyMetadata] as? [String: Sendable])?[VCLCredentialManifest.CodingKeys.KeyFinalizeOffersUri] as? String ?? "" } } public var checkOffersUri: String { get { - (jwt.payload?[VCLCredentialManifest.CodingKeys.KeyMetadata] as? [String: Any])?[VCLCredentialManifest.CodingKeys.KeyCheckOffersUri] as? String ?? "" } } + (jwt.payload?[VCLCredentialManifest.CodingKeys.KeyMetadata] as? [String: Sendable])?[VCLCredentialManifest.CodingKeys.KeyCheckOffersUri] as? String ?? "" } } public var submitPresentationUri: String { get { - (jwt.payload?[VCLCredentialManifest.CodingKeys.KeyMetadata] as? [String: Any])?[VCLCredentialManifest.CodingKeys.KeySubmitIdentificationUri] as? String ?? "" } } + (jwt.payload?[VCLCredentialManifest.CodingKeys.KeyMetadata] as? [String: Sendable])?[VCLCredentialManifest.CodingKeys.KeySubmitIdentificationUri] as? String ?? "" } } private func retrieveAud() -> String { - let url = ((jwt.payload?[CodingKeys.KeyMetadata] as? [String: Any])?[CodingKeys.KeyFinalizeOffersUri] as? String) ?? "" + let url = ((jwt.payload?[CodingKeys.KeyMetadata] as? [String: Sendable])?[CodingKeys.KeyFinalizeOffersUri] as? String) ?? "" if let range = url.range(of: "/issue/") { return String(url[.. [String: Any?] { + func generateRequestBody(proof: VCLJwt?) -> [String: Sendable?] { var retVal = self.payload if let proof = proof { retVal[CodingKeys.KeyProof] = [ diff --git a/VCL/VCL/api/entities/VCLGenerateOffersDescriptor.swift b/VCL/VCL/api/entities/VCLGenerateOffersDescriptor.swift index 92a44c8..43184d5 100644 --- a/VCL/VCL/api/entities/VCLGenerateOffersDescriptor.swift +++ b/VCL/VCL/api/entities/VCLGenerateOffersDescriptor.swift @@ -27,11 +27,11 @@ public struct VCLGenerateOffersDescriptor: Sendable { self.identificationVerifiableCredentials = identificationVerifiableCredentials } - public var payload: [String: Any?] { get { + public var payload: [String: Sendable?] { get { [ CodingKeys.KeyExchangeId: exchangeId, - CodingKeys.KeyTypes: types ?? [Any](), - CodingKeys.KeyOfferHashes: offerHashes ?? [Any]() + CodingKeys.KeyTypes: types ?? [Sendable](), + CodingKeys.KeyOfferHashes: offerHashes ?? [Sendable]() ] } } diff --git a/VCL/VCL/api/entities/VCLJwt.swift b/VCL/VCL/api/entities/VCLJwt.swift index c39a506..12fbc08 100644 --- a/VCL/VCL/api/entities/VCLJwt.swift +++ b/VCL/VCL/api/entities/VCLJwt.swift @@ -81,7 +81,7 @@ public struct VCLJwt: Sendable { } var kid: String? { get { - return (header?[CodingKeys.KeyKid] as? String) ?? ((header?[CodingKeys.KeyJwk] as? [String: Any])?[CodingKeys.KeyKid]) as? String + return (header?[CodingKeys.KeyKid] as? String) ?? ((header?[CodingKeys.KeyJwk] as? [String: Sendable])?[CodingKeys.KeyKid]) as? String } } var iss: String? { get { return self.payload?[CodingKeys.KeyIss] as? String diff --git a/VCL/VCL/api/entities/VCLOffer.swift b/VCL/VCL/api/entities/VCLOffer.swift index 8023be5..8021a69 100644 --- a/VCL/VCL/api/entities/VCLOffer.swift +++ b/VCL/VCL/api/entities/VCLOffer.swift @@ -16,7 +16,7 @@ public struct VCLOffer: Sendable { self.payload = payload } - public var issuerId: String { get { (payload[CodingKeys.KeyIssuer] as? [String: Any])?[CodingKeys.KeyId] as? String + public var issuerId: String { get { (payload[CodingKeys.KeyIssuer] as? [String: Sendable])?[CodingKeys.KeyId] as? String ?? payload[CodingKeys.KeyIssuer] as? String ?? "" }} diff --git a/VCL/VCL/api/entities/VCLPresentationRequest.swift b/VCL/VCL/api/entities/VCLPresentationRequest.swift index 23f8002..796eb7d 100644 --- a/VCL/VCL/api/entities/VCLPresentationRequest.swift +++ b/VCL/VCL/api/entities/VCLPresentationRequest.swift @@ -36,15 +36,15 @@ public struct VCLPresentationRequest: Sendable { public var iss: String { get { jwt.payload?[CodingKeys.KeyIss] as? String ?? "" } } public var exchangeId: String { get { jwt.payload?[CodingKeys.KeyExchangeId] as? String ?? "" } } public var presentationDefinitionId: String { get { - (jwt.payload?[CodingKeys.KeyPresentationDefinition] as? [String:Any])? [CodingKeys.KeyId] as? String ?? "" } + (jwt.payload?[CodingKeys.KeyPresentationDefinition] as? [String: Sendable])? [CodingKeys.KeyId] as? String ?? "" } } var keyID: String { get { return jwt.header?["kid"] as? String ?? "" } } var vendorOriginContext: String? { get { deepLink.vendorOriginContext } } var progressUri: String { get { - (jwt.payload?[CodingKeys.KeyMetadata] as? [String: Any])?[CodingKeys.KeyProgressUri] as? String ?? "" } } + (jwt.payload?[CodingKeys.KeyMetadata] as? [String: Sendable])?[CodingKeys.KeyProgressUri] as? String ?? "" } } var submitPresentationUri: String { get { - (jwt.payload?[CodingKeys.KeyMetadata] as? [String: Any])?[CodingKeys.KeySubmitPresentationUri] as? String ?? "" } } + (jwt.payload?[CodingKeys.KeyMetadata] as? [String: Sendable])?[CodingKeys.KeySubmitPresentationUri] as? String ?? "" } } public struct CodingKeys { public static let KeyId = "id" diff --git a/VCL/VCL/api/entities/VCLVerifiedProfile.swift b/VCL/VCL/api/entities/VCLVerifiedProfile.swift index 467e782..97951e5 100644 --- a/VCL/VCL/api/entities/VCLVerifiedProfile.swift +++ b/VCL/VCL/api/entities/VCLVerifiedProfile.swift @@ -17,7 +17,7 @@ public struct VCLVerifiedProfile: Sendable { self.payload = payload } - public var credentialSubject: [String: Any]? { get { payload[CodingKeys.KeyCredentialSubject] as? [String : Any] } } + public var credentialSubject: [String: Sendable]? { get { payload[CodingKeys.KeyCredentialSubject] as? [String : Sendable] } } public var name: String? { get { credentialSubject?[CodingKeys.KeyName] as? String } } public var logo: String? { get { credentialSubject?[CodingKeys.KeyLogo] as? String } } diff --git a/VCL/VCL/api/entities/error/VCLError.swift b/VCL/VCL/api/entities/error/VCLError.swift index 0190625..305ef03 100644 --- a/VCL/VCL/api/entities/error/VCLError.swift +++ b/VCL/VCL/api/entities/error/VCLError.swift @@ -68,7 +68,7 @@ public struct VCLError: Sendable, Error { } } - public func toDictionary() -> [String: Any?] { + public func toDictionary() -> [String: Sendable?] { return [ CodingKeys.KeyPayload: payload, CodingKeys.KeyError: error, diff --git a/VCL/VCL/impl/VCLImpl.swift b/VCL/VCL/impl/VCLImpl.swift index 75ced0d..2b395b1 100644 --- a/VCL/VCL/impl/VCLImpl.swift +++ b/VCL/VCL/impl/VCLImpl.swift @@ -86,8 +86,8 @@ public final class VCLImpl: @unchecked Sendable, VCL { } private func completionHandler( - _ successHandler: @escaping () -> Void, - _ errorHandler: @escaping (VCLError) -> Void + _ successHandler: @escaping @Sendable () -> Void, + _ errorHandler: @escaping @Sendable (VCLError) -> Void ) { if let error = self.initializationWatcher.firstError() { errorHandler(error) @@ -496,7 +496,7 @@ extension VCLImpl { } func printVersion() { - VCLLog.d("Version: \(GlobalConfig.Version)") - VCLLog.d("Build: \(GlobalConfig.Build)") + NSLog("Version: \(GlobalConfig.Version)") + NSLog("Build: \(GlobalConfig.Build)") } } diff --git a/VCL/VCL/impl/data/repositories/ExchangeProgressRepositoryImpl.swift b/VCL/VCL/impl/data/repositories/ExchangeProgressRepositoryImpl.swift index cb62144..9b57022 100644 --- a/VCL/VCL/impl/data/repositories/ExchangeProgressRepositoryImpl.swift +++ b/VCL/VCL/impl/data/repositories/ExchangeProgressRepositoryImpl.swift @@ -44,7 +44,7 @@ final class ExchangeProgressRepositoryImpl: ExchangeProgressRepository { } } - private func parseExchange(_ exchangeJsonDict: [String: Any]?) -> VCLExchange { + private func parseExchange(_ exchangeJsonDict: [String: Sendable]?) -> VCLExchange { return VCLExchange( id: exchangeJsonDict?[VCLExchange.CodingKeys.KeyId] as? String, type: exchangeJsonDict?[VCLExchange.CodingKeys.KeyType] as? String, diff --git a/VCL/VCL/impl/data/repositories/SubmissionRepositoryImpl.swift b/VCL/VCL/impl/data/repositories/SubmissionRepositoryImpl.swift index a337c9e..acd332a 100644 --- a/VCL/VCL/impl/data/repositories/SubmissionRepositoryImpl.swift +++ b/VCL/VCL/impl/data/repositories/SubmissionRepositoryImpl.swift @@ -47,17 +47,17 @@ final class SubmissionRepositoryImpl: SubmissionRepository { }) } - private func parse(_ jsonDict: [String: Any]?, _ jti: String, _ submissionId: String) -> VCLSubmissionResult { + private func parse(_ jsonDict: [String: Sendable]?, _ jti: String, _ submissionId: String) -> VCLSubmissionResult { let exchangeJsonDict = jsonDict?[VCLSubmissionResult.CodingKeys.KeyExchange] return VCLSubmissionResult( sessionToken: VCLToken(value: jsonDict?[VCLSubmissionResult.CodingKeys.KeyToken] as? String ?? ""), - exchange: parseExchange(exchangeJsonDict as? [String : Any]), + exchange: parseExchange(exchangeJsonDict as? [String: Sendable]), jti: jti, submissionId: submissionId ) } - private func parseExchange(_ exchangeJsonDict: [String: Any]?) -> VCLExchange { + private func parseExchange(_ exchangeJsonDict: [String: Sendable]?) -> VCLExchange { return VCLExchange( id: exchangeJsonDict?[VCLExchange.CodingKeys.KeyId] as? String, type: exchangeJsonDict?[VCLExchange.CodingKeys.KeyType] as? String, diff --git a/VCL/VCL/impl/extensions/ArrayExtensions.swift b/VCL/VCL/impl/extensions/ArrayExtensions.swift index 04cb263..49803a0 100644 --- a/VCL/VCL/impl/extensions/ArrayExtensions.swift +++ b/VCL/VCL/impl/extensions/ArrayExtensions.swift @@ -20,10 +20,10 @@ extension Array { } } -public func == (lhs: [Any], rhs: [Any] ) -> Bool { +public func == (lhs: [Sendable], rhs: [Sendable] ) -> Bool { return NSArray(array: lhs).isEqual(to: rhs) } -public func != (lhs: [Any], rhs: [Any] ) -> Bool { +public func != (lhs: [Sendable], rhs: [Sendable] ) -> Bool { return !(lhs == rhs) } diff --git a/VCL/VCL/impl/extensions/DictionaryExtensions.swift b/VCL/VCL/impl/extensions/DictionaryExtensions.swift index a750df5..2672637 100644 --- a/VCL/VCL/impl/extensions/DictionaryExtensions.swift +++ b/VCL/VCL/impl/extensions/DictionaryExtensions.swift @@ -19,15 +19,15 @@ extension Dictionary { } } /// A recursive function that replaces all values for a given key - func update(_ dict: [String: Any], set value: Any, for key: String) -> [String: Any] { + func update(_ dict: [String: Sendable], set value: Sendable, for key: String) -> [String: Sendable] { var newDict = dict for (k, v) in newDict { if k == key { newDict[k] = value - } else if let subDict = v as? [String: Any] { + } else if let subDict = v as? [String: Sendable] { newDict[k] = update(subDict, set: value, for: key) - } else if let subArray = v as? [[String: Any]] { - var newArray = [[String: Any]]() + } else if let subArray = v as? [[String: Sendable]] { + var newArray = [[String: Sendable]]() for item in subArray { newArray.append(update(item, set: value, for: key)) } @@ -38,10 +38,10 @@ extension Dictionary { } } -public func == (lhs: [String: Any], rhs: [String: Any]) -> Bool { +public func == (lhs: [String: Sendable], rhs: [String: Sendable]) -> Bool { return NSDictionary(dictionary: lhs).isEqual(to: rhs) } -public func != (lhs: [String: Any], rhs: [String: Any]) -> Bool { +public func != (lhs: [String: Sendable], rhs: [String: Sendable]) -> Bool { return !(lhs == rhs) } diff --git a/VCL/VCL/impl/jwt/remote/VCLJwtSignServiceRemoteImpl.swift b/VCL/VCL/impl/jwt/remote/VCLJwtSignServiceRemoteImpl.swift index ce8b9d7..992defd 100644 --- a/VCL/VCL/impl/jwt/remote/VCLJwtSignServiceRemoteImpl.swift +++ b/VCL/VCL/impl/jwt/remote/VCLJwtSignServiceRemoteImpl.swift @@ -52,10 +52,10 @@ final class VCLJwtSignServiceRemoteImpl: VCLJwtSignService { jwtDescriptor: VCLJwtDescriptor, nonce: String?, didJwk: VCLDidJwk - ) -> [String: Any] { - var retVal = [String: Any]() - var header = [String: Any]() - var options = [String: Any]() + ) -> [String: Sendable] { + var retVal = [String: Sendable]() + var header = [String: Sendable]() + var options = [String: Sendable]() var payload = jwtDescriptor.payload ?? [:] // HeaderValues.XVnfProtocolVersion == VCLXVnfProtocolVersion.XVnfProtocolVersion1 diff --git a/VCL/VCL/impl/jwt/remote/VCLJwtVerifyServiceRemoteImpl.swift b/VCL/VCL/impl/jwt/remote/VCLJwtVerifyServiceRemoteImpl.swift index 153b115..ee99952 100644 --- a/VCL/VCL/impl/jwt/remote/VCLJwtVerifyServiceRemoteImpl.swift +++ b/VCL/VCL/impl/jwt/remote/VCLJwtVerifyServiceRemoteImpl.swift @@ -48,7 +48,7 @@ final class VCLJwtVerifyServiceRemoteImpl: VCLJwtVerifyService { private func generatePayloadToVerify( jwt: VCLJwt, publicJwk: VCLPublicJwk - ) -> [String: Any] { + ) -> [String: Sendable] { return [ CodingKeys.KeyJwt: jwt.encodedJwt, CodingKeys.KeyPublicKey: publicJwk.valueDict diff --git a/VCL/VCLTests/entities/VCLFinalizeOffersDescriptorTest.swift b/VCL/VCLTests/entities/VCLFinalizeOffersDescriptorTest.swift index 74b2a81..d796812 100644 --- a/VCL/VCLTests/entities/VCLFinalizeOffersDescriptorTest.swift +++ b/VCL/VCLTests/entities/VCLFinalizeOffersDescriptorTest.swift @@ -18,7 +18,7 @@ class VCLFinalizeOffersDescriptorTest: XCTestCase { private let keyService = VCLKeyServiceLocalImpl(secretStore: SecretStoreMock.Instance) private let offers = VCLOffers( - payload: [String: Any](), + payload: [String: Sendable](), all: [VCLOffer(payload: [:])], responseCode: 200, sessionToken: VCLToken(value: ""), @@ -77,7 +77,7 @@ class VCLFinalizeOffersDescriptorTest: XCTestCase { assert(requestBody["approvedOfferIds"] as? [String] == self!.approvedOfferIds) assert(requestBody["rejectedOfferIds"] as? [String] == self!.rejectedOfferIds) - let proof = requestBody["proof"] as? [String: Any] + let proof = requestBody["proof"] as? [String: Sendable] assert((proof?["proof_type"] as? String) == "jwt") assert((proof?["jwt"] as? String) == jwt.encodedJwt) // equivalent to checking nonce in proof jwt diff --git a/VCL/VCLTests/entities/VCLOffersTest.swift b/VCL/VCLTests/entities/VCLOffersTest.swift index 26baac9..323a0c5 100644 --- a/VCL/VCLTests/entities/VCLOffersTest.swift +++ b/VCL/VCLTests/entities/VCLOffersTest.swift @@ -35,7 +35,7 @@ class VCLOffersTest: XCTestCase { func testOffersFromJsonArray() { assert( - subject1.payload[VCLOffers.CodingKeys.KeyOffers] as! [[String: Any]] == OffersMocks.OffersJsonArrayStr.toListOfDictionaries()! + subject1.payload[VCLOffers.CodingKeys.KeyOffers] as! [[String: Sendable]] == OffersMocks.OffersJsonArrayStr.toListOfDictionaries()! ) assert(subject1.challenge == nil) testExpectations(subject1) @@ -46,7 +46,7 @@ class VCLOffersTest: XCTestCase { func testOffersFromJsonDictionary() { assert( - subject2.payload[VCLOffers.CodingKeys.KeyOffers] as! [[String: Any]] == OffersMocks.OffersJsonArrayStr.toListOfDictionaries()! + subject2.payload[VCLOffers.CodingKeys.KeyOffers] as! [[String: Sendable]] == OffersMocks.OffersJsonArrayStr.toListOfDictionaries()! ) assert(subject2.challenge == OffersMocks.challenge) testExpectations(subject2) @@ -57,7 +57,7 @@ class VCLOffersTest: XCTestCase { func testOffersFromEmptyJsonArray() { assert( - subject3.payload[VCLOffers.CodingKeys.KeyOffers] as! [[String: Any]] == OffersMocks.offersJsonEmptyArrayStr.toListOfDictionaries()! + subject3.payload[VCLOffers.CodingKeys.KeyOffers] as! [[String: Sendable]] == OffersMocks.offersJsonEmptyArrayStr.toListOfDictionaries()! ) assert(subject3.challenge == nil) testExpectationsEmpty(subject3) diff --git a/VCL/VCLTests/entities/VCLSubmissionTest.swift b/VCL/VCLTests/entities/VCLSubmissionTest.swift index 56eddd2..c02cfc1 100644 --- a/VCL/VCLTests/entities/VCLSubmissionTest.swift +++ b/VCL/VCLTests/entities/VCLSubmissionTest.swift @@ -54,7 +54,7 @@ final class VCLSubmissionTest: XCTestCase { assert(requestBodyJsonObj[SubmissionCodingKeys.KeyExchangeId] as? String == subjectPresentationSubmission.exchangeId) assert(requestBodyJsonObj[SubmissionCodingKeys.KeyContext] as? [String] == SubmissionCodingKeys.ValueContextList) - let pushDelegateBodyJsonObj = requestBodyJsonObj[SubmissionCodingKeys.KeyPushDelegate] as! [String: Any] + let pushDelegateBodyJsonObj = requestBodyJsonObj[SubmissionCodingKeys.KeyPushDelegate] as! [String: Sendable] assert(pushDelegateBodyJsonObj[VCLPushDelegate.CodingKeys.KeyPushUrl] as? String == PresentationSubmissionMocks.PushDelegate.pushUrl) assert(pushDelegateBodyJsonObj[VCLPushDelegate.CodingKeys.KeyPushToken] as? String == PresentationSubmissionMocks.PushDelegate.pushToken) diff --git a/VCL/VCLTests/infrastructure/jwt/remote/VCLJwtSignServiceTest.swift b/VCL/VCLTests/infrastructure/jwt/remote/VCLJwtSignServiceTest.swift index 1987a68..4c12e8e 100644 --- a/VCL/VCLTests/infrastructure/jwt/remote/VCLJwtSignServiceTest.swift +++ b/VCL/VCLTests/infrastructure/jwt/remote/VCLJwtSignServiceTest.swift @@ -42,12 +42,12 @@ class VCLJwtSignServiceTest: XCTestCase { nonce: "nonce 1", didJwk: didJwk ) - let header = payloadToSign["header"] as? [String: Any] - let options = payloadToSign["options"] as? [String: Any] - let payload = payloadToSign["payload"] as? [String: Any] + let header = payloadToSign["header"] as? [String: Sendable] + let options = payloadToSign["options"] as? [String: Sendable] + let payload = payloadToSign["payload"] as? [String: Sendable] assert(header?["kid"] as? String == didJwk.kid) - assert(header?["jwk"] as? [String: Any] ?? [:] == didJwk.publicJwk.valueDict) + assert(header?["jwk"] as? [String: Sendable] ?? [:] == didJwk.publicJwk.valueDict) assert(options?["keyId"] as? String == didJwk.keyId) diff --git a/VCL/VCLTests/infrastructure/resources/valid/CredentialTypeSchemaMocks.swift b/VCL/VCLTests/infrastructure/resources/valid/CredentialTypeSchemaMocks.swift index e5f9cbb..4f4c9e1 100644 --- a/VCL/VCLTests/infrastructure/resources/valid/CredentialTypeSchemaMocks.swift +++ b/VCL/VCLTests/infrastructure/resources/valid/CredentialTypeSchemaMocks.swift @@ -63,7 +63,7 @@ class CredentialTypeSchemaMocks { " ]}\n" static let CredentialType = VCLCredentialType( - payload: [String: Any](), + payload: [String: Sendable](), id: "60759e68c4a22d1aea4820a5", schema: "???", createdAt: "2021-04-13T13:36:40.832Z", diff --git a/VCL/VCLTests/usecases/CredentialTypesUIFormSchemaUseCaseTest.swift b/VCL/VCLTests/usecases/CredentialTypesUIFormSchemaUseCaseTest.swift index 0fea5be..12d0035 100644 --- a/VCL/VCLTests/usecases/CredentialTypesUIFormSchemaUseCaseTest.swift +++ b/VCL/VCLTests/usecases/CredentialTypesUIFormSchemaUseCaseTest.swift @@ -22,7 +22,7 @@ final class CredentialTypesUIFormSchemaUseCaseTest: XCTestCase { private var mockedCountries: VCLCountries! override func setUp() { - mockedCountries = jsonArrToCountries(CredentialTypesUIFormSchemaMocks.CountriesJson.toList() as! [[String: Any]]) + mockedCountries = jsonArrToCountries(CredentialTypesUIFormSchemaMocks.CountriesJson.toList() as! [[String: Sendable]]) } func testCredentialTypesFormSchemaFull() { @@ -41,7 +41,7 @@ final class CredentialTypesUIFormSchemaUseCaseTest: XCTestCase { countries: mockedCountries ) { do { - let addressJsonObj = try $0.get().payload["place"] as! [String: Any] + let addressJsonObj = try $0.get().payload["place"] as! [String: Sendable] let addressCountryJsonObj = addressJsonObj[VCLCredentialTypesUIFormSchema.CodingKeys.KeyAddressCountry] as! [String: Any] let addressRegionJsonObj = addressJsonObj[VCLCredentialTypesUIFormSchema.CodingKeys.KeyAddressRegion] as! [String: Any] @@ -77,7 +77,7 @@ final class CredentialTypesUIFormSchemaUseCaseTest: XCTestCase { countries: mockedCountries ) { do { - let addressJsonObj = try $0.get().payload["place"] as! [String: Any] + let addressJsonObj = try $0.get().payload["place"] as! [String: Sendable] let addressCountryJsonObj = addressJsonObj[VCLCredentialTypesUIFormSchema.CodingKeys.KeyAddressCountry] as! [String: Any] let addressRegionJsonObj = addressJsonObj[VCLCredentialTypesUIFormSchema.CodingKeys.KeyAddressRegion] as! [String: Any] @@ -113,7 +113,7 @@ final class CredentialTypesUIFormSchemaUseCaseTest: XCTestCase { countries: mockedCountries ) { do { - let addressJsonObj = try $0.get().payload["place"] as! [String: Any] + let addressJsonObj = try $0.get().payload["place"] as! [String: Sendable] let addressCountryJsonObj = addressJsonObj[VCLCredentialTypesUIFormSchema.CodingKeys.KeyAddressCountry] as! [String: Any] let addressRegionJsonObj = addressJsonObj[VCLCredentialTypesUIFormSchema.CodingKeys.KeyAddressRegion] as! [String: Any] @@ -149,9 +149,9 @@ final class CredentialTypesUIFormSchemaUseCaseTest: XCTestCase { countries: mockedCountries ) { do { - let addressJsonObj = try $0.get().payload["place"] as! [String: Any] - let addressCountryJsonObj = addressJsonObj[VCLCredentialTypesUIFormSchema.CodingKeys.KeyAddressCountry] as! [String: Any] - let addressRegionJsonObj = addressJsonObj[VCLCredentialTypesUIFormSchema.CodingKeys.KeyAddressRegion] as! [String: Any] + let addressJsonObj = try $0.get().payload["place"] as! [String: Sendable] + let addressCountryJsonObj = addressJsonObj[VCLCredentialTypesUIFormSchema.CodingKeys.KeyAddressCountry] as! [String: Sendable] + let addressRegionJsonObj = addressJsonObj[VCLCredentialTypesUIFormSchema.CodingKeys.KeyAddressRegion] as! [String: Sendable] let expectedAddressCountryCodes = addressCountryJsonObj[VCLCredentialTypesUIFormSchema.CodingKeys.KeyUiEnum] as! [String] let expectedAddressCountryNames = addressCountryJsonObj[VCLCredentialTypesUIFormSchema.CodingKeys.KeyUiNames] as? [String] @@ -194,7 +194,7 @@ final class CredentialTypesUIFormSchemaUseCaseTest: XCTestCase { } } - private func jsonArrToCountries(_ countriesArr: [[String: Any]]) -> VCLCountries { + private func jsonArrToCountries(_ countriesArr: [[String: Sendable]]) -> VCLCountries { var countries = [VCLCountry]() for i in 0.. VCLCountry { + private func parseCountry(_ countryDict: [String: Sendable]) -> VCLCountry { var regions: VCLRegions? = nil - if let regionsArr = countryDict[VCLCountry.Codes.KeyRegions] as? [[String: Any]] { + if let regionsArr = countryDict[VCLCountry.Codes.KeyRegions] as? [[String: Sendable]] { var regionsList = [VCLRegion]() for i in 0.. VCLExchange { - return VCLExchange(id: (exchangeJsonDict[VCLExchange.CodingKeys.KeyId] as! String), - type: (exchangeJsonDict[VCLExchange.CodingKeys.KeyType] as! String), - disclosureComplete: (exchangeJsonDict[VCLExchange.CodingKeys.KeyDisclosureComplete] as! Bool), - exchangeComplete: (exchangeJsonDict[VCLExchange.CodingKeys.KeyExchangeComplete] as! Bool)) + private func expectedExchange(exchangeJsonDict: [String: Sendable]) -> VCLExchange { + return VCLExchange( + id: (exchangeJsonDict[VCLExchange.CodingKeys.KeyId] as! String), + type: (exchangeJsonDict[VCLExchange.CodingKeys.KeyType] as! String), + disclosureComplete: (exchangeJsonDict[VCLExchange.CodingKeys.KeyDisclosureComplete] as! Bool), + exchangeComplete: (exchangeJsonDict[VCLExchange.CodingKeys.KeyExchangeComplete] as! Bool) + ) } } diff --git a/VCL/VCLTests/usecases/JwtServiceUseCaseTest.swift b/VCL/VCLTests/usecases/JwtServiceUseCaseTest.swift index ef852de..2d4e34c 100644 --- a/VCL/VCLTests/usecases/JwtServiceUseCaseTest.swift +++ b/VCL/VCLTests/usecases/JwtServiceUseCaseTest.swift @@ -48,7 +48,7 @@ final class JwtServiceUseCaseTest: XCTestCase { do { let jwt = try $0.get() assert(jwt.header?["alg"] as? String == VCLSignatureAlgorithm.SECP256k1.jwsAlgorithm) - assert(((jwt.header?["jwk"] as? [String: Any])?["crv"] as? String) == VCLSignatureAlgorithm.SECP256k1.rawValue) + assert(((jwt.header?["jwk"] as? [String: Sendable])?["crv"] as? String) == VCLSignatureAlgorithm.SECP256k1.rawValue) assert(jwt.header?["typ"] as? String == "JWT") } catch { XCTFail("\(error)") diff --git a/VCL/VCLTests/usecases/PresentationSubmissionUseCaseTest.swift b/VCL/VCLTests/usecases/PresentationSubmissionUseCaseTest.swift index ef80f25..214f24a 100644 --- a/VCL/VCLTests/usecases/PresentationSubmissionUseCaseTest.swift +++ b/VCL/VCLTests/usecases/PresentationSubmissionUseCaseTest.swift @@ -69,17 +69,17 @@ final class PresentationSubmissionUseCaseTest: XCTestCase { } } - private func expectedPresentationSubmissionResult(_ jsonDict: [String: Any], _ jti: String, submissionId: String) -> VCLSubmissionResult { + private func expectedPresentationSubmissionResult(_ jsonDict: [String: Sendable], _ jti: String, submissionId: String) -> VCLSubmissionResult { let exchangeJsonDict = jsonDict[VCLSubmissionResult.CodingKeys.KeyExchange] return VCLSubmissionResult( sessionToken: VCLToken(value: (jsonDict[VCLSubmissionResult.CodingKeys.KeyToken] as! String)), - exchange: expectedExchange(exchangeJsonDict as! [String : Any]), + exchange: expectedExchange(exchangeJsonDict as! [String : Sendable]), jti: jti, submissionId: submissionId ) } - private func expectedExchange(_ exchangeJsonDict: [String: Any]) -> VCLExchange { + private func expectedExchange(_ exchangeJsonDict: [String: Sendable]) -> VCLExchange { return VCLExchange( id: (exchangeJsonDict[VCLExchange.CodingKeys.KeyId] as! String), type: (exchangeJsonDict[VCLExchange.CodingKeys.KeyType] as! String), diff --git a/VCL/VCLTests/utils/UtilsTest.swift b/VCL/VCLTests/utils/UtilsTest.swift index cc64374..b84df97 100644 --- a/VCL/VCLTests/utils/UtilsTest.swift +++ b/VCL/VCLTests/utils/UtilsTest.swift @@ -13,7 +13,7 @@ import XCTest class UtilsTest: XCTestCase { func testGetIdentifier() { - let jsonObject: [String: Any] = [ + let jsonObject: [String: Sendable] = [ "a": "ValueA", "b": ["identifier": "ValueB"], "c": ["id1": "ValueC"], @@ -29,7 +29,7 @@ class UtilsTest: XCTestCase { } func testGetIdentifierNoMatch() { - let jsonObject: [String: Any] = [ + let jsonObject: [String: Sendable] = [ "a": "ValueA", "b": ["identifier": "ValueB"], "c": ["x": "ValueX"] @@ -49,21 +49,21 @@ class UtilsTest: XCTestCase { } func testGetPrimaryIdentifierMapWithId() { - let value: [String: Any] = ["id": "ValueY"] + let value: [String: Sendable] = ["id": "ValueY"] let result = Utils.getPrimaryIdentifier(value) assert("ValueY" == result) } func testGetPrimaryIdentifierMapWithIdentifier() { - let value: [String: Any] = ["identifier": "ValueZ"] + let value: [String: Sendable] = ["identifier": "ValueZ"] let result = Utils.getPrimaryIdentifier(value) assert("ValueZ" == result) } func testGetPrimaryIdentifierNull() { - let value: [AnyHashable: Any]? = nil + let value: [String: Sendable]? = nil let result = Utils.getPrimaryIdentifier(value) assert(result == nil) diff --git a/VCL/VCLTests/verifiers/CredentialDidVerifierTest.swift b/VCL/VCLTests/verifiers/CredentialDidVerifierTest.swift index 408c299..9735e39 100644 --- a/VCL/VCLTests/verifiers/CredentialDidVerifierTest.swift +++ b/VCL/VCLTests/verifiers/CredentialDidVerifierTest.swift @@ -17,7 +17,7 @@ class CredentialDidVerifierTest: XCTestCase { CredentialMocks.JwtCredentialsFromNotaryIssuer.toList()?.count ?? 0 private let credentialsFromRegularIssuerAmount = CredentialMocks.JwtCredentialsFromRegularIssuer.toList()?.count ?? 0 - private let OffersMock = VCLOffers(payload: [String: Any](), all: [VCLOffer(payload: [:])], responseCode: 1, sessionToken: VCLToken(value: ""), challenge: "") + private let OffersMock = VCLOffers(payload: [String: Sendable](), all: [VCLOffer(payload: [:])], responseCode: 1, sessionToken: VCLToken(value: ""), challenge: "") var finalizeOffersDescriptorOfNotaryIssuer: VCLFinalizeOffersDescriptor! var credentialManifestFromNotaryIssuer: VCLCredentialManifest! diff --git a/VCL/VCLTests/verifiers/OffersByDeepLinkVerifierTest.swift b/VCL/VCLTests/verifiers/OffersByDeepLinkVerifierTest.swift index 8bf7d9d..d13b634 100644 --- a/VCL/VCLTests/verifiers/OffersByDeepLinkVerifierTest.swift +++ b/VCL/VCLTests/verifiers/OffersByDeepLinkVerifierTest.swift @@ -24,7 +24,7 @@ class OffersByDeepLinkVerifierTest: XCTestCase { offers = VCLOffers( payload: offersPayload, all: Utils.offersFromJsonArray( - offersJsonArray: offersPayload[VCLOffers.CodingKeys.KeyOffers] as? [[String: Any]] ?? [] + offersJsonArray: offersPayload[VCLOffers.CodingKeys.KeyOffers] as? [[String: Sendable]] ?? [] ), responseCode: 0, sessionToken: VCLToken(value: ""),