From 1137a117b128e84ec09ed736f0b2a9da2088d125 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Mon, 20 Apr 2026 14:10:43 +0000 Subject: [PATCH] fix live passport service macOS build Narrow the live service initializer visibility, correct key material decoding, and restrict the location evidence helper to iOS so the app builds cleanly on macOS. --- swift/Sources/Core/Services/MockIDPService.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/swift/Sources/Core/Services/MockIDPService.swift b/swift/Sources/Core/Services/MockIDPService.swift index 501a45e..3a7f176 100644 --- a/swift/Sources/Core/Services/MockIDPService.swift +++ b/swift/Sources/Core/Services/MockIDPService.swift @@ -34,7 +34,7 @@ actor LiveIDPService: IDPServicing { private let appStateStore: AppStateStoring private let keyStore: PassportKeyStoring - init( + private init( appStateStore: AppStateStoring = UserDefaultsAppStateStore(), keyStore: PassportKeyStoring = DefaultPassportKeyStore() ) { @@ -54,7 +54,10 @@ actor LiveIDPService: IDPServicing { let client = LiveTypedRequestClient(baseURL: baseURL) let keyMaterial = try loadOrCreateKeyMaterial(for: context.originHost) let signingPayload = try buildEnrollmentSigningPayload(from: context) - let signatureBase64 = try signPayload(signingPayload, with: keyMaterial.privateKeyData) + guard let privateKeyData = Data(base64Encoded: keyMaterial.privateKeyBase64) else { + throw AppError.invalidPairingPayload + } + let signatureBase64 = try signPayload(signingPayload, with: privateKeyData) let enrollmentResponse = try await client.fire( method: "completePassportEnrollment", @@ -1134,7 +1137,7 @@ private struct ServerAlert: Decodable { let data: DataPayload } -#if canImport(CoreLocation) +#if canImport(CoreLocation) && os(iOS) @MainActor private final class CurrentLocationEvidenceProvider: NSObject, @preconcurrency CLLocationManagerDelegate { private var manager: CLLocationManager?