Repository navigation
[MOO-2540]: Make device-bound iOS keychain - #76
Open
MxKevinBeqo wants to merge 2 commits into
Open
MxKevinBeqo wants to merge 2 commits into
MxKevinBeqo wants to merge 2 commits into
Conversation
Set after-first-unlock device-only accessibility for encrypted values and session cookies. Migrate legacy items in place and preserve readable data on migration failure. Add an opt-in strict getter for authoritative missing-key detection. Decode existing cookie archives using their NSCoding format so sessions remain restorable. Keep legacy getter behavior and Android storage policy unchanged. Refs: MOO-2540 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add native coverage for accessibility migration, failure retries, strict reads, and session-cookie persistence and restoration. Extend the iOS example harness with a Debug-only attribute inspector and legacy fixtures. Wire the CocoaPods test spec, package its sources, and document native test execution. Refs: MOO-2540 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
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.
This PR makes the below changes:
The recommendation is using AfterFirstUnlock over WhenUnlocked so reads from the background (sync, push and background fetch handlers) keep working. The existing errSecInteractionNotAllowed handling stays as it is.
Migrate existing items: on first read, or once at startup, upgrade items already on devices with SecItemUpdate, using a query on kSecClass + kSecAttrAccount and attributes { kSecAttrAccessible: … }. If the update fails, log it and leave the item unchanged; never delete it.
Handle a restored backup (critical): after a restore to a new device, the encrypted SQLite file comes back but dbpassword no longer does. Today getOrCreateDbPassword() (client, client/native/nativeDatabaseHelpers.ts:139) would generate a new key and fail to open the existing DB. The client needs a recovery path for "DB file exists but key is missing": delete the DB, clear the session and force a resync/login. This needs coordination with the client/Offline team; open a linked ticket if it lives in appdev.