mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Run SwiftFormat.
This commit is contained in:
@@ -13,7 +13,7 @@ import MatrixRustSDK
|
||||
enum KeychainControllerService: String {
|
||||
case sessions
|
||||
case tests
|
||||
|
||||
|
||||
var restorationTokenID: String {
|
||||
InfoPlistReader.main.baseBundleIdentifier + "." + rawValue
|
||||
}
|
||||
@@ -33,14 +33,14 @@ final class KeychainController: KeychainControllerProtocol {
|
||||
case appLockPINCode
|
||||
case appLockBiometricState
|
||||
}
|
||||
|
||||
|
||||
init(service: KeychainControllerService, accessGroup: String) {
|
||||
restorationTokenKeychain = Keychain(service: service.restorationTokenID, accessGroup: accessGroup)
|
||||
mainKeychain = Keychain(service: service.mainID, accessGroup: accessGroup)
|
||||
}
|
||||
|
||||
// MARK: - Restoration Tokens
|
||||
|
||||
|
||||
func setRestorationToken(_ restorationToken: RestorationToken, forUsername username: String) {
|
||||
do {
|
||||
let tokenData = try JSONEncoder().encode(restorationToken)
|
||||
@@ -49,7 +49,7 @@ final class KeychainController: KeychainControllerProtocol {
|
||||
MXLog.error("Failed storing user restore token with error: \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func restorationTokenForUsername(_ username: String) -> RestorationToken? {
|
||||
do {
|
||||
guard let tokenData = try restorationTokenKeychain.getData(username) else {
|
||||
@@ -66,17 +66,17 @@ final class KeychainController: KeychainControllerProtocol {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func restorationTokens() -> [KeychainCredentials] {
|
||||
restorationTokenKeychain.allKeys().compactMap { username in
|
||||
guard let restorationToken = restorationTokenForUsername(username) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
return KeychainCredentials(userID: username, restorationToken: restorationToken)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func removeRestorationTokenForUsername(_ username: String) {
|
||||
MXLog.warning("Removing restoration token for user: \(username).")
|
||||
|
||||
@@ -86,7 +86,7 @@ final class KeychainController: KeychainControllerProtocol {
|
||||
MXLog.error("Failed removing restore token with error: \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func removeAllRestorationTokens() {
|
||||
MXLog.warning("Removing all user restoration tokens.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user