From 1df64ebcf135941abe130f1bba54dc0ea2a6b4b6 Mon Sep 17 00:00:00 2001 From: Precious OSSAI Date: Tue, 26 Mar 2024 17:19:07 +0000 Subject: [PATCH] Pass correlation ID to risk SDK --- .github/workflows/codeql-analysis.yml | 32 +++++++++++++++---- .../xcschemes/CheckoutTests.xcscheme | 11 ++++++- .../xcschemes/FramesTests.xcscheme | 25 +++++++++++++++ Checkout.podspec | 2 +- Checkout/Samples/CocoapodsSample/Podfile | 3 +- .../project.pbxproj | 4 +-- .../xcshareddata/swiftpm/Package.resolved | 11 ++++--- .../Tokenisation/CheckoutAPIService.swift | 2 +- Package.resolved | 4 +-- Package.swift | 2 +- .../project.pbxproj | 4 +-- .../xcshareddata/swiftpm/Package.resolved | 11 ++++--- iOS Example Frame/Podfile | 5 +-- 13 files changed, 87 insertions(+), 29 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 236762a39..49f7d6738 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -19,10 +19,17 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +env: + destination: "platform=iOS Simulator,name=iPhone 15 Pro,OS=latest" + configuration: "Debug" + noIndex: "COMPILER_INDEX_STORE_ENABLE=NO" + noSigning: "CODE_SIGNING_ALLOWED=NO" + versionXcode: "15.3" + jobs: analyze: name: Analyze - runs-on: [ macos-latest ] + runs-on: [ macos-13-large ] permissions: actions: read contents: read @@ -45,24 +52,37 @@ jobs: with: languages: ${{ matrix.language }} queries: security-and-quality - + + - name: Select Xcode + run: | + sudo xcode-select -switch /Applications/Xcode_${versionXcode}.app + + - name: Log xcodebuild Version + run: | + xcodebuild -version + + - name: Build Frames run: | - xcodebuild -scheme Frames -destination "platform=iOS Simulator,name=iPhone 14 Pro,OS=latest" + xcodebuild -scheme Frames -destination "${destination}" "${noIndex}" "${noSigning}" | xcpretty + + - name: Build CheckoutTests + run: | + xcodebuild build -scheme CheckoutTests -destination "${destination}" "${noIndex}" "${noSigning}" | xcpretty - name: Build FramesTests run: | - xcodebuild -scheme FramesTests -destination "platform=iOS Simulator,name=iPhone 14 Pro,OS=latest" test + xcodebuild build -scheme FramesTests -destination "${destination}" "${noIndex}" "${noSigning}" | xcpretty - name: Build iOS Example Frame SPM run: | cd iOS\ Example\ Frame\ SPM - xcodebuild build -scheme iOS\ Example\ Frame -destination "platform=iOS Simulator,name=iPhone 14 Pro,OS=latest" + xcodebuild build -scheme iOS\ Example\ Frame -destination "${destination}" "${noIndex}" "${noSigning}" | xcpretty - name: Build UITest run: | cd iOS\ Example\ Frame\ SPM - xcodebuild -scheme UITest -destination "platform=iOS Simulator,name=iPhone 14 Pro,OS=latest" + xcodebuild -scheme UITest -destination "${destination}" "${noIndex}" "${noSigning}" | xcpretty # Perform analysis on the code - name: Analyze code with CodeQL diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/CheckoutTests.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/CheckoutTests.xcscheme index 0b5f0da47..e94d9d260 100644 --- a/.swiftpm/xcode/xcshareddata/xcschemes/CheckoutTests.xcscheme +++ b/.swiftpm/xcode/xcshareddata/xcschemes/CheckoutTests.xcscheme @@ -8,7 +8,7 @@ @@ -53,6 +53,15 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES"> + + + + diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/FramesTests.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/FramesTests.xcscheme index 7401b5223..52abafc31 100644 --- a/.swiftpm/xcode/xcshareddata/xcschemes/FramesTests.xcscheme +++ b/.swiftpm/xcode/xcshareddata/xcschemes/FramesTests.xcscheme @@ -5,6 +5,22 @@ + + + + + + + + + + diff --git a/Checkout.podspec b/Checkout.podspec index 37700c0a9..46c376e75 100644 --- a/Checkout.podspec +++ b/Checkout.podspec @@ -20,6 +20,6 @@ Pod::Spec.new do |s| s.exclude_files = "Checkout/Samples/**" s.dependency 'CheckoutEventLoggerKit', '~> 1.2.4' - s.dependency 'Risk', '2.0.1' + s.dependency 'Risk', '2.0.3' end diff --git a/Checkout/Samples/CocoapodsSample/Podfile b/Checkout/Samples/CocoapodsSample/Podfile index 7f336fb18..12e61fca2 100644 --- a/Checkout/Samples/CocoapodsSample/Podfile +++ b/Checkout/Samples/CocoapodsSample/Podfile @@ -5,6 +5,7 @@ target 'CheckoutCocoapodsSample' do use_frameworks! # Pods for CheckoutSDKCocoapodsSample - pod 'Checkout', '4.3.2' + # pod 'Checkout', '4.3.2' + pod 'Frames', :git => 'https://github.com/checkout/frames-ios', :branch => 'feature/pass-correlation-id-to-risk-sdk' end diff --git a/Checkout/Samples/SPMSample/CheckoutSPMSample.xcodeproj/project.pbxproj b/Checkout/Samples/SPMSample/CheckoutSPMSample.xcodeproj/project.pbxproj index 7f0690cd5..13f3f1714 100644 --- a/Checkout/Samples/SPMSample/CheckoutSPMSample.xcodeproj/project.pbxproj +++ b/Checkout/Samples/SPMSample/CheckoutSPMSample.xcodeproj/project.pbxproj @@ -511,8 +511,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/checkout/frames-ios"; requirement = { - kind = exactVersion; - version = 4.3.2; + branch = "feature/pass-correlation-id-to-risk-sdk"; + kind = branch; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/Checkout/Samples/SPMSample/CheckoutSPMSample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Checkout/Samples/SPMSample/CheckoutSPMSample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 09eb31bc7..816b7fb75 100644 --- a/Checkout/Samples/SPMSample/CheckoutSPMSample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Checkout/Samples/SPMSample/CheckoutSPMSample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,4 +1,5 @@ { + "originHash" : "7798b3f49dc3db57f852eea46d1454b7808add05a95e8d76dd9047b1be391a6f", "pins" : [ { "identity" : "checkout-event-logger-ios-framework", @@ -14,8 +15,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/checkout/checkout-risk-sdk-ios.git", "state" : { - "revision" : "4823f05166dca8392a41b56b975515c7e0f1a8da", - "version" : "2.0.1" + "revision" : "a5df46ecd4324661459faa9e9ac18d627b4d26aa", + "version" : "2.0.3" } }, { @@ -32,8 +33,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/checkout/frames-ios", "state" : { - "revision" : "2dae4f877e3a1882172c749e3bf4c32228b9d6a3", - "version" : "4.3.2" + "branch" : "feature/pass-correlation-id-to-risk-sdk", + "revision" : "0a0df16b3494aedfc176be64f5c3aca0398ab468" } }, { @@ -46,5 +47,5 @@ } } ], - "version" : 2 + "version" : 3 } diff --git a/Checkout/Source/Tokenisation/CheckoutAPIService.swift b/Checkout/Source/Tokenisation/CheckoutAPIService.swift index 93b33d473..f8bfa4897 100644 --- a/Checkout/Source/Tokenisation/CheckoutAPIService.swift +++ b/Checkout/Source/Tokenisation/CheckoutAPIService.swift @@ -59,7 +59,7 @@ final public class CheckoutAPIService: CheckoutAPIProtocol { riskEnvironment = .sandbox } - let riskConfig = RiskConfig(publicKey: publicKey, environment: riskEnvironment, framesMode: true) + let riskConfig = RiskConfig(publicKey: publicKey, environment: riskEnvironment, framesMode: true, correlationId: logManager.correlationID) let riskSDK = Risk.init(config: riskConfig) logManager.setup( diff --git a/Package.resolved b/Package.resolved index b692b452c..20d1d9091 100644 --- a/Package.resolved +++ b/Package.resolved @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/checkout/checkout-risk-sdk-ios.git", "state" : { - "revision" : "4823f05166dca8392a41b56b975515c7e0f1a8da", - "version" : "2.0.1" + "revision" : "a5df46ecd4324661459faa9e9ac18d627b4d26aa", + "version" : "2.0.3" } }, { diff --git a/Package.swift b/Package.swift index 6644d9da0..e90e1e0b4 100644 --- a/Package.swift +++ b/Package.swift @@ -20,7 +20,7 @@ let package = Package( exact: "3.5.9"), .package( url: "https://github.com/checkout/checkout-risk-sdk-ios.git", - exact: "2.0.1"), + exact: "2.0.3"), .package( url: "https://github.com/checkout/checkout-event-logger-ios-framework.git", from: "1.2.4" diff --git a/iOS Example Frame SPM/iOS Example Frame SPM.xcodeproj/project.pbxproj b/iOS Example Frame SPM/iOS Example Frame SPM.xcodeproj/project.pbxproj index a2e7152f4..e0f82c2da 100644 --- a/iOS Example Frame SPM/iOS Example Frame SPM.xcodeproj/project.pbxproj +++ b/iOS Example Frame SPM/iOS Example Frame SPM.xcodeproj/project.pbxproj @@ -1238,8 +1238,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/checkout/frames-ios"; requirement = { - kind = exactVersion; - version = 4.3.2; + branch = "feature/pass-correlation-id-to-risk-sdk"; + kind = branch; }; }; 16C3F83E2A7927ED00690639 /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */ = { diff --git a/iOS Example Frame SPM/iOS Example Frame SPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/iOS Example Frame SPM/iOS Example Frame SPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 94ee63983..69488b7d0 100644 --- a/iOS Example Frame SPM/iOS Example Frame SPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/iOS Example Frame SPM/iOS Example Frame SPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,4 +1,5 @@ { + "originHash" : "ab51e04eecae4feb4dec9e81bffe3f653bf828f3a710f8ebf7a9b5842606a6dd", "pins" : [ { "identity" : "checkout-event-logger-ios-framework", @@ -14,8 +15,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/checkout/checkout-risk-sdk-ios.git", "state" : { - "revision" : "4823f05166dca8392a41b56b975515c7e0f1a8da", - "version" : "2.0.1" + "revision" : "a5df46ecd4324661459faa9e9ac18d627b4d26aa", + "version" : "2.0.3" } }, { @@ -32,8 +33,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/checkout/frames-ios", "state" : { - "revision" : "2dae4f877e3a1882172c749e3bf4c32228b9d6a3", - "version" : "4.3.2" + "branch" : "feature/pass-correlation-id-to-risk-sdk", + "revision" : "0a0df16b3494aedfc176be64f5c3aca0398ab468" } }, { @@ -55,5 +56,5 @@ } } ], - "version" : 2 + "version" : 3 } diff --git a/iOS Example Frame/Podfile b/iOS Example Frame/Podfile index 030c976d5..0fd7aef6f 100644 --- a/iOS Example Frame/Podfile +++ b/iOS Example Frame/Podfile @@ -6,8 +6,9 @@ target 'iOS Example Frame' do use_frameworks! # Pods for iOS Example Custom - pod 'Frames', '4.3.2' - + # pod 'Frames', '4.3.2' + pod 'Frames', :git => 'https://github.com/checkout/frames-ios', :branch => 'feature/pass-correlation-id-to-risk-sdk' + end post_install do |installer|