mirror of
https://github.com/bitwarden/android.git
synced 2026-03-23 14:50:41 -05:00
[PM-24575] Add feature flag for AEAD enrollment on key rotation (#5665)
This commit is contained in:
@@ -31,6 +31,7 @@ fun <T : Any> FlagKey<T>.ListItemContent(
|
||||
FlagKey.CipherKeyEncryption,
|
||||
FlagKey.UserManagedPrivilegedApps,
|
||||
FlagKey.RemoveCardPolicy,
|
||||
FlagKey.EnrollAeadOnKeyRotation,
|
||||
-> {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
BooleanFlagItem(
|
||||
@@ -83,4 +84,8 @@ private fun <T : Any> FlagKey<T>.getDisplayLabel(): String = when (this) {
|
||||
FlagKey.BitwardenAuthenticationEnabled -> {
|
||||
stringResource(BitwardenString.bitwarden_authentication_enabled)
|
||||
}
|
||||
|
||||
FlagKey.EnrollAeadOnKeyRotation -> {
|
||||
stringResource(BitwardenString.enroll_aead_on_key_rotation)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ fun <T : Any> FlagKey<T>.ListItemContent(
|
||||
FlagKey.CredentialExchangeProtocolImport,
|
||||
FlagKey.RemoveCardPolicy,
|
||||
FlagKey.UserManagedPrivilegedApps,
|
||||
FlagKey.EnrollAeadOnKeyRotation,
|
||||
-> BooleanFlagItem(
|
||||
label = flagKey.getDisplayLabel(),
|
||||
key = flagKey as FlagKey<Boolean>,
|
||||
@@ -76,4 +77,8 @@ private fun <T : Any> FlagKey<T>.getDisplayLabel(): String = when (this) {
|
||||
FlagKey.BitwardenAuthenticationEnabled -> {
|
||||
stringResource(BitwardenString.bitwarden_authentication_enabled)
|
||||
}
|
||||
|
||||
FlagKey.EnrollAeadOnKeyRotation -> {
|
||||
stringResource(BitwardenString.enroll_aead_on_key_rotation)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,6 +89,14 @@ sealed class FlagKey<out T : Any> {
|
||||
override val defaultValue: Boolean = false
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents the feature flag to enable the enrollment of AEAD on key rotation.
|
||||
*/
|
||||
data object EnrollAeadOnKeyRotation : FlagKey<Boolean>() {
|
||||
override val keyName: String = "enroll-aead-on-key-rotation"
|
||||
override val defaultValue: Boolean = false
|
||||
}
|
||||
|
||||
//region Dummy keys for testing
|
||||
/**
|
||||
* Data object holding the key for a [Boolean] flag to be used in tests.
|
||||
|
||||
@@ -32,6 +32,10 @@ class FlagKeyTest {
|
||||
FlagKey.BitwardenAuthenticationEnabled.keyName,
|
||||
"bitwarden-authentication-enabled",
|
||||
)
|
||||
assertEquals(
|
||||
FlagKey.EnrollAeadOnKeyRotation.keyName,
|
||||
"enroll-aead-on-key-rotation",
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -44,6 +48,7 @@ class FlagKeyTest {
|
||||
FlagKey.UserManagedPrivilegedApps,
|
||||
FlagKey.RemoveCardPolicy,
|
||||
FlagKey.BitwardenAuthenticationEnabled,
|
||||
FlagKey.EnrollAeadOnKeyRotation,
|
||||
).all {
|
||||
!it.defaultValue
|
||||
},
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
<string name="import_format_label_2fas_json">2FAS (no password)</string>
|
||||
<string name="import_format_label_lastpass_json">LastPass (.json)</string>
|
||||
<string name="import_format_label_aegis_json">Aegis (.json)</string>
|
||||
<string name="enroll_aead_on_key_rotation">Enroll AEAD on key rotation</string>
|
||||
|
||||
<!-- endregion Debug Menu -->
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user