mirror of
https://github.com/dani-garcia/vaultwarden.wiki.git
synced 2026-11-03 17:46:47 +02:00
Add configurable Fill Assist rules URL (#7791)
This commit is contained in:
6 files changed
+94
-5
No files matched your search
@@ -603,6 +603,9 @@ make_config! {
|
||||
/// This setting applies globally to all users. To control this on a per-org basis instead, use the "Disable Send" org policy.
|
||||
sends_allowed: bool, true, def, true;
|
||||
|
||||
/// Fill Assist Rules URL |> HTTPS URL for the server-wide Fill Assist rules feed base directory.
|
||||
fill_assist_rules_url: String, true, def, "https://fillassist.bitwarden.com".to_owned();
|
||||
|
||||
/// HIBP Api Key |> HaveIBeenPwned API Key, request it here: https://haveibeenpwned.com/API/Key
|
||||
hibp_api_key: Pass, true, option;
|
||||
|
||||
@@ -1023,6 +1026,21 @@ fn validate_config(cfg: &ConfigItems, on_update: bool) -> Result<(), Error> {
|
||||
);
|
||||
}
|
||||
|
||||
let valid_fill_assist_rules_url = Url::parse(&cfg.fill_assist_rules_url).is_ok_and(|url| {
|
||||
url.scheme() == "https"
|
||||
&& url.has_host()
|
||||
&& url.username().is_empty()
|
||||
&& url.password().is_none()
|
||||
&& url.query().is_none()
|
||||
&& url.fragment().is_none()
|
||||
&& cfg.fill_assist_rules_url.trim() == cfg.fill_assist_rules_url
|
||||
});
|
||||
if !valid_fill_assist_rules_url {
|
||||
err!(
|
||||
"`FILL_ASSIST_RULES_URL` must be a valid HTTPS URL without credentials, query parameters, fragments, or surrounding whitespace."
|
||||
);
|
||||
}
|
||||
|
||||
let connect_src = cfg.allowed_connect_src.to_lowercase();
|
||||
for url in connect_src.split_whitespace() {
|
||||
if !url.starts_with("https://") || Url::parse(url).is_err() {
|
||||
@@ -1477,6 +1495,7 @@ pub const SUPPORTED_FEATURE_FLAGS: &[&str] = &[
|
||||
// Autofill Team
|
||||
"undetermined-cipher-scenario-logic",
|
||||
"enable-basic-auth-response",
|
||||
"fill-assist-targeting-rules",
|
||||
"ssh-agent-v2",
|
||||
"windows-desktop-autotype",
|
||||
"windows-desktop-autotype-ga",
|
||||
|
||||
Reference in new issue
Block a user