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 60d81bd42..59e915129 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 @@ -33,6 +33,8 @@ sealed class FlagKey { ImportLoginsFlow, SshKeyCipherItems, VerifiedSsoDomainEndpoint, + CredentialExchangeProtocolImport, + CredentialExchangeProtocolExport, ) } } @@ -90,6 +92,7 @@ sealed class FlagKey { override val defaultValue: Boolean = false override val isRemotelyConfigured: Boolean = true } + /** * Data object holding the feature flag key for the new verified SSO domain endpoint feature. */ @@ -99,6 +102,27 @@ sealed class FlagKey { override val isRemotelyConfigured: Boolean = true } + /** + * Data object holding hte feature flag key for the Credential Exchange Protocol (CXP) import + * feature. + */ + data object CredentialExchangeProtocolImport : FlagKey() { + override val keyName: String = "cxp-import-mobile" + override val defaultValue: Boolean = false + override val isRemotelyConfigured: Boolean = true + } + + /** + * Data object holding the feature flag key for the Credential Exchange Protocol (CXP) export + * feature. + */ + data object CredentialExchangeProtocolExport : FlagKey() { + override val keyName: String = "cxp-export-mobile" + 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. */ @@ -126,4 +150,5 @@ sealed class FlagKey { override val defaultValue: String = "defaultValue" override val isRemotelyConfigured: Boolean = true } + //endregion Dummy keys for testing } 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 98e7342db..b55c1f316 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 @@ -29,6 +29,8 @@ fun FlagKey.ListItemContent( FlagKey.ImportLoginsFlow, FlagKey.SshKeyCipherItems, FlagKey.VerifiedSsoDomainEndpoint, + FlagKey.CredentialExchangeProtocolImport, + FlagKey.CredentialExchangeProtocolExport, -> BooleanFlagItem( label = flagKey.getDisplayLabel(), key = flagKey as FlagKey, @@ -73,4 +75,6 @@ private fun FlagKey.getDisplayLabel(): String = when (this) { FlagKey.ImportLoginsFlow -> stringResource(R.string.import_logins_flow) FlagKey.SshKeyCipherItems -> stringResource(R.string.ssh_key_cipher_item_types) FlagKey.VerifiedSsoDomainEndpoint -> stringResource(R.string.verified_sso_domain_verified) + FlagKey.CredentialExchangeProtocolImport -> stringResource(R.string.cxp_import) + FlagKey.CredentialExchangeProtocolExport -> stringResource(R.string.cxp_export) } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 426bcbcce..001900acd 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1095,4 +1095,6 @@ Do you want to switch to this account? Copy email Copy phone number Copy address + CXP Import + CXP Export 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 3bda50b54..c340bc400 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 @@ -114,6 +114,8 @@ private val DEFAULT_MAP_VALUE: Map, Any> = mapOf( FlagKey.ImportLoginsFlow to true, FlagKey.SshKeyCipherItems to true, FlagKey.VerifiedSsoDomainEndpoint to true, + FlagKey.CredentialExchangeProtocolImport to true, + FlagKey.CredentialExchangeProtocolExport to true, ) private val UPDATED_MAP_VALUE: Map, Any> = mapOf( @@ -124,6 +126,8 @@ private val UPDATED_MAP_VALUE: Map, Any> = mapOf( FlagKey.ImportLoginsFlow to false, FlagKey.SshKeyCipherItems to false, FlagKey.VerifiedSsoDomainEndpoint to false, + FlagKey.CredentialExchangeProtocolImport to false, + FlagKey.CredentialExchangeProtocolExport to false, ) private val DEFAULT_STATE = DebugMenuState(