Conversation
| .iOS(.v12), | ||
| .tvOS(.v12), | ||
| .watchOS(.v4), | ||
| .macOS(.v10_13), |
There was a problem hiding this comment.
minimum versions in Xcode 16 updated
| if !userPrompt.isEmpty { | ||
| secItemQuery[kSecUseOperationPrompt as String] = userPrompt | ||
| let context = LAContext() | ||
| context.localizedReason = userPrompt |
There was a problem hiding this comment.
sigh. this API doesn't exist on either tvOS or watchOS. the methods that call into this method no longer expose the userPrompt
| /// - Throws: An error of type `KeychainError`. | ||
| @objc | ||
| public func object(forKey key: String, withPrompt userPrompt: String) throws -> Data { | ||
| try execute(in: lock) { |
There was a problem hiding this comment.
Swift 6 can't rethrow with a typed error, so we just inline the helper here and elsewhere
|
|
||
| extension SecureEnclaveIntegrationTests { | ||
|
|
||
| @available (*, deprecated) |
There was a problem hiding this comment.
funnily enough, this space is now a warning
| @@ -1,20 +0,0 @@ | |||
| #!/bin/bash -l | |||
There was a problem hiding this comment.
not needed on recent Xcodes!
| // limitations under the License. | ||
| // | ||
|
|
||
| #import "VALLegacyValet.h" |
There was a problem hiding this comment.
whoops. Xcode is warning about these malformed imports now, which is long overdue!
| removeQueueExpectation.fulfill() | ||
| } | ||
|
|
||
| waitForExpectations(timeout: 10.0, handler: nil) |
There was a problem hiding this comment.
Xcode is pushing us towards the fulfillment method below now.
|
|
||
| for _ in 1...50 { | ||
| setQueue.async { | ||
| setQueue.async { [vanillaValet, passcode, key] in |
There was a problem hiding this comment.
self isn't Sendable, so we capture what we need rather than self
| // MARK: Shared Access Group | ||
|
|
||
| static var sharedAccessGroupIdentifier: SharedGroupIdentifier = { | ||
| static let sharedAccessGroupIdentifier: SharedGroupIdentifier = { |
There was a problem hiding this comment.
these were never set. not sure why I made them var to begin with, but... easy fix!
| try migrateObjects(matching: valet.baseKeychainQuery, removeOnCompletion: removeOnCompletion) | ||
| } | ||
|
|
||
| // MARK: Renamed Methods |
There was a problem hiding this comment.
These were renamed in more than four years ago in the V4 release. Open to keeping them around but doing some roomba-ing.
|
|
||
| ## Migrating from prior Valet versions | ||
|
|
||
| The good news: most Valet configurations do _not_ have to migrate keychain data when upgrading from an older version of Valet. All Valet objects are backwards compatible with their counterparts from prior versions. We have exhaustive unit tests to prove it (search for `test_backwardsCompatibility`). Valets that have had their configurations deprecated by Apple will need to migrate stored data. |
There was a problem hiding this comment.
the exhaustive tests required the v2 (objc) version of Valet to live forever without changes, and these old files were utilizing deprecated API. We maintained these tests for the better part of a decade. We successfully managed to deploy a rewrite in Swift without regression years ago. Time to let go.
| import Foundation | ||
|
|
||
|
|
||
| internal final class WeakStorage<T: AnyObject>: @unchecked Sendable { |
There was a problem hiding this comment.
thread-safe because the underlying storage is only ever accessed or modified within a lock.
| } | ||
|
|
||
| /// - Parameters: | ||
| /// - identifier: A non-empty string that must correspond with the value for keychain-access-groups in your Entitlements file. |
Breaking change! Gets us running on Xcode 16, dropping support for prior Xcode versions. Fixes all consumer-facing warnings regardless of build system, belatedly addressing #294. Also (see inline comments) removes API for tvOS and watchOS that likely never worked given warnings received when compiling on Xcode 16.
Getting on Swift 6 allows us to use typed throws. Utilizing typed throws feels like the right move given that we haven't seen a change to what errors we throw in seven years.