parse-community / Parse-Swift

The Swift SDK for Parse Platform (iOS, macOS, watchOS, tvOS, Linux, Android, Windows)
https://parseplatform.org
MIT License
306 stars 69 forks source link

fix: default to setting use data protection to false for macOS Keychain #398

Closed cbaker6 closed 2 years ago

cbaker6 commented 2 years ago

New Pull Request Checklist

Issue Description

378 Set all queries to the macOS Keychain to kSecUseDataProtectionKeychain == true by default. Though this is recommended by Apple to make the macOS and iOS Keychains behave the same way, it causes the issue of preventing saved items to the Keychain from being queried in Swift Playgrounds and other macOS environments (SPM XCTest) that do not have the ability to configure the Keychain.

Related issue: #n/a

Approach

For macOS, default to not setting kSecUseDataProtectionKeychain == true and provide the usingDataProtectionKeychain option when configuring the SDK. Developers can decide to set usingDataProtectionKeychain == true which will cause all macOS queries to use kSecUseDataProtectionKeychain == true and make the macOS Keychain behave like the iOS Keychain.

TODOs before merging

parse-github-assistant[bot] commented 2 years ago

Thanks for opening this pull request!

codecov[bot] commented 2 years ago

Codecov Report

Merging #398 (2e756b4) into main (ed74494) will decrease coverage by 0.04%. The diff coverage is 83.33%.

@@            Coverage Diff             @@
##             main     #398      +/-   ##
==========================================
- Coverage   89.68%   89.63%   -0.05%     
==========================================
  Files         158      158              
  Lines       15075    15080       +5     
==========================================
- Hits        13520    13517       -3     
- Misses       1555     1563       +8     
Impacted Files Coverage Δ
Sources/ParseSwift/Types/ParseConfiguration.swift 53.19% <50.00%> (-0.15%) :arrow_down:
Sources/ParseSwift/Parse.swift 99.01% <100.00%> (-0.99%) :arrow_down:
Sources/ParseSwift/Storage/KeychainStore.swift 97.86% <100.00%> (ø)
...eSwift/InternalObjects/BaseParseInstallation.swift 45.45% <0.00%> (-54.55%) :arrow_down:
Sources/ParseSwift/Objects/ParseObject.swift 87.29% <0.00%> (-0.15%) :arrow_down:
Sources/ParseSwift/Objects/ParseUser.swift 86.34% <0.00%> (+0.16%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.