Prove passphrase-hidden items fail closed without a matcher - #569
Merged
Merged
Conversation
Nothing asserted that onlyPassphrase items stay hidden when the search-passphrase matcher is nil, which is the real state after a keychain key-load failure. Cover the nil-matcher and wrong-phrase paths with hidden items whose titles would otherwise match the text query. Co-Authored-By: Claude Fable 5 <noreply@anthropic.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.
Problem
No test anywhere asserted the fail-closed behavior of passphrase-hidden items: when
retrieve(query:searchPassphraseMatcher:)is called with anilmatcher — the real state after a keychain key-load failure leavessearchPassphraseDigesternil inVaultDataModel—.onlyPassphraseitems must stay hidden. Only the positive match path was covered.Changes (test-only)
Two tests in
PersistedLocalVaultStoreTests, using hidden items whose titles also match the text query — so the text predicate alone would leak them ifsearchableLevelwere mishandled:retrieveMatchingQuery_keepsOnlyPassphraseItemsHiddenWhenMatcherNil— both the explicitmatcher: nilcall and theretrieve(query:)convenience return only the control item.retrieveMatchingQuery_keepsOnlyPassphraseItemsHiddenForWrongPhrase— a present matcher with a non-matching query text also returns only the control item.Local verification: PersistedLocalVaultStoreTests suite green on iPhone 18 Pro Max / iOS 27.0.
🤖 Generated with Claude Code