square / Valet

Valet lets you securely store data in the iOS, tvOS, watchOS, or macOS Keychain without knowing a thing about how the Keychain works. It’s easy. We promise.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deprecation warnings when targeting iOS 14+

AttilaTheFun opened this issue · comments

I'm using Valet via SPM and just started targeting iOS 14.

I'm seeing the following deprecation warnings from SecureEnclave.swift:

'kSecUseOperationPrompt' was deprecated in iOS 14.0: Use kSecUseAuthenticationContext and set LAContext.localizedReason property

'kSecUseAuthenticationUIFail' was deprecated in iOS 14.0: Instead of kSecUseAuthenticationUI, use kSecUseAuthenticationContext and set LAContext.interactionNotAllowed property

I generally try to treat warnings as errors and it would be great if these could be resolved. Let me know if you'd prefer I create a pull request or you'd like to fix the warnings yourselves. Thanks!

Hey Logan! Good to hear from you, and thanks for letting us know about this issue.

The wrinkle with fixing this issue will be that the LocalAuthentication framework doesn't exist on tvOS:

// Xcode 13 and prior incorrectly say that LocalAuthentication is available on tvOS, so we have to check both as long as Xcode 13 and prior are supported.
#if !os(tvOS) && canImport(LocalAuthentication)

Given these warnings, and given that LocalAuthentication is missing from tvOS: it sounds like we should remove SecureEnclaveValet from the tvOS target entirely, taking a similar approach as we did in #284. I don't have the bandwidth to put a PR together for this at the moment, and would welcome one from you.

I think we'll treat this issue as a bugfix bump since from the warning it looks like SecureEnclaveValet never actually worked on tvOS (it works on simulator / tests but apparently the simulator can get this kind of thing wrong), and given that no one ever told us that this wasn't working it seems like no one was using the feature.

Let me know your thoughts. cc @NickEntin

Sure that makes sense! I can try to put a PR together for that next week.

That approach sounds good to me 👍