Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
3397b7c
SDK Update - com.bitwarden:sdk-android 4.0.0-9751-1789780d
bw-ghapp[bot] Oct 28, 2026
277bb08
SDK Update - com.bitwarden:sdk-android 4.0.0-9762-b8c41223
bw-ghapp[bot] Oct 28, 2026
164adad
SDK Update - com.bitwarden:sdk-android 4.0.0-9769-4d983d78
bw-ghapp[bot] Oct 28, 2026
6952eac
SDK Update - com.bitwarden:sdk-android 4.0.0-9779-5c0b59ae
bw-ghapp[bot] Oct 28, 2026
1a8d111
SDK Update - com.bitwarden:sdk-android 4.0.0-9795-47f3a7f7
bw-ghapp[bot] Oct 29, 2026
b125d0b
SDK Update - com.bitwarden:sdk-android 4.0.0-9796-f2f05345
bw-ghapp[bot] Oct 29, 2026
31bcd38
SDK Update - com.bitwarden:sdk-android 4.0.0-9801-71794918
bw-ghapp[bot] Oct 29, 2026
0e1187e
SDK Update - com.bitwarden:sdk-android 4.0.0-9812-89119cd8
bw-ghapp[bot] Oct 29, 2026
88d1955
SDK Update - com.bitwarden:sdk-android 4.0.0-9816-d7ab9964
bw-ghapp[bot] Oct 29, 2026
82e0db2
SDK Update - com.bitwarden:sdk-android 4.0.0-9829-bae4427e
bw-ghapp[bot] Oct 29, 2026
facbe91
Preserve login httpAuthenticationEnabled on add/edit save
bw-ghapp[bot] Oct 29, 2026
27455c5
SDK Update - com.bitwarden:sdk-android 4.0.0-9838-404d3d4f
bw-ghapp[bot] Oct 29, 2026
26808e5
SDK Update - com.bitwarden:sdk-android 4.0.0-9839-c1c9b9a5
bw-ghapp[bot] Oct 29, 2026
8c44b60
SDK Update - com.bitwarden:sdk-android 4.0.0-9866-d3938694
bw-ghapp[bot] Oct 30, 2026
7d89bda
SDK Update - com.bitwarden:sdk-android 4.0.0-9867-3e7a9738
bw-ghapp[bot] Oct 30, 2026
f73449e
SDK Update - com.bitwarden:sdk-android 4.0.0-9872-92ca8306
bw-ghapp[bot] Oct 30, 2026
9360188
SDK Update - com.bitwarden:sdk-android 4.0.0-9898-1819c5a0
bw-ghapp[bot] Nov 2, 2026
4db1a94
SDK Update - com.bitwarden:sdk-android 4.0.0-9907-36e5096b
bw-ghapp[bot] Nov 2, 2026
7bd8dde
SDK Update - com.bitwarden:sdk-android 4.0.0-9914-ca53f727
bw-ghapp[bot] Nov 2, 2026
50841f3
SDK Update - com.bitwarden:sdk-android 4.0.0-9919-2f10c1cb
bw-ghapp[bot] Nov 3, 2026
bdbabfe
SDK Update - com.bitwarden:sdk-android 4.0.0-9921-1baf7bc0
bw-ghapp[bot] Nov 3, 2026
4a9530a
SDK Update - com.bitwarden:sdk-android 4.0.0-9932-37d73c02
bw-ghapp[bot] Nov 3, 2026
89db797
SDK Update - com.bitwarden:sdk-android 4.0.0-9933-8aa7955d
bw-ghapp[bot] Nov 3, 2026
0edd82f
SDK Update - com.bitwarden:sdk-android 4.0.0-9991-a06993f4
bw-ghapp[bot] Nov 3, 2026
018f2f6
SDK Update - com.bitwarden:sdk-android 4.0.0-9993-d4722984
bw-ghapp[bot] Nov 3, 2026
11f5914
SDK Update - com.bitwarden:sdk-android 4.0.0-9998-18a2d27a
bw-ghapp[bot] Nov 3, 2026
4b9950e
SDK Update - com.bitwarden:sdk-android 4.0.0-10000-6b0adaf7
bw-ghapp[bot] Nov 4, 2026
fd66d77
SDK Update - com.bitwarden:sdk-android 4.0.0-10010-6b78af30
bw-ghapp[bot] Nov 4, 2026
fa942cf
SDK Update - com.bitwarden:sdk-android 4.0.0-10011-b2d59860
bw-ghapp[bot] Nov 4, 2026
b4ffa11
SDK Update - com.bitwarden:sdk-android 4.0.0-10015-28d17ad2
bw-ghapp[bot] Nov 4, 2026
f2fd4c2
SDK Update - com.bitwarden:sdk-android 4.0.0-10023-11cdbce9
bw-ghapp[bot] Nov 4, 2026
25e4a48
SDK Update - com.bitwarden:sdk-android 4.0.0-10024-67d741eb
bw-ghapp[bot] Nov 4, 2026
87f15d4
SDK Update - com.bitwarden:sdk-android 4.0.0-10036-99102101
bw-ghapp[bot] Nov 5, 2026
16ccfb5
Persist SDK pin length through the state bridge
bw-ghapp[bot] Nov 5, 2026
1bc996e
SDK Update - com.bitwarden:sdk-android 4.0.0-10044-144b5027
bw-ghapp[bot] Nov 5, 2026
67227b3
SDK Update - com.bitwarden:sdk-android 4.0.0-10046-867cc58d
bw-ghapp[bot] Nov 5, 2026
fe2ddf4
SDK Update - com.bitwarden:sdk-android 4.0.0-10052-2cb3e38f
bw-ghapp[bot] Nov 5, 2026
3e26d56
SDK Update - com.bitwarden:sdk-android 4.0.0-10056-e89726f4
bw-ghapp[bot] Nov 5, 2026
c55e464
SDK Update - com.bitwarden:sdk-android 4.0.0-10060-c7dff088
bw-ghapp[bot] Nov 5, 2026
881238a
SDK Update - com.bitwarden:sdk-android 4.0.0-10064-aa560aa1
bw-ghapp[bot] Nov 5, 2026
13c2f1e
Clear the SDK pin length when PIN unlock is disabled
bw-ghapp[bot] Nov 5, 2026
11ad7b1
SDK Update - com.bitwarden:sdk-android 4.0.0-10071-73350fde
bw-ghapp[bot] Nov 5, 2026
2f7d901
SDK Update - com.bitwarden:sdk-android 4.0.0-10102-000c1765
bw-ghapp[bot] Nov 6, 2026
7ff669e
SDK Update - com.bitwarden:sdk-android 4.0.0-10105-408bf11b
bw-ghapp[bot] Nov 6, 2026
2d93098
SDK Update - com.bitwarden:sdk-android 4.0.0-10109-5b7fbb41
bw-ghapp[bot] Nov 6, 2026
44b1d32
SDK Update - com.bitwarden:sdk-android 4.0.0-10108-32e23008
bw-ghapp[bot] Nov 6, 2026
759ca2d
SDK Update - com.bitwarden:sdk-android 4.0.0-10124-a13b4c4e
bw-ghapp[bot] Nov 6, 2026
164c01a
Preserve httpAuthenticationEnabled through the network layer
bw-ghapp[bot] Nov 6, 2026
d85ed8d
SDK Update - com.bitwarden:sdk-android 4.0.0-10143-580a5c16
bw-ghapp[bot] Nov 9, 2026
2ba8724
SDK Update - com.bitwarden:sdk-android 4.0.0-10146-26a9beca
bw-ghapp[bot] Nov 9, 2026
65f34f2
SDK Update - com.bitwarden:sdk-android 4.0.0-10150-221632ac
bw-ghapp[bot] Nov 9, 2026
3d823bf
SDK Update - com.bitwarden:sdk-android 4.0.0-10155-2bf65d72
bw-ghapp[bot] Nov 9, 2026
d2e6c82
SDK Update - com.bitwarden:sdk-android 4.0.0-10159-1109561f
bw-ghapp[bot] Nov 9, 2026
f7ad6f2
SDK Update - com.bitwarden:sdk-android 4.0.0-10165-2a588111
bw-ghapp[bot] Nov 9, 2026
7f33916
SDK Update - com.bitwarden:sdk-android 4.0.0-10166-8a9566aa
bw-ghapp[bot] Nov 9, 2026
05f092b
SDK Update - com.bitwarden:sdk-android 4.0.0-10168-afc7f7f5
bw-ghapp[bot] Nov 9, 2026
c46f31e
SDK Update - com.bitwarden:sdk-android 4.0.0-10174-86bea6b5
bw-ghapp[bot] Nov 9, 2026
d6f8921
SDK Update - com.bitwarden:sdk-android 4.0.0-10176-839c6ca0
bw-ghapp[bot] Nov 9, 2026
e91cc18
SDK Update - com.bitwarden:sdk-android 4.0.0-10188-69bca2ad
bw-ghapp[bot] Nov 10, 2026
34904df
SDK Update - com.bitwarden:sdk-android 4.0.0-10189-c5111daf
bw-ghapp[bot] Nov 10, 2026
cea05bf
SDK Update - com.bitwarden:sdk-android 4.0.0-10193-5582920a
bw-ghapp[bot] Nov 10, 2026
ec94eb6
SDK Update - com.bitwarden:sdk-android 4.0.0-10197-c04bc697
bw-ghapp[bot] Nov 10, 2026
a1b4531
SDK Update - com.bitwarden:sdk-android 4.0.0-10198-56b5ff13
bw-ghapp[bot] Nov 10, 2026
76c5fb2
SDK Update - com.bitwarden:sdk-android 4.0.0-10203-8e40e22e
bw-ghapp[bot] Nov 10, 2026
9f9faa5
SDK Update - com.bitwarden:sdk-android 4.0.0-10208-5bcc1260
bw-ghapp[bot] Nov 10, 2026
6b80402
SDK Update - com.bitwarden:sdk-android 4.0.0-10214-15db6b9f
bw-ghapp[bot] Nov 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,16 @@ interface AuthDiskSource : AppIdProvider {
*/
fun storeEncryptedPin(userId: String, encryptedPin: String?)

/**
* Retrieves the number of digits in the PIN for the given [userId].
*/
fun getPinLength(userId: String): Int?

/**
* Stores the number of digits in the PIN for the given [userId].
*/
fun storePinLength(userId: String, pinLength: Int?)

/**
* Gets the organization keys for the given [userId] in the form of a mapping from organization
* ID to encrypted organization key.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ private const val MASTER_KEY_ENCRYPTION_PRIVATE_KEY = "encPrivateKey"
private const val PIN_PROTECTED_USER_KEY_KEY = "pinKeyEncryptedUserKey"
private const val PIN_PROTECTED_USER_KEY_KEY_ENVELOPE = "pinKeyEncryptedUserKeyEnvelope"
private const val ENCRYPTED_PIN_KEY = "protectedPin"
private const val PIN_LENGTH_KEY = "pinLength"
private const val ORGANIZATIONS_KEY = "organizations"
private const val ORGANIZATION_KEYS_KEY = "encOrgKeys"
private const val TWO_FACTOR_TOKEN_KEY = "twoFactorToken"
Expand All @@ -68,7 +69,7 @@ private const val V2_ENCRYPTED_MIGRATIONS_GRACE_PERIOD_START =
/**
* Primary implementation of [AuthDiskSource].
*/
@Suppress("TooManyFunctions")
@Suppress("TooManyFunctions", "LargeClass")
class AuthDiskSourceImpl(
encryptedSharedPreferences: SharedPreferences,
keystoreEncryptedPreferences: SharedPreferences,
Expand Down Expand Up @@ -194,6 +195,7 @@ class AuthDiskSourceImpl(
storeShowImportLogins(userId = userId, showImportLogins = null)
storeLastLockTimestamp(userId = userId, lastLockTimestamp = null)
storeEncryptedPin(userId = userId, encryptedPin = null)
storePinLength(userId = userId, pinLength = null)
storePinProtectedUserKey(userId = userId, pinProtectedUserKey = null)
storeEphemeralPinProtectedUserKeyEnvelope(
userId = userId,
Expand Down Expand Up @@ -472,6 +474,16 @@ class AuthDiskSourceImpl(
)
}

override fun getPinLength(userId: String): Int? =
getInt(key = PIN_LENGTH_KEY.appendIdentifier(userId))

override fun storePinLength(userId: String, pinLength: Int?) {
putInt(
key = PIN_LENGTH_KEY.appendIdentifier(userId),
value = pinLength,
)
}

override fun getOrganizationKeys(userId: String): Map<String, String>? =
getString(key = ORGANIZATION_KEYS_KEY.appendIdentifier(userId))
?.let { json.decodeFromStringOrNull(it) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ internal class UserLogoutManagerImpl(
val vaultTimeoutInMinutes = settingsDiskSource.getVaultTimeoutInMinutes(userId = userId)
val vaultTimeoutAction = settingsDiskSource.getVaultTimeoutAction(userId = userId)
val encryptedPin = authDiskSource.getEncryptedPin(userId = userId)
val pinLength = authDiskSource.getPinLength(userId = userId)
val pinProtectedUserKey = authDiskSource.getPinProtectedUserKey(userId = userId)
val ephemeralPinProtectedUserKeyEnvelope = authDiskSource
.getEphemeralPinProtectedUserKeyEnvelope(userId = userId)
Expand Down Expand Up @@ -116,6 +117,7 @@ internal class UserLogoutManagerImpl(
}
authDiskSource.apply {
storeEncryptedPin(userId = userId, encryptedPin = encryptedPin)
storePinLength(userId = userId, pinLength = pinLength)
storePinProtectedUserKey(userId = userId, pinProtectedUserKey = pinProtectedUserKey)
storeEphemeralPinProtectedUserKeyEnvelope(
userId = userId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,17 @@ internal class SdkStateBridge(
authDiskSource.storeEncryptedPin(userId = userId, encryptedPin = null)
}

override suspend fun setPinLength(value: UInt) {
authDiskSource.storePinLength(userId = userId, pinLength = value.toInt())
}

override suspend fun getPinLength(): UInt? =
authDiskSource.getPinLength(userId = userId)?.toUInt()

override suspend fun clearPinLength() {
authDiskSource.storePinLength(userId = userId, pinLength = null)
}

override suspend fun setV2UpgradeToken(value: V2UpgradeToken) {
authDiskSource.storeV2UpgradeToken(
userId = userId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,9 @@ class SettingsRepositoryImpl(
pinProtectedUserKeyEnvelope = null,
)
storePinProtectedUserKey(userId = userId, pinProtectedUserKey = null)
// The SDK only repopulates this on unlock when it is absent, so a stale value here
// would survive a later PIN change.
storePinLength(userId = userId, pinLength = null)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ private fun Login.toEncryptedNetworkLogin(): SyncResponseJson.Cipher.Login =
uri = null,
username = username,
fido2Credentials = fido2Credentials?.toNetworkFido2Credentials(),
httpAuthenticationEnabled = httpAuthenticationEnabled,
)

private fun List<Fido2Credential>.toNetworkFido2Credentials() =
Expand Down Expand Up @@ -534,6 +535,7 @@ fun SyncResponseJson.Cipher.Login.toSdkLogin(): Login =
totp = totp,
autofillOnPageLoad = shouldAutofillOnPageLoad,
fido2Credentials = fido2Credentials?.toSdkFido2Credentials(),
httpAuthenticationEnabled = httpAuthenticationEnabled,
)

private fun List<SyncResponseJson.Cipher.Fido2Credential>.toSdkFido2Credentials() =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ private fun VaultAddEditState.ViewState.Content.ItemType.toLoginView(
uris = it.uriList.toLoginUriView(),
totp = it.totp.orNullIfBlank(),
autofillOnPageLoad = common.originalCipher?.login?.autofillOnPageLoad,
// Not modeled in the UI; preserved so saving does not clear a value set elsewhere.
httpAuthenticationEnabled = common.originalCipher
?.login
?.httpAuthenticationEnabled,
fido2Credentials = common.originalCipher?.login?.fido2Credentials
.takeIf { _ -> it.fido2CredentialCreationDateTime != null },
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ class AuthDiskSourceTest {
biometricsKey = "1234-9876-0192",
)
authDiskSource.storeEncryptedPin(userId = userId, encryptedPin = "encryptedPin")
authDiskSource.storePinLength(userId = userId, pinLength = 4)
authDiskSource.storePinProtectedUserKey(
userId = userId,
pinProtectedUserKey = "pinProtectedUserKey",
Expand Down Expand Up @@ -415,6 +416,7 @@ class AuthDiskSourceTest {
assertNull(authDiskSource.getAuthenticatorSyncUnlockKey(userId = userId))
assertNull(authDiskSource.getShowImportLogins(userId = userId))
assertNull(authDiskSource.getEncryptedPin(userId = userId))
assertNull(authDiskSource.getPinLength(userId = userId))
assertNull(authDiskSource.getPinProtectedUserKey(userId = userId))
assertNull(authDiskSource.getPinProtectedUserKeyEnvelope(userId = userId))
assertNull(authDiskSource.getEphemeralPinProtectedUserKeyEnvelope(userId = userId))
Expand Down Expand Up @@ -1071,6 +1073,45 @@ class AuthDiskSourceTest {
)
}

@Test
fun `getPinLength should pull from SharedPreferences`() {
val pinLengthBaseKey = "bwPreferencesStorage:pinLength"
val mockUserId = "mockUserId"
val mockPinLength = 4
fakeSharedPreferences
.edit {
putInt(
"${pinLengthBaseKey}_$mockUserId",
mockPinLength,
)
}
val actual = authDiskSource.getPinLength(userId = mockUserId)
assertEquals(
mockPinLength,
actual,
)
}

@Test
fun `storePinLength should update SharedPreferences`() {
val pinLengthBaseKey = "bwPreferencesStorage:pinLength"
val mockUserId = "mockUserId"
val mockPinLength = 6
authDiskSource.storePinLength(
userId = mockUserId,
pinLength = mockPinLength,
)
val actual = fakeSharedPreferences
.getInt(
"${pinLengthBaseKey}_$mockUserId",
0,
)
assertEquals(
mockPinLength,
actual,
)
}

@Test
fun `getOrganizationKeys should pull from SharedPreferences`() {
val organizationKeysBaseKey = "bwPreferencesStorage:encOrgKeys"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class FakeAuthDiskSource : AuthDiskSource {
private val storedUserAutoUnlockKeys = mutableMapOf<String, String?>()
private val storedPinProtectedUserKeys = mutableMapOf<String, Pair<String?, Boolean>>()
private val storedEncryptedPins = mutableMapOf<String, String?>()
private val storedPinLengths = mutableMapOf<String, Int?>()
private val storedOrganizations =
mutableMapOf<String, List<SyncResponseJson.Profile.Organization>?>()
private val storedOrganizationKeys = mutableMapOf<String, Map<String, String>?>()
Expand Down Expand Up @@ -100,6 +101,7 @@ class FakeAuthDiskSource : AuthDiskSource {
storedEphemeralPinProtectedUserKeyEnvelopes.remove(userId)
storedPersistentPinProtectedUserKeyEnvelopes.remove(userId)
storedEncryptedPins.remove(userId)
storedPinLengths.remove(userId)
storedPinProtectedUserKeys.remove(userId)
storedV2UpgradeTokens.remove(userId)
storedUserKeyIds.remove(userId)
Expand Down Expand Up @@ -245,6 +247,12 @@ class FakeAuthDiskSource : AuthDiskSource {
storedEncryptedPins[userId] = encryptedPin
}

override fun getPinLength(userId: String): Int? = storedPinLengths[userId]

override fun storePinLength(userId: String, pinLength: Int?) {
storedPinLengths[userId] = pinLength
}

override fun getOrganizationKeys(
userId: String,
): Map<String, String>? = storedOrganizationKeys[userId]
Expand Down Expand Up @@ -523,6 +531,13 @@ class FakeAuthDiskSource : AuthDiskSource {
assertEquals(encryptedPin, storedEncryptedPins[userId])
}

/**
* Assert that the [pinLength] was stored successfully using the [userId].
*/
fun assertPinLength(userId: String, pinLength: Int?) {
assertEquals(pinLength, storedPinLengths[userId])
}

/**
* Assert that the [pinProtectedUserKey] was stored successfully using the [userId].
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ class UserLogoutManagerTest {
val pinProtectedUserKey = "pinProtectedUserKey"
val pinProtectedUserKeyEnvelope = "pinProtectedUserKeyEnvelope"
val encryptedPin = "encryptedPin"
val pinLength = 4

every {
settingsDiskSource.getVaultTimeoutInMinutes(userId = userId)
Expand Down Expand Up @@ -189,6 +190,8 @@ class UserLogoutManagerTest {
every {
authDiskSource.storeEncryptedPin(userId = userId, encryptedPin = encryptedPin)
} just runs
every { authDiskSource.getPinLength(userId = userId) } returns pinLength
every { authDiskSource.storePinLength(userId = userId, pinLength = pinLength) } just runs

userLogoutManager.softLogout(userId = userId, reason = LogoutReason.Timeout)

Expand Down Expand Up @@ -224,6 +227,7 @@ class UserLogoutManagerTest {
pinProtectedUserKey = pinProtectedUserKey,
)
authDiskSource.storeEncryptedPin(userId = userId, encryptedPin = encryptedPin)
authDiskSource.storePinLength(userId = userId, pinLength = pinLength)
}
}

Expand All @@ -235,6 +239,7 @@ class UserLogoutManagerTest {
val pinProtectedUserKey = "pinProtectedUserKey"
val pinProtectedUserKeyEnvelope = "pinProtectedUserKeyEnvelope"
val encryptedPin = "encryptedPin"
val pinLength = 4

every {
settingsDiskSource.getVaultTimeoutInMinutes(userId = userId)
Expand Down Expand Up @@ -271,6 +276,8 @@ class UserLogoutManagerTest {
every {
authDiskSource.storeEncryptedPin(userId = userId, encryptedPin = encryptedPin)
} just runs
every { authDiskSource.getPinLength(userId = userId) } returns pinLength
every { authDiskSource.storePinLength(userId = userId, pinLength = pinLength) } just runs

userLogoutManager.softLogout(userId = userId, reason = LogoutReason.Timeout)

Expand All @@ -296,6 +303,7 @@ class UserLogoutManagerTest {
pinProtectedUserKey = pinProtectedUserKey,
)
authDiskSource.storeEncryptedPin(userId = userId, encryptedPin = encryptedPin)
authDiskSource.storePinLength(userId = userId, pinLength = pinLength)
}
}

Expand Down Expand Up @@ -400,7 +408,9 @@ class UserLogoutManagerTest {
every {
authDiskSource.getPersistentPinProtectedUserKeyEnvelope(userId = userId)
} returns "pinProtectedUserKeyEnvelope"
every { authDiskSource.getPinLength(userId = userId) } returns 4
every { authDiskSource.storeEncryptedPin(userId = userId, encryptedPin = any()) } just runs
every { authDiskSource.storePinLength(userId = userId, pinLength = any()) } just runs
every {
authDiskSource.storePinProtectedUserKey(userId = userId, pinProtectedUserKey = any())
} just runs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,31 @@ class SdkStateBridgeTest {
authDiskSource.assertEncryptedPin(userId = USER_ID, encryptedPin = null)
}

@Test
fun `setPinLength should store the pin length`() = runTest {
stateBridge.setPinLength(value = 4u)

authDiskSource.assertPinLength(userId = USER_ID, pinLength = 4)
}

@Test
fun `getPinLength should return the stored pin length`() = runTest {
assertNull(stateBridge.getPinLength())

authDiskSource.storePinLength(userId = USER_ID, pinLength = 4)

assertEquals(4u, stateBridge.getPinLength())
}

@Test
fun `clearPinLength should clear the pin length`() = runTest {
authDiskSource.storePinLength(userId = USER_ID, pinLength = 4)

stateBridge.clearPinLength()

authDiskSource.assertPinLength(userId = USER_ID, pinLength = null)
}

@Test
fun `setV2UpgradeToken should store the token as a V2UpgradeTokenJson`() = runTest {
stateBridge.setV2UpgradeToken(value = V2_UPGRADE_TOKEN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,7 @@ class SettingsRepositoryTest {
userId = USER_ID,
pinProtectedUserKeyEnvelope = "pinProtectedUserKeyEnvelope",
)
storePinLength(userId = USER_ID, pinLength = 4)
}

settingsRepository.clearUnlockPin()
Expand All @@ -1229,6 +1230,7 @@ class SettingsRepositoryTest {
userId = USER_ID,
pinProtectedUserKeyEnvelope = null,
)
assertPinLength(userId = USER_ID, pinLength = null)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ private const val CIPHER_JSON = """
"password": "mockPassword-1",
"passwordRevisionDate": "2023-10-27T12:00:00.000Z",
"autofillOnPageLoad": false,
"httpAuthenticationEnabled": false,
"uri": "mockUri-1",
"username": "mockUsername-1",
"fido2Credentials": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ fun createMockSdkLogin(number: Int, clock: Clock): Login =
number = number,
clock = clock,
),
httpAuthenticationEnabled = false,
)

/**
Expand Down
Loading
Loading