mirror of
https://github.com/bitwarden/android.git
synced 2026-03-22 20:41:29 -05:00
[PM-3553] Add SimpleLogin self-hosted alias feature flag (#4715)
This commit is contained in:
@@ -43,6 +43,7 @@ sealed class FlagKey<out T : Any> {
|
||||
SingleTapPasskeyCreation,
|
||||
SingleTapPasskeyAuthentication,
|
||||
AnonAddySelfHostAlias,
|
||||
SimpleLoginSelfHostAlias,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -212,6 +213,15 @@ sealed class FlagKey<out T : Any> {
|
||||
override val isRemotelyConfigured: Boolean = true
|
||||
}
|
||||
|
||||
/**
|
||||
* Data object holding the feature flag key to enable SimpleLogin self-host alias generation.
|
||||
*/
|
||||
data object SimpleLoginSelfHostAlias : FlagKey<Boolean>() {
|
||||
override val keyName: String = "simple-login-self-host-alias"
|
||||
override val defaultValue: Boolean = false
|
||||
override val isRemotelyConfigured: Boolean = true
|
||||
}
|
||||
|
||||
//region Dummy keys for testing
|
||||
/**
|
||||
* Data object holding the key for a [Boolean] flag to be used in tests.
|
||||
|
||||
@@ -42,6 +42,7 @@ fun <T : Any> FlagKey<T>.ListItemContent(
|
||||
FlagKey.SingleTapPasskeyCreation,
|
||||
FlagKey.SingleTapPasskeyAuthentication,
|
||||
FlagKey.AnonAddySelfHostAlias,
|
||||
FlagKey.SimpleLoginSelfHostAlias,
|
||||
-> BooleanFlagItem(
|
||||
label = flagKey.getDisplayLabel(),
|
||||
key = flagKey as FlagKey<Boolean>,
|
||||
@@ -99,4 +100,5 @@ private fun <T : Any> FlagKey<T>.getDisplayLabel(): String = when (this) {
|
||||
FlagKey.SingleTapPasskeyAuthentication ->
|
||||
stringResource(R.string.single_tap_passkey_authentication)
|
||||
FlagKey.AnonAddySelfHostAlias -> stringResource(R.string.anon_addy_self_hosted_aliases)
|
||||
FlagKey.SimpleLoginSelfHostAlias -> stringResource(R.string.simple_login_self_hosted_aliases)
|
||||
}
|
||||
|
||||
@@ -21,11 +21,12 @@
|
||||
<string name="restart_onboarding_carousel">Show Onboarding Carousel</string>
|
||||
<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>
|
||||
<string name="app_review_prompt">App Review Prompt</string>
|
||||
<string name="cipher_key_encryption">Cipher Key Encryption</string>">
|
||||
<string name="new_device_permanent_dismiss">New device notice permanent dismiss</string>">
|
||||
<string name="new_device_temporary_dismiss">New device notice temporary dismiss</string>">
|
||||
<string name="cipher_key_encryption">Cipher Key Encryption</string>
|
||||
<string name="new_device_permanent_dismiss">New device notice permanent dismiss</string>
|
||||
<string name="new_device_temporary_dismiss">New device notice temporary dismiss</string>
|
||||
<string name="ignore_environment_check">Ignore environment check</string>">
|
||||
<string name="reset_coach_mark_tour_status">Reset all coach mark tours</string>
|
||||
<string name="anon_addy_self_hosted_aliases">AnonAddy self-hosted aliases</string>
|
||||
<string name="simple_login_self_hosted_aliases">SimpleLogin self-hosted aliases</string>
|
||||
<!-- /Debug Menu -->
|
||||
</resources>
|
||||
|
||||
@@ -102,6 +102,7 @@ class FlagKeyTest {
|
||||
FlagKey.SingleTapPasskeyCreation,
|
||||
FlagKey.SingleTapPasskeyAuthentication,
|
||||
FlagKey.AnonAddySelfHostAlias,
|
||||
FlagKey.SimpleLoginSelfHostAlias,
|
||||
).all {
|
||||
!it.defaultValue
|
||||
},
|
||||
@@ -131,6 +132,7 @@ class FlagKeyTest {
|
||||
FlagKey.SingleTapPasskeyAuthentication,
|
||||
FlagKey.MutualTls,
|
||||
FlagKey.AnonAddySelfHostAlias,
|
||||
FlagKey.SimpleLoginSelfHostAlias,
|
||||
).all {
|
||||
it.isRemotelyConfigured
|
||||
},
|
||||
|
||||
@@ -135,6 +135,7 @@ private val DEFAULT_MAP_VALUE: Map<FlagKey<Any>, Any> = mapOf(
|
||||
FlagKey.SingleTapPasskeyCreation to true,
|
||||
FlagKey.SingleTapPasskeyAuthentication to true,
|
||||
FlagKey.AnonAddySelfHostAlias to true,
|
||||
FlagKey.SimpleLoginSelfHostAlias to true,
|
||||
)
|
||||
|
||||
private val UPDATED_MAP_VALUE: Map<FlagKey<Any>, Any> = mapOf(
|
||||
@@ -155,6 +156,7 @@ private val UPDATED_MAP_VALUE: Map<FlagKey<Any>, Any> = mapOf(
|
||||
FlagKey.SingleTapPasskeyCreation to false,
|
||||
FlagKey.SingleTapPasskeyAuthentication to false,
|
||||
FlagKey.AnonAddySelfHostAlias to false,
|
||||
FlagKey.SimpleLoginSelfHostAlias to false,
|
||||
)
|
||||
|
||||
private val DEFAULT_STATE = DebugMenuState(
|
||||
|
||||
Reference in New Issue
Block a user