phoeagon 3 weeks ago
committed by GitHub
parent
commit
048db2ee9e
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 5
      .env.template
  2. 18
      src/config.rs

5
.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

18
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;

Loading…
Cancel
Save