Skip to content
This repository was archived by the owner on Oct 19, 2024. It is now read-only.

Commit 5184fa7

Browse files
committed
Use sync endpoint instead of getAll in UserClient when re-encoding ciphers
Endpoint `getAll` is deprecated.
1 parent ca7421b commit 5184fa7

File tree

1 file changed

+2
-1
lines changed
  • client/src/main/kotlin/dev/medzik/librepass/client/api

1 file changed

+2
-1
lines changed

client/src/main/kotlin/dev/medzik/librepass/client/api/User.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import dev.medzik.librepass.utils.Cryptography.computeAesKey
1616
import dev.medzik.librepass.utils.Cryptography.computePasswordHash
1717
import dev.medzik.librepass.utils.fromHex
1818
import dev.medzik.librepass.utils.toHex
19+
import java.util.*
1920

2021
/**
2122
* User Client for manage user settings.
@@ -169,7 +170,7 @@ class UserClient(
169170
// re-encrypt ciphers data with the new encryption key
170171
val cipherClient = CipherClient(apiKey, apiUrl)
171172
val ciphers = mutableListOf<ChangePasswordCipherData>()
172-
cipherClient.getAll().forEach { cipher ->
173+
cipherClient.sync(Date(0), emptyList(), emptyList()).ciphers.forEach { cipher ->
173174
// decrypt cipher data with an old aes key
174175
val oldData = Aes.decrypt(Aes.GCM, oldAesKey, cipher.protectedData)
175176

0 commit comments

Comments
 (0)