Browse Source

Update supported Bitwarden client feature flags

pull/7502/head
Dávid Balatoni 2 months ago
parent
commit
b678843368
Failed to extract signature
  1. 31
      .env.template
  2. 8
      src/api/core/mod.rs
  3. 38
      src/config.rs
  4. 17
      src/util.rs

31
.env.template

@ -381,22 +381,21 @@
## Note that clients cache the /api/config endpoint for about 1 hour and it could take some time before they are enabled or disabled!
##
## The following flags are available:
## - "pm-5594-safari-account-switching": Enable account switching in Safari. (Safari >= 2026.2.0)
## - "ssh-agent": Enable SSH agent support on Desktop. (Desktop >= 2024.12.0)
## - "ssh-agent-v2": Enable newer SSH agent support. (Desktop >= 2026.2.1)
## - "ssh-key-vault-item": Enable the creation and use of SSH key vault items. (Clients >= 2024.12.0)
## - "pm-25373-windows-biometrics-v2": Enable the new implementation of biometrics on Windows. (Desktop >= 2025.11.0)
## - "pm-26340-linux-biometrics-v2": Enable the new implementation of biometrics on Linux. (Desktop >= 2025.11.0)
## - "anon-addy-self-host-alias": Enable configuring self-hosted Anon Addy alias generator. (Android >= 2025.3.0, iOS >= 2025.4.0)
## - "simple-login-self-host-alias": Enable configuring self-hosted Simple Login alias generator. (Android >= 2025.3.0, iOS >= 2025.4.0)
## - "mutual-tls": Enable the use of mutual TLS on Android (Clients >= 2025.2.0)
## - "cxp-import-mobile": Enable the import via CXP on iOS (Clients >= 2025.9.2)
## - "cxp-export-mobile": Enable the export via CXP on iOS (Clients >= 2025.9.2)
## - "pm-30529-webauthn-related-origins":
## - "desktop-ui-migration-milestone-1": Special feature flag for desktop UI (Desktop >= 2026.2.0)
## - "desktop-ui-migration-milestone-2": Special feature flag for desktop UI (Desktop >= 2026.2.0)
## - "desktop-ui-migration-milestone-3": Special feature flag for desktop UI (Desktop >= 2026.2.0)
## - "desktop-ui-migration-milestone-4": Special feature flag for desktop UI (Desktop >= 2026.2.0)
## - "pm-5594-safari-account-switching": Enable account switching in the Safari browser extension. (Verified in Browser 2026.7.0)
## - "undetermined-cipher-scenario-logic": Enable the browser extension's updated autofill matching logic. (Verified in Browser 2026.7.0)
## - "macos-native-credential-sync": Enable native macOS credential-provider sync in Desktop. (Verified in Desktop 2026.7.0)
## - "fill-assist-targeting-rules": Enable Fill Assist targeting rules for autofill. (Verified in Browser/Android/iOS 2026.7.0)
## - "pm-39071-default-password-manager-prompt": Prompt new browser-extension installations to make Bitwarden the default password manager. (Verified in Browser 2026.7.0)
## - "windows-desktop-autotype": Enable Windows Desktop auto-type for Premium accounts. (Verified in Desktop 2026.7.0)
## - "windows-desktop-autotype-ga": Show Windows Desktop auto-type controls; also enable "windows-desktop-autotype". (Verified in Desktop 2026.7.0)
## - "ssh-agent-v2": Enable the current SSH agent implementation in Desktop. (Verified in Desktop 2026.7.0)
## - "ssh-ecdsa": Allow importing supported ECDSA SSH keys in Desktop; also enable "ssh-agent-v2". (Verified in Desktop 2026.7.0)
## - "desktop-ui-settings-dialog": Use the Desktop settings dialog. (Verified in Desktop 2026.7.0)
## - "pm-34171-card-scanner": Scan a payment card to populate card-item details. (Verified in Android/iOS 2026.7.0)
## - "pm-34224-mobile-attachment-updates": Use the updated Android attachment screen. (Verified in Android 2026.7.0)
## - "pm-30529-webauthn-related-origins": Allow passkey operations across domains a site declares as related. (Verified in Browser 2026.7.0)
## - "pm-34410-attachment-upload-progress": Show attachment upload progress in supported clients. (Verified in Browser/Desktop 2026.7.0)
## - "phishing-detection": Warn in the browser extension when a visited site matches its phishing data. (Verified in Browser 2026.7.0)
# EXPERIMENTAL_CLIENT_FEATURE_FLAGS=
## Require new device emails. When a user logs in an email is required to be sent.

8
src/api/core/mod.rs

@ -211,10 +211,10 @@ fn get_api_webauthn(_headers: Headers) -> Json<Value> {
fn config() -> Json<Value> {
let domain = CONFIG.domain();
// Official available feature flags can be found here:
// Server (v2026.2.1): https://github.com/bitwarden/server/blob/0e42725d0837bd1c0dabd864ff621a579959744b/src/Core/Constants.cs#L135
// Client (v2026.2.1): https://github.com/bitwarden/clients/blob/f96380c3138291a028bdd2c7a5fee540d5c98ba5/libs/common/src/enums/feature-flag.enum.ts#L12
// Android (v2026.2.1): https://github.com/bitwarden/android/blob/6902c19c0093fa476bbf74ccaa70c9f14afbb82f/core/src/main/kotlin/com/bitwarden/core/data/manager/model/FlagKey.kt#L31
// iOS (v2026.2.1): https://github.com/bitwarden/ios/blob/cdd9ba1770ca2ffc098d02d12cc3208e3a830454/BitwardenShared/Core/Platform/Models/Enum/FeatureFlag.swift#L7
// Server (v2026.7.1): https://github.com/bitwarden/server/blob/97ad380f0f82b560d81c1e2e684cef9e85b3379e/src/Core/Constants.cs#L120
// Client (v2026.7.0): https://github.com/bitwarden/clients/blob/adf0337e4a0f788b895933792fc04fa162669eff/libs/common/src/enums/feature-flag.enum.ts#L10
// Android (v2026.7.0-bwpm): https://github.com/bitwarden/android/blob/36c892e1887b5051270ead6021afb16420663566/core/src/main/kotlin/com/bitwarden/core/data/manager/model/FlagKey.kt#L28
// iOS (v2026.7.0-bwpm): https://github.com/bitwarden/ios/blob/e9514dc0f85092ef3cf2a2ccbe07dc5a4f661b0c/BitwardenShared/Core/Platform/Models/Enum/FeatureFlag.swift#L5
let mut feature_states = parse_experimental_client_feature_flags(
&CONFIG.experimental_client_feature_flags(),
&FeatureFlagFilter::ValidOnly,

38
src/config.rs

@ -1409,33 +1409,33 @@ pub enum PathType {
}
// Official available feature flags can be found here:
// Server (v2026.2.1): https://github.com/bitwarden/server/blob/0e42725d0837bd1c0dabd864ff621a579959744b/src/Core/Constants.cs#L135
// Client (v2026.2.1): https://github.com/bitwarden/clients/blob/f96380c3138291a028bdd2c7a5fee540d5c98ba5/libs/common/src/enums/feature-flag.enum.ts#L12
// Android (v2026.2.1): https://github.com/bitwarden/android/blob/6902c19c0093fa476bbf74ccaa70c9f14afbb82f/core/src/main/kotlin/com/bitwarden/core/data/manager/model/FlagKey.kt#L31
// iOS (v2026.2.1): https://github.com/bitwarden/ios/blob/cdd9ba1770ca2ffc098d02d12cc3208e3a830454/BitwardenShared/Core/Platform/Models/Enum/FeatureFlag.swift#L7
// Server (v2026.7.1): https://github.com/bitwarden/server/blob/97ad380f0f82b560d81c1e2e684cef9e85b3379e/src/Core/Constants.cs#L120
// Client (v2026.7.0): https://github.com/bitwarden/clients/blob/adf0337e4a0f788b895933792fc04fa162669eff/libs/common/src/enums/feature-flag.enum.ts#L10
// Android (v2026.7.0-bwpm): https://github.com/bitwarden/android/blob/36c892e1887b5051270ead6021afb16420663566/core/src/main/kotlin/com/bitwarden/core/data/manager/model/FlagKey.kt#L28
// iOS (v2026.7.0-bwpm): https://github.com/bitwarden/ios/blob/e9514dc0f85092ef3cf2a2ccbe07dc5a4f661b0c/BitwardenShared/Core/Platform/Models/Enum/FeatureFlag.swift#L5
pub const SUPPORTED_FEATURE_FLAGS: &[&str] = &[
// Architecture
"desktop-ui-migration-milestone-1",
"desktop-ui-migration-milestone-2",
"desktop-ui-migration-milestone-3",
"desktop-ui-migration-milestone-4",
// Auth Team
"pm-5594-safari-account-switching",
// Autofill Team
"ssh-agent",
"undetermined-cipher-scenario-logic",
"macos-native-credential-sync",
"fill-assist-targeting-rules",
"pm-39071-default-password-manager-prompt",
// Desktop Native Team
"windows-desktop-autotype",
"windows-desktop-autotype-ga",
"ssh-agent-v2",
// Key Management Team
"ssh-key-vault-item",
"pm-25373-windows-biometrics-v2",
"pm-26340-linux-biometrics-v2",
"ssh-ecdsa",
// Desktop Team
"desktop-ui-settings-dialog",
// Mobile Team
"anon-addy-self-host-alias",
"simple-login-self-host-alias",
"mutual-tls",
"cxp-import-mobile",
"cxp-export-mobile",
"pm-34171-card-scanner",
"pm-34224-mobile-attachment-updates",
// Platform Team
"pm-30529-webauthn-related-origins",
"pm-34410-attachment-upload-progress",
// DIRT Team
"phishing-detection",
];
impl Config {

17
src/util.rs

@ -804,6 +804,23 @@ pub fn parse_experimental_client_feature_flags(
.collect()
}
#[cfg(test)]
mod feature_flag_tests {
use super::*;
#[test]
fn feature_flag_filters_preserve_supported_boolean_flags() {
let configured = format!(" unknown, {}, removed ", SUPPORTED_FEATURE_FLAGS.join(", "));
let valid = parse_experimental_client_feature_flags(&configured, &FeatureFlagFilter::ValidOnly);
let invalid = parse_experimental_client_feature_flags(&configured, &FeatureFlagFilter::InvalidOnly);
assert_eq!(valid.len(), SUPPORTED_FEATURE_FLAGS.len());
assert!(valid.values().all(|value| *value));
assert!(invalid.contains_key("unknown"));
assert!(invalid.contains_key("removed"));
}
}
/// TODO: This is extracted from IpAddr::is_global, which is unstable:
/// https://doc.rust-lang.org/nightly/std/net/enum.IpAddr.html#method.is_global
/// Remove once https://github.com/rust-lang/rust/issues/27709 is merged

Loading…
Cancel
Save