Initial service implementation for using a PIN code. (#1912)

* Initial service implementation for using a PIN code.

* Tweak Danger for commit size

600-800 lines is perfectly normal for our PRs, up it to 1000.
This commit is contained in:
Doug
2023-10-19 10:42:12 +01:00
committed by GitHub
parent fbcf037240
commit 99c28784a9
14 changed files with 730 additions and 35 deletions
@@ -24,9 +24,24 @@ struct KeychainCredentials {
// sourcery: AutoMockable
protocol KeychainControllerProtocol: ClientSessionDelegate {
// MARK: Restoration Tokens
func setRestorationToken(_ restorationToken: RestorationToken, forUsername: String)
func restorationTokenForUsername(_ username: String) -> RestorationToken?
func restorationTokens() -> [KeychainCredentials]
func removeRestorationTokenForUsername(_ username: String)
func removeAllRestorationTokens()
// MARK: App Secrets
/// Removes everything from the keychain excluding any restoration tokens.
func resetSecrets()
/// Whether or not an App Lock PIN code has been set.
func containsPINCode() throws -> Bool
/// Sets a new PIN code for App Lock.
func setPINCode(_ pinCode: String) throws
/// The PIN code required to unlock the app.
func pinCode() -> String?
/// Removes the App Lock PIN code.
func removePINCode()
}