diff --git a/SimpleKeychain/Accessibility.swift b/SimpleKeychain/Accessibility.swift index 698cfb9..36cde3f 100644 --- a/SimpleKeychain/Accessibility.swift +++ b/SimpleKeychain/Accessibility.swift @@ -1,7 +1,7 @@ import Security /// Represents the accessibility types of Keychain items. It's a mirror of `kSecAttrAccessible` values. -public enum Accessibility: RawRepresentable { +public enum Accessibility: RawRepresentable, Sendable { /// The data in the Keychain item can be accessed only while the device is unlocked by the user. /// See [kSecAttrAccessibleWhenUnlocked](https://developer.apple.com/documentation/security/ksecattraccessiblewhenunlocked). diff --git a/SimpleKeychain/SimpleKeychain.swift b/SimpleKeychain/SimpleKeychain.swift index c9fe1ab..8ff3d07 100644 --- a/SimpleKeychain/SimpleKeychain.swift +++ b/SimpleKeychain/SimpleKeychain.swift @@ -1,7 +1,7 @@ import Foundation import Security #if canImport(LocalAuthentication) -import LocalAuthentication +@preconcurrency import LocalAuthentication #endif typealias RetrieveFunction = (_ query: CFDictionary, _ result: UnsafeMutablePointer?) -> OSStatus @@ -10,16 +10,16 @@ typealias RemoveFunction = (_ query: CFDictionary) -> OSStatus /// A simple Keychain wrapper for iOS, macOS, tvOS, and watchOS. /// Supports sharing credentials with an **access group** or through **iCloud**, and integrating /// **Touch ID / Face ID**. -public struct SimpleKeychain { +public struct SimpleKeychain: Sendable { let service: String let accessGroup: String? let accessibility: Accessibility let accessControlFlags: SecAccessControlCreateFlags? let isSynchronizable: Bool - let attributes: [String: Any] + nonisolated(unsafe) let attributes: [String: Any] - var retrieve: RetrieveFunction = SecItemCopyMatching - var remove: RemoveFunction = SecItemDelete + nonisolated(unsafe) var retrieve: RetrieveFunction = SecItemCopyMatching + nonisolated(unsafe) var remove: RemoveFunction = SecItemDelete #if canImport(LocalAuthentication) && !os(tvOS) let context: LAContext?