Update to latest version of the SDK (#1430)

This commit is contained in:
David Perez 2024-06-07 12:21:11 -05:00 committed by Álison Fernandes
parent b8e43d75cf
commit 23aedd5bcb
4 changed files with 20 additions and 45 deletions

View file

@ -102,13 +102,21 @@ fun createMockLoginView(
fido2Credentials = createMockSdkFido2CredentialList(number, clock),
)
fun createMockSdkFido2CredentialList(number: Int, clock: Clock = FIXED_CLOCK) =
listOf(createMockSdkFido2CredentialView(number, clock))
fun createMockSdkFido2CredentialView(
/**
* Create a list of mock [Fido2Credential] with a given [number].
*/
fun createMockSdkFido2CredentialList(
number: Int,
clock: Clock = FIXED_CLOCK,
) = Fido2Credential(
): List<Fido2Credential> = listOf(createMockSdkFido2Credential(number, clock))
/**
* Create a mock [Fido2Credential] with a given [number].
*/
fun createMockSdkFido2Credential(
number: Int,
clock: Clock = FIXED_CLOCK,
): Fido2Credential = Fido2Credential(
credentialId = "mockCredentialId-$number",
keyType = "mockKeyType-$number",
keyAlgorithm = "mockKeyAlgorithm-$number",

View file

@ -21,6 +21,7 @@ import com.x8bit.bitwarden.data.platform.repository.model.Environment
import com.x8bit.bitwarden.data.vault.datasource.sdk.model.createMockCipherView
import com.x8bit.bitwarden.data.vault.datasource.sdk.model.createMockCollectionView
import com.x8bit.bitwarden.data.vault.datasource.sdk.model.createMockFolderView
import com.x8bit.bitwarden.data.vault.datasource.sdk.model.createMockSdkFido2CredentialList
import com.x8bit.bitwarden.ui.platform.base.util.asText
import com.x8bit.bitwarden.ui.platform.manager.resource.ResourceManager
import com.x8bit.bitwarden.ui.vault.feature.addedit.VaultAddEditState
@ -556,23 +557,7 @@ private val DEFAULT_LOGIN_CIPHER_VIEW: CipherView = DEFAULT_BASE_CIPHER_VIEW.cop
),
totp = "otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example",
autofillOnPageLoad = false,
fido2Credentials = listOf(
Fido2Credential(
credentialId = "mockCredentialId",
keyType = "mockKeyType",
keyAlgorithm = "mockKeyAlgorithm",
keyCurve = "mockKeyCurve",
keyValue = "mockKeyValue",
rpId = "mockRpId",
userHandle = "mockUserHandle",
userName = "mockUserName",
counter = "mockCounter",
rpName = "mockRpName",
userDisplayName = "mockUserDisplayName",
discoverable = "mockDiscoverable",
creationDate = FIXED_CLOCK.instant(),
),
),
fido2Credentials = createMockSdkFido2CredentialList(number = 1, clock = FIXED_CLOCK),
),
)

View file

@ -4,7 +4,6 @@ import com.bitwarden.core.AttachmentView
import com.bitwarden.core.CipherRepromptType
import com.bitwarden.core.CipherType
import com.bitwarden.core.CipherView
import com.bitwarden.core.Fido2Credential
import com.bitwarden.core.FieldType
import com.bitwarden.core.FieldView
import com.bitwarden.core.IdentityView
@ -12,6 +11,7 @@ import com.bitwarden.core.LoginUriView
import com.bitwarden.core.LoginView
import com.bitwarden.core.PasswordHistoryView
import com.x8bit.bitwarden.R
import com.x8bit.bitwarden.data.vault.datasource.sdk.model.createMockSdkFido2CredentialList
import com.x8bit.bitwarden.ui.platform.base.util.asText
import com.x8bit.bitwarden.ui.vault.feature.item.VaultItemState
import com.x8bit.bitwarden.ui.vault.feature.item.model.TotpCodeItemData
@ -46,23 +46,7 @@ fun createLoginView(isEmpty: Boolean): LoginView =
totp = "otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example"
.takeUnless { isEmpty },
autofillOnPageLoad = false,
fido2Credentials = listOf(
Fido2Credential(
credentialId = "mockCredentialId",
keyType = "mockKeyType",
keyAlgorithm = "mockKeyAlgorithm",
keyCurve = "mockKeyCurve",
keyValue = "mockKeyValue",
rpId = "mockRpId",
userHandle = "mockUserHandle",
userName = "mockUserName",
counter = "mockCounter",
rpName = "mockRpName",
userDisplayName = "mockUserDisplayName",
discoverable = "mockDiscoverable",
creationDate = Instant.ofEpochSecond(1_000L),
),
).takeUnless { isEmpty },
fido2Credentials = createMockSdkFido2CredentialList(number = 1).takeUnless { isEmpty },
)
@Suppress("CyclomaticComplexMethod")
@ -253,10 +237,8 @@ fun createLoginContent(isEmpty: Boolean): VaultItemState.ViewState.Content.ItemT
totpCode = "testCode",
)
.takeUnless { isEmpty },
fido2CredentialCreationDateText = R.string.created_xy.asText(
"1/1/70",
"12:16 AM",
)
fido2CredentialCreationDateText = R.string.created_xy
.asText("10/27/23", "12:00 PM")
.takeUnless { isEmpty },
)

View file

@ -24,7 +24,7 @@ androidxSplash = "1.1.0-rc01"
androidXAppCompat = "1.7.0"
androdixAutofill = "1.1.0"
androidxWork = "2.9.0"
bitwardenSdk = "0.5.0-20240531.135208-67"
bitwardenSdk = "0.5.0-20240607.161329-78"
crashlytics = "3.0.1"
detekt = "1.23.6"
firebaseBom = "33.1.0"