Merge commit from fork

* fix(shell): properly validate open scope

* change empty regex to an impossible match

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Co-authored-by: Chip Reed <chip@chip.sh>
This commit is contained in:
Tillmann
2025-04-02 00:24:25 -03:00
committed by GitHub
co-authored by Lucas Nogueira Chip Reed
parent 4dd5c51436
commit 9cf0390a52
11 changed files with 44 additions and 11 deletions
+4 -1
View File
@@ -18,6 +18,9 @@ pub struct Config {
#[serde(untagged, deny_unknown_fields)]
#[non_exhaustive]
pub enum ShellAllowlistOpen {
/// Shell open API allowlist is not defined by the user.
/// In this case we add the default validation regex (same as [`Self::Flag(true)`]).
Unset,
/// If the shell open API should be enabled.
///
/// If enabled, the default validation regex (`^((mailto:\w+)|(tel:\w+)|(https?://\w+)).+`) is used.
@@ -35,6 +38,6 @@ pub enum ShellAllowlistOpen {
impl Default for ShellAllowlistOpen {
fn default() -> Self {
Self::Flag(false)
Self::Unset
}
}