LocalData/Sources/LocalData/Protocols/KeychainStoring.swift
Matt Bruce ac486a38bc Update Audit, Configuration, Migrations (+4 more)
Summary:
- Sources: Audit, Configuration, Migrations, Models, Protocols (+2 more)

Stats:
- 37 files changed, 256 insertions(+), 22 deletions(-)
2026-01-18 14:53:30 -06:00

28 lines
864 B
Swift

import Foundation
/// Protocol defining the interface for Keychain operations.
///
/// Conformers enable dependency injection and mocking in tests.
public protocol KeychainStoring: Sendable {
/// Stores data for a keychain entry.
func set(
_ data: Data,
service: String,
key: String,
accessibility: KeychainAccessibility,
accessControl: KeychainAccessControl?
) async throws
/// Retrieves data for a keychain entry.
func get(service: String, key: String) async throws -> Data?
/// Deletes a keychain entry.
func delete(service: String, key: String) async throws
/// Checks if a keychain entry exists.
func exists(service: String, key: String) async throws -> Bool
/// Deletes all keychain entries for a service.
func deleteAll(service: String) async throws
}