mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:31:27 +00:00
Expose the store passphrase as Data instead of a base64 string.
This commit is contained in:
@@ -114,7 +114,7 @@ struct UserSessionStoreTests {
|
||||
let sessionDirectories = SessionDirectories()
|
||||
|
||||
// When creating a user session for it.
|
||||
guard case .success(let userSession) = await store.userSession(for: client, sessionDirectories: sessionDirectories, passphrase: "passphrase") else {
|
||||
guard case .success(let userSession) = await store.userSession(for: client, sessionDirectories: sessionDirectories, passphrase: Data("passphrase".utf8)) else {
|
||||
Issue.record("Creating the session should succeed.")
|
||||
return
|
||||
}
|
||||
@@ -122,7 +122,7 @@ struct UserSessionStoreTests {
|
||||
// Then the session should be built and its restoration token persisted.
|
||||
#expect(userSession.clientProxy.userID == "@alice:matrix.org")
|
||||
#expect(keychainController.setRestorationTokenForUsernameReceivedArguments?.forUsername == "@alice:matrix.org")
|
||||
#expect(keychainController.setRestorationTokenForUsernameReceivedArguments?.restorationToken.passphrase == "passphrase")
|
||||
#expect(keychainController.setRestorationTokenForUsernameReceivedArguments?.restorationToken.passphrase == Data("passphrase".utf8))
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -132,7 +132,7 @@ struct UserSessionStoreTests {
|
||||
client.sessionThrowableError = TestError.generic
|
||||
|
||||
// When creating a user session for it.
|
||||
guard case .failure(.failedSettingUpSession) = await store.userSession(for: client, sessionDirectories: .init(), passphrase: "passphrase") else {
|
||||
guard case .failure(.failedSettingUpSession) = await store.userSession(for: client, sessionDirectories: .init(), passphrase: Data("passphrase".utf8)) else {
|
||||
Issue.record("Creating the session should fail.")
|
||||
return
|
||||
}
|
||||
@@ -177,7 +177,7 @@ struct UserSessionStoreTests {
|
||||
slidingSyncVersion: .native)
|
||||
let restorationToken = RestorationToken(session: session,
|
||||
sessionDirectories: sessionDirectories,
|
||||
passphrase: "passphrase",
|
||||
passphrase: Data("passphrase".utf8),
|
||||
pusherNotificationClientIdentifier: nil)
|
||||
return KeychainCredentials(userID: userID, restorationToken: restorationToken)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user