-
Notifications
You must be signed in to change notification settings - Fork 53
[Keychain] Prevent keychain access from prompting user for permissions on macOS #75
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
Conversation
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
Will add a corresponding bug number in PR description after getting PR ready for release. |
Coverage Report 1Affected Products
Test Logs |
7487b41
to
7213821
Compare
paulb777
approved these changes
Aug 25, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
charlotteliang
approved these changes
Aug 25, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Context
This PR adds the
kSecUseDataProtectionKeychain
search attribute to the keychain wrapper APIs inGULKeychainStorage.h
andGULKeychainUtils.h
. The search key will make the macOS keychain behave like the iOS-style keychain. This is needed to avoid the keychain access pop-ups that occur when a macOS-style keychain is accessed.GoogleUtilities exposes two public headers that facilitate interaction with the Keychain:
GULKeychainStorage.h
andGULKeychainUtils.h
.GULKeychainStorage.h
implementation usesGULKeychainUtils.h
to actually make call the Keychain's native APIs. Because of this, adding thekSecUseDataProtectionKeychain
was, at minimum, required inGULKeychainUtils.h
. But, to avoid future implementation changes whereGULKeychainStorage.h
no longer usesGULKeychainUtils.h
as an implementation detail, I have ensured the key is inject at theGULKeychainStorage.h
level. This will ensure that using both headers will always result in a querying the keychain with thekSecUseDataProtectionKeychain
flag set totrue
, now and in the future.Additionally, explicitly setting
kSecUseDataProtectionKeychain
totrue
only really affects macOS because the key is set totrue
by default. For macOS, settingkSecUseDataProtectionKeychain
totrue
requires that targets that include the GoogleUtilities framework are signed with a provisioning profile that includes the Keychain Sharing capability.More details at go/firebase-macos-keychain-popups
Outstanding work (in order of planned completion)
GULKeychain*
and targeting macOS.GULKeychainStorage.h
andGULKeychainUtils.h
regarding macOS-specific constraints.Fixes