Skip to content
Snippets Groups Projects
Commit 08b5e5c1 authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Add PasswordStorage

parent 414c184b
No related branches found
No related tags found
1 merge request!1Client management
This commit is part of merge request !1. Comments created here will be created in the context of that merge request.
......@@ -5,3 +5,7 @@ public struct BindingsDownloadAndVerifySignedNdfWithUrlUnknownError: Error, Equa
public struct BindingsGenerateSecretUnknownError: Error, Equatable {
public init() {}
}
public struct PasswordStorageMissingPasswordError: Error, Equatable {
public init() {}
}
import Foundation
public struct PasswordStorage {
public init(
save: @escaping (Data) throws -> Void,
load: @escaping () throws -> Data
) {
self.save = save
self.load = load
}
public var save: (Data) throws -> Void
public var load: () throws -> Data
}
#if DEBUG
extension PasswordStorage {
public static let failing = PasswordStorage(
save: { _ in
struct NotImplemented: Error {}
throw NotImplemented()
},
load: {
struct NotImplemented: Error {}
throw NotImplemented()
}
)
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment