diff --git a/.env.template b/.env.template index c5563a1d..4a2a262c 100644 --- a/.env.template +++ b/.env.template @@ -386,6 +386,11 @@ ## - "cxp-export-mobile": Enable the export via CXP on iOS (Clients >=2025.9.2) # EXPERIMENTAL_CLIENT_FEATURE_FLAGS=fido2-vault-credentials +## Skip validation of experimental client feature flags. +## If set to true, Vaultwarden will not check if the flags in EXPERIMENTAL_CLIENT_FEATURE_FLAGS are known. +## Use this at your own risk! +# EXPERIMENTAL_CLIENT_FEATURE_FLAGS_SKIP_VALIDATION=false + ## Require new device emails. When a user logs in an email is required to be sent. ## If sending the email fails the login attempt will fail!! # REQUIRE_DEVICE_EMAIL=false diff --git a/src/config.rs b/src/config.rs index 0221fd9a..74827b2f 100644 --- a/src/config.rs +++ b/src/config.rs @@ -712,6 +712,9 @@ make_config! { /// Customize the enabled feature flags on the clients |> This is a comma separated list of feature flags to enable. experimental_client_feature_flags: String, false, def, String::new(); + /// Skip validation of experimental client feature flags |> If this is set to true, the experimental client feature flags will not be validated. This is useful for testing. + /// Use this at your own risk! + experimental_client_feature_flags_skip_validation: bool, false, def, false; /// Require new device emails |> When a user logs in an email is required to be sent. /// If sending the email fails the login attempt will fail. @@ -1053,12 +1056,15 @@ fn validate_config(cfg: &ConfigItems) -> Result<(), Error> { // Webauthn Related Origins "pm-30529-webauthn-related-origins", ]; - let configured_flags = parse_experimental_client_feature_flags(&cfg.experimental_client_feature_flags); - let invalid_flags: Vec<_> = configured_flags.keys().filter(|flag| !KNOWN_FLAGS.contains(&flag.as_str())).collect(); - if !invalid_flags.is_empty() { - err!(format!("Unrecognized experimental client feature flags: {invalid_flags:?}.\n\n\ - Please ensure all feature flags are spelled correctly and that they are supported in this version.\n\ - Supported flags: {KNOWN_FLAGS:?}")); + if !cfg.experimental_client_feature_flags_skip_validation { + let configured_flags = parse_experimental_client_feature_flags(&cfg.experimental_client_feature_flags); + let invalid_flags: Vec<_> = + configured_flags.keys().filter(|flag| !KNOWN_FLAGS.contains(&flag.as_str())).collect(); + if !invalid_flags.is_empty() { + err!(format!("Unrecognized experimental client feature flags: {invalid_flags:?}.\n\n\ + Please ensure all feature flags are spelled correctly and that they are supported in this version.\n\ + Supported flags: {KNOWN_FLAGS:?}")); + } } const MAX_FILESIZE_KB: i64 = i64::MAX >> 10;