mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-08-26 04:33:20 +00:00
implement server side default URI matching
This commit is contained in:
parent
3dbfc484a5
commit
eedfc4c7a1
3 changed files with 25 additions and 0 deletions
|
@ -97,6 +97,17 @@
|
|||
## If unset (the default), events are kept indefinitely and the scheduled job is disabled!
|
||||
# EVENTS_DAYS_RETAIN=
|
||||
|
||||
## Override the default URI matching when for all ciphers
|
||||
## When users leave the default URI matching for a cipher, replace it by the given value.
|
||||
## -1: user default,
|
||||
## 0: base domain,
|
||||
## 1: host,
|
||||
## 2: begins with,
|
||||
## 3: regular expression,
|
||||
## 4: exact match,
|
||||
## 5: never match.
|
||||
# OVERRIDE_DEFAULT_URI_MATCHING=-1
|
||||
|
||||
## BETA FEATURE: Groups
|
||||
## Controls whether group support is enabled for organizations
|
||||
## This setting applies to organizations.
|
||||
|
|
|
@ -456,6 +456,10 @@ pub async fn update_cipher_from_data(
|
|||
if json_data.is_array() {
|
||||
json_data.as_array_mut().unwrap().iter_mut().for_each(|ref mut f| {
|
||||
f.as_object_mut().unwrap().remove("Response");
|
||||
// When user leaves the default "URI matching" and admin has it overridden
|
||||
if CONFIG.override_default_uri_matching() >= 0 && f["Match"].is_null() {
|
||||
f.as_object_mut().unwrap()["Match"] = Value::Number(CONFIG.override_default_uri_matching().into());
|
||||
}
|
||||
});
|
||||
};
|
||||
json_data
|
||||
|
|
|
@ -494,6 +494,16 @@ make_config! {
|
|||
|
||||
/// Events days retain |> Number of days to retain events stored in the database. If unset, events are kept indefently.
|
||||
events_days_retain: i64, false, option;
|
||||
|
||||
/// Override default URI matching for all ciphers |> When users leave the default URI matching for a cipher, replace it by the given value.
|
||||
/// -1: user default,
|
||||
/// 0: base domain,
|
||||
/// 1: host,
|
||||
/// 2: begins with,
|
||||
/// 3: regular expression,
|
||||
/// 4: exact match,
|
||||
/// 5: never match.
|
||||
override_default_uri_matching: i8, true, def, -1;
|
||||
},
|
||||
|
||||
/// Advanced settings
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue