From 731dd5bfdc62505c904bf8e7262bb5c1428b5a5a Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Sun, 7 Dec 2025 23:09:11 +0800 Subject: [PATCH] docs: remove `$APP` and `$LOG` from `FsScope` (#14623) --- crates/tauri-cli/config.schema.json | 2 +- crates/tauri-schema-generator/schemas/config.schema.json | 2 +- crates/tauri-utils/src/config.rs | 4 ++-- .../tests/acl/fixtures/capabilities/scope-extended/cap.json | 4 ++-- crates/tests/acl/fixtures/plugins/fs/scope.toml | 4 ++-- crates/tests/acl/fixtures/plugins/os/windows.toml | 2 +- .../snapshots/acl_tests__tests__file-explorer-remote.snap | 2 +- .../fixtures/snapshots/acl_tests__tests__file-explorer.snap | 2 +- .../fixtures/snapshots/acl_tests__tests__multiwindow.snap | 2 +- .../snapshots/acl_tests__tests__scope-extended.snap | 6 +++--- .../acl/fixtures/snapshots/acl_tests__tests__scope.snap | 2 +- .../acl_tests__tests__platform-specific-permissions.snap | 2 +- 12 files changed, 17 insertions(+), 17 deletions(-) diff --git a/crates/tauri-cli/config.schema.json b/crates/tauri-cli/config.schema.json index 1d19c20ea..c71bf6e2d 100644 --- a/crates/tauri-cli/config.schema.json +++ b/crates/tauri-cli/config.schema.json @@ -1296,7 +1296,7 @@ "additionalProperties": false }, "FsScope": { - "description": "Protocol scope definition.\n It is a list of glob patterns that restrict the API access from the webview.\n\n Each pattern can start with a variable that resolves to a system base directory.\n The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`,\n `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`,\n `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`,\n `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", + "description": "Protocol scope definition.\n It is a list of glob patterns that restrict the API access from the webview.\n\n Each pattern can start with a variable that resolves to a system base directory.\n The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`,\n `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`,\n `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$TEMP`,\n `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", "anyOf": [ { "description": "A list of paths that are allowed by this scope.", diff --git a/crates/tauri-schema-generator/schemas/config.schema.json b/crates/tauri-schema-generator/schemas/config.schema.json index 1d19c20ea..c71bf6e2d 100644 --- a/crates/tauri-schema-generator/schemas/config.schema.json +++ b/crates/tauri-schema-generator/schemas/config.schema.json @@ -1296,7 +1296,7 @@ "additionalProperties": false }, "FsScope": { - "description": "Protocol scope definition.\n It is a list of glob patterns that restrict the API access from the webview.\n\n Each pattern can start with a variable that resolves to a system base directory.\n The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`,\n `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`,\n `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`,\n `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", + "description": "Protocol scope definition.\n It is a list of glob patterns that restrict the API access from the webview.\n\n Each pattern can start with a variable that resolves to a system base directory.\n The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`,\n `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`,\n `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$TEMP`,\n `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", "anyOf": [ { "description": "A list of paths that are allowed by this scope.", diff --git a/crates/tauri-utils/src/config.rs b/crates/tauri-utils/src/config.rs index 37c77abff..c90dc3e59 100644 --- a/crates/tauri-utils/src/config.rs +++ b/crates/tauri-utils/src/config.rs @@ -2211,8 +2211,8 @@ impl Default for DisabledCspModificationKind { /// Each pattern can start with a variable that resolves to a system base directory. /// The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, /// `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, -/// `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, -/// `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`. +/// `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$TEMP`, +/// `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`. #[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] #[serde(untagged)] #[cfg_attr(feature = "schema", derive(JsonSchema))] diff --git a/crates/tests/acl/fixtures/capabilities/scope-extended/cap.json b/crates/tests/acl/fixtures/capabilities/scope-extended/cap.json index 26355eed5..78ec36d96 100644 --- a/crates/tests/acl/fixtures/capabilities/scope-extended/cap.json +++ b/crates/tests/acl/fixtures/capabilities/scope-extended/cap.json @@ -25,12 +25,12 @@ "identifier": "fs:allow-app", "allow": [ { - "path": "$APP/**" + "path": "$APPDATA/**" } ], "deny": [ { - "path": "$APP/*.db" + "path": "$APPDATA/*.db" } ] }, diff --git a/crates/tests/acl/fixtures/plugins/fs/scope.toml b/crates/tests/acl/fixtures/plugins/fs/scope.toml index 6d8a29a3f..efe82a96c 100644 --- a/crates/tests/acl/fixtures/plugins/fs/scope.toml +++ b/crates/tests/acl/fixtures/plugins/fs/scope.toml @@ -1,8 +1,8 @@ [[permission]] identifier = "allow-app" -description = "Allows accessing the $APP path." +description = "Allows accessing the $APPDATA path." [[permission.scope.allow]] -path = "$APP" +path = "$APPDATA" [[permission]] identifier = "allow-download-dir" diff --git a/crates/tests/acl/fixtures/plugins/os/windows.toml b/crates/tests/acl/fixtures/plugins/os/windows.toml index 577b0c967..1f84a6d99 100644 --- a/crates/tests/acl/fixtures/plugins/os/windows.toml +++ b/crates/tests/acl/fixtures/plugins/os/windows.toml @@ -3,4 +3,4 @@ identifier = "deny-webview-folder-windows" platforms = ["windows"] description = "Denies access to the webview folder on Windows" [[permission.scope.deny]] -path = "$APP/EBWebView/**" +path = "$APPLOCALDATA/EBWebView/**" diff --git a/crates/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer-remote.snap b/crates/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer-remote.snap index dd9b05093..50029e7bd 100644 --- a/crates/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer-remote.snap +++ b/crates/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer-remote.snap @@ -398,7 +398,7 @@ Resolved { Map( { "path": String( - "$APP", + "$APPDATA", ), }, ), diff --git a/crates/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer.snap b/crates/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer.snap index a3e4cd8b3..03f795b43 100644 --- a/crates/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer.snap +++ b/crates/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer.snap @@ -68,7 +68,7 @@ Resolved { Map( { "path": String( - "$APP", + "$APPDATA", ), }, ), diff --git a/crates/tests/acl/fixtures/snapshots/acl_tests__tests__multiwindow.snap b/crates/tests/acl/fixtures/snapshots/acl_tests__tests__multiwindow.snap index f80ef7566..95ba3490d 100644 --- a/crates/tests/acl/fixtures/snapshots/acl_tests__tests__multiwindow.snap +++ b/crates/tests/acl/fixtures/snapshots/acl_tests__tests__multiwindow.snap @@ -310,7 +310,7 @@ Resolved { Map( { "path": String( - "$APP", + "$APPDATA", ), }, ), diff --git a/crates/tests/acl/fixtures/snapshots/acl_tests__tests__scope-extended.snap b/crates/tests/acl/fixtures/snapshots/acl_tests__tests__scope-extended.snap index 41d2d99d7..7f1606fae 100644 --- a/crates/tests/acl/fixtures/snapshots/acl_tests__tests__scope-extended.snap +++ b/crates/tests/acl/fixtures/snapshots/acl_tests__tests__scope-extended.snap @@ -244,14 +244,14 @@ Resolved { Map( { "path": String( - "$APP/**", + "$APPDATA/**", ), }, ), Map( { "path": String( - "$APP", + "$APPDATA", ), }, ), @@ -281,7 +281,7 @@ Resolved { Map( { "path": String( - "$APP/*.db", + "$APPDATA/*.db", ), }, ), diff --git a/crates/tests/acl/fixtures/snapshots/acl_tests__tests__scope.snap b/crates/tests/acl/fixtures/snapshots/acl_tests__tests__scope.snap index e98810961..b74d04381 100644 --- a/crates/tests/acl/fixtures/snapshots/acl_tests__tests__scope.snap +++ b/crates/tests/acl/fixtures/snapshots/acl_tests__tests__scope.snap @@ -208,7 +208,7 @@ Resolved { Map( { "path": String( - "$APP", + "$APPDATA", ), }, ), diff --git a/crates/tests/acl/fixtures/snapshots/windows/acl_tests__tests__platform-specific-permissions.snap b/crates/tests/acl/fixtures/snapshots/windows/acl_tests__tests__platform-specific-permissions.snap index 618dcd1a7..17498f928 100644 --- a/crates/tests/acl/fixtures/snapshots/windows/acl_tests__tests__platform-specific-permissions.snap +++ b/crates/tests/acl/fixtures/snapshots/windows/acl_tests__tests__platform-specific-permissions.snap @@ -56,7 +56,7 @@ Resolved { Map( { "path": String( - "$APP/EBWebView/**", + "$APPLOCALDATA/EBWebView/**", ), }, ),