From 4bb47a18d07541b33b36d5a6ebf92eaa7587a183 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Wed, 21 Feb 2024 20:36:47 +1100 Subject: [PATCH 1/3] Point to WordPressAuthenticator version with `URLSession` config --- Podfile | 4 ++-- Podfile.lock | 15 ++++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Podfile b/Podfile index 05f7dbecf38..c6e820e5ab9 100644 --- a/Podfile +++ b/Podfile @@ -85,9 +85,9 @@ target 'WooCommerce' do pod 'Gridicons', '~> 1.2.0' # To allow pod to pick up beta versions use -beta. E.g., 1.1.7-beta.1 - pod 'WordPressAuthenticator', '~> 9.0' + # pod 'WordPressAuthenticator', '~> 9.0' # pod 'WordPressAuthenticator', git: 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', branch: '' - # pod 'WordPressAuthenticator', git: 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', commit: '' + pod 'WordPressAuthenticator', git: 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', commit: 'b516ec85375fe4e3fa0d4f5a2358697cf43cc6a8' # pod 'WordPressAuthenticator', path: '../WordPressAuthenticator-iOS' pod 'WordPressKit', '~> 13.1' diff --git a/Podfile.lock b/Podfile.lock index 26b61266d89..b6a4e1e3340 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -33,7 +33,7 @@ PODS: - Gridicons (~> 1.0) - "NSURL+IDN (= 0.4)" - SVProgressHUD (~> 2.2.5) - - WordPressKit (~> 13.0) + - WordPressKit (~> 13.1) - WordPressShared (~> 2.1-beta) - WordPressUI (~> 1.7-beta) - WordPressKit (13.1.0): @@ -74,7 +74,7 @@ DEPENDENCIES: - SwiftLint (~> 0.54) - WordPress-Aztec-iOS (from `https://github.com/wordpress-mobile/AztecEditor-iOS.git`, commit `950c7bc1bf98326986f10cccb2715ad86976f0fd`) - WordPress-Editor-iOS (from `https://github.com/wordpress-mobile/AztecEditor-iOS.git`, commit `950c7bc1bf98326986f10cccb2715ad86976f0fd`) - - WordPressAuthenticator (~> 9.0) + - WordPressAuthenticator (from `https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git`, commit `b516ec85375fe4e3fa0d4f5a2358697cf43cc6a8`) - WordPressKit (~> 13.1) - WordPressShared (~> 2.1) - WordPressUI (~> 1.15) @@ -84,7 +84,6 @@ DEPENDENCIES: SPEC REPOS: https://github.com/wordpress-mobile/cocoapods-specs.git: - - WordPressAuthenticator - WordPressKit trunk: - Alamofire @@ -123,6 +122,9 @@ EXTERNAL SOURCES: WordPress-Editor-iOS: :commit: 950c7bc1bf98326986f10cccb2715ad86976f0fd :git: https://github.com/wordpress-mobile/AztecEditor-iOS.git + WordPressAuthenticator: + :commit: b516ec85375fe4e3fa0d4f5a2358697cf43cc6a8 + :git: https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git CHECKOUT OPTIONS: WordPress-Aztec-iOS: @@ -131,6 +133,9 @@ CHECKOUT OPTIONS: WordPress-Editor-iOS: :commit: 950c7bc1bf98326986f10cccb2715ad86976f0fd :git: https://github.com/wordpress-mobile/AztecEditor-iOS.git + WordPressAuthenticator: + :commit: b516ec85375fe4e3fa0d4f5a2358697cf43cc6a8 + :git: https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git SPEC CHECKSUMS: Alamofire: 3ec537f71edc9804815215393ae2b1a8ea33a844 @@ -151,7 +156,7 @@ SPEC CHECKSUMS: UIDeviceIdentifier: 442b65b4ff1832d4ca9c2a157815cb29ad981b17 WordPress-Aztec-iOS: fbebd569c61baa252b3f5058c0a2a9a6ada686bb WordPress-Editor-iOS: bda9f7f942212589b890329a0cb22547311749ef - WordPressAuthenticator: 0891ba77c788044d32fe67a4d0435fdd598cecbd + WordPressAuthenticator: 415b7a0957826ebde01f944f540fd502913b8a35 WordPressKit: 7189845e0325fc6022a02638b572e1de8c1d7cc6 WordPressShared: 0aa459e5257a77184db87805a998f447443c9706 WordPressUI: 700e3ec5a9f77b6920c8104c338c85788036ab3c @@ -166,6 +171,6 @@ SPEC CHECKSUMS: ZendeskSupportProvidersSDK: 685b5d185af47ced0ec40564ec46355c838bbd06 ZendeskSupportSDK: 92e6f9d334e81e9186f8a17583862350460a5393 -PODFILE CHECKSUM: 296197a9c546e1c3e40c103704720a4b850f7ab1 +PODFILE CHECKSUM: da09a93ffffcdbe2305f5c3e0f0390052772f3c6 COCOAPODS: 1.14.0 From baa37e1ee0f7cb876a9863413101ff6625fee9d2 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Wed, 21 Feb 2024 21:36:14 +1100 Subject: [PATCH 2/3] Configure API clients `URLSession` usage via WordPressAuth --- WooCommerce/Classes/AppDelegate.swift | 10 ---------- .../Extensions/WordPressAuthenticator+Woo.swift | 5 ++++- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/WooCommerce/Classes/AppDelegate.swift b/WooCommerce/Classes/AppDelegate.swift index e08c3373e17..22d71d2eb2d 100644 --- a/WooCommerce/Classes/AppDelegate.swift +++ b/WooCommerce/Classes/AppDelegate.swift @@ -10,7 +10,6 @@ import KeychainAccess import WordPressUI import WordPressAuthenticator import AutomatticTracks -import WordPressKit import class Yosemite.ScreenshotStoresManager @@ -103,8 +102,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { setupUniversalLinkRouter() disableAnimationsIfNeeded() - configureWordPressKit() - // Don't track startup waiting time if user starts logged out if !ServiceLocator.stores.isAuthenticated { cancelStartupWaitingTimeTracker() @@ -462,13 +459,6 @@ private extension AppDelegate { break } } - - func configureWordPressKit() { - if ServiceLocator.featureFlagService.isFeatureFlagEnabled(.useURLSessionInWordPressKit) { - WordPressOrgXMLRPCApi.useURLSession = true - WordPressComRestApi.useURLSession = true - } - } } diff --git a/WooCommerce/Classes/Extensions/WordPressAuthenticator+Woo.swift b/WooCommerce/Classes/Extensions/WordPressAuthenticator+Woo.swift index 919583c8810..e4914e03e71 100644 --- a/WooCommerce/Classes/Extensions/WordPressAuthenticator+Woo.swift +++ b/WooCommerce/Classes/Extensions/WordPressAuthenticator+Woo.swift @@ -8,6 +8,8 @@ extension WordPressAuthenticator { featureFlagService: FeatureFlagService = ServiceLocator.featureFlagService) { let isWPComMagicLinkShownAsSecondaryActionOnPasswordScreen = true let isManualErrorHandlingEnabled = featureFlagService.isFeatureFlagEnabled(.manualErrorHandlingForSiteCredentialLogin) + let useURLSession = ServiceLocator.featureFlagService.isFeatureFlagEnabled(.useURLSessionInWordPressKit) + let configuration = WordPressAuthenticatorConfiguration(wpcomClientId: ApiCredentials.dotcomAppId, wpcomSecret: ApiCredentials.dotcomSecret, wpcomScheme: dotcomAuthScheme, @@ -39,7 +41,8 @@ extension WordPressAuthenticator { enableManualSiteCredentialLogin: true, enableManualErrorHandlingForSiteCredentialLogin: isManualErrorHandlingEnabled, useEnterEmailAddressAsStepValueForGetStartedVC: true, - enableSiteAddressLoginOnlyInPrologue: true) + enableSiteAddressLoginOnlyInPrologue: true, + useURLSession: useURLSession) let systemGray3LightModeColor = UIColor(red: 199/255.0, green: 199/255.0, blue: 204/255.0, alpha: 1) let systemLabelLightModeColor = UIColor(red: 0, green: 0, blue: 0, alpha: 1) From 710c1aaeb72e2900de5c9115a3a0142abb09a9fa Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Wed, 21 Feb 2024 21:40:44 +1100 Subject: [PATCH 3/3] Remove the explicit dependency on WordPressKit --- Podfile | 3 --- Podfile.lock | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Podfile b/Podfile index c6e820e5ab9..9dba912e65f 100644 --- a/Podfile +++ b/Podfile @@ -90,9 +90,6 @@ target 'WooCommerce' do pod 'WordPressAuthenticator', git: 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', commit: 'b516ec85375fe4e3fa0d4f5a2358697cf43cc6a8' # pod 'WordPressAuthenticator', path: '../WordPressAuthenticator-iOS' - pod 'WordPressKit', '~> 13.1' - # pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', commit: '' - wordpress_shared pod 'WordPressUI', '~> 1.15' diff --git a/Podfile.lock b/Podfile.lock index b6a4e1e3340..72b490a0032 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -75,7 +75,6 @@ DEPENDENCIES: - WordPress-Aztec-iOS (from `https://github.com/wordpress-mobile/AztecEditor-iOS.git`, commit `950c7bc1bf98326986f10cccb2715ad86976f0fd`) - WordPress-Editor-iOS (from `https://github.com/wordpress-mobile/AztecEditor-iOS.git`, commit `950c7bc1bf98326986f10cccb2715ad86976f0fd`) - WordPressAuthenticator (from `https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git`, commit `b516ec85375fe4e3fa0d4f5a2358697cf43cc6a8`) - - WordPressKit (~> 13.1) - WordPressShared (~> 2.1) - WordPressUI (~> 1.15) - Wormholy (~> 1.6.6) @@ -171,6 +170,6 @@ SPEC CHECKSUMS: ZendeskSupportProvidersSDK: 685b5d185af47ced0ec40564ec46355c838bbd06 ZendeskSupportSDK: 92e6f9d334e81e9186f8a17583862350460a5393 -PODFILE CHECKSUM: da09a93ffffcdbe2305f5c3e0f0390052772f3c6 +PODFILE CHECKSUM: f9cfeec9fa67afdd05758ab2a2e55553154d2f1c COCOAPODS: 1.14.0