mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 11:58:32 +00:00
Expose the store passphrase as Data instead of a base64 string.
This commit is contained in:
@@ -23,7 +23,7 @@ struct RestorationTokenTests {
|
||||
oidcData: "data-from-mas",
|
||||
slidingSyncVersion: .proxy(url: "https://sync.example.com")),
|
||||
sessionDirectory: .sessionsBaseDirectory.appending(component: UUID().uuidString),
|
||||
passphrase: "passphrase",
|
||||
passphrase: Data("passphrase".utf8).base64EncodedString(),
|
||||
pusherNotificationClientIdentifier: "pusher-identifier")
|
||||
let data = try JSONEncoder().encode(originalToken)
|
||||
|
||||
@@ -46,7 +46,7 @@ struct RestorationTokenTests {
|
||||
oidcData: "data-from-mas",
|
||||
slidingSyncVersion: .native),
|
||||
sessionDirectory: .sessionsBaseDirectory.appending(component: sessionDirectoryName),
|
||||
passphrase: "passphrase",
|
||||
passphrase: Data("passphrase".utf8).base64EncodedString(),
|
||||
pusherNotificationClientIdentifier: "pusher-identifier")
|
||||
let data = try JSONEncoder().encode(originalToken)
|
||||
|
||||
@@ -55,7 +55,7 @@ struct RestorationTokenTests {
|
||||
|
||||
// Then the output should be a valid token with the expected store directories.
|
||||
assertEqual(session: decodedToken.session, originalSession: originalToken.session)
|
||||
#expect(decodedToken.passphrase == originalToken.passphrase, "The passphrase should not be changed.")
|
||||
#expect(decodedToken.passphrase.base64EncodedString() == originalToken.passphrase, "The passphrase should not be changed.")
|
||||
#expect(decodedToken.pusherNotificationClientIdentifier == originalToken.pusherNotificationClientIdentifier,
|
||||
"The push notification client identifier should not be changed.")
|
||||
#expect(decodedToken.sessionDirectories.dataDirectory == originalToken.sessionDirectory,
|
||||
@@ -77,7 +77,7 @@ struct RestorationTokenTests {
|
||||
slidingSyncVersion: .native),
|
||||
sessionDirectory: .sessionsBaseDirectory.appending(component: sessionDirectoryName),
|
||||
cacheDirectory: .sessionCachesBaseDirectory.appending(component: sessionDirectoryName),
|
||||
passphrase: "passphrase",
|
||||
passphrase: Data("passphrase".utf8).base64EncodedString(),
|
||||
pusherNotificationClientIdentifier: "pusher-identifier")
|
||||
let data = try JSONEncoder().encode(originalToken)
|
||||
|
||||
@@ -86,7 +86,7 @@ struct RestorationTokenTests {
|
||||
|
||||
// Then the output should be a valid token.
|
||||
assertEqual(session: decodedToken.session, originalSession: originalToken.session)
|
||||
#expect(decodedToken.passphrase == originalToken.passphrase, "The passphrase should not be changed.")
|
||||
#expect(decodedToken.passphrase.base64EncodedString() == originalToken.passphrase, "The passphrase should not be changed.")
|
||||
#expect(decodedToken.pusherNotificationClientIdentifier == originalToken.pusherNotificationClientIdentifier,
|
||||
"The push notification client identifier should not be changed.")
|
||||
#expect(decodedToken.sessionDirectories.dataDirectory == originalToken.sessionDirectory,
|
||||
@@ -106,7 +106,7 @@ struct RestorationTokenTests {
|
||||
oauthData: "data-from-mas",
|
||||
slidingSyncVersion: .native),
|
||||
sessionDirectories: .init(),
|
||||
passphrase: "passphrase",
|
||||
passphrase: Data("passphrase".utf8),
|
||||
pusherNotificationClientIdentifier: "pusher-identifier")
|
||||
let data = try JSONEncoder().encode(originalToken)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user