mirror of
https://github.com/bitwarden/android.git
synced 2026-10-22 02:53:19 -05:00
[PM-33393] fix: TOTP auth key can be shown by users without permission [bug-factory poc] (#7487)
Co-authored-by: bug-factory <bug-factory@bitwarden.com>
This commit is contained in:
1 parent
cb88abf4d5
commit
1470154cf3
2 files changed
+22
-6
No files matched your search
+10
@@ -366,6 +366,16 @@ private fun TotpRow(
|
||||
onTotpSetupClick: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
if (!canViewTotp && totpKey != null) {
|
||||
BitwardenHiddenPasswordField(
|
||||
label = stringResource(id = BitwardenString.authenticator_key),
|
||||
value = totpKey,
|
||||
passwordFieldTestTag = "LoginTotpEntry",
|
||||
cardStyle = CardStyle.Full,
|
||||
modifier = modifier.fillMaxWidth(),
|
||||
)
|
||||
return
|
||||
}
|
||||
BitwardenPasswordField(
|
||||
label = stringResource(id = BitwardenString.authenticator_key),
|
||||
value = totpKey.orEmpty(),
|
||||
|
||||
+12
-6
@@ -1333,13 +1333,19 @@ class VaultAddEditScreenTest : BitwardenComposeTest() {
|
||||
}
|
||||
|
||||
composeTestRule
|
||||
.onNodeWithTextAfterScroll(text = "Set up authenticator key")
|
||||
.assertIsDisplayed()
|
||||
.onNodeWithTextAfterScroll(text = "Authenticator key")
|
||||
.assertTextEquals("Authenticator key", "••••••••")
|
||||
.assertIsNotEnabled()
|
||||
|
||||
composeTestRule.assertScrollableNodeDoesNotExist("Delete")
|
||||
composeTestRule.assertScrollableNodeDoesNotExist("Copy TOTP")
|
||||
composeTestRule.assertScrollableNodeDoesNotExist("Camera")
|
||||
composeTestRule
|
||||
.onNodeWithContentDescription("Show")
|
||||
.assertDoesNotExist()
|
||||
composeTestRule
|
||||
.onNodeWithContentDescription("Copy TOTP")
|
||||
.assertDoesNotExist()
|
||||
composeTestRule
|
||||
.onNodeWithContentDescription("Delete")
|
||||
.assertDoesNotExist()
|
||||
composeTestRule.assertScrollableNodeDoesNotExist("Set up authenticator key")
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in new issue
Block a user