Enable database encryption for new logins on Nightly/PR builds. (#2328)

- Slightly reworks where the pusher client ID is generated.
This commit is contained in:
Doug
2024-01-12 16:45:59 +00:00
committed by GitHub
parent d475c9c63b
commit 01f42546e1
20 changed files with 147 additions and 60 deletions
@@ -14,24 +14,13 @@
// limitations under the License.
//
import CryptoKit
import Foundation
import MatrixRustSDK
struct RestorationToken: Codable, Equatable {
let session: MatrixRustSDK.Session
let passphrase: String?
let pusherNotificationClientIdentifier: String?
init(session: MatrixRustSDK.Session) {
self.session = session
if let data = session.userId.data(using: .utf8) {
let digest = SHA256.hash(data: data)
pusherNotificationClientIdentifier = digest.compactMap { String(format: "%02x", $0) }.joined()
} else {
pusherNotificationClientIdentifier = nil
}
}
}
extension MatrixRustSDK.Session: Codable {