From 772fe846a82616bf01133575198e589e05190446 Mon Sep 17 00:00:00 2001 From: Andreas Bauer Date: Fri, 2 Aug 2024 12:05:10 +0200 Subject: [PATCH] Update docs --- README.md | 4 ++-- Sources/SpeziLocalStorage/LocalStorage.swift | 4 ++-- Sources/SpeziSecureStorage/SecureStorage.swift | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2dfef30..1887062 100644 --- a/README.md +++ b/README.md @@ -76,8 +76,8 @@ The [`LocalStorage`](https://swiftpackageindex.com/stanfordspezi/spezistorage/do The [`LocalStorage`](https://swiftpackageindex.com/stanfordspezi/spezistorage/documentation/spezilocalstorage/localstorage) module defaults to storing data encrypted supported by the [`SecureStorage`](https://swiftpackageindex.com/StanfordSpezi/SpeziStorage/documentation/spezisecurestorage) module. The [`LocalStorageSetting`](https://swiftpackageindex.com/stanfordspezi/spezistorage/documentation/spezilocalstorage/localstoragesetting) enables configuring how data in the [`LocalStorage`](https://swiftpackageindex.com/stanfordspezi/spezistorage/documentation/spezilocalstorage/localstorage) module can be stored and retrieved. -- Store or update new elements: [`store(_:storageKey:settings:)`](https://swiftpackageindex.com/stanfordspezi/spezistorage/documentation/spezilocalstorage/localstorage/store(_:storagekey:settings:)) -- Retrieve existing elements: [`read(_:storageKey:settings:)`](https://swiftpackageindex.com/stanfordspezi/spezistorage/documentation/spezilocalstorage/localstorage/read(_:storagekey:settings:)) +- Store or update new elements: [`store(_:encoder:storageKey:settings:)`](https://swiftpackageindex.com/stanfordspezi/spezistorage/documentation/spezilocalstorage/localstorage/store(_:encoder:storagekey:settings:)) +- Retrieve existing elements: [`read(_:decoder:storageKey:settings:)`](https://swiftpackageindex.com/stanfordspezi/spezistorage/documentation/spezilocalstorage/localstorage/read(_:decoder:storagekey:settings:)) - Delete existing elements: [`delete(_:)`](https://swiftpackageindex.com/stanfordspezi/spezistorage/documentation/spezilocalstorage/localstorage/delete(_:)) diff --git a/Sources/SpeziLocalStorage/LocalStorage.swift b/Sources/SpeziLocalStorage/LocalStorage.swift index 72591aa..c349794 100644 --- a/Sources/SpeziLocalStorage/LocalStorage.swift +++ b/Sources/SpeziLocalStorage/LocalStorage.swift @@ -18,9 +18,9 @@ import SpeziSecureStorage /// The module relies on the [`SecureStorage`](https://swiftpackageindex.com/StanfordSpezi/SpeziStorage/documentation/spezisecurestorage) /// module to enable an encrypted on-disk storage as defined by the ``LocalStorageSetting`` configuration. /// -/// Use ``LocalStorage/store(_:storageKey:settings:)`` to store elements on disk and define the settings using a ``LocalStorageSetting`` instance. +/// Use ``store(_:encoder:storageKey:settings:)`` to store elements on disk and define the settings using a `LocalStorageSetting` instance. /// -/// Use ``LocalStorage/read(_:storageKey:settings:)`` to read elements on disk which are decoded as define by passed in ``LocalStorageSetting`` instance. +/// Use ``read(_:decoder:storageKey:settings:)`` to read elements on disk which are decoded as define by passed in `LocalStorageSetting` instance. public final class LocalStorage: Module, DefaultInitializable, EnvironmentAccessible, @unchecked Sendable { private let encryptionAlgorithm: SecKeyAlgorithm = .eciesEncryptionCofactorX963SHA256AESGCM @Dependency private var secureStorage = SecureStorage() diff --git a/Sources/SpeziSecureStorage/SecureStorage.swift b/Sources/SpeziSecureStorage/SecureStorage.swift index 3c0d338..1c6bf80 100644 --- a/Sources/SpeziSecureStorage/SecureStorage.swift +++ b/Sources/SpeziSecureStorage/SecureStorage.swift @@ -19,7 +19,7 @@ import XCTRuntimeAssertions /// The storing of credentials and keys follows the Keychain documentation provided by Apple: /// [Using the keychain to manage user secrets](https://developer.apple.com/documentation/security/keychain_services/keychain_items/using_the_keychain_to_manage_user_secrets). /// -/// On the macOS platform, the ``SecureStorage`` uses the [Data protection keychain](https://developer.apple.com/documentation/technotes/tn3137-on-mac-keychains) which mirrors the data protection keychain originated on iOS. +/// On the macOS platform, the `SecureStorage` uses the [Data protection keychain](https://developer.apple.com/documentation/technotes/tn3137-on-mac-keychains) which mirrors the data protection keychain originated on iOS. public final class SecureStorage: Module, DefaultInitializable, EnvironmentAccessible, Sendable { /// The ``SecureStorage`` serves as a reusable `Module` that can be used to store store small chunks of data such as credentials and keys. /// @@ -230,6 +230,7 @@ public final class SecureStorage: Module, DefaultInitializable, EnvironmentAcces /// Delete all existing credentials stored in the Keychain. /// - Parameters: + /// - itemTypes: The types of items. /// - accessGroup: The access group associated with the credentials. public func deleteAllCredentials(itemTypes: SecureStorageItemTypes = .all, accessGroup: String? = nil) throws { for kSecClassType in itemTypes.kSecClass {