Skip to content

Commit 4f46217

Browse files
PM-26059: Remove CipherKeyEncryption feature flag
1 parent aa23d5e commit 4f46217

6 files changed

Lines changed: 5 additions & 25 deletions

File tree

app/src/main/kotlin/com/x8bit/bitwarden/data/platform/manager/FeatureFlagManagerImpl.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ class FeatureFlagManagerImpl(
1919

2020
override val sdkFeatureFlags: Map<String, Boolean>
2121
get() = mapOf(
22-
CIPHER_KEY_ENCRYPTION_KEY to
23-
getCipherKeyEncryptionFlagState(),
22+
CIPHER_KEY_ENCRYPTION_KEY to getCipherKeyEncryptionFlagState(),
2423
)
2524

2625
override fun <T : Any> getFeatureFlagFlow(key: FlagKey<T>): Flow<T> =
@@ -48,11 +47,11 @@ class FeatureFlagManagerImpl(
4847
* Get the computed value of the cipher key encryption flag based on server version and
4948
* remote flag.
5049
*/
51-
private fun getCipherKeyEncryptionFlagState() =
50+
private fun getCipherKeyEncryptionFlagState(): Boolean =
5251
isServerVersionAtLeast(
5352
serverConfigRepository.serverConfigStateFlow.value,
5453
CIPHER_KEY_ENC_MIN_SERVER_VERSION,
55-
) && getFeatureFlag(FlagKey.CipherKeyEncryption)
54+
)
5655
}
5756

5857
/**

app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/debugmenu/DebugMenuViewModelTest.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,9 @@ class DebugMenuViewModelTest : BaseViewModelTest() {
110110
@Test
111111
fun `handleUpdateFeatureFlag should update the feature flag via the repository`() {
112112
val viewModel = createViewModel()
113-
viewModel.trySendAction(
114-
DebugMenuAction.UpdateFeatureFlag(FlagKey.CipherKeyEncryption, false),
115-
)
113+
viewModel.trySendAction(DebugMenuAction.UpdateFeatureFlag(FlagKey.DummyBoolean, false))
116114
verify(exactly = 1) {
117-
mockDebugMenuRepository.updateFeatureFlag(FlagKey.CipherKeyEncryption, false)
115+
mockDebugMenuRepository.updateFeatureFlag(FlagKey.DummyBoolean, false)
118116
}
119117
}
120118

core/src/main/kotlin/com/bitwarden/core/data/manager/model/FlagKey.kt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ sealed class FlagKey<out T : Any> {
3333
CredentialExchangeProtocolImport,
3434
CredentialExchangeProtocolExport,
3535
ForceUpdateKdfSettings,
36-
CipherKeyEncryption,
3736
NoLogoutOnKdfChange,
3837
MigrateMyVaultToMyItems,
3938
ArchiveItems,
@@ -60,14 +59,6 @@ sealed class FlagKey<out T : Any> {
6059
override val defaultValue: Boolean = false
6160
}
6261

63-
/**
64-
* Data object holding the feature flag key for the Cipher Key Encryption feature.
65-
*/
66-
data object CipherKeyEncryption : FlagKey<Boolean>() {
67-
override val keyName: String = "cipher-key-encryption"
68-
override val defaultValue: Boolean = false
69-
}
70-
7162
/**
7263
* Indicates the state of Bitwarden authentication.
7364
*/

core/src/test/kotlin/com/bitwarden/core/data/manager/model/FlagKeyTest.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ class FlagKeyTest {
1616
FlagKey.CredentialExchangeProtocolExport.keyName,
1717
"cxp-export-mobile",
1818
)
19-
assertEquals(
20-
FlagKey.CipherKeyEncryption.keyName,
21-
"cipher-key-encryption",
22-
)
2319
assertEquals(
2420
FlagKey.BitwardenAuthenticationEnabled.keyName,
2521
"bitwarden-authentication-enabled",
@@ -48,7 +44,6 @@ class FlagKeyTest {
4844
listOf(
4945
FlagKey.CredentialExchangeProtocolImport,
5046
FlagKey.CredentialExchangeProtocolExport,
51-
FlagKey.CipherKeyEncryption,
5247
FlagKey.BitwardenAuthenticationEnabled,
5348
FlagKey.ForceUpdateKdfSettings,
5449
FlagKey.MigrateMyVaultToMyItems,

ui/src/main/kotlin/com/bitwarden/ui/platform/components/debug/FeatureFlagListItems.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ fun <T : Any> FlagKey<T>.ListItemContent(
2626
FlagKey.BitwardenAuthenticationEnabled,
2727
FlagKey.CredentialExchangeProtocolImport,
2828
FlagKey.CredentialExchangeProtocolExport,
29-
FlagKey.CipherKeyEncryption,
3029
FlagKey.ForceUpdateKdfSettings,
3130
FlagKey.NoLogoutOnKdfChange,
3231
FlagKey.MigrateMyVaultToMyItems,
@@ -75,7 +74,6 @@ private fun <T : Any> FlagKey<T>.getDisplayLabel(): String = when (this) {
7574

7675
FlagKey.CredentialExchangeProtocolImport -> stringResource(BitwardenString.cxp_import)
7776
FlagKey.CredentialExchangeProtocolExport -> stringResource(BitwardenString.cxp_export)
78-
FlagKey.CipherKeyEncryption -> stringResource(BitwardenString.cipher_key_encryption)
7977
FlagKey.ForceUpdateKdfSettings -> stringResource(BitwardenString.force_update_kdf_settings)
8078
FlagKey.NoLogoutOnKdfChange -> stringResource(BitwardenString.avoid_logout_on_kdf_change)
8179
FlagKey.BitwardenAuthenticationEnabled -> {

ui/src/main/res/values/strings_non_localized.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
<string name="restart_onboarding_details">This will reset the onboarding status for the current user, if available. After clicking the button you will immediately be redirected to the onboarding flow. Onboarding flag must be enabled.</string>
2727
<string name="restart_onboarding_carousel">Show Onboarding Carousel</string>
2828
<string name="restart_onboarding_carousel_details">This will force the change to app state which will cause the first time carousel to show. The carousel will continue to show for any \"new\" account until a login is completed. May need to exit debug menu manually.</string>
29-
<string name="cipher_key_encryption">Cipher Key Encryption</string>
3029
<string name="reset_coach_mark_tour_status">Reset all coach mark tours</string>
3130
<string name="generate_crash">Generate crash</string>
3231
<string name="generate_error_report">Generate error report</string>

0 commit comments

Comments
 (0)