@@ -58,7 +58,6 @@ public final class Valet: NSObject, Sendable {
5858 findOrCreate ( groupIdentifier, identifier: identifier, configuration: . iCloud( accessibility) )
5959 }
6060
61- #if os(macOS)
6261 /// Creates a Valet with an explicitly set kSecAttrService.
6362 /// - Parameters:
6463 /// - identifier: A non-empty string that uniquely identifies a Valet. Must be unique relative to other Valet identifiers.
@@ -102,8 +101,7 @@ public final class Valet: NSObject, Sendable {
102101 public class func iCloudSharedGroupValet( withExplicitlySet identifier: SharedGroupIdentifier , accessibility: CloudAccessibility ) -> Valet {
103102 findOrCreate ( explicitlySet: identifier, configuration: . iCloud( accessibility) )
104103 }
105- #endif
106-
104+
107105 // MARK: Equatable
108106
109107 /// - Returns: `true` if lhs and rhs both read from and write to the same sandbox within the keychain.
@@ -144,7 +142,6 @@ public final class Valet: NSObject, Sendable {
144142 }
145143
146144
147- #if os(macOS)
148145 private class func findOrCreate( explicitlySet identifier: Identifier , configuration: Configuration ) -> Valet {
149146 let service : Service = . standardOverride( service: identifier, configuration)
150147 let key = service. description + configuration. description + configuration. accessibility. description + identifier. description
@@ -171,8 +168,7 @@ public final class Valet: NSObject, Sendable {
171168 }
172169 }
173170
174- #endif
175-
171+
176172 // MARK: Initialization
177173
178174 @available ( * , unavailable)
@@ -201,7 +197,6 @@ public final class Valet: NSObject, Sendable {
201197 accessibility = configuration. accessibility
202198 }
203199
204- #if os(macOS)
205200 private init ( overrideIdentifier: Identifier , configuration: Configuration ) {
206201 self . identifier = overrideIdentifier
207202 self . configuration = configuration
@@ -215,7 +210,6 @@ public final class Valet: NSObject, Sendable {
215210 service = . sharedGroupOverride( service: identifier, configuration)
216211 accessibility = configuration. accessibility
217212 }
218- #endif
219213
220214 // MARK: CustomStringConvertible
221215
@@ -424,12 +418,10 @@ public final class Valet: NSObject, Sendable {
424418 serviceAttribute = Service . sharedGroup ( with: configuration, groupIdentifier: sharedGroupIdentifier, identifier: identifier, accessibilityDescription: accessibilityDescription)
425419 case . standard:
426420 serviceAttribute = Service . standard ( with: configuration, identifier: identifier, accessibilityDescription: accessibilityDescription)
427- #if os(macOS)
428421 case let . sharedGroupOverride( sharedGroupIdentifier, _) :
429422 serviceAttribute = sharedGroupIdentifier. description
430423 case . standardOverride:
431424 serviceAttribute = identifier. description
432- #endif
433425 }
434426 keychainQuery [ kSecAttrService as String ] = serviceAttribute
435427 try migrateObjects ( matching: keychainQuery, removeOnCompletion: removeOnCompletion)
@@ -459,12 +451,10 @@ public final class Valet: NSObject, Sendable {
459451 serviceAttribute = Service . sharedGroup ( with: configuration, groupIdentifier: groupIdentifier, identifier: identifier, accessibilityDescription: accessibilityDescription)
460452 case . standard:
461453 serviceAttribute = Service . standard ( with: configuration, identifier: identifier, accessibilityDescription: accessibilityDescription)
462- #if os(macOS)
463454 case . sharedGroupOverride:
464455 serviceAttribute = Service . sharedGroup ( with: configuration, explicitlySetIdentifier: identifier, accessibilityDescription: accessibilityDescription)
465456 case . standardOverride:
466457 serviceAttribute = Service . standard ( with: configuration, identifier: identifier, accessibilityDescription: accessibilityDescription)
467- #endif
468458 }
469459 keychainQuery [ kSecAttrService as String ] = serviceAttribute
470460 try migrateObjects ( matching: keychainQuery, removeOnCompletion: removeOnCompletion)
@@ -590,7 +580,6 @@ extension Valet {
590580 return iCloudSharedGroupValet ( with: identifier, accessibility: accessibility)
591581 }
592582
593- #if os(macOS)
594583 /// Creates a Valet with an explicitly set kSecAttrService.
595584 /// - Parameters:
596585 /// - identifier: A non-empty string that uniquely identifies a Valet. Must be unique relative to other Valet identifiers.
@@ -658,7 +647,6 @@ extension Valet {
658647 }
659648 return findOrCreate ( explicitlySet: identifier, configuration: . iCloud( accessibility) )
660649 }
661- #endif
662650
663651 // MARK: Public Methods
664652
@@ -751,7 +739,6 @@ extension Valet {
751739 }
752740 }
753741
754- #if os(macOS)
755742 class func permutations( withExplictlySet identifier: Identifier , shared: Bool = false ) -> [ Valet ] {
756743 Accessibility . allCases. map { accessibility in
757744 . valet( withExplicitlySet: identifier, accessibility: accessibility)
@@ -775,6 +762,5 @@ extension Valet {
775762 . iCloudSharedGroupValet( withExplicitlySet: identifier, accessibility: cloudAccessibility)
776763 }
777764 }
778- #endif
779765
780766}
0 commit comments