mirror of
https://github.com/bitwarden/android.git
synced 2025-12-10 09:56:45 -06:00
Update SDK to 1.0.0-3101-0eba924a (#5893)
Co-authored-by: bw-ghapp[bot] <178206702+bw-ghapp[bot]@users.noreply.github.com> Co-authored-by: Carlos Gonçalves <cgoncalves@bitwarden.com>
This commit is contained in:
parent
b0e0b44671
commit
6f6aacabfb
@ -106,6 +106,7 @@ fun Cipher.toEncryptedNetworkCipherResponse(
|
||||
shouldViewPassword = viewPassword,
|
||||
key = key,
|
||||
encryptedFor = encryptedFor,
|
||||
archivedDate = archivedDate?.let { ZonedDateTime.ofInstant(it, ZoneOffset.UTC) },
|
||||
)
|
||||
|
||||
/**
|
||||
@ -389,6 +390,7 @@ fun SyncResponseJson.Cipher.toEncryptedSdkCipher(): Cipher =
|
||||
creationDate = creationDate.toInstant(),
|
||||
deletedDate = deletedDate?.toInstant(),
|
||||
revisionDate = revisionDate.toInstant(),
|
||||
archivedDate = archivedDate?.toInstant(),
|
||||
)
|
||||
|
||||
/**
|
||||
@ -704,4 +706,5 @@ fun Cipher.toFailureCipherListView(): CipherListView =
|
||||
deletedDate = deletedDate,
|
||||
revisionDate = revisionDate,
|
||||
copyableFields = emptyList(),
|
||||
archivedDate = archivedDate,
|
||||
)
|
||||
|
||||
@ -44,6 +44,7 @@ fun VaultAddEditState.ViewState.Content.toCipherView(): CipherView =
|
||||
creationDate = common.originalCipher?.creationDate ?: Instant.now(),
|
||||
deletedDate = common.originalCipher?.deletedDate,
|
||||
revisionDate = common.originalCipher?.revisionDate ?: Instant.now(),
|
||||
archivedDate = common.originalCipher?.archivedDate,
|
||||
|
||||
// Type specific section
|
||||
type = type.toCipherType(),
|
||||
|
||||
@ -425,6 +425,7 @@ private const val CIPHER_JSON = """
|
||||
"folderId": "mockFolderId-1",
|
||||
"organizationId": "mockOrganizationId-1",
|
||||
"deletedDate": "2023-10-27T12:00:00.000Z",
|
||||
"archivedDate": "2023-10-27T12:00:00.000Z",
|
||||
"identity": {
|
||||
"passportNumber": "mockPassportNumber-1",
|
||||
"lastName": "mockLastName-1",
|
||||
|
||||
@ -54,6 +54,7 @@ fun createMockCipherListView(
|
||||
.takeIf { type is CipherListViewType.Login }
|
||||
.orEmpty(),
|
||||
isDeleted: Boolean = false,
|
||||
isArchived: Boolean = false,
|
||||
): CipherListView = CipherListView(
|
||||
id = id,
|
||||
organizationId = organizationId,
|
||||
@ -66,6 +67,7 @@ fun createMockCipherListView(
|
||||
revisionDate = revisionDate,
|
||||
creationDate = creationDate,
|
||||
deletedDate = if (isDeleted) Instant.parse(DEFAULT_TIMESTAMP) else null,
|
||||
archivedDate = if (isArchived) Instant.parse(DEFAULT_TIMESTAMP) else null,
|
||||
attachments = attachments,
|
||||
organizationUseTotp = organizationUseTotp,
|
||||
edit = edit,
|
||||
|
||||
@ -61,6 +61,7 @@ fun createMockCipherView(
|
||||
),
|
||||
card: CardView? = createMockCardView(number = number).takeIf { cipherType == CipherType.CARD },
|
||||
attachments: List<AttachmentView> = listOf(createMockAttachmentView(number = number)),
|
||||
isArchived: Boolean = false,
|
||||
): CipherView =
|
||||
CipherView(
|
||||
id = "mockId-$number",
|
||||
@ -73,12 +74,17 @@ fun createMockCipherView(
|
||||
type = cipherType,
|
||||
login = login.takeIf { cipherType == CipherType.LOGIN },
|
||||
creationDate = clock.instant(),
|
||||
revisionDate = clock.instant(),
|
||||
deletedDate = if (isDeleted) {
|
||||
clock.instant()
|
||||
} else {
|
||||
null
|
||||
},
|
||||
revisionDate = clock.instant(),
|
||||
archivedDate = if (isArchived) {
|
||||
clock.instant()
|
||||
} else {
|
||||
null
|
||||
},
|
||||
attachments = attachments,
|
||||
card = card,
|
||||
fields = listOf(createMockFieldView(number = number)),
|
||||
|
||||
@ -47,6 +47,7 @@ fun createMockSdkCipher(number: Int, clock: Clock = FIXED_CLOCK): Cipher =
|
||||
creationDate = clock.instant(),
|
||||
deletedDate = clock.instant(),
|
||||
revisionDate = clock.instant(),
|
||||
archivedDate = clock.instant(),
|
||||
attachments = listOf(createMockSdkAttachment(number = number)),
|
||||
card = createMockSdkCard(number = number),
|
||||
fields = listOf(createMockSdkField(number = number)),
|
||||
|
||||
@ -640,6 +640,7 @@ private val DEFAULT_BASE_CIPHER_VIEW: CipherView = CipherView(
|
||||
creationDate = FIXED_CLOCK.instant(),
|
||||
deletedDate = null,
|
||||
revisionDate = FIXED_CLOCK.instant(),
|
||||
archivedDate = null,
|
||||
sshKey = null,
|
||||
)
|
||||
|
||||
|
||||
@ -159,6 +159,7 @@ fun createCipherView(type: CipherType, isEmpty: Boolean): CipherView =
|
||||
creationDate = Instant.ofEpochSecond(1_000L),
|
||||
deletedDate = null,
|
||||
revisionDate = Instant.ofEpochSecond(1_000L),
|
||||
archivedDate = null,
|
||||
sshKey = createSshKeyView(isEmpty),
|
||||
)
|
||||
|
||||
|
||||
@ -114,6 +114,7 @@ class VaultAddItemStateExtensionsTest {
|
||||
creationDate = Instant.MIN,
|
||||
deletedDate = null,
|
||||
revisionDate = Instant.MIN,
|
||||
archivedDate = null,
|
||||
sshKey = null,
|
||||
),
|
||||
result,
|
||||
@ -299,6 +300,7 @@ class VaultAddItemStateExtensionsTest {
|
||||
creationDate = Instant.MIN,
|
||||
deletedDate = null,
|
||||
revisionDate = Instant.MIN,
|
||||
archivedDate = null,
|
||||
sshKey = null,
|
||||
),
|
||||
result,
|
||||
@ -432,6 +434,7 @@ class VaultAddItemStateExtensionsTest {
|
||||
creationDate = Instant.MIN,
|
||||
deletedDate = null,
|
||||
revisionDate = Instant.MIN,
|
||||
archivedDate = null,
|
||||
sshKey = null,
|
||||
),
|
||||
result,
|
||||
@ -619,6 +622,7 @@ class VaultAddItemStateExtensionsTest {
|
||||
creationDate = Instant.MIN,
|
||||
deletedDate = null,
|
||||
revisionDate = Instant.MIN,
|
||||
archivedDate = null,
|
||||
sshKey = null,
|
||||
),
|
||||
result,
|
||||
@ -762,6 +766,7 @@ class VaultAddItemStateExtensionsTest {
|
||||
creationDate = Instant.MIN,
|
||||
deletedDate = null,
|
||||
revisionDate = Instant.MIN,
|
||||
archivedDate = null,
|
||||
sshKey = SshKeyView(
|
||||
publicKey = "mockPublicKey-1",
|
||||
privateKey = "mockPrivateKey-1",
|
||||
@ -981,6 +986,7 @@ private val DEFAULT_BASE_CIPHER_VIEW: CipherView = CipherView(
|
||||
creationDate = Instant.MIN,
|
||||
deletedDate = null,
|
||||
revisionDate = Instant.MIN,
|
||||
archivedDate = null,
|
||||
sshKey = null,
|
||||
)
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ androidxRoom = "2.8.0"
|
||||
androidxSecurityCrypto = "1.1.0"
|
||||
androidxSplash = "1.1.0-rc01"
|
||||
androidxWork = "2.10.4"
|
||||
bitwardenSdk = "1.0.0-3005-5a722fd2"
|
||||
bitwardenSdk = "1.0.0-3101-0eba924a"
|
||||
crashlytics = "3.0.6"
|
||||
detekt = "1.23.8"
|
||||
firebaseBom = "34.2.0"
|
||||
|
||||
@ -449,6 +449,7 @@ data class SyncResponseJson(
|
||||
* @property card The card of the cipher.
|
||||
* @property key The key of the cipher (nullable).
|
||||
* @property encryptedFor ID of the user who the cipher is encrypted by.
|
||||
* @property archivedDate The archived date of the cipher (nullable).
|
||||
*/
|
||||
@Serializable
|
||||
data class Cipher(
|
||||
@ -532,6 +533,10 @@ data class SyncResponseJson(
|
||||
|
||||
@SerialName("encryptedFor")
|
||||
val encryptedFor: String?,
|
||||
|
||||
@SerialName("archivedDate")
|
||||
@Contextual
|
||||
val archivedDate: ZonedDateTime?,
|
||||
) {
|
||||
/**
|
||||
* Represents an attachment in the vault response.
|
||||
|
||||
@ -503,7 +503,8 @@ private const val CREATE_ATTACHMENT_SUCCESS_JSON = """
|
||||
"privateKey": "mockPrivateKey-1",
|
||||
"keyFingerprint": "mockKeyFingerprint-1"
|
||||
},
|
||||
"encryptedFor": "mockEncryptedFor-1"
|
||||
"encryptedFor": "mockEncryptedFor-1",
|
||||
"archivedDate": "2023-10-27T12:00:00.00Z"
|
||||
}
|
||||
}
|
||||
"""
|
||||
@ -631,7 +632,8 @@ private const val CREATE_RESTORE_UPDATE_CIPHER_SUCCESS_JSON = """
|
||||
"privateKey": "mockPrivateKey-1",
|
||||
"keyFingerprint": "mockKeyFingerprint-1"
|
||||
},
|
||||
"encryptedFor": "mockEncryptedFor-1"
|
||||
"encryptedFor": "mockEncryptedFor-1",
|
||||
"archivedDate": "2023-10-27T12:00:00.00Z"
|
||||
}
|
||||
"""
|
||||
|
||||
|
||||
@ -335,7 +335,8 @@ private const val SYNC_SUCCESS_JSON = """
|
||||
"privateKey": "mockPrivateKey-1",
|
||||
"keyFingerprint": "mockKeyFingerprint-1"
|
||||
},
|
||||
"encryptedFor": "mockEncryptedFor-1"
|
||||
"encryptedFor": "mockEncryptedFor-1",
|
||||
"archivedDate": "2023-10-27T12:00:00.00Z"
|
||||
}
|
||||
],
|
||||
"domains": {
|
||||
|
||||
@ -23,6 +23,7 @@ fun createMockCipher(
|
||||
creationDate: ZonedDateTime = MOCK_ZONED_DATE_TIME,
|
||||
revisionDate: ZonedDateTime = MOCK_ZONED_DATE_TIME,
|
||||
deletedDate: ZonedDateTime? = MOCK_ZONED_DATE_TIME,
|
||||
archivedDate: ZonedDateTime? = MOCK_ZONED_DATE_TIME,
|
||||
attachments: List<SyncResponseJson.Cipher.Attachment>? = listOf(
|
||||
createMockAttachment(number = number),
|
||||
),
|
||||
@ -61,6 +62,7 @@ fun createMockCipher(
|
||||
creationDate = creationDate,
|
||||
revisionDate = revisionDate,
|
||||
deletedDate = deletedDate,
|
||||
archivedDate = archivedDate,
|
||||
attachments = attachments,
|
||||
fields = fields,
|
||||
isFavorite = isFavorite,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user