Remove deprecated keychain no-UI symbol#526
Open
iam-brain wants to merge 1 commit intosteipete:mainfrom
Open
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
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.
Summary
kSecUseAuthenticationUIFailsymbol so production builds stop emitting the macOS deprecation warningWhy This Change Is Structured This Way
The old helper explicitly documented a real behavior constraint:
That matters because a naive cleanup would have been risky. Simply deleting the legacy UI-fail policy would remove the deprecation warning, but it could also reintroduce interactive keychain prompts for older generic-password items.
During review, that exact concern was raised and re-checked against the SDK behavior: Apple recommends the
LAContextpath, but legacy keychain items may still behave differently on macOS. Because these queries touch external keychain items such as Claude CLI credentials, preserving the existing no-UI behavior is more important than purely modernizing the code shape.So this PR takes a compatibility-preserving approach:
kSecUseAuthenticationContextwithLAContext.interactionNotAllowed = trueIn other words: this is intended to be a warning cleanup without a behavior change.
What Changed
kSecUseAuthenticationUIFailLAContext.interactionNotAllowedpathVerification
Automated verification run on the final diff:
swift test --filter KeychainNoUIQueryTestsswift build -c releaseswift testpnpm check./Scripts/compile_and_run.shResults:
kSecUseAuthenticationUIFaildeprecation warningWhat We Can And Cannot Prove
What this PR proves well:
What this PR cannot fully prove in automation:
That part is inherently environment-dependent. The strongest runtime check is a manual smoke test against a real promptable legacy keychain item on a machine where CodexBar is not already trusted. The expected outcome is still: no prompt during preflight, and
errSecInteractionNotAllowed/.interactionRequiredinstead.Risk / Tradeoff
This keeps a compatibility shim (
"u_AuthUIF") rather than a typed constant. That is less ideal than a fully modern API-only path, but it is the safer choice here because it preserves the behavior the old code was intentionally relying on while still removing the compile-time deprecation warning.