-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve internal keychain handling (#71)
Description =========== The `KeychainLookupList` first added to this project missused an undocumented feature in macOS to implement all keychain additions and removals without the need to execute the `security` commandline tool. The logic worked by altering the config plist for the security tool: `com.apple.security.plist`. This worked great and allowed to run the tests on a mocked config file without altering the state of the executing machine. Since macOS 10.15 this solution became more and more brittle as this file was no longer created by default and is sometimes deleted. Multiple issues came up over the last few month so I decided to move the logic back to the `security` cli tool. There is a huge drawback when it comes to tests. We would like to test the logic in isolation but there is only one global keychain lookup mechanims on macOS. So altering this under test means to leave a broken state. To limit issues with broken/failing or forced closed tests I decided to implement the tests with a simple reset function. Before and After each test we reset the keychain lookup list to a default state. This state is by default the login keychain + the configured default keychain. One can also provide a list of keychains via a custom environment variable `ATLAS_BUILD_UNITY_IOS_DEFAULT_KEYCHAINS`. This variable should provide a list separated by `:` (unix) or `;` (windows) to the default user keychains. The `KeychainLookupListSpec` is also not running by default to not break any system configs. To opt in declare the `ATLAS_BUILD_UNITY_IOS_EXECUTE_KEYCHAIN_SPEC` environment variable. The implementation of the tests and the changed `KeychainLookupList` has one minor breaking behavior change. The method `clear` will do an internal `reset` instead of removing all keychains. Changes ======= ! *[IMPROVE] internal keychain handling
- Loading branch information
Showing
6 changed files
with
251 additions
and
282 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
@Library('github.com/wooga/[email protected]') _ | ||
|
||
withCredentials([string(credentialsId: 'atlas_build_unity_coveralls_token', variable: 'coveralls_token')]) { | ||
buildGradlePlugin plaforms: ['osx','windows', 'linux'], coverallsToken: coveralls_token, testEnvironment:[] | ||
buildGradlePlugin plaforms: ['osx','windows', 'linux'], coverallsToken: coveralls_token, testEnvironment:["ATLAS_BUILD_UNITY_IOS_EXECUTE_KEYCHAIN_SPEC=YES"] | ||
} |
This file contains 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 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 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
Oops, something went wrong.