Update SDK to 2.0.0-6639-21488a37 (#6864)

Co-authored-by: bw-ghapp[bot] <178206702+bw-ghapp[bot]@users.noreply.github.com>
This commit is contained in:
bw-ghapp[bot]
2026-05-06 10:13:20 -05:00
committed by GitHub
parent a53260fdf7
commit 01859beb06
28 changed files with 701 additions and 117 deletions

View File

@@ -54,6 +54,8 @@ val CipherView.subtitle: String?
CipherType.SECURE_NOTE,
CipherType.SSH_KEY,
CipherType.BANK_ACCOUNT,
CipherType.DRIVERS_LICENSE,
CipherType.PASSPORT,
-> null
}

View File

@@ -24,6 +24,7 @@ import com.bitwarden.vault.CipherPermissions
import com.bitwarden.vault.CipherRepromptType
import com.bitwarden.vault.CipherType
import com.bitwarden.vault.CipherView
import com.bitwarden.vault.DriversLicense
import com.bitwarden.vault.EncryptionContext
import com.bitwarden.vault.Fido2Credential
import com.bitwarden.vault.Field
@@ -32,6 +33,7 @@ import com.bitwarden.vault.Identity
import com.bitwarden.vault.Login
import com.bitwarden.vault.LoginListView
import com.bitwarden.vault.LoginUri
import com.bitwarden.vault.Passport
import com.bitwarden.vault.PasswordHistory
import com.bitwarden.vault.SecureNote
import com.bitwarden.vault.SecureNoteType
@@ -101,8 +103,8 @@ fun Cipher.toEncryptedNetworkCipherResponse(
attachments = attachments?.toNetworkAttachmentList(),
sshKey = sshKey?.toEncryptedNetworkSshKey(),
bankAccount = bankAccount?.toEncryptedNetworkBankAccount(),
driversLicense = null,
passport = null,
driversLicense = driversLicense?.toEncryptedNetworkDriversLicense(),
passport = passport?.toEncryptedNetworkPassport(),
shouldOrganizationUseTotp = organizationUseTotp,
shouldEdit = edit,
revisionDate = revisionDate,
@@ -174,6 +176,47 @@ private fun BankAccount.toEncryptedNetworkBankAccount(): SyncResponseJson.Cipher
bankContactPhone = bankContactPhone,
)
/**
* Converts a Bitwarden SDK [DriversLicense] object to a corresponding
* [SyncResponseJson.Cipher.DriversLicense] object.
*/
private fun DriversLicense.toEncryptedNetworkDriversLicense():
SyncResponseJson.Cipher.DriversLicense =
SyncResponseJson.Cipher.DriversLicense(
firstName = firstName,
middleName = middleName,
lastName = lastName,
licenseNumber = licenseNumber,
issuingCountry = issuingCountry,
issuingState = issuingState,
issuingAuthority = issuingAuthority,
expirationDate = expirationDate,
dateOfBirth = dateOfBirth,
issueDate = issueDate,
licenseClass = licenseClass,
)
/**
* Converts a Bitwarden SDK [Passport] object to a corresponding
* [SyncResponseJson.Cipher.Passport] object.
*/
private fun Passport.toEncryptedNetworkPassport(): SyncResponseJson.Cipher.Passport =
SyncResponseJson.Cipher.Passport(
surname = surname,
givenName = givenName,
dateOfBirth = dateOfBirth,
birthPlace = birthPlace,
sex = sex,
nationality = nationality,
passportNumber = passportNumber,
passportType = passportType,
nationalIdentificationNumber = nationalIdentificationNumber,
issuingCountry = issuingCountry,
issuingAuthority = issuingAuthority,
issueDate = issueDate,
expirationDate = expirationDate,
)
private fun SshKey.toEncryptedNetworkSshKey(): SyncResponseJson.Cipher.SshKey =
SyncResponseJson.Cipher.SshKey(
publicKey = publicKey,
@@ -399,6 +442,8 @@ private fun CipherType.toNetworkCipherType(): CipherTypeJson =
CipherType.IDENTITY -> CipherTypeJson.IDENTITY
CipherType.SSH_KEY -> CipherTypeJson.SSH_KEY
CipherType.BANK_ACCOUNT -> CipherTypeJson.BANK_ACCOUNT
CipherType.DRIVERS_LICENSE -> CipherTypeJson.DRIVERS_LICENSE
CipherType.PASSPORT -> CipherTypeJson.PASSPORT
}
/**
@@ -427,6 +472,8 @@ fun SyncResponseJson.Cipher.toEncryptedSdkCipher(): Cipher =
sshKey = sshKey?.toSdkSshKey(),
card = card?.toSdkCard(),
bankAccount = bankAccount?.toSdkBankAccount(),
driversLicense = driversLicense?.toSdkDriversLicense(),
passport = passport?.toSdkPassport(),
secureNote = secureNote?.toSdkSecureNote(),
favorite = isFavorite,
reprompt = reprompt.toSdkRepromptType(),
@@ -534,6 +581,45 @@ fun SyncResponseJson.Cipher.BankAccount.toSdkBankAccount(): BankAccount =
bankContactPhone = bankContactPhone,
)
/**
* Transforms a [SyncResponseJson.Cipher.DriversLicense] into the corresponding Bitwarden SDK
* [DriversLicense].
*/
fun SyncResponseJson.Cipher.DriversLicense.toSdkDriversLicense(): DriversLicense =
DriversLicense(
firstName = firstName,
middleName = middleName,
lastName = lastName,
licenseNumber = licenseNumber,
issuingCountry = issuingCountry,
issuingState = issuingState,
issuingAuthority = issuingAuthority,
expirationDate = expirationDate,
dateOfBirth = dateOfBirth,
issueDate = issueDate,
licenseClass = licenseClass,
)
/**
* Transforms a [SyncResponseJson.Cipher.Passport] into the corresponding Bitwarden SDK [Passport].
*/
fun SyncResponseJson.Cipher.Passport.toSdkPassport(): Passport =
Passport(
surname = surname,
givenName = givenName,
dateOfBirth = dateOfBirth,
birthPlace = birthPlace,
sex = sex,
nationality = nationality,
passportNumber = passportNumber,
passportType = passportType,
nationalIdentificationNumber = nationalIdentificationNumber,
issuingCountry = issuingCountry,
issuingAuthority = issuingAuthority,
issueDate = issueDate,
expirationDate = expirationDate,
)
/**
* Transforms a [SyncResponseJson.Cipher.SecureNote] into
* the corresponding Bitwarden SDK [SecureNote].
@@ -767,6 +853,8 @@ fun Cipher.toFailureCipherListView(): CipherListView =
CipherType.IDENTITY -> CipherListViewType.Identity
CipherType.SSH_KEY -> CipherListViewType.SshKey
CipherType.BANK_ACCOUNT -> CipherListViewType.BankAccount
CipherType.DRIVERS_LICENSE -> CipherListViewType.DriversLicense
CipherType.PASSPORT -> CipherListViewType.Passport
},
favorite = favorite,
reprompt = reprompt,

View File

@@ -267,6 +267,8 @@ private val CipherListViewType.iconRes: Int
CipherListViewType.Identity -> BitwardenDrawable.ic_id_card
CipherListViewType.SshKey -> BitwardenDrawable.ic_ssh_key
CipherListViewType.BankAccount -> BitwardenDrawable.ic_note
CipherListViewType.DriversLicense -> BitwardenDrawable.ic_note
CipherListViewType.Passport -> BitwardenDrawable.ic_note
}
/**

View File

@@ -2980,12 +2980,13 @@ data class VaultAddEditState(
val firstName: String = "",
val middleName: String = "",
val lastName: String = "",
val dateOfBirth: String = "",
val licenseNumber: String = "",
val issuingCountry: String = "",
val issuingState: String = "",
val expirationMonth: String = "",
val expirationDay: String = "",
val expirationYear: String = "",
val issuingAuthority: String = "",
val issueDate: String = "",
val expirationDate: String = "",
val licenseClass: String = "",
) : ItemType() {
override val itemTypeOption: ItemTypeOption
@@ -3004,20 +3005,17 @@ data class VaultAddEditState(
data class Passport(
val surname: String = "",
val givenName: String = "",
val dobMonth: String = "",
val dobDay: String = "",
val dobYear: String = "",
val dateOfBirth: String = "",
val birthPlace: String = "",
val sex: String = "",
val nationality: String = "",
val passportNumber: String = "",
val passportType: String = "",
val issuingCountry: String = "",
val issuingAuthority: String = "",
val issueMonth: String = "",
val issueDay: String = "",
val issueYear: String = "",
val expirationMonth: String = "",
val expirationDay: String = "",
val expirationYear: String = "",
val issueDate: String = "",
val expirationDate: String = "",
val nationalIdentificationNumber: String = "",
) : ItemType() {
override val itemTypeOption: ItemTypeOption
get() = ItemTypeOption.PASSPORT

View File

@@ -112,6 +112,32 @@ fun CipherView.toViewState(
iban = bankAccount?.iban.orEmpty(),
bankContactPhone = bankAccount?.bankContactPhone.orEmpty(),
)
CipherType.DRIVERS_LICENSE -> {
VaultAddEditState.ViewState.Content.ItemType.DriversLicense(
firstName = driversLicense?.firstName.orEmpty(),
middleName = driversLicense?.middleName.orEmpty(),
lastName = driversLicense?.lastName.orEmpty(),
licenseNumber = driversLicense?.licenseNumber.orEmpty(),
issuingCountry = driversLicense?.issuingCountry.orEmpty(),
issuingState = driversLicense?.issuingState.orEmpty(),
expirationDate = driversLicense?.expirationDate.orEmpty(),
licenseClass = driversLicense?.licenseClass.orEmpty(),
)
}
CipherType.PASSPORT -> VaultAddEditState.ViewState.Content.ItemType.Passport(
surname = passport?.surname.orEmpty(),
givenName = passport?.givenName.orEmpty(),
dateOfBirth = passport?.dateOfBirth.orEmpty(),
nationality = passport?.nationality.orEmpty(),
passportNumber = passport?.passportNumber.orEmpty(),
passportType = passport?.passportType.orEmpty(),
issuingCountry = passport?.issuingCountry.orEmpty(),
issuingAuthority = passport?.issuingAuthority.orEmpty(),
issueDate = passport?.issueDate.orEmpty(),
expirationDate = passport?.expirationDate.orEmpty(),
)
},
common = VaultAddEditState.ViewState.Content.Common(
originalCipher = this,
@@ -274,7 +300,7 @@ private fun UserState.Account.toAvailableOwners(
*organizations
.map {
VaultAddEditState.Owner(
name = it.name.orEmpty(),
name = it.name,
id = it.id,
collections = collectionViewList
.filter { collection ->

View File

@@ -1899,9 +1899,7 @@ data class VaultItemState(
val licenseNumber: String?,
val issuingCountry: String?,
val issuingState: String?,
val expirationMonth: String?,
val expirationDay: String?,
val expirationYear: String?,
val expirationDate: String?,
val licenseClass: String?,
) : ItemType()
@@ -1911,20 +1909,14 @@ data class VaultItemState(
data class Passport(
val surname: String?,
val givenName: String?,
val dobMonth: String?,
val dobDay: String?,
val dobYear: String?,
val dateOfBirth: String?,
val nationality: String?,
val passportNumber: String?,
val passportType: String?,
val issuingCountry: String?,
val issuingAuthority: String?,
val issueMonth: String?,
val issueDay: String?,
val issueYear: String?,
val expirationMonth: String?,
val expirationDay: String?,
val expirationYear: String?,
val issueDate: String?,
val expirationDate: String?,
) : ItemType()
}
}

View File

@@ -228,6 +228,32 @@ fun CipherView.toViewState(
bankContactPhone = bankAccount?.bankContactPhone,
)
}
CipherType.DRIVERS_LICENSE -> {
VaultItemState.ViewState.Content.ItemType.DriversLicense(
firstName = driversLicense?.firstName.orEmpty(),
middleName = driversLicense?.middleName.orEmpty(),
lastName = driversLicense?.lastName.orEmpty(),
licenseNumber = driversLicense?.licenseNumber.orEmpty(),
issuingCountry = driversLicense?.issuingCountry.orEmpty(),
issuingState = driversLicense?.issuingState.orEmpty(),
expirationDate = driversLicense?.expirationDate.orEmpty(),
licenseClass = driversLicense?.licenseClass.orEmpty(),
)
}
CipherType.PASSPORT -> VaultItemState.ViewState.Content.ItemType.Passport(
surname = passport?.surname.orEmpty(),
givenName = passport?.givenName.orEmpty(),
dateOfBirth = passport?.dateOfBirth.orEmpty(),
nationality = passport?.nationality.orEmpty(),
passportNumber = passport?.passportNumber.orEmpty(),
passportType = passport?.passportType.orEmpty(),
issuingCountry = passport?.issuingCountry.orEmpty(),
issuingAuthority = passport?.issuingAuthority.orEmpty(),
issueDate = passport?.issueDate.orEmpty(),
expirationDate = passport?.expirationDate.orEmpty(),
)
},
)
@@ -319,6 +345,8 @@ private val CipherType.iconRes: Int
CipherType.SSH_KEY -> BitwardenDrawable.ic_ssh_key
CipherType.LOGIN -> BitwardenDrawable.ic_globe
CipherType.BANK_ACCOUNT -> BitwardenDrawable.ic_note
CipherType.DRIVERS_LICENSE -> BitwardenDrawable.ic_note
CipherType.PASSPORT -> BitwardenDrawable.ic_note
}
@get:DrawableRes

View File

@@ -1344,6 +1344,8 @@ class VaultItemListingViewModel @Inject constructor(
CipherType.IDENTITY -> VaultItemCipherType.IDENTITY
CipherType.SSH_KEY -> VaultItemCipherType.SSH_KEY
CipherType.BANK_ACCOUNT -> VaultItemCipherType.BANK_ACCOUNT
CipherType.DRIVERS_LICENSE -> VaultItemCipherType.DRIVERS_LICENSE
CipherType.PASSPORT -> VaultItemCipherType.PASSPORT
},
),
)
@@ -1366,6 +1368,8 @@ class VaultItemListingViewModel @Inject constructor(
CipherType.IDENTITY -> VaultItemCipherType.IDENTITY
CipherType.SSH_KEY -> VaultItemCipherType.SSH_KEY
CipherType.BANK_ACCOUNT -> VaultItemCipherType.BANK_ACCOUNT
CipherType.DRIVERS_LICENSE -> VaultItemCipherType.DRIVERS_LICENSE
CipherType.PASSPORT -> VaultItemCipherType.PASSPORT
},
),
)

View File

@@ -526,6 +526,8 @@ private fun CipherListView.toIconTestTag(): String =
CipherListViewType.Identity -> "IdentityCipherIcon"
CipherListViewType.SshKey -> "SshKeyCipherIcon"
CipherListViewType.BankAccount -> "BankAccountCipherIcon"
CipherListViewType.DriversLicense -> "DriversLicenseCipherIcon"
CipherListViewType.Passport -> "PassportCipherIcon"
}
private fun CipherListView.toIconData(
@@ -589,6 +591,8 @@ private val CipherListViewType.iconRes: Int
CipherListViewType.Identity -> BitwardenDrawable.ic_id_card
CipherListViewType.SshKey -> BitwardenDrawable.ic_ssh_key
CipherListViewType.BankAccount -> BitwardenDrawable.ic_note
CipherListViewType.DriversLicense -> BitwardenDrawable.ic_note
CipherListViewType.Passport -> BitwardenDrawable.ic_note
}
private fun List<CipherListView>.applyFilters(

View File

@@ -8,11 +8,13 @@ import com.bitwarden.vault.CardView
import com.bitwarden.vault.CipherRepromptType
import com.bitwarden.vault.CipherType
import com.bitwarden.vault.CipherView
import com.bitwarden.vault.DriversLicenseView
import com.bitwarden.vault.FieldType
import com.bitwarden.vault.FieldView
import com.bitwarden.vault.IdentityView
import com.bitwarden.vault.LoginUriView
import com.bitwarden.vault.LoginView
import com.bitwarden.vault.PassportView
import com.bitwarden.vault.PasswordHistoryView
import com.bitwarden.vault.SecureNoteType
import com.bitwarden.vault.SecureNoteView
@@ -65,6 +67,8 @@ fun VaultAddEditState.ViewState.Content.toCipherView(
card = type.toCardView(),
sshKey = type.toSshKeyView(),
bankAccount = type.toBankAccountView(),
driversLicense = type.toDriversLicense(),
passport = type.toPassport(),
// Fields we always grab from the UI
name = common.name,
@@ -86,7 +90,7 @@ private fun VaultAddEditState.ViewState.Content.ItemType.toCipherType(): CipherT
is VaultAddEditState.ViewState.Content.ItemType.BankAccount -> CipherType.BANK_ACCOUNT
is VaultAddEditState.ViewState.Content.ItemType.DriversLicense,
is VaultAddEditState.ViewState.Content.ItemType.Passport,
-> throw IllegalArgumentException("SDK mapping not yet available for $this")
-> throw IllegalArgumentException("SDK mapping not yet available for $this")
}
private fun VaultAddEditState.ViewState.Content.ItemType.toSshKeyView(): SshKeyView? =
@@ -117,6 +121,42 @@ private fun VaultAddEditState.ViewState.Content.ItemType.toBankAccountView(): Ba
)
}
private fun VaultAddEditState.ViewState.Content.ItemType.toDriversLicense(): DriversLicenseView? =
(this as? VaultAddEditState.ViewState.Content.ItemType.DriversLicense)?.let {
DriversLicenseView(
firstName = it.firstName.orNullIfBlank(),
middleName = it.middleName.orNullIfBlank(),
lastName = it.lastName.orNullIfBlank(),
dateOfBirth = it.dateOfBirth.orNullIfBlank(),
licenseNumber = it.licenseNumber.orNullIfBlank(),
issuingCountry = it.issuingCountry.orNullIfBlank(),
issuingState = it.issuingState.orNullIfBlank(),
issueDate = it.issueDate.orNullIfBlank(),
issuingAuthority = it.issuingAuthority.orNullIfBlank(),
expirationDate = it.expirationDate.orNullIfBlank(),
licenseClass = it.licenseClass.orNullIfBlank(),
)
}
private fun VaultAddEditState.ViewState.Content.ItemType.toPassport(): PassportView? =
(this as? VaultAddEditState.ViewState.Content.ItemType.Passport)?.let {
PassportView(
surname = it.surname.orNullIfBlank(),
givenName = it.givenName.orNullIfBlank(),
dateOfBirth = it.dateOfBirth.orNullIfBlank(),
birthPlace = it.dateOfBirth.orNullIfBlank(),
sex = it.sex.orNullIfBlank(),
nationality = it.nationality.orNullIfBlank(),
passportNumber = it.passportNumber.orNullIfBlank(),
passportType = it.passportType.orNullIfBlank(),
issuingCountry = it.issuingCountry.orNullIfBlank(),
issuingAuthority = it.issuingAuthority.orNullIfBlank(),
issueDate = it.issueDate.orNullIfBlank(),
expirationDate = it.expirationDate.orNullIfBlank(),
nationalIdentificationNumber = it.nationalIdentificationNumber.orNullIfBlank(),
)
}
private fun VaultAddEditState.ViewState.Content.ItemType.toCardView(): CardView? =
(this as? VaultAddEditState.ViewState.Content.ItemType.Card)?.let {
CardView(

View File

@@ -367,6 +367,8 @@ private fun CipherListView.toVaultItemOrNull(
// TODO: [PM-32009] Map BankAccount to its own VaultItem subclass when the UI is wired.
CipherListViewType.BankAccount -> null
CipherListViewType.DriversLicense -> null
CipherListViewType.Passport -> null
}
}

View File

@@ -14,4 +14,6 @@ fun CipherListViewType.toSdkCipherType(): CipherType =
CipherListViewType.SecureNote -> CipherType.SECURE_NOTE
CipherListViewType.SshKey -> CipherType.SSH_KEY
CipherListViewType.BankAccount -> CipherType.BANK_ACCOUNT
CipherListViewType.DriversLicense -> CipherType.DRIVERS_LICENSE
CipherListViewType.Passport -> CipherType.PASSPORT
}

View File

@@ -14,4 +14,6 @@ fun CipherType.toVaultItemCipherType(): VaultItemCipherType =
CipherType.IDENTITY -> VaultItemCipherType.IDENTITY
CipherType.SSH_KEY -> VaultItemCipherType.SSH_KEY
CipherType.BANK_ACCOUNT -> VaultItemCipherType.BANK_ACCOUNT
CipherType.DRIVERS_LICENSE -> VaultItemCipherType.DRIVERS_LICENSE
CipherType.PASSPORT -> VaultItemCipherType.PASSPORT
}

View File

@@ -601,6 +601,34 @@ private const val CIPHER_JSON = """
"iban": "mockIban-1",
"bankContactPhone": "mockBankContactPhone-1"
},
"driversLicense": {
"firstName": "mockFirstName-1",
"middleName": "mockMiddleName-1",
"lastName": "mockLastName-1",
"licenseNumber": "mockLicenseNumber-1",
"issuingCountry": "mockIssuingCountry-1",
"issuingState": "mockIssuingState-1",
"issuingAuthority": "mockIssuingAuthority-1",
"expirationDate": "mockExpirationDate-1",
"dateOfBirth": "mockDateOfBirth-1",
"issueDate": "mockIssueDate-1",
"licenseClass": "mockLicenseClass-1",
},
"passport": {
"surname": "mockSurname-1",
"givenName": "mockGivenName-1",
"dateOfBirth": "mockDateOfBirth-1",
"birthPlace": "mockBirthPlace-1",
"sex": "mockSex-1",
"nationality": "mockNationality-1",
"passportNumber": "mockPassportNumber-1",
"passportType": "mockPassportType-1",
"nationalIdentificationNumber": "mockNationalIdentificationNumber-1",
"issuingCountry": "mockIssuingCountry-1",
"issuingAuthority": "mockIssuingAuthority-1",
"issueDate": "mockIssueDate-1",
"expirationDate": "mockExpirationDate-1",
},
"encryptedFor": "mockEncryptedFor-1"
}
"""

View File

@@ -7,12 +7,14 @@ import com.bitwarden.vault.CardView
import com.bitwarden.vault.CipherRepromptType
import com.bitwarden.vault.CipherType
import com.bitwarden.vault.CipherView
import com.bitwarden.vault.DriversLicenseView
import com.bitwarden.vault.Fido2Credential
import com.bitwarden.vault.FieldType
import com.bitwarden.vault.FieldView
import com.bitwarden.vault.IdentityView
import com.bitwarden.vault.LoginUriView
import com.bitwarden.vault.LoginView
import com.bitwarden.vault.PassportView
import com.bitwarden.vault.PasswordHistoryView
import com.bitwarden.vault.SecureNoteType
import com.bitwarden.vault.SecureNoteView
@@ -61,6 +63,8 @@ fun createMockCipherView(
),
card: CardView? = createMockCardView(number = number).takeIf { cipherType == CipherType.CARD },
bankAccount: BankAccountView? = createMockBankAccountView(number = number),
driversLicense: DriversLicenseView? = createMockDriversLicenseView(number = 1),
passport: PassportView? = createMockPassportView(number = 1),
attachments: List<AttachmentView> = listOf(createMockAttachmentView(number = number)),
isArchived: Boolean = false,
passwordHistory: List<PasswordHistoryView> = listOf(
@@ -97,6 +101,8 @@ fun createMockCipherView(
},
sshKey = sshKey.takeIf { cipherType == CipherType.SSH_KEY },
bankAccount = bankAccount.takeIf { cipherType == CipherType.BANK_ACCOUNT },
driversLicense = driversLicense.takeIf { cipherType == CipherType.DRIVERS_LICENSE },
passport = passport.takeIf { cipherType == CipherType.PASSPORT },
favorite = false,
passwordHistory = passwordHistory,
permissions = createMockSdkCipherPermissions(),
@@ -256,6 +262,74 @@ fun createMockBankAccountView(
bankContactPhone = bankContactPhone,
)
/**
* Create a mock [DriversLicenseView] with a given [number].
*/
@Suppress("LongParameterList")
fun createMockDriversLicenseView(
number: Int,
firstName: String? = "mockFirstName-$number",
middleName: String? = "mockMiddleName-$number",
lastName: String? = "mockLastName-$number",
dateOfBirth: String? = "mockDateOfBirth-$number",
licenseNumber: String? = "mockLicenseNumber-$number",
issuingCountry: String? = "mockIssuingCountry-$number",
issuingState: String? = "mockIssuingState-$number",
issuingAuthority: String? = "mockIssuingAuthority-$number",
issueDate: String? = "mockIssueDate-$number",
expirationDate: String? = "mockExpirationDate-$number",
licenseClass: String? = "mockLicenseClass-$number",
): DriversLicenseView =
DriversLicenseView(
firstName = firstName,
middleName = middleName,
lastName = lastName,
dateOfBirth = dateOfBirth,
licenseNumber = licenseNumber,
issuingCountry = issuingCountry,
issuingState = issuingState,
issuingAuthority = issuingAuthority,
issueDate = issueDate,
expirationDate = expirationDate,
licenseClass = licenseClass,
)
/**
* Create a mock [PassportView] with a given [number].
*/
@Suppress("LongParameterList")
fun createMockPassportView(
number: Int,
surname: String? = "mockSurname-$number",
givenName: String? = "mockGivenName-$number",
dateOfBirth: String? = "mockDateOfBirth-$number",
birthPlace: String? = "mockBirthPlace-$number",
sex: String? = "mockSex-$number",
nationality: String? = "mockNationality-$number",
passportNumber: String? = "mockPassportNumber-$number",
passportType: String? = "mockPassportType-$number",
issuingCountry: String? = "mockIssuingCountry-$number",
issuingAuthority: String? = "mockIssuingAuthority-$number",
issueDate: String? = "mockIssueDate-$number",
expirationDate: String? = "mockExpirationDate-$number",
nationalIdentificationNumber: String? = "mockNationalIdentificationNumber-$number",
): PassportView =
PassportView(
surname = surname,
givenName = givenName,
dateOfBirth = dateOfBirth,
birthPlace = birthPlace,
sex = sex,
nationality = nationality,
passportNumber = passportNumber,
passportType = passportType,
issuingCountry = issuingCountry,
issuingAuthority = issuingAuthority,
issueDate = issueDate,
expirationDate = expirationDate,
nationalIdentificationNumber = nationalIdentificationNumber,
)
/**
* Create a mock [FieldView] with a given [number].
*/

View File

@@ -7,11 +7,13 @@ import com.bitwarden.vault.Cipher
import com.bitwarden.vault.CipherPermissions
import com.bitwarden.vault.CipherRepromptType
import com.bitwarden.vault.CipherType
import com.bitwarden.vault.DriversLicense
import com.bitwarden.vault.Field
import com.bitwarden.vault.FieldType
import com.bitwarden.vault.Identity
import com.bitwarden.vault.Login
import com.bitwarden.vault.LoginUri
import com.bitwarden.vault.Passport
import com.bitwarden.vault.PasswordHistory
import com.bitwarden.vault.SecureNote
import com.bitwarden.vault.SecureNoteType
@@ -54,6 +56,8 @@ fun createMockSdkCipher(
attachments = listOf(createMockSdkAttachment(number = number)),
card = createMockSdkCard(number = number),
bankAccount = createMockSdkBankAccount(number = number),
driversLicense = createMockSdkDriversLicense(number = number),
passport = createMockSdkPassport(number = number),
fields = listOf(createMockSdkField(number = number)),
identity = createMockSdkIdentity(number = number),
sshKey = createMockSdkSshKey(number = number),
@@ -150,6 +154,44 @@ fun createMockSdkBankAccount(number: Int): BankAccount =
bankContactPhone = "mockBankContactPhone-$number",
)
/**
* Create a mock [DriversLicense] with a given [number].
*/
fun createMockSdkDriversLicense(number: Int): DriversLicense =
DriversLicense(
firstName = "mockFirstName-$number",
middleName = "mockMiddleName-$number",
lastName = "mockLastName-$number",
licenseNumber = "mockLicenseNumber-$number",
issuingCountry = "mockIssuingCountry-$number",
issuingState = "mockIssuingState-$number",
issuingAuthority = "mockIssuingAuthority-$number",
expirationDate = "mockExpirationDate-$number",
dateOfBirth = "mockDateOfBirth-$number",
issueDate = "mockIssueDate-$number",
licenseClass = "mockLicenseClass-$number",
)
/**
* Create a mock [Passport] with a given [number].
*/
fun createMockSdkPassport(number: Int): Passport =
Passport(
surname = "mockSurname-$number",
givenName = "mockGivenName-$number",
dateOfBirth = "mockDateOfBirth-$number",
birthPlace = "mockBirthPlace-$number",
sex = "mockSex-$number",
nationality = "mockNationality-$number",
passportNumber = "mockPassportNumber-$number",
passportType = "mockPassportType-$number",
nationalIdentificationNumber = "mockNationalIdentificationNumber-$number",
issuingCountry = "mockIssuingCountry-$number",
issuingAuthority = "mockIssuingAuthority-$number",
issueDate = "mockIssueDate-$number",
expirationDate = "mockExpirationDate-$number",
)
/**
* Create a mock [Field] with a given [number].
*/

View File

@@ -280,6 +280,76 @@ fun createMockDisplayItemForCipher(
itemType = SearchState.DisplayItem.ItemType.Vault(type = cipherType),
)
}
CipherType.DRIVERS_LICENSE -> {
SearchState.DisplayItem(
id = "mockId-$number",
title = "mockName-$number",
titleTestTag = "CipherNameLabel",
subtitle = null,
subtitleTestTag = "CipherSubTitleLabel",
iconData = IconData.Local(BitwardenDrawable.ic_note),
extraIconList = persistentListOf(
IconData.Local(
iconRes = BitwardenDrawable.ic_collections,
contentDescription = BitwardenString.collections.asText(),
testTag = "CipherInCollectionIcon",
),
),
overflowOptions = persistentListOf(
ListingItemOverflowAction.VaultAction.ViewClick(
cipherId = "mockId-$number",
cipherType = CipherType.DRIVERS_LICENSE,
requiresPasswordReprompt = true,
),
ListingItemOverflowAction.VaultAction.EditClick(
cipherId = "mockId-$number",
cipherType = CipherType.DRIVERS_LICENSE,
requiresPasswordReprompt = true,
),
),
overflowTestTag = "CipherOptionsButton",
totpCode = null,
autofillSelectionOptions = persistentListOf(),
shouldDisplayMasterPasswordReprompt = false,
itemType = SearchState.DisplayItem.ItemType.Vault(type = cipherType),
)
}
CipherType.PASSPORT -> {
SearchState.DisplayItem(
id = "mockId-$number",
title = "mockName-$number",
titleTestTag = "CipherNameLabel",
subtitle = null,
subtitleTestTag = "CipherSubTitleLabel",
iconData = IconData.Local(BitwardenDrawable.ic_note),
extraIconList = persistentListOf(
IconData.Local(
iconRes = BitwardenDrawable.ic_collections,
contentDescription = BitwardenString.collections.asText(),
testTag = "CipherInCollectionIcon",
),
),
overflowOptions = persistentListOf(
ListingItemOverflowAction.VaultAction.ViewClick(
cipherId = "mockId-$number",
cipherType = CipherType.PASSPORT,
requiresPasswordReprompt = true,
),
ListingItemOverflowAction.VaultAction.EditClick(
cipherId = "mockId-$number",
cipherType = CipherType.PASSPORT,
requiresPasswordReprompt = true,
),
),
overflowTestTag = "CipherOptionsButton",
totpCode = null,
autofillSelectionOptions = persistentListOf(),
shouldDisplayMasterPasswordReprompt = false,
itemType = SearchState.DisplayItem.ItemType.Vault(type = cipherType),
)
}
}
/**

View File

@@ -740,6 +740,8 @@ private val DEFAULT_BASE_CIPHER_VIEW: CipherView = CipherView(
card = null,
secureNote = null,
bankAccount = null,
driversLicense = null,
passport = null,
favorite = false,
reprompt = CipherRepromptType.PASSWORD,
organizationUseTotp = false,

View File

@@ -99,6 +99,8 @@ fun createCipherView(type: CipherType, isEmpty: Boolean): CipherView =
card = null,
secureNote = null,
bankAccount = null,
driversLicense = null,
passport = null,
favorite = false,
reprompt = CipherRepromptType.PASSWORD,
organizationUseTotp = false,

View File

@@ -320,6 +320,94 @@ fun createMockDisplayItemForCipher(
itemType = VaultItemListingState.DisplayItem.ItemType.Vault(type = cipherType),
)
}
CipherType.DRIVERS_LICENSE -> {
VaultItemListingState.DisplayItem(
id = "mockId-$number",
title = "mockName-$number".asText(),
titleTestTag = "CipherNameLabel",
secondSubtitle = secondSubtitle,
secondSubtitleTestTag = secondSubtitleTestTag,
subtitle = subtitle,
subtitleTestTag = "CipherSubTitleLabel",
iconData = IconData.Local(BitwardenDrawable.ic_note),
extraIconList = persistentListOf(
IconData.Local(
iconRes = BitwardenDrawable.ic_collections,
contentDescription = BitwardenString.collections.asText(),
testTag = "CipherInCollectionIcon",
),
IconData.Local(
iconRes = BitwardenDrawable.ic_paperclip,
contentDescription = BitwardenString.attachments.asText(),
testTag = "CipherWithAttachmentsIcon",
),
),
overflowOptions = listOf(
ListingItemOverflowAction.VaultAction.ViewClick(
cipherId = "mockId-$number",
cipherType = cipherType,
requiresPasswordReprompt = requiresPasswordReprompt,
),
ListingItemOverflowAction.VaultAction.EditClick(
cipherId = "mockId-$number",
cipherType = cipherType,
requiresPasswordReprompt = requiresPasswordReprompt,
),
ListingItemOverflowAction.VaultAction.ArchiveClick(cipherId = "mockId-$number"),
),
optionsTestTag = "CipherOptionsButton",
isAutofill = false,
isCredentialCreation = false,
shouldShowMasterPasswordReprompt = false,
iconTestTag = "BankAccountCipherIcon",
itemType = VaultItemListingState.DisplayItem.ItemType.Vault(type = cipherType),
)
}
CipherType.PASSPORT -> {
VaultItemListingState.DisplayItem(
id = "mockId-$number",
title = "mockName-$number".asText(),
titleTestTag = "CipherNameLabel",
secondSubtitle = secondSubtitle,
secondSubtitleTestTag = secondSubtitleTestTag,
subtitle = subtitle,
subtitleTestTag = "CipherSubTitleLabel",
iconData = IconData.Local(BitwardenDrawable.ic_note),
extraIconList = persistentListOf(
IconData.Local(
iconRes = BitwardenDrawable.ic_collections,
contentDescription = BitwardenString.collections.asText(),
testTag = "CipherInCollectionIcon",
),
IconData.Local(
iconRes = BitwardenDrawable.ic_paperclip,
contentDescription = BitwardenString.attachments.asText(),
testTag = "CipherWithAttachmentsIcon",
),
),
overflowOptions = listOf(
ListingItemOverflowAction.VaultAction.ViewClick(
cipherId = "mockId-$number",
cipherType = cipherType,
requiresPasswordReprompt = requiresPasswordReprompt,
),
ListingItemOverflowAction.VaultAction.EditClick(
cipherId = "mockId-$number",
cipherType = cipherType,
requiresPasswordReprompt = requiresPasswordReprompt,
),
ListingItemOverflowAction.VaultAction.ArchiveClick(cipherId = "mockId-$number"),
),
optionsTestTag = "CipherOptionsButton",
isAutofill = false,
isCredentialCreation = false,
shouldShowMasterPasswordReprompt = false,
iconTestTag = "BankAccountCipherIcon",
itemType = VaultItemListingState.DisplayItem.ItemType.Vault(type = cipherType),
)
}
}
/**

View File

@@ -1532,7 +1532,7 @@ class VaultViewModelTest : BaseViewModelTest() {
noFolderItems = listOf(),
trashItemsCount = 0,
totpItemsCount = 1,
itemTypesCount = 6,
itemTypesCount = CipherType.entries.size,
sshKeyItemsCount = 0,
archivedItemsCount = 0,
archiveSubText = null,
@@ -1670,7 +1670,7 @@ class VaultViewModelTest : BaseViewModelTest() {
noFolderItems = listOf(),
trashItemsCount = 0,
totpItemsCount = 1,
itemTypesCount = 6,
itemTypesCount = CipherType.entries.size,
sshKeyItemsCount = 0,
archivedItemsCount = 0,
archiveSubText = null,
@@ -1810,7 +1810,7 @@ class VaultViewModelTest : BaseViewModelTest() {
noFolderItems = listOf(),
trashItemsCount = 0,
totpItemsCount = 1,
itemTypesCount = 6,
itemTypesCount = CipherType.entries.size,
sshKeyItemsCount = 0,
archivedItemsCount = 0,
archiveSubText = null,
@@ -1877,7 +1877,7 @@ class VaultViewModelTest : BaseViewModelTest() {
noFolderItems = listOf(),
trashItemsCount = 0,
totpItemsCount = 1,
itemTypesCount = 6,
itemTypesCount = CipherType.entries.size,
sshKeyItemsCount = 0,
archivedItemsCount = 0,
archiveSubText = null,
@@ -1992,7 +1992,7 @@ class VaultViewModelTest : BaseViewModelTest() {
noFolderItems = listOf(),
trashItemsCount = 0,
totpItemsCount = 1,
itemTypesCount = 6,
itemTypesCount = CipherType.entries.size,
sshKeyItemsCount = 0,
archivedItemsCount = 0,
archiveSubText = null,
@@ -2316,7 +2316,7 @@ class VaultViewModelTest : BaseViewModelTest() {
noFolderItems = listOf(),
trashItemsCount = 0,
totpItemsCount = 0,
itemTypesCount = 6,
itemTypesCount = CipherType.entries.size,
sshKeyItemsCount = 0,
archivedItemsCount = null,
archiveSubText = BitwardenString.premium_subscription_required.asText(),
@@ -2422,7 +2422,7 @@ class VaultViewModelTest : BaseViewModelTest() {
noFolderItems = listOf(),
trashItemsCount = 0,
totpItemsCount = 0,
itemTypesCount = 6,
itemTypesCount = CipherType.entries.size,
sshKeyItemsCount = 0,
archivedItemsCount = 1,
archiveSubText = null,
@@ -2494,7 +2494,7 @@ class VaultViewModelTest : BaseViewModelTest() {
noFolderItems = listOf(),
trashItemsCount = 0,
totpItemsCount = 1,
itemTypesCount = 6,
itemTypesCount = CipherType.entries.size,
sshKeyItemsCount = 0,
archivedItemsCount = 0,
archiveSubText = null,
@@ -3820,7 +3820,7 @@ class VaultViewModelTest : BaseViewModelTest() {
noFolderItems = listOf(),
trashItemsCount = 0,
totpItemsCount = 2,
itemTypesCount = 6,
itemTypesCount = CipherType.entries.size,
sshKeyItemsCount = 0,
archivedItemsCount = 0,
archiveSubText = null,
@@ -3881,7 +3881,7 @@ class VaultViewModelTest : BaseViewModelTest() {
noFolderItems = listOf(),
trashItemsCount = 0,
totpItemsCount = 2,
itemTypesCount = 6,
itemTypesCount = CipherType.entries.size,
sshKeyItemsCount = 0,
archivedItemsCount = 0,
archiveSubText = null,

View File

@@ -92,6 +92,8 @@ class VaultAddItemStateExtensionsTest {
card = null,
secureNote = null,
bankAccount = null,
driversLicense = null,
passport = null,
favorite = false,
reprompt = CipherRepromptType.NONE,
organizationUseTotp = false,
@@ -256,6 +258,8 @@ class VaultAddItemStateExtensionsTest {
identity = null,
card = null,
bankAccount = null,
driversLicense = null,
passport = null,
secureNote = SecureNoteView(SecureNoteType.GENERIC),
favorite = false,
reprompt = CipherRepromptType.NONE,
@@ -386,6 +390,8 @@ class VaultAddItemStateExtensionsTest {
type = CipherType.IDENTITY,
login = null,
bankAccount = null,
driversLicense = null,
passport = null,
identity = IdentityView(
title = "MR",
firstName = "mockFirstName",
@@ -594,6 +600,8 @@ class VaultAddItemStateExtensionsTest {
),
secureNote = null,
bankAccount = null,
driversLicense = null,
passport = null,
favorite = false,
reprompt = CipherRepromptType.NONE,
organizationUseTotp = false,
@@ -736,6 +744,8 @@ class VaultAddItemStateExtensionsTest {
card = null,
secureNote = null,
bankAccount = null,
driversLicense = null,
passport = null,
favorite = false,
reprompt = CipherRepromptType.NONE,
organizationUseTotp = false,
@@ -1035,6 +1045,8 @@ class VaultAddItemStateExtensionsTest {
card = null,
secureNote = null,
bankAccount = null,
driversLicense = null,
passport = null,
favorite = false,
reprompt = CipherRepromptType.NONE,
organizationUseTotp = false,
@@ -1147,6 +1159,8 @@ private val DEFAULT_BASE_CIPHER_VIEW: CipherView = CipherView(
card = null,
secureNote = null,
bankAccount = null,
driversLicense = null,
passport = null,
favorite = false,
reprompt = CipherRepromptType.PASSWORD,
organizationUseTotp = false,

View File

@@ -140,7 +140,7 @@ class VaultDataExtensionsTest {
noFolderItems = listOf(),
trashItemsCount = 0,
totpItemsCount = 1,
itemTypesCount = 6,
itemTypesCount = CipherType.entries.size,
sshKeyItemsCount = 0,
archivedItemsCount = 1,
archiveSubText = null,
@@ -194,7 +194,7 @@ class VaultDataExtensionsTest {
noFolderItems = listOf(),
trashItemsCount = 0,
totpItemsCount = 1,
itemTypesCount = 6,
itemTypesCount = CipherType.entries.size,
sshKeyItemsCount = 0,
archivedItemsCount = 0,
archiveSubText = null,
@@ -268,7 +268,7 @@ class VaultDataExtensionsTest {
noFolderItems = listOf(),
trashItemsCount = 0,
totpItemsCount = 1,
itemTypesCount = 6,
itemTypesCount = CipherType.entries.size,
sshKeyItemsCount = 0,
archivedItemsCount = 0,
archiveSubText = null,
@@ -367,7 +367,7 @@ class VaultDataExtensionsTest {
noFolderItems = listOf(),
trashItemsCount = 0,
totpItemsCount = 1,
itemTypesCount = 6,
itemTypesCount = CipherType.entries.size,
sshKeyItemsCount = 0,
archivedItemsCount = 0,
archiveSubText = null,
@@ -412,7 +412,7 @@ class VaultDataExtensionsTest {
noFolderItems = listOf(),
trashItemsCount = 0,
totpItemsCount = 0,
itemTypesCount = 6,
itemTypesCount = CipherType.entries.size,
sshKeyItemsCount = 0,
archivedItemsCount = null,
archiveSubText = BitwardenString.premium_subscription_required.asText(),
@@ -459,7 +459,7 @@ class VaultDataExtensionsTest {
noFolderItems = listOf(),
trashItemsCount = 0,
totpItemsCount = 1,
itemTypesCount = 6,
itemTypesCount = CipherType.entries.size,
sshKeyItemsCount = 0,
archivedItemsCount = null,
archiveSubText = BitwardenString.premium_subscription_required.asText(),
@@ -506,7 +506,7 @@ class VaultDataExtensionsTest {
noFolderItems = listOf(),
trashItemsCount = 0,
totpItemsCount = 1,
itemTypesCount = 6,
itemTypesCount = CipherType.entries.size,
sshKeyItemsCount = 0,
archivedItemsCount = null,
archiveSubText = BitwardenString.premium_subscription_required.asText(),
@@ -737,7 +737,7 @@ class VaultDataExtensionsTest {
noFolderItems = listOf(),
trashItemsCount = 2,
totpItemsCount = 1,
itemTypesCount = 6,
itemTypesCount = CipherType.entries.size,
sshKeyItemsCount = 0,
archivedItemsCount = 0,
archiveSubText = null,
@@ -784,7 +784,7 @@ class VaultDataExtensionsTest {
noFolderItems = listOf(),
trashItemsCount = 2,
totpItemsCount = 0,
itemTypesCount = 6,
itemTypesCount = CipherType.entries.size,
sshKeyItemsCount = 0,
archivedItemsCount = 0,
archiveSubText = null,
@@ -840,7 +840,7 @@ class VaultDataExtensionsTest {
noFolderItems = listOf(),
trashItemsCount = 0,
totpItemsCount = 100,
itemTypesCount = 6,
itemTypesCount = CipherType.entries.size,
sshKeyItemsCount = 0,
archivedItemsCount = 0,
archiveSubText = null,
@@ -909,7 +909,7 @@ class VaultDataExtensionsTest {
),
trashItemsCount = 0,
totpItemsCount = 1,
itemTypesCount = 6,
itemTypesCount = CipherType.entries.size,
sshKeyItemsCount = 0,
archivedItemsCount = 0,
archiveSubText = null,
@@ -998,7 +998,7 @@ class VaultDataExtensionsTest {
noFolderItems = listOf(),
trashItemsCount = 0,
totpItemsCount = 1,
itemTypesCount = 6,
itemTypesCount = CipherType.entries.size,
sshKeyItemsCount = 0,
archivedItemsCount = 0,
archiveSubText = null,

View File

@@ -30,7 +30,7 @@ androidxRoom = "2.8.4"
androidxSecurityCrypto = "1.1.0"
androidxSplash = "1.2.0"
androidxWork = "2.11.2"
bitwardenSdk = "2.0.0-6535-86ed52c7"
bitwardenSdk = "2.0.0-6639-21488a37"
crashlytics = "3.0.7"
detekt = "1.23.8"
firebaseBom = "34.12.0"

View File

@@ -851,11 +851,12 @@ data class SyncResponseJson(
* @property middleName The middle name (nullable).
* @property lastName The last name (nullable).
* @property licenseNumber The license number (nullable).
* @property dateOfBirth The date of birth (nullable).
* @property issuingCountry The issuing country (nullable).
* @property issuingState The issuing state/province (nullable).
* @property expirationMonth The expiration month (nullable).
* @property expirationDay The expiration day of month (nullable).
* @property expirationYear The expiration year (nullable).
* @property issuingAuthority The issuing authority (nullable).
* @property issueDate The issue date (nullable).
* @property expirationDate The expiration date (nullable).
* @property licenseClass The license class (nullable).
*/
@Serializable
@@ -872,20 +873,23 @@ data class SyncResponseJson(
@SerialName("licenseNumber")
val licenseNumber: String?,
@SerialName("dateOfBirth")
val dateOfBirth: String?,
@SerialName("issuingCountry")
val issuingCountry: String?,
@SerialName("issuingAuthority")
val issuingAuthority: String?,
@SerialName("issuingState")
val issuingState: String?,
@SerialName("expirationMonth")
val expirationMonth: String?,
@SerialName("issueDate")
val issueDate: String?,
@SerialName("expirationDay")
val expirationDay: String?,
@SerialName("expirationYear")
val expirationYear: String?,
@SerialName("expirationDate")
val expirationDate: String?,
@SerialName("licenseClass")
val licenseClass: String?,
@@ -896,20 +900,17 @@ data class SyncResponseJson(
*
* @property surname The surname (nullable).
* @property givenName The given name (nullable).
* @property dobMonth The month of birth (nullable).
* @property dobDay The day of month of birth (nullable).
* @property dobYear The year of birth (nullable).
* @property dateOfBirth The date of birth (nullable).
* @property birthPlace The place of birth (nullable).
* @property sex The sex of the individual (nullable).
* @property nationality The nationality (nullable).
* @property passportNumber The passport number (nullable).
* @property passportType The passport type (nullable).
* @property issuingCountry The issuing country (nullable).
* @property issuingAuthority The issuing authority/office (nullable).
* @property issueMonth The issue month (nullable).
* @property issueDay The issue day of month (nullable).
* @property issueYear The issue year (nullable).
* @property expirationMonth The expiration month (nullable).
* @property expirationDay The expiration day of month (nullable).
* @property expirationYear The expiration year (nullable).
* @property issueDate The issue date (nullable).
* @property expirationDate The expiration date (nullable).
* @property nationalIdentificationNumber The nation ID (nullable).
*/
@Serializable
data class Passport(
@@ -919,14 +920,14 @@ data class SyncResponseJson(
@SerialName("givenName")
val givenName: String?,
@SerialName("dobMonth")
val dobMonth: String?,
@SerialName("dateOfBirth")
val dateOfBirth: String?,
@SerialName("dobDay")
val dobDay: String?,
@SerialName("birthPlace")
val birthPlace: String?,
@SerialName("dobYear")
val dobYear: String?,
@SerialName("sex")
val sex: String?,
@SerialName("nationality")
val nationality: String?,
@@ -943,23 +944,14 @@ data class SyncResponseJson(
@SerialName("issuingAuthority")
val issuingAuthority: String?,
@SerialName("issueMonth")
val issueMonth: String?,
@SerialName("issueDate")
val issueDate: String?,
@SerialName("issueDay")
val issueDay: String?,
@SerialName("expirationDate")
val expirationDate: String?,
@SerialName("issueYear")
val issueYear: String?,
@SerialName("expirationMonth")
val expirationMonth: String?,
@SerialName("expirationDay")
val expirationDay: String?,
@SerialName("expirationYear")
val expirationYear: String?,
@SerialName("nationalIdentificationNumber")
val nationalIdentificationNumber: String?,
)
/**

View File

@@ -641,6 +641,34 @@ private const val CREATE_ATTACHMENT_SUCCESS_JSON = """
"iban": "mockIban-1",
"bankContactPhone": "mockBankContactPhone-1"
},
"driversLicense": {
"firstName": "mockFirstName-1",
"middleName": "mockMiddleName-1",
"lastName": "mockLastName-1",
"licenseNumber": "mockLicenseNumber-1",
"issuingCountry": "mockIssuingCountry-1",
"issuingState": "mockIssuingState-1",
"issuingAuthority": "mockIssuingAuthority-1",
"expirationDate": "mockExpirationDate-1",
"dateOfBirth": "mockDateOfBirth-1",
"issueDate": "mockIssueDate-1",
"licenseClass": "mockLicenseClass-1",
},
"passport": {
"surname": "mockSurname-1",
"givenName": "mockGivenName-1",
"dateOfBirth": "mockDateOfBirth-1",
"birthPlace": "mockBirthPlace-1",
"sex": "mockSex-1",
"nationality": "mockNationality-1",
"passportNumber": "mockPassportNumber-1",
"passportType": "mockPassportType-1",
"nationalIdentificationNumber": "mockNationalIdentificationNumber-1",
"issuingCountry": "mockIssuingCountry-1",
"issuingAuthority": "mockIssuingAuthority-1",
"issueDate": "mockIssueDate-1",
"expirationDate": "mockExpirationDate-1",
},
"encryptedFor": "mockEncryptedFor-1",
"archivedDate": "2023-10-27T12:00:00.00Z"
}
@@ -782,6 +810,34 @@ private const val CREATE_RESTORE_UPDATE_CIPHER_SUCCESS_JSON = """
"iban": "mockIban-1",
"bankContactPhone": "mockBankContactPhone-1"
},
"driversLicense": {
"firstName": "mockFirstName-1",
"middleName": "mockMiddleName-1",
"lastName": "mockLastName-1",
"licenseNumber": "mockLicenseNumber-1",
"issuingCountry": "mockIssuingCountry-1",
"issuingState": "mockIssuingState-1",
"issuingAuthority": "mockIssuingAuthority-1",
"expirationDate": "mockExpirationDate-1",
"dateOfBirth": "mockDateOfBirth-1",
"issueDate": "mockIssueDate-1",
"licenseClass": "mockLicenseClass-1",
},
"passport": {
"surname": "mockSurname-1",
"givenName": "mockGivenName-1",
"dateOfBirth": "mockDateOfBirth-1",
"birthPlace": "mockBirthPlace-1",
"sex": "mockSex-1",
"nationality": "mockNationality-1",
"passportNumber": "mockPassportNumber-1",
"passportType": "mockPassportType-1",
"nationalIdentificationNumber": "mockNationalIdentificationNumber-1",
"issuingCountry": "mockIssuingCountry-1",
"issuingAuthority": "mockIssuingAuthority-1",
"issueDate": "mockIssueDate-1",
"expirationDate": "mockExpirationDate-1",
},
"encryptedFor": "mockEncryptedFor-1",
"archivedDate": "2023-10-27T12:00:00.00Z"
}

View File

@@ -347,6 +347,34 @@ private const val SYNC_SUCCESS_JSON = """
"iban": "mockIban-1",
"bankContactPhone": "mockBankContactPhone-1"
},
"driversLicense": {
"firstName": "mockFirstName-1",
"middleName": "mockMiddleName-1",
"lastName": "mockLastName-1",
"licenseNumber": "mockLicenseNumber-1",
"issuingCountry": "mockIssuingCountry-1",
"issuingState": "mockIssuingState-1",
"issuingAuthority": "mockIssuingAuthority-1",
"expirationDate": "mockExpirationDate-1",
"dateOfBirth": "mockDateOfBirth-1",
"issueDate": "mockIssueDate-1",
"licenseClass": "mockLicenseClass-1",
},
"passport": {
"surname": "mockSurname-1",
"givenName": "mockGivenName-1",
"dateOfBirth": "mockDateOfBirth-1",
"birthPlace": "mockBirthPlace-1",
"sex": "mockSex-1",
"nationality": "mockNationality-1",
"passportNumber": "mockPassportNumber-1",
"passportType": "mockPassportType-1",
"nationalIdentificationNumber": "mockNationalIdentificationNumber-1",
"issuingCountry": "mockIssuingCountry-1",
"issuingAuthority": "mockIssuingAuthority-1",
"issueDate": "mockIssueDate-1",
"expirationDate": "mockExpirationDate-1",
},
"encryptedFor": "mockEncryptedFor-1",
"archivedDate": "2023-10-27T12:00:00.00Z"
}

View File

@@ -33,8 +33,10 @@ fun createMockCipher(
identity: SyncResponseJson.Cipher.Identity? = createMockIdentity(number = number),
sshKey: SyncResponseJson.Cipher.SshKey? = createMockSshKey(number = number),
bankAccount: SyncResponseJson.Cipher.BankAccount? = createMockBankAccount(number = number),
driversLicense: SyncResponseJson.Cipher.DriversLicense? = null,
passport: SyncResponseJson.Cipher.Passport? = null,
driversLicense: SyncResponseJson.Cipher.DriversLicense? = createMockDriversLicense(
number = number,
),
passport: SyncResponseJson.Cipher.Passport? = createMockPassport(number = number),
secureNote: SyncResponseJson.Cipher.SecureNote? = createMockSecureNote(),
fields: List<SyncResponseJson.Cipher.Field>? = listOf(createMockField(number = number)),
isFavorite: Boolean = false,
@@ -300,24 +302,26 @@ fun createMockDriversLicense(
firstName: String? = "mockFirstName-$number",
middleName: String? = "mockMiddleName-$number",
lastName: String? = "mockLastName-$number",
dateOfBirth: String? = "mockDateOfBirth-$number",
licenseNumber: String? = "mockLicenseNumber-$number",
issuingCountry: String? = "mockIssuingCountry-$number",
issuingState: String? = "mockIssuingState-$number",
expirationMonth: String? = "mockExpirationMonth-$number",
expirationDay: String? = "mockExpirationDay-$number",
expirationYear: String? = "mockExpirationYear-$number",
issuingAuthority: String? = "mockIssuingAuthority-$number",
issueDate: String? = "mockIssueDate-$number",
expirationDate: String? = "mockExpirationDate-$number",
licenseClass: String? = "mockLicenseClass-$number",
): SyncResponseJson.Cipher.DriversLicense =
SyncResponseJson.Cipher.DriversLicense(
firstName = firstName,
middleName = middleName,
lastName = lastName,
dateOfBirth = dateOfBirth,
licenseNumber = licenseNumber,
issuingCountry = issuingCountry,
issuingState = issuingState,
expirationMonth = expirationMonth,
expirationDay = expirationDay,
expirationYear = expirationYear,
issuingAuthority = issuingAuthority,
issueDate = issueDate,
expirationDate = expirationDate,
licenseClass = licenseClass,
)
@@ -328,38 +332,32 @@ fun createMockPassport(
number: Int,
surname: String? = "mockSurname-$number",
givenName: String? = "mockGivenName-$number",
dobMonth: String? = "mockDobMonth-$number",
dobDay: String? = "mockDobDay-$number",
dobYear: String? = "mockDobYear-$number",
dateOfBirth: String? = "mockDateOfBirth-$number",
birthPlace: String? = "mockBirthPlace-$number",
sex: String? = "mockSex-$number",
nationality: String? = "mockNationality-$number",
passportNumber: String? = "mockPassportNumber-$number",
passportType: String? = "mockPassportType-$number",
issuingCountry: String? = "mockIssuingCountry-$number",
issuingAuthority: String? = "mockIssuingAuthority-$number",
issueMonth: String? = "mockIssueMonth-$number",
issueDay: String? = "mockIssueDay-$number",
issueYear: String? = "mockIssueYear-$number",
expirationMonth: String? = "mockExpirationMonth-$number",
expirationDay: String? = "mockExpirationDay-$number",
expirationYear: String? = "mockExpirationYear-$number",
issueDate: String? = "mockIssueDate-$number",
expirationDate: String? = "mockExpirationDate-$number",
nationalIdentificationNumber: String? = "mockNationalIdentificationNumber-$number",
): SyncResponseJson.Cipher.Passport =
SyncResponseJson.Cipher.Passport(
surname = surname,
givenName = givenName,
dobMonth = dobMonth,
dobDay = dobDay,
dobYear = dobYear,
dateOfBirth = dateOfBirth,
birthPlace = birthPlace,
sex = sex,
nationality = nationality,
passportNumber = passportNumber,
passportType = passportType,
issuingCountry = issuingCountry,
issuingAuthority = issuingAuthority,
issueMonth = issueMonth,
issueDay = issueDay,
issueYear = issueYear,
expirationMonth = expirationMonth,
expirationDay = expirationDay,
expirationYear = expirationYear,
issueDate = issueDate,
expirationDate = expirationDate,
nationalIdentificationNumber = nationalIdentificationNumber,
)
/**