diff --git a/SecureStorageSample/StorageKeys/Keychain/APITokenKey.swift b/SecureStorageSample/StorageKeys/Keychain/APITokenKey.swift index c119fc7..1a8ee31 100644 --- a/SecureStorageSample/StorageKeys/Keychain/APITokenKey.swift +++ b/SecureStorageSample/StorageKeys/Keychain/APITokenKey.swift @@ -7,7 +7,7 @@ extension StorageKey where Value == String { /// Stores API token in keychain. nonisolated static let apiToken = StorageKey( name: "api_token", - domain: .keychain(service: StorageServiceIdentifiers.keychainAPIToken), + domain: .keychain(service: nil), security: .keychain( accessibility: .whenUnlockedThisDeviceOnly, accessControl: nil diff --git a/SecureStorageSample/StorageKeys/Keychain/CredentialsKey.swift b/SecureStorageSample/StorageKeys/Keychain/CredentialsKey.swift index c7fef60..de141d2 100644 --- a/SecureStorageSample/StorageKeys/Keychain/CredentialsKey.swift +++ b/SecureStorageSample/StorageKeys/Keychain/CredentialsKey.swift @@ -8,7 +8,7 @@ extension StorageKey where Value == Credential { /// Configurable accessibility and access control. nonisolated static let credentials = StorageKey( name: "user_credentials", - domain: .keychain(service: StorageServiceIdentifiers.keychainCredentials), + domain: .keychain(service: nil), security: .keychain(accessibility: .afterFirstUnlock, accessControl: nil), serializer: .json, owner: "SampleApp", @@ -26,7 +26,7 @@ extension StorageKey where Value == Credential { ) -> StorageKey { StorageKey( name: "user_credentials", - domain: .keychain(service: StorageServiceIdentifiers.keychainCredentials), + domain: .keychain(service: nil), security: .keychain(accessibility: accessibility, accessControl: accessControl), serializer: .json, owner: "SampleApp", diff --git a/SecureStorageSample/StorageKeys/Keychain/ExternalKeyMaterialKey.swift b/SecureStorageSample/StorageKeys/Keychain/ExternalKeyMaterialKey.swift index f272974..5fb5163 100644 --- a/SecureStorageSample/StorageKeys/Keychain/ExternalKeyMaterialKey.swift +++ b/SecureStorageSample/StorageKeys/Keychain/ExternalKeyMaterialKey.swift @@ -7,7 +7,7 @@ extension StorageKey where Value == Data { /// Stores external key material used for encryption policies. nonisolated static let externalKeyMaterial = StorageKey( name: "external_key_material", - domain: .keychain(service: StorageServiceIdentifiers.keychainExternalKeyMaterial), + domain: .keychain(service: nil), security: .keychain( accessibility: .afterFirstUnlock, accessControl: nil diff --git a/SecureStorageSample/StorageKeys/Keychain/LastLocationKey.swift b/SecureStorageSample/StorageKeys/Keychain/LastLocationKey.swift index edeea26..6813acc 100644 --- a/SecureStorageSample/StorageKeys/Keychain/LastLocationKey.swift +++ b/SecureStorageSample/StorageKeys/Keychain/LastLocationKey.swift @@ -7,7 +7,7 @@ extension StorageKey where Value == SampleLocationData { /// Stores sensitive location data in keychain with biometric protection. nonisolated static let lastLocation = StorageKey( name: "last_known_location", - domain: .keychain(service: StorageServiceIdentifiers.keychainLocation), + domain: .keychain(service: nil), security: .keychain( accessibility: .afterFirstUnlock, accessControl: .userPresence diff --git a/SecureStorageSample/StorageKeys/Migration/ConditionalMigrationKeys.swift b/SecureStorageSample/StorageKeys/Migration/ConditionalMigrationKeys.swift index 39d494f..1e09eb7 100644 --- a/SecureStorageSample/StorageKeys/Migration/ConditionalMigrationKeys.swift +++ b/SecureStorageSample/StorageKeys/Migration/ConditionalMigrationKeys.swift @@ -17,7 +17,7 @@ extension StorageKey where Value == String { nonisolated static let modernAppMode = StorageKey( name: "modern_app_mode", - domain: .keychain(service: StorageServiceIdentifiers.keychainLocation), + domain: .keychain(service: nil), security: .keychain( accessibility: .afterFirstUnlock, accessControl: .userPresence diff --git a/SecureStorageSample/StorageKeys/Migration/MigrationKeys.swift b/SecureStorageSample/StorageKeys/Migration/MigrationKeys.swift index 936a241..7cede97 100644 --- a/SecureStorageSample/StorageKeys/Migration/MigrationKeys.swift +++ b/SecureStorageSample/StorageKeys/Migration/MigrationKeys.swift @@ -19,7 +19,7 @@ extension StorageKey where Value == String { /// The modern key where data should end up (in Keychain). nonisolated static let modernMigrationDestination = StorageKey( name: "secure_user_id", - domain: .keychain(service: StorageServiceIdentifiers.keychainLocation), + domain: .keychain(service: nil), security: .keychain( accessibility: .afterFirstUnlock, accessControl: .userPresence diff --git a/SecureStorageSample/StorageKeys/Migration/TransformingMigrationKeys.swift b/SecureStorageSample/StorageKeys/Migration/TransformingMigrationKeys.swift index 5317b4a..459674d 100644 --- a/SecureStorageSample/StorageKeys/Migration/TransformingMigrationKeys.swift +++ b/SecureStorageSample/StorageKeys/Migration/TransformingMigrationKeys.swift @@ -20,7 +20,7 @@ extension StorageKey where Value == String { extension StorageKey where Value == ProfileName { nonisolated static let modernProfileName = StorageKey( name: "modern_profile_name", - domain: .keychain(service: StorageServiceIdentifiers.keychainLocation), + domain: .keychain(service: nil), security: .keychain( accessibility: .afterFirstUnlock, accessControl: .userPresence diff --git a/localPackages/SharedPackage/Sources/SharedKit/Constants/StorageServiceIdentifiers.swift b/localPackages/SharedPackage/Sources/SharedKit/Constants/StorageServiceIdentifiers.swift index 53e00fa..95586ea 100644 --- a/localPackages/SharedPackage/Sources/SharedKit/Constants/StorageServiceIdentifiers.swift +++ b/localPackages/SharedPackage/Sources/SharedKit/Constants/StorageServiceIdentifiers.swift @@ -28,20 +28,4 @@ public enum StorageServiceIdentifiers { Logger.debug("App Group ID: \(appGroupIdentifier)") Logger.debug("---------------------------") } - - public static var keychainCredentials: String { - "\(teamIDPrefix)\(bundleIdentifier)" - } - - public static var keychainAPIToken: String { - "\(teamIDPrefix)\(bundleIdentifier).api" - } - - public static var keychainExternalKeyMaterial: String { - "\(teamIDPrefix)\(bundleIdentifier).externalkey" - } - - public static var keychainLocation: String { - "\(teamIDPrefix)\(bundleIdentifier).security" - } }