import Foundation

public protocol KeychainService: Sendable {
    func save(_ value: String, forKey key: String) async
    func loadValue(forKey key: String) async -> String?
}

public actor MemoryKeychainService: KeychainService {
    private var storage: [String: String] = [:]

    public init() {}

    public func save(_ value: String, forKey key: String) async {
        storage[key] = value
    }

    public func loadValue(forKey key: String) async -> String? {
        storage[key]
    }
}
