Remove AppGroupConfiguration
This commit is contained in:
parent
d135edc8ef
commit
8f0046e971
@ -27,7 +27,7 @@ The project also includes a watchOS companion app target for watch-specific demo
|
||||
1. Open `SecureStorgageSample.xcodeproj`
|
||||
2. Select an iOS simulator or device
|
||||
3. Build and run (⌘R)
|
||||
4. To use App Group demos, set your App Group identifier in `SecureStorgageSample/SecureStorgageSample/Models/AppGroupConfiguration.swift` and enable the entitlement for each target that should share data.
|
||||
4. To use App Group demos, enable the App Group entitlement for each target that should share data. The identifier is derived from the bundle ID via SharedKit constants.
|
||||
|
||||
## Project Structure
|
||||
|
||||
@ -37,7 +37,8 @@ SharedPackage/
|
||||
└── Sources/
|
||||
└── SharedKit/
|
||||
├── Constants/
|
||||
│ └── StorageKeyNames.swift
|
||||
│ ├── StorageKeyNames.swift
|
||||
│ └── StorageServiceIdentifiers.swift
|
||||
└── Models/
|
||||
└── UserProfile.swift
|
||||
SecureStorgageSample/
|
||||
@ -117,6 +118,7 @@ The app demonstrates various storage configurations:
|
||||
|
||||
- Storage keys are now split into one file per key and grouped by domain; platform-focused keys live in `StorageKeys/Platform` with comments calling out availability/sync focus.
|
||||
- The shared model/constants live in `SharedPackage` (`SharedKit`) to keep the watch/iOS data contract centralized.
|
||||
- Keychain service IDs and App Group identifiers are centralized in `SharedKit/Constants/StorageServiceIdentifiers.swift` to avoid hardcoded strings in keys.
|
||||
- The watch app uses a handler-based WatchConnectivity layer so new payload types can be added in `Services/Handlers` without bloating the main service.
|
||||
- A `StorageKeyCatalog` sample is included to generate a security audit report of all storage keys.
|
||||
- Each `StorageKey` includes a `description` used in audit reports.
|
||||
|
||||
@ -1,8 +0,0 @@
|
||||
import Foundation
|
||||
import SharedKit
|
||||
|
||||
enum AppGroupConfiguration {
|
||||
static var identifier: String {
|
||||
StorageServiceIdentifiers.appGroupIdentifier
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
import LocalData
|
||||
|
||||
import SharedKit
|
||||
extension StorageKeys {
|
||||
/// Stores a shared setting in App Group UserDefaults.
|
||||
/// - Domain: App Group UserDefaults
|
||||
@ -10,7 +10,7 @@ extension StorageKeys {
|
||||
typealias Value = String
|
||||
|
||||
let name = "app_group_setting"
|
||||
let domain: StorageDomain = .appGroupUserDefaults(identifier: AppGroupConfiguration.identifier)
|
||||
let domain: StorageDomain = .appGroupUserDefaults(identifier: StorageServiceIdentifiers.appGroupIdentifier)
|
||||
let security: SecurityPolicy = .none
|
||||
let serializer: Serializer<String> = .json
|
||||
let owner = "SampleApp"
|
||||
|
||||
@ -24,7 +24,7 @@ extension StorageKeys {
|
||||
}
|
||||
|
||||
var domain: StorageDomain {
|
||||
.appGroupFileSystem(identifier: AppGroupConfiguration.identifier, directory: directory)
|
||||
.appGroupFileSystem(identifier: StorageServiceIdentifiers.appGroupIdentifier, directory: directory)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import Foundation
|
||||
import LocalData
|
||||
import SharedKit
|
||||
|
||||
extension StorageKeys {
|
||||
/// Stores user preferences in App Group UserDefaults.
|
||||
@ -10,7 +11,7 @@ extension StorageKeys {
|
||||
typealias Value = [String: AnyCodable]
|
||||
|
||||
let name = "user_preferences"
|
||||
let domain: StorageDomain = .appGroupUserDefaults(identifier: AppGroupConfiguration.identifier)
|
||||
let domain: StorageDomain = .appGroupUserDefaults(identifier: StorageServiceIdentifiers.appGroupIdentifier)
|
||||
let security: SecurityPolicy = .none
|
||||
let serializer: Serializer<[String: AnyCodable]> = .json
|
||||
let owner = "SampleApp"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user