diff --git a/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/model/FlagKey.kt b/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/model/FlagKey.kt index 88ccd5f7465..861711879d1 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/model/FlagKey.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/model/FlagKey.kt @@ -31,6 +31,7 @@ sealed class FlagKey { OnboardingFlow, OnboardingCarousel, ImportLoginsFlow, + SshKeyCipherItems, ) } } @@ -80,6 +81,15 @@ sealed class FlagKey { override val isRemotelyConfigured: Boolean = false } + /** + * Data object holding the feature flag key for the SSH key cipher items feature. + */ + data object SshKeyCipherItems : FlagKey() { + override val keyName: String = "ssh-key-vault-item" + override val defaultValue: Boolean = false + override val isRemotelyConfigured: Boolean = true + } + /** * Data object holding the key for a [Boolean] flag to be used in tests. */ diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/debugmenu/components/FeatureFlagListItems.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/debugmenu/components/FeatureFlagListItems.kt index 6d264cb9281..59b932eaac1 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/debugmenu/components/FeatureFlagListItems.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/debugmenu/components/FeatureFlagListItems.kt @@ -27,6 +27,7 @@ fun FlagKey.ListItemContent( FlagKey.OnboardingCarousel, FlagKey.OnboardingFlow, FlagKey.ImportLoginsFlow, + FlagKey.SshKeyCipherItems, -> BooleanFlagItem( label = flagKey.getDisplayLabel(), key = flagKey as FlagKey, @@ -69,4 +70,5 @@ private fun FlagKey.getDisplayLabel(): String = when (this) { FlagKey.OnboardingCarousel -> stringResource(R.string.onboarding_carousel) FlagKey.OnboardingFlow -> stringResource(R.string.onboarding_flow) FlagKey.ImportLoginsFlow -> stringResource(R.string.import_logins_flow) + FlagKey.SshKeyCipherItems -> stringResource(R.string.ssh_key_cipher_item_types) } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index eb62ccf511e..f6e39894821 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1061,4 +1061,5 @@ Do you want to switch to this account? Save the exported file This is not a recognized Bitwarden server. You may need to check with your provider or update your server. Syncing logins... + SSH Key Cipher Item Types diff --git a/app/src/test/java/com/x8bit/bitwarden/data/platform/manager/FlagKeyTest.kt b/app/src/test/java/com/x8bit/bitwarden/data/platform/manager/FlagKeyTest.kt index 350b6d576e9..6be73357a90 100644 --- a/app/src/test/java/com/x8bit/bitwarden/data/platform/manager/FlagKeyTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/data/platform/manager/FlagKeyTest.kt @@ -30,4 +30,9 @@ class FlagKeyTest { fun `ImportLoginsFlow default value should be false`() { assertFalse(FlagKey.ImportLoginsFlow.defaultValue) } + + @Test + fun `SshKeyCipherItems default value should be false`() { + assertFalse(FlagKey.SshKeyCipherItems.defaultValue) + } } diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/debugmenu/DebugMenuViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/debugmenu/DebugMenuViewModelTest.kt index da866387d46..68e5096231d 100644 --- a/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/debugmenu/DebugMenuViewModelTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/debugmenu/DebugMenuViewModelTest.kt @@ -112,6 +112,7 @@ private val DEFAULT_MAP_VALUE: Map, Any> = mapOf( FlagKey.OnboardingCarousel to true, FlagKey.OnboardingFlow to true, FlagKey.ImportLoginsFlow to true, + FlagKey.SshKeyCipherItems to true, ) private val UPDATED_MAP_VALUE: Map, Any> = mapOf( @@ -120,6 +121,7 @@ private val UPDATED_MAP_VALUE: Map, Any> = mapOf( FlagKey.OnboardingCarousel to true, FlagKey.OnboardingFlow to false, FlagKey.ImportLoginsFlow to false, + FlagKey.SshKeyCipherItems to false, ) private val DEFAULT_STATE = DebugMenuState(