-
Notifications
You must be signed in to change notification settings - Fork 5
Remove secrets from tests #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
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 268b1ce
Merge branch 'develop' into remove_secrets
goergisn d4c9fcf
Removing bearer looking bearer with PLACEHOLDEr
goergisn 1b99635
Better description
goergisn 0e44bc3
hardcoding old bearer to try out overriding values
goergisn c718239
maybe like this
goergisn 2431815
fixing tests
goergisn fd03f8d
using bearer from Github Secrets
goergisn 4650643
Update DevSecrets.xcconfig.template
goergisn cfa04be
Update Secrets.xcconfig
goergisn f1b8bcd
Merge branch 'develop' into remove_secrets
goergisn fa4cafb
Update README.md
goergisn 73d7f6c
Update test_cocoapods_integration.yml
goergisn c8bbaf9
Update test_cocoapods_integration.yml
goergisn 1ab8b51
updating xcode project versio
goergisn 132880b
Revert "Update test_cocoapods_integration.yml"
goergisn 6dbf4f5
Update test_cocoapods_integration.yml
goergisn dd89704
Update test_cocoapods_integration.yml
goergisn 8a6619f
Update test_cocoapods_integration.yml
goergisn a5e237e
Update test_cocoapods_integration.yml
goergisn c552872
Update test_cocoapods_integration.yml
goergisn d1dc372
Update test_cocoapods_integration.yml
goergisn 97dcd36
Update test_cocoapods_integration.yml
goergisn a10d36a
Update test_cocoapods_integration.yml
goergisn 3b6cb9e
Update project.pbxproj
goergisn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,3 +36,4 @@ Internal/ | |
| #Swift Package Manager | ||
| .swiftpm | ||
| Package.resolved | ||
| DevSecrets.xcconfig | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.