mirror of
https://github.com/bitwarden/android.git
synced 2025-02-17 20:40:00 +03:00
[PM-15064] Add feature flags for CXP import and export
This commit introduces two new feature flags: - `cxp-import-mobile`: Enables Credential Exchange Protocol (CXP) import functionality. - `cxp-export-mobile`: Enables Credential Exchange Protocol (CXP) export functionality. These flags are added to the debug menu for testing and can be remotely configured.
This commit is contained in:
parent
d418444dc0
commit
f675eb7388
4 changed files with 35 additions and 0 deletions
|
@ -33,6 +33,8 @@ sealed class FlagKey<out T : Any> {
|
||||||
ImportLoginsFlow,
|
ImportLoginsFlow,
|
||||||
SshKeyCipherItems,
|
SshKeyCipherItems,
|
||||||
VerifiedSsoDomainEndpoint,
|
VerifiedSsoDomainEndpoint,
|
||||||
|
CredentialExchangeProtocolImport,
|
||||||
|
CredentialExchangeProtocolExport,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,6 +92,7 @@ sealed class FlagKey<out T : Any> {
|
||||||
override val defaultValue: Boolean = false
|
override val defaultValue: Boolean = false
|
||||||
override val isRemotelyConfigured: Boolean = true
|
override val isRemotelyConfigured: Boolean = true
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data object holding the feature flag key for the new verified SSO domain endpoint feature.
|
* Data object holding the feature flag key for the new verified SSO domain endpoint feature.
|
||||||
*/
|
*/
|
||||||
|
@ -99,6 +102,27 @@ sealed class FlagKey<out T : Any> {
|
||||||
override val isRemotelyConfigured: Boolean = true
|
override val isRemotelyConfigured: Boolean = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Data object holding hte feature flag key for the Credential Exchange Protocol (CXP) import
|
||||||
|
* feature.
|
||||||
|
*/
|
||||||
|
data object CredentialExchangeProtocolImport : FlagKey<Boolean>() {
|
||||||
|
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<Boolean>() {
|
||||||
|
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.
|
* Data object holding the key for a [Boolean] flag to be used in tests.
|
||||||
*/
|
*/
|
||||||
|
@ -126,4 +150,5 @@ sealed class FlagKey<out T : Any> {
|
||||||
override val defaultValue: String = "defaultValue"
|
override val defaultValue: String = "defaultValue"
|
||||||
override val isRemotelyConfigured: Boolean = true
|
override val isRemotelyConfigured: Boolean = true
|
||||||
}
|
}
|
||||||
|
//endregion Dummy keys for testing
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,8 @@ fun <T : Any> FlagKey<T>.ListItemContent(
|
||||||
FlagKey.ImportLoginsFlow,
|
FlagKey.ImportLoginsFlow,
|
||||||
FlagKey.SshKeyCipherItems,
|
FlagKey.SshKeyCipherItems,
|
||||||
FlagKey.VerifiedSsoDomainEndpoint,
|
FlagKey.VerifiedSsoDomainEndpoint,
|
||||||
|
FlagKey.CredentialExchangeProtocolImport,
|
||||||
|
FlagKey.CredentialExchangeProtocolExport,
|
||||||
-> BooleanFlagItem(
|
-> BooleanFlagItem(
|
||||||
label = flagKey.getDisplayLabel(),
|
label = flagKey.getDisplayLabel(),
|
||||||
key = flagKey as FlagKey<Boolean>,
|
key = flagKey as FlagKey<Boolean>,
|
||||||
|
@ -73,4 +75,6 @@ private fun <T : Any> FlagKey<T>.getDisplayLabel(): String = when (this) {
|
||||||
FlagKey.ImportLoginsFlow -> stringResource(R.string.import_logins_flow)
|
FlagKey.ImportLoginsFlow -> stringResource(R.string.import_logins_flow)
|
||||||
FlagKey.SshKeyCipherItems -> stringResource(R.string.ssh_key_cipher_item_types)
|
FlagKey.SshKeyCipherItems -> stringResource(R.string.ssh_key_cipher_item_types)
|
||||||
FlagKey.VerifiedSsoDomainEndpoint -> stringResource(R.string.verified_sso_domain_verified)
|
FlagKey.VerifiedSsoDomainEndpoint -> stringResource(R.string.verified_sso_domain_verified)
|
||||||
|
FlagKey.CredentialExchangeProtocolImport -> stringResource(R.string.cxp_import)
|
||||||
|
FlagKey.CredentialExchangeProtocolExport -> stringResource(R.string.cxp_export)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1095,4 +1095,6 @@ Do you want to switch to this account?</string>
|
||||||
<string name="copy_email">Copy email</string>
|
<string name="copy_email">Copy email</string>
|
||||||
<string name="copy_phone">Copy phone number</string>
|
<string name="copy_phone">Copy phone number</string>
|
||||||
<string name="copy_address">Copy address</string>
|
<string name="copy_address">Copy address</string>
|
||||||
|
<string name="cxp_import">CXP Import</string>
|
||||||
|
<string name="cxp_export">CXP Export</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -114,6 +114,8 @@ private val DEFAULT_MAP_VALUE: Map<FlagKey<Any>, Any> = mapOf(
|
||||||
FlagKey.ImportLoginsFlow to true,
|
FlagKey.ImportLoginsFlow to true,
|
||||||
FlagKey.SshKeyCipherItems to true,
|
FlagKey.SshKeyCipherItems to true,
|
||||||
FlagKey.VerifiedSsoDomainEndpoint to true,
|
FlagKey.VerifiedSsoDomainEndpoint to true,
|
||||||
|
FlagKey.CredentialExchangeProtocolImport to true,
|
||||||
|
FlagKey.CredentialExchangeProtocolExport to true,
|
||||||
)
|
)
|
||||||
|
|
||||||
private val UPDATED_MAP_VALUE: Map<FlagKey<Any>, Any> = mapOf(
|
private val UPDATED_MAP_VALUE: Map<FlagKey<Any>, Any> = mapOf(
|
||||||
|
@ -124,6 +126,8 @@ private val UPDATED_MAP_VALUE: Map<FlagKey<Any>, Any> = mapOf(
|
||||||
FlagKey.ImportLoginsFlow to false,
|
FlagKey.ImportLoginsFlow to false,
|
||||||
FlagKey.SshKeyCipherItems to false,
|
FlagKey.SshKeyCipherItems to false,
|
||||||
FlagKey.VerifiedSsoDomainEndpoint to false,
|
FlagKey.VerifiedSsoDomainEndpoint to false,
|
||||||
|
FlagKey.CredentialExchangeProtocolImport to false,
|
||||||
|
FlagKey.CredentialExchangeProtocolExport to false,
|
||||||
)
|
)
|
||||||
|
|
||||||
private val DEFAULT_STATE = DebugMenuState(
|
private val DEFAULT_STATE = DebugMenuState(
|
||||||
|
|
Loading…
Add table
Reference in a new issue