Add AppStorageCatalog
This commit is contained in:
parent
e7115693a1
commit
92adb96fe1
@ -112,6 +112,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.
|
||||
- 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.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
@ -18,6 +18,10 @@ struct SecureStorgageSampleApp: App {
|
||||
for: SampleKeyMaterialSources.external
|
||||
)
|
||||
}
|
||||
#if DEBUG
|
||||
let report = StorageAuditReport.renderText(for: AppStorageCatalog.self)
|
||||
print(report)
|
||||
#endif
|
||||
}
|
||||
|
||||
var body: some Scene {
|
||||
|
||||
28
SecureStorgageSample/Services/AppStorageCatalog.swift
Normal file
28
SecureStorgageSample/Services/AppStorageCatalog.swift
Normal file
@ -0,0 +1,28 @@
|
||||
import Foundation
|
||||
import LocalData
|
||||
import SharedKit
|
||||
|
||||
struct AppStorageCatalog: StorageKeyCatalog {
|
||||
static var allKeys: [StorageKeyDescriptor] {
|
||||
[
|
||||
.from(StorageKeys.AppVersionKey(), serializer: "json"),
|
||||
.from(StorageKeys.UserPreferencesKey(), serializer: "json"),
|
||||
.from(StorageKeys.CredentialsKey(), serializer: "json"),
|
||||
.from(StorageKeys.LastLocationKey(), serializer: "json"),
|
||||
.from(StorageKeys.APITokenKey(), serializer: "json"),
|
||||
.from(StorageKeys.UserProfileFileKey(), serializer: "json"),
|
||||
.from(StorageKeys.CachedDataKey(), serializer: "data"),
|
||||
.from(StorageKeys.SettingsPlistKey(), serializer: "plist"),
|
||||
.from(StorageKeys.SessionLogsKey(), serializer: "json"),
|
||||
.from(StorageKeys.PrivateNotesKey(), serializer: "json"),
|
||||
.from(StorageKeys.ExternalSessionLogsKey(), serializer: "json"),
|
||||
.from(StorageKeys.WatchVibrationKey(), serializer: "json"),
|
||||
.from(StorageKeys.SyncableSettingKey(), serializer: "json"),
|
||||
.from(
|
||||
StorageKeys.ExternalKeyMaterialKey(keyName: "<dynamic>"),
|
||||
serializer: "data",
|
||||
notes: "Key name is dynamic per external source."
|
||||
)
|
||||
]
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user