Added key to sync response model and cipher sdk object (#201)

This commit is contained in:
Ramsey Smith 2023-11-02 15:44:11 -06:00 committed by Álison Fernandes
parent 949bb4ad5a
commit fc36f95ab7
5 changed files with 8 additions and 3 deletions

View file

@ -587,6 +587,9 @@ data class SyncResponseJson(
@SerialName("card") @SerialName("card")
val card: Card?, val card: Card?,
@SerialName("key")
val key: String?,
) { ) {
/** /**
* Represents an attachment in the vault response. * Represents an attachment in the vault response.

View file

@ -40,7 +40,7 @@ fun SyncResponseJson.Cipher.toEncryptedSdkCipher(): Cipher =
organizationId = organizationId, organizationId = organizationId,
folderId = folderId, folderId = folderId,
collectionIds = collectionIds.orEmpty(), collectionIds = collectionIds.orEmpty(),
key = null, key = key,
name = name.orEmpty(), name = name.orEmpty(),
notes = notes, notes = notes,
type = type.toSdkCipherType(), type = type.toSdkCipherType(),

View file

@ -29,6 +29,7 @@ fun createMockCipher(number: Int): SyncResponseJson.Cipher =
shouldEdit = false, shouldEdit = false,
shouldOrganizationUseTotp = false, shouldOrganizationUseTotp = false,
shouldViewPassword = false, shouldViewPassword = false,
key = "mockKey-$number",
) )
/** /**

View file

@ -299,7 +299,8 @@ private const val SYNC_SUCCESS_JSON = """
"expYear": "mockExpirationYear-1", "expYear": "mockExpirationYear-1",
"cardholderName": "mockCardholderName-1", "cardholderName": "mockCardholderName-1",
"brand": "mockBrand-1" "brand": "mockBrand-1"
} },
"key": "mockKey-1"
} }
], ],
"domains": { "domains": {

View file

@ -26,7 +26,7 @@ fun createMockSdkCipher(number: Int): Cipher =
organizationId = "mockOrganizationId-$number", organizationId = "mockOrganizationId-$number",
folderId = "mockFolderId-$number", folderId = "mockFolderId-$number",
collectionIds = listOf("mockCollectionId-$number"), collectionIds = listOf("mockCollectionId-$number"),
key = null, key = "mockKey-$number",
name = "mockName-$number", name = "mockName-$number",
notes = "mockNotes-$number", notes = "mockNotes-$number",
type = CipherType.LOGIN, type = CipherType.LOGIN,