Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2651ed3
Using xcconfig to provide local secrets
goergisn Jul 18, 2025
268b1ce
Merge branch 'develop' into remove_secrets
goergisn Jul 18, 2025
d4c9fcf
Removing bearer looking bearer with PLACEHOLDEr
goergisn Jul 18, 2025
1b99635
Better description
goergisn Jul 18, 2025
0e44bc3
hardcoding old bearer to try out overriding values
goergisn Jul 18, 2025
c718239
maybe like this
goergisn Jul 18, 2025
2431815
fixing tests
goergisn Jul 18, 2025
fd03f8d
using bearer from Github Secrets
goergisn Jul 18, 2025
4650643
Update DevSecrets.xcconfig.template
goergisn Jul 18, 2025
cfa04be
Update Secrets.xcconfig
goergisn Jul 18, 2025
f1b8bcd
Merge branch 'develop' into remove_secrets
goergisn Jul 21, 2025
fa4cafb
Update README.md
goergisn Jul 21, 2025
73d7f6c
Update test_cocoapods_integration.yml
goergisn Jul 21, 2025
c8bbaf9
Update test_cocoapods_integration.yml
goergisn Jul 21, 2025
1ab8b51
updating xcode project versio
goergisn Jul 21, 2025
132880b
Revert "Update test_cocoapods_integration.yml"
goergisn Jul 21, 2025
6dbf4f5
Update test_cocoapods_integration.yml
goergisn Jul 21, 2025
dd89704
Update test_cocoapods_integration.yml
goergisn Jul 21, 2025
8a6619f
Update test_cocoapods_integration.yml
goergisn Jul 21, 2025
a5e237e
Update test_cocoapods_integration.yml
goergisn Jul 21, 2025
c552872
Update test_cocoapods_integration.yml
goergisn Jul 21, 2025
d1dc372
Update test_cocoapods_integration.yml
goergisn Jul 21, 2025
97dcd36
Update test_cocoapods_integration.yml
goergisn Jul 21, 2025
a10d36a
Update test_cocoapods_integration.yml
goergisn Jul 21, 2025
3b6cb9e
Update project.pbxproj
goergisn Jul 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,8 @@ jobs:
-testPlan "EndToEndTests" \
-enableCodeCoverage YES \
-resultBundlePath "EndToEndTests.xcresult" \
-destination "name=iPhone 16 Pro,OS=18.1" | xcpretty --utf --color && exit ${PIPESTATUS[0]}
-destination "name=iPhone 16 Pro,OS=18.1" \
GO_REST_AUTH_BEARER='Bearer $GO_REST_AUTH_BEARER' \
| xcpretty --utf --color && exit ${PIPESTATUS[0]}
env:
GO_REST_AUTH_BEARER: ${{ secrets.GO_REST_AUTH_BEARER }}
17 changes: 13 additions & 4 deletions .github/workflows/test_cocoapods_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
jobs:

pods:
runs-on: macos-14
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- uses: n1hility/cancel-previous-runs@v3
Expand All @@ -26,12 +26,21 @@ jobs:
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.1'

- name: Test Cocoapods Integration
run: |
brew update
brew install xcodegen
gem install cocoapods -v 1.10.2
pod repo update

# Xcodegen 2.44 introduced a bug that breaks compatibility with cocoapods
# See: https://github.com/yonaskolb/XcodeGen/issues/1561

# Unfortunately brew cannot install older versions
# so we install mint, so we can install an older version of xcodegen
brew update
brew install mint
mint install yonaskolb/xcodegen@2.43.0
export PATH="$PATH:/Users/runner/.mint/bin" # make xcodegen available

pod lib lint AdyenNetworking.podspec --allow-warnings --verbose
Scripts/test-CocoaPods-integration.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ Internal/
#Swift Package Manager
.swiftpm
Package.resolved
DevSecrets.xcconfig
17 changes: 16 additions & 1 deletion AdyenNetworking.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
816807532D6635A500359BE6 /* UserModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F913B3DE26B40C5B008F6CD2 /* UserModel.swift */; };
816807542D6635A500359BE6 /* APIContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = F913B3E026B40E0B008F6CD2 /* APIContext.swift */; };
816807552D6635A500359BE6 /* MockScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82EC1A1728ED7D8600F47B10 /* MockScheduler.swift */; };
817243742E2A5B3F002E386B /* Secrets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 817243732E2A5B3F002E386B /* Secrets.swift */; };
8189E29E2D66386D00D6694C /* EndToEndTests.xctestplan in Resources */ = {isa = PBXBuildFile; fileRef = 8189E29D2D66386D00D6694C /* EndToEndTests.xctestplan */; };
81911E972E2A47D7005F129B /* Secrets.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 81911E952E2A46C3005F129B /* Secrets.xcconfig */; };
81EA9E4D2D563B4E00C077C9 /* AdyenNetworking.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F938996E26B004EE0065561F /* AdyenNetworking.framework */; };
AE58F25F2968474500012D1A /* AnyResponseValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE58F25E2968474500012D1A /* AnyResponseValidator.swift */; };
B14E1D8F28A27F1D00E36290 /* AnyCoder.swift in Sources */ = {isa = PBXBuildFile; fileRef = B14E1D8E28A27F1D00E36290 /* AnyCoder.swift */; };
Expand Down Expand Up @@ -105,7 +107,10 @@
81571B7B2D6F3B4B0043F876 /* DebugLogging.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DebugLogging.swift; sourceTree = "<group>"; };
81571B7D2D6F3CD60043F876 /* MockDebugLogger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockDebugLogger.swift; sourceTree = "<group>"; };
81571B7F2D6F3F160043F876 /* DebugLogger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DebugLogger.swift; sourceTree = "<group>"; };
817243732E2A5B3F002E386B /* Secrets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Secrets.swift; sourceTree = "<group>"; };
8189E29D2D66386D00D6694C /* EndToEndTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = EndToEndTests.xctestplan; sourceTree = "<group>"; };
81911E952E2A46C3005F129B /* Secrets.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Secrets.xcconfig; sourceTree = "<group>"; };
81926ADF2E2A596300E651BD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
81EA9E492D563B4E00C077C9 /* UnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
82D5C1D028E59D7F00179E66 /* TestDownloadRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestDownloadRequest.swift; sourceTree = "<group>"; };
82EC1A1728ED7D8600F47B10 /* MockScheduler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockScheduler.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -241,6 +246,8 @@
children = (
F913B3E226B410C3008F6CD2 /* Mocks */,
F9FCFF4726CB96E800540FE1 /* APIClientTests.swift */,
817243732E2A5B3F002E386B /* Secrets.swift */,
81926ADF2E2A596300E651BD /* Info.plist */,
8189E29D2D66386D00D6694C /* EndToEndTests.xctestplan */,
);
path = EndToEndTests;
Expand Down Expand Up @@ -291,6 +298,7 @@
816807562D6635AE00359BE6 /* Tests */,
F938996F26B004EE0065561F /* Products */,
F913B3E526B4152C008F6CD2 /* Frameworks */,
81911E952E2A46C3005F129B /* Secrets.xcconfig */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -463,14 +471,14 @@
};
};
buildConfigurationList = F938996826B004EE0065561F /* Build configuration list for PBXProject "AdyenNetworking" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = F938996426B004EE0065561F;
preferredProjectObjectVersion = 54;
productRefGroup = F938996F26B004EE0065561F /* Products */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -506,6 +514,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
81911E972E2A47D7005F129B /* Secrets.xcconfig in Resources */,
8189E29E2D66386D00D6694C /* EndToEndTests.xctestplan in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -548,6 +557,7 @@
buildActionMask = 2147483647;
files = (
8168074F2D66359E00359BE6 /* TestDownloadRequest.swift in Sources */,
817243742E2A5B3F002E386B /* Secrets.swift in Sources */,
816807502D66359E00359BE6 /* InvalidCreateUsersRequest.swift in Sources */,
816807512D66359E00359BE6 /* GetUsersRequest.swift in Sources */,
816807522D66359E00359BE6 /* CreateUsersRequest.swift in Sources */,
Expand Down Expand Up @@ -704,10 +714,13 @@
};
F913B3D326B18552008F6CD2 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 81911E952E2A46C3005F129B /* Secrets.xcconfig */;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = B2NYSS5932;
GENERATE_INFOPLIST_FILE = YES;
GO_REST_AUTH_BEARER = "$(inherited)";
INFOPLIST_FILE = Tests/EndToEndTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.5;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -726,6 +739,8 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = B2NYSS5932;
GENERATE_INFOPLIST_FILE = YES;
GO_REST_AUTH_BEARER = "$(inherited)";
INFOPLIST_FILE = Tests/EndToEndTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.5;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand Down
11 changes: 11 additions & 0 deletions DevSecrets.xcconfig.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//
// DevSecrets.xcconfig.template
//
// Create a copy of this file, name it "DevSecrets.xcconfig"
// and place it in the root directory of AdyenNetworking.
//
// DevSecrets.xcconfig is in the .gitignore but make sure you don't accidentally commit any secrets.
//

// Generate an auth bearer on "https://gorest.co.in/"
GO_REST_AUTH_BEARER = "Bearer YOUR_TOKEN"
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ Please check the `Networking Demo App` folder, for some code examples.

:warning: _Please make sure to retain the `APIClient` instance, otherwise the completion handler will not be called._

## Testing

Running End-to-End Tests

Our `EndToEndTests` interact with the gorest.co.in API and require bearer authentication.

To run these tests locally:
1. Generate a Token: Obtain your personal bearer token from [gorest.co.in](https://gorest.co.in/).
2. Create DevSecrets.xcconfig: In the root directory of this project, create a new file named DevSecrets.xcconfig.
3. Add Your Token: Copy the content from DevSecrets.xcconfig.template into your new DevSecrets.xcconfig file. Replace the placeholder token with the actual bearer token you generated.

## Support

If you have a feature request, or spotted a bug or a technical problem, create a GitHub issue. For other questions, contact our Support Team via [Customer Area](https://ca-live.adyen.com/ca/ca/contactUs/support.shtml) or via email: support@adyen.com
Expand Down
8 changes: 8 additions & 0 deletions Secrets.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// Secrets.xcconfig
// AdyenNetworking
//

// To be able to run EndToEndTests you need to have following file in the root of your project
// Find the required content in the "DevSecrets.xcconfig.template"
#include? "DevSecrets.xcconfig"
Comment thread
robertdalmeida marked this conversation as resolved.
8 changes: 8 additions & 0 deletions Tests/EndToEndTests/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>GO_REST_AUTH_BEARER</key>
<string>$(GO_REST_AUTH_BEARER)</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Tests/EndToEndTests/Mocks/APIContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal struct APIContext: AnyAPIContext {
var headers: [String : String] = [
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": "Bearer e475ecaf522c28108af6b7a99e0ad788c73e9f8b15608ee3a1acef57da1c36f6"
"Authorization": Secrets.goRestAuthBearer
]

var queryParameters: [URLQueryItem] = []
Expand Down
36 changes: 36 additions & 0 deletions Tests/EndToEndTests/Secrets.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// Secrets.swift
// AdyenNetworking
//
// Created by Alexander Guretzki on 18/07/2025.
//

import Foundation

// We're using a class to internally figure out which bundle to load the secrets from
class Secrets {
private init() {}

static var goRestAuthBearer: String {
guard let bearer = stringValue(for: "GO_REST_AUTH_BEARER") else {
fatalError("GO_REST_AUTH_BEARER has to be provided via DevSecrets.xcconfig")
}

var characterSet = CharacterSet()
characterSet.insert("\"")
return bearer.trimmingCharacters(in: characterSet) // Making sure we don't have double ""
}
}

// MARK: - Helpers

private extension Secrets {
static func value<T>(for key: String) -> T? {
let bundle = Bundle(for: Self.self)
return bundle.infoDictionary?[key] as? T
}

static func stringValue(for key: String) -> String? {
return value(for: key)
}
}
Loading