From 58fe2e812a85b9f4eba105286a63f271ea637836 Mon Sep 17 00:00:00 2001 From: Amr Bashir Date: Wed, 31 Jan 2024 14:38:25 +0200 Subject: [PATCH] fix: improvements and ipc fixes for loading window content using custom protocol (#8670) * fix: improvements and ipc fixes for loading window content using custom protocol closes #5478 * Discard changes to tooling/cli/Cargo.lock * clippy * fix tests * typo * fix webviewurl deserialize * resolve todo, fixes * fmt --------- Co-authored-by: Lucas Nogueira --- .../tauri-custom-protcol-for-window-url.md | 5 + .changes/tauri-utils-dist-dir-optional.md | 5 + ...tauri-utils-webivew-url-custom-protocol.md | 5 + core/tauri-build/src/codegen/context.rs | 4 +- core/tauri-codegen/src/context.rs | 55 +- core/tauri-config-schema/schema.json | 21 +- core/tauri-utils/CHANGELOG.md | 2 +- core/tauri-utils/src/acl/resolved.rs | 10 +- core/tauri-utils/src/config.rs | 94 +- core/tauri/permissions/app/.schema.json | 339 +++++ .../tauri/permissions/app/schemas/schema.json | 329 +++++ core/tauri/permissions/event/.schema.json | 311 +++++ .../permissions/event/schemas/schema.json | 301 +++++ core/tauri/permissions/menu/.schema.json | 577 +++++++++ .../permissions/menu/schemas/schema.json | 567 +++++++++ core/tauri/permissions/path/.schema.json | 381 ++++++ .../permissions/path/schemas/schema.json | 371 ++++++ core/tauri/permissions/resources/.schema.json | 283 +++++ .../permissions/resources/schemas/schema.json | 273 ++++ core/tauri/permissions/tray/.schema.json | 395 ++++++ .../permissions/tray/schemas/schema.json | 385 ++++++ core/tauri/permissions/webview/.schema.json | 409 ++++++ .../permissions/webview/schemas/schema.json | 399 ++++++ core/tauri/permissions/window/.schema.json | 1109 +++++++++++++++++ .../permissions/window/schemas/schema.json | 1099 ++++++++++++++++ core/tauri/src/manager/mod.rs | 12 +- core/tauri/src/manager/webview.rs | 2 + core/tauri/src/protocol/tauri.rs | 2 +- core/tauri/src/test/mock_runtime.rs | 2 +- core/tauri/src/webview/mod.rs | 49 +- core/tauri/src/webview/webview_window.rs | 6 +- core/tauri/src/window/mod.rs | 6 +- .../window/scripts/undecorated-resizing.js | 2 +- examples/api/src-tauri/Cargo.lock | 851 ++++++------- examples/api/src-tauri/Cargo.toml | 3 - .../permissions/.schema.json | 290 +++++ .../permissions/schemas/schema.json | 280 +++++ examples/api/src/App.svelte | 6 +- tooling/cli/schema.json | 21 +- tooling/cli/src/build.rs | 2 +- tooling/cli/src/dev.rs | 12 +- tooling/cli/src/info/app.rs | 10 +- tooling/cli/src/mobile/mod.rs | 2 +- 43 files changed, 8707 insertions(+), 580 deletions(-) create mode 100644 .changes/tauri-custom-protcol-for-window-url.md create mode 100644 .changes/tauri-utils-dist-dir-optional.md create mode 100644 .changes/tauri-utils-webivew-url-custom-protocol.md create mode 100644 core/tauri/permissions/app/.schema.json create mode 100644 core/tauri/permissions/app/schemas/schema.json create mode 100644 core/tauri/permissions/event/.schema.json create mode 100644 core/tauri/permissions/event/schemas/schema.json create mode 100644 core/tauri/permissions/menu/.schema.json create mode 100644 core/tauri/permissions/menu/schemas/schema.json create mode 100644 core/tauri/permissions/path/.schema.json create mode 100644 core/tauri/permissions/path/schemas/schema.json create mode 100644 core/tauri/permissions/resources/.schema.json create mode 100644 core/tauri/permissions/resources/schemas/schema.json create mode 100644 core/tauri/permissions/tray/.schema.json create mode 100644 core/tauri/permissions/tray/schemas/schema.json create mode 100644 core/tauri/permissions/webview/.schema.json create mode 100644 core/tauri/permissions/webview/schemas/schema.json create mode 100644 core/tauri/permissions/window/.schema.json create mode 100644 core/tauri/permissions/window/schemas/schema.json create mode 100644 examples/api/src-tauri/tauri-plugin-sample/permissions/.schema.json create mode 100644 examples/api/src-tauri/tauri-plugin-sample/permissions/schemas/schema.json diff --git a/.changes/tauri-custom-protcol-for-window-url.md b/.changes/tauri-custom-protcol-for-window-url.md new file mode 100644 index 000000000..95f3bb1b8 --- /dev/null +++ b/.changes/tauri-custom-protcol-for-window-url.md @@ -0,0 +1,5 @@ +--- +'tauri': 'patch:enhance' +--- + +Allow IPC calls when window origin is a defined custom protocol. diff --git a/.changes/tauri-utils-dist-dir-optional.md b/.changes/tauri-utils-dist-dir-optional.md new file mode 100644 index 000000000..b88b0f868 --- /dev/null +++ b/.changes/tauri-utils-dist-dir-optional.md @@ -0,0 +1,5 @@ +--- +'tauri-utils': 'patch:breaking' +--- + +Changed `dist_dir` and `dev_path` config options to be optional. diff --git a/.changes/tauri-utils-webivew-url-custom-protocol.md b/.changes/tauri-utils-webivew-url-custom-protocol.md new file mode 100644 index 000000000..4342d999d --- /dev/null +++ b/.changes/tauri-utils-webivew-url-custom-protocol.md @@ -0,0 +1,5 @@ +--- +'tauri-utils': 'patch:feat' +--- + +Add `WebviewUrl::CustomProtocol` enum variant. diff --git a/core/tauri-build/src/codegen/context.rs b/core/tauri-build/src/codegen/context.rs index 2ebee78a9..d54b77198 100644 --- a/core/tauri-build/src/codegen/context.rs +++ b/core/tauri-build/src/codegen/context.rs @@ -88,10 +88,10 @@ impl CodegenContext { &config.build.dist_dir }; match app_url { - AppUrl::Url(WebviewUrl::App(p)) => { + Some(AppUrl::Url(WebviewUrl::App(p))) => { println!("cargo:rerun-if-changed={}", config_parent.join(p).display()); } - AppUrl::Files(files) => { + Some(AppUrl::Files(files)) => { for path in files { println!( "cargo:rerun-if-changed={}", diff --git a/core/tauri-codegen/src/context.rs b/core/tauri-codegen/src/context.rs index 129d93763..703818627 100644 --- a/core/tauri-codegen/src/context.rs +++ b/core/tauri-codegen/src/context.rs @@ -164,36 +164,33 @@ pub fn context_codegen(data: ContextData) -> Result match url { - WebviewUrl::External(_) => Default::default(), - WebviewUrl::App(path) => { - if path.components().count() == 0 { - panic!( - "The `{}` configuration cannot be empty", - if dev { "devPath" } else { "distDir" } - ) + Some(url) => match url { + AppUrl::Url(url) => match url { + WebviewUrl::External(_) | WebviewUrl::CustomProtocol(_) => Default::default(), + WebviewUrl::App(path) => { + let assets_path = config_parent.join(path); + if !assets_path.exists() { + panic!( + "The `{}` configuration is set to `{:?}` but this path doesn't exist", + if dev { "devPath" } else { "distDir" }, + path + ) + } + EmbeddedAssets::new(assets_path, &options, map_core_assets(&options, target))? } - let assets_path = config_parent.join(path); - if !assets_path.exists() { - panic!( - "The `{}` configuration is set to `{:?}` but this path doesn't exist", - if dev { "devPath" } else { "distDir" }, - path - ) - } - EmbeddedAssets::new(assets_path, &options, map_core_assets(&options, target))? - } + _ => unimplemented!(), + }, + AppUrl::Files(files) => EmbeddedAssets::new( + files + .iter() + .map(|p| config_parent.join(p)) + .collect::>(), + &options, + map_core_assets(&options, target), + )?, _ => unimplemented!(), }, - AppUrl::Files(files) => EmbeddedAssets::new( - files - .iter() - .map(|p| config_parent.join(p)) - .collect::>(), - &options, - map_core_assets(&options, target), - )?, - _ => unimplemented!(), + None => Default::default(), }; let out_dir = { @@ -398,7 +395,7 @@ pub fn context_codegen(data: ContextData) -> Result Result tauri > bundle > deb`. - [`c4d6fb4b`](https://www.github.com/tauri-apps/tauri/commit/c4d6fb4b1ea8acf02707a9fe5dcab47c1c5bae7b)([#2353](https://www.github.com/tauri-apps/tauri/pull/2353)) Added the `maximizable`, `minimizable` and `closable` options to the window configuration. - [`3cb7a3e6`](https://www.github.com/tauri-apps/tauri/commit/3cb7a3e642bb10ee90dc1d24daa48b8c8c15c9ce)([#6997](https://www.github.com/tauri-apps/tauri/pull/6997)) Add `MimeType::parse_with_fallback` and `MimeType::parse_from_uri_with_fallback` diff --git a/core/tauri-utils/src/acl/resolved.rs b/core/tauri-utils/src/acl/resolved.rs index 5fdd8c2ab..85667df7c 100644 --- a/core/tauri-utils/src/acl/resolved.rs +++ b/core/tauri-utils/src/acl/resolved.rs @@ -21,7 +21,7 @@ use super::{ }; /// A key for a scope, used to link a [`ResolvedCommand#structfield.scope`] to the store [`Resolved#structfield.scopes`]. -pub type ScopeKey = usize; +pub type ScopeKey = u64; /// Metadata for what referenced a [`ResolvedCommand`]. #[cfg(debug_assertions)] @@ -206,7 +206,7 @@ impl Resolved { let mut hasher = DefaultHasher::new(); allowed.scope.hash(&mut hasher); - let hash = hasher.finish() as usize; + let hash = hasher.finish(); allowed.resolved_scope_key.replace(hash); @@ -297,15 +297,15 @@ struct ResolvedCommandTemp { #[cfg(debug_assertions)] pub referenced_by: Vec, pub windows: HashSet, - pub scope: Vec, - pub resolved_scope_key: Option, + pub scope: Vec, + pub resolved_scope_key: Option, } fn resolve_command( commands: &mut BTreeMap, command: String, capability: &Capability, - scope_id: Option, + scope_id: Option, #[cfg(debug_assertions)] permission: &Permission, ) { let contexts = match &capability.context { diff --git a/core/tauri-utils/src/config.rs b/core/tauri-utils/src/config.rs index b51925ee6..bcb7266d9 100644 --- a/core/tauri-utils/src/config.rs +++ b/core/tauri-utils/src/config.rs @@ -43,23 +43,50 @@ fn default_true() -> bool { } /// An URL to open on a Tauri webview window. -#[derive(PartialEq, Eq, Debug, Clone, Deserialize, Serialize)] +#[derive(PartialEq, Eq, Debug, Clone, Serialize)] #[cfg_attr(feature = "schema", derive(JsonSchema))] #[serde(untagged)] #[non_exhaustive] pub enum WebviewUrl { - /// An external URL. + /// An external URL. Must use either the `http` or `https` schemes. External(Url), /// The path portion of an app URL. /// For instance, to load `tauri://localhost/users/john`, /// you can simply provide `users/john` in this configuration. App(PathBuf), + /// A custom protocol url, for example, `doom://index.html` + CustomProtocol(Url), +} + +impl<'de> Deserialize<'de> for WebviewUrl { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + #[derive(Deserialize)] + #[serde(untagged)] + enum WebviewUrlDeserializer { + Url(Url), + Path(PathBuf), + } + + match WebviewUrlDeserializer::deserialize(deserializer)? { + WebviewUrlDeserializer::Url(u) => { + if u.scheme() == "https" || u.scheme() == "http" { + Ok(Self::External(u)) + } else { + Ok(Self::CustomProtocol(u)) + } + } + WebviewUrlDeserializer::Path(p) => Ok(Self::App(p)), + } + } } impl fmt::Display for WebviewUrl { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Self::External(url) => write!(f, "{url}"), + Self::External(url) | Self::CustomProtocol(url) => write!(f, "{url}"), Self::App(path) => write!(f, "{}", path.display()), } } @@ -1858,7 +1885,7 @@ pub enum HookCommand { /// /// See more: #[skip_serializing_none] -#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] +#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize, Default)] #[cfg_attr(feature = "schema", derive(JsonSchema))] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct BuildConfig { @@ -1871,8 +1898,8 @@ pub struct BuildConfig { /// /// See [vite](https://vitejs.dev/guide/), [Webpack DevServer](https://webpack.js.org/configuration/dev-server/) and [sirv](https://github.com/lukeed/sirv) /// for examples on how to set up a dev server. - #[serde(default = "default_dev_path", alias = "dev-path")] - pub dev_path: AppUrl, + #[serde(alias = "dev-path")] + pub dev_path: Option, /// The path to the application assets or URL to load in production. /// /// When a path relative to the configuration file is provided, @@ -1884,8 +1911,8 @@ pub struct BuildConfig { /// /// When an URL is provided, the application won't have bundled assets /// and the application will load that URL by default. - #[serde(default = "default_dist_dir", alias = "dist-dir")] - pub dist_dir: AppUrl, + #[serde(alias = "dist-dir")] + pub dist_dir: Option, /// A shell command to run before `tauri dev` kicks in. /// /// The TAURI_ENV_PLATFORM, TAURI_ENV_ARCH, TAURI_ENV_FAMILY, TAURI_ENV_PLATFORM_VERSION, TAURI_ENV_PLATFORM_TYPE and TAURI_ENV_DEBUG environment variables are set if you perform conditional compilation. @@ -1908,31 +1935,6 @@ pub struct BuildConfig { pub with_global_tauri: bool, } -impl Default for BuildConfig { - fn default() -> Self { - Self { - runner: None, - dev_path: default_dev_path(), - dist_dir: default_dist_dir(), - before_dev_command: None, - before_build_command: None, - before_bundle_command: None, - features: None, - with_global_tauri: false, - } - } -} - -fn default_dev_path() -> AppUrl { - AppUrl::Url(WebviewUrl::External( - Url::parse("http://localhost:8080").unwrap(), - )) -} - -fn default_dist_dir() -> AppUrl { - AppUrl::Url(WebviewUrl::App("../dist".into())) -} - #[derive(Debug, PartialEq, Eq)] struct PackageVersion(String); @@ -2123,8 +2125,8 @@ pub struct PluginConfig(pub HashMap); fn default_build() -> BuildConfig { BuildConfig { runner: None, - dev_path: default_dev_path(), - dist_dir: default_dist_dir(), + dev_path: None, + dist_dir: None, before_dev_command: None, before_build_command: None, before_bundle_command: None, @@ -2159,6 +2161,10 @@ mod build { let url = url_lit(url); quote! { #prefix::External(#url) } } + Self::CustomProtocol(url) => { + let url = url_lit(url); + quote! { #prefix::CustomProtocol(#url) } + } }) } } @@ -2489,8 +2495,8 @@ mod build { impl ToTokens for BuildConfig { fn to_tokens(&self, tokens: &mut TokenStream) { - let dev_path = &self.dev_path; - let dist_dir = &self.dist_dir; + let dev_path = opt_lit(self.dev_path.as_ref()); + let dist_dir = opt_lit(self.dist_dir.as_ref()); let with_global_tauri = self.with_global_tauri; let runner = quote!(None); let before_dev_command = quote!(None); @@ -2758,8 +2764,6 @@ mod test { let t_config = TauriConfig::default(); // get default build config let b_config = BuildConfig::default(); - // get default dev path - let d_path = default_dev_path(); // get default window let d_windows: Vec = vec![]; // get default bundle @@ -2806,10 +2810,8 @@ mod test { // create a build config let build = BuildConfig { runner: None, - dev_path: AppUrl::Url(WebviewUrl::External( - Url::parse("http://localhost:8080").unwrap(), - )), - dist_dir: AppUrl::Url(WebviewUrl::App("../dist".into())), + dev_path: None, + dist_dir: None, before_dev_command: None, before_build_command: None, before_bundle_command: None, @@ -2821,12 +2823,6 @@ mod test { assert_eq!(t_config, tauri); assert_eq!(b_config, build); assert_eq!(d_bundle, tauri.bundle); - assert_eq!( - d_path, - AppUrl::Url(WebviewUrl::External( - Url::parse("http://localhost:8080").unwrap() - )) - ); assert_eq!(d_windows, tauri.windows); } } diff --git a/core/tauri/permissions/app/.schema.json b/core/tauri/permissions/app/.schema.json new file mode 100644 index 000000000..d5a469447 --- /dev/null +++ b/core/tauri/permissions/app/.schema.json @@ -0,0 +1,339 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionFile", + "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", + "type": "object", + "properties": { + "default": { + "description": "The default permission set for the plugin", + "anyOf": [ + { + "$ref": "#/definitions/DefaultPermission" + }, + { + "type": "null" + } + ] + }, + "permission": { + "description": "A list of inlined permissions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + }, + "set": { + "description": "A list of permissions sets defined", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/PermissionSet" + } + }, + "test": { + "description": "Test something!!", + "anyOf": [ + { + "$ref": "#/definitions/PermissionSet" + }, + { + "type": "null" + } + ] + } + }, + "definitions": { + "Commands": { + "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", + "type": "object", + "properties": { + "allow": { + "description": "Allowed command.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Denied command, which takes priority.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "DefaultPermission": { + "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "type": "string" + } + }, + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + } + } + }, + "Number": { + "description": "A valid ACL number.", + "anyOf": [ + { + "description": "Represents an [`i64`].", + "type": "integer", + "format": "int64" + }, + { + "description": "Represents a [`f64`].", + "type": "number", + "format": "double" + } + ] + }, + "Permission": { + "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "commands": { + "description": "Allowed or denied commands when using this permission.", + "default": { + "allow": [], + "deny": [] + }, + "allOf": [ + { + "$ref": "#/definitions/Commands" + } + ] + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "scope": { + "description": "Allowed or denied scoped when using this permission.", + "default": { + "allow": null, + "deny": null + }, + "allOf": [ + { + "$ref": "#/definitions/Scopes" + } + ] + }, + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + } + } + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "allow-app-hide -> Enables the app_hide command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-app-hide" + ] + }, + { + "description": "deny-app-hide -> Denies the app_hide command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-app-hide" + ] + }, + { + "description": "allow-app-show -> Enables the app_show command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-app-show" + ] + }, + { + "description": "deny-app-show -> Denies the app_show command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-app-show" + ] + }, + { + "description": "allow-name -> Enables the name command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-name" + ] + }, + { + "description": "deny-name -> Denies the name command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-name" + ] + }, + { + "description": "allow-tauri-version -> Enables the tauri_version command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-tauri-version" + ] + }, + { + "description": "deny-tauri-version -> Denies the tauri_version command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-tauri-version" + ] + }, + { + "description": "allow-version -> Enables the version command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-version" + ] + }, + { + "description": "deny-version -> Denies the version command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-version" + ] + }, + { + "description": "default -> Default permissions for the plugin.", + "type": "string", + "enum": [ + "default" + ] + } + ] + }, + "PermissionSet": { + "description": "A set of direct permissions grouped together under a new name.", + "type": "object", + "required": [ + "description", + "identifier", + "permissions" + ], + "properties": { + "description": { + "description": "Human-readable description of what the permission does.", + "type": "string" + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionKind" + } + } + } + }, + "Scopes": { + "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "type": "object", + "properties": { + "allow": { + "description": "Data that defines what is allowed by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + }, + "deny": { + "description": "Data that defines what is denied by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + "Value": { + "description": "All supported ACL values.", + "anyOf": [ + { + "description": "Represents a [`bool`].", + "type": "boolean" + }, + { + "description": "Represents a valid ACL [`Number`].", + "allOf": [ + { + "$ref": "#/definitions/Number" + } + ] + }, + { + "description": "Represents a [`String`].", + "type": "string" + }, + { + "description": "Represents a list of other [`Value`]s.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + { + "description": "Represents a map of [`String`] keys to [`Value`]s.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Value" + } + } + ] + } + } +} \ No newline at end of file diff --git a/core/tauri/permissions/app/schemas/schema.json b/core/tauri/permissions/app/schemas/schema.json new file mode 100644 index 000000000..a30cf6141 --- /dev/null +++ b/core/tauri/permissions/app/schemas/schema.json @@ -0,0 +1,329 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionFile", + "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", + "type": "object", + "properties": { + "default": { + "description": "The default permission set for the plugin", + "anyOf": [ + { + "$ref": "#/definitions/DefaultPermission" + }, + { + "type": "null" + } + ] + }, + "set": { + "description": "A list of permissions sets defined", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/PermissionSet" + } + }, + "permission": { + "description": "A list of inlined permissions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + } + }, + "definitions": { + "DefaultPermission": { + "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PermissionSet": { + "description": "A set of direct permissions grouped together under a new name.", + "type": "object", + "required": [ + "description", + "identifier", + "permissions" + ], + "properties": { + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": "string" + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionKind" + } + } + } + }, + "Permission": { + "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "commands": { + "description": "Allowed or denied commands when using this permission.", + "default": { + "allow": [], + "deny": [] + }, + "allOf": [ + { + "$ref": "#/definitions/Commands" + } + ] + }, + "scope": { + "description": "Allowed or denied scoped when using this permission.", + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/Scopes" + } + ] + } + } + }, + "Commands": { + "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", + "type": "object", + "properties": { + "allow": { + "description": "Allowed command.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Denied command, which takes priority.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Scopes": { + "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "type": "object", + "properties": { + "allow": { + "description": "Data that defines what is allowed by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + }, + "deny": { + "description": "Data that defines what is denied by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + "Value": { + "description": "All supported ACL values.", + "anyOf": [ + { + "description": "Represents a null JSON value.", + "type": "null" + }, + { + "description": "Represents a [`bool`].", + "type": "boolean" + }, + { + "description": "Represents a valid ACL [`Number`].", + "allOf": [ + { + "$ref": "#/definitions/Number" + } + ] + }, + { + "description": "Represents a [`String`].", + "type": "string" + }, + { + "description": "Represents a list of other [`Value`]s.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + { + "description": "Represents a map of [`String`] keys to [`Value`]s.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Value" + } + } + ] + }, + "Number": { + "description": "A valid ACL number.", + "anyOf": [ + { + "description": "Represents an [`i64`].", + "type": "integer", + "format": "int64" + }, + { + "description": "Represents a [`f64`].", + "type": "number", + "format": "double" + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "allow-app-hide -> Enables the app_hide command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-app-hide" + ] + }, + { + "description": "deny-app-hide -> Denies the app_hide command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-app-hide" + ] + }, + { + "description": "allow-app-show -> Enables the app_show command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-app-show" + ] + }, + { + "description": "deny-app-show -> Denies the app_show command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-app-show" + ] + }, + { + "description": "allow-name -> Enables the name command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-name" + ] + }, + { + "description": "deny-name -> Denies the name command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-name" + ] + }, + { + "description": "allow-tauri-version -> Enables the tauri_version command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-tauri-version" + ] + }, + { + "description": "deny-tauri-version -> Denies the tauri_version command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-tauri-version" + ] + }, + { + "description": "allow-version -> Enables the version command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-version" + ] + }, + { + "description": "deny-version -> Denies the version command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-version" + ] + }, + { + "description": "default -> Default permissions for the plugin.", + "type": "string", + "enum": [ + "default" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/core/tauri/permissions/event/.schema.json b/core/tauri/permissions/event/.schema.json new file mode 100644 index 000000000..c073cc382 --- /dev/null +++ b/core/tauri/permissions/event/.schema.json @@ -0,0 +1,311 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionFile", + "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", + "type": "object", + "properties": { + "default": { + "description": "The default permission set for the plugin", + "anyOf": [ + { + "$ref": "#/definitions/DefaultPermission" + }, + { + "type": "null" + } + ] + }, + "permission": { + "description": "A list of inlined permissions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + }, + "set": { + "description": "A list of permissions sets defined", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/PermissionSet" + } + }, + "test": { + "description": "Test something!!", + "anyOf": [ + { + "$ref": "#/definitions/PermissionSet" + }, + { + "type": "null" + } + ] + } + }, + "definitions": { + "Commands": { + "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", + "type": "object", + "properties": { + "allow": { + "description": "Allowed command.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Denied command, which takes priority.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "DefaultPermission": { + "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "type": "string" + } + }, + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + } + } + }, + "Number": { + "description": "A valid ACL number.", + "anyOf": [ + { + "description": "Represents an [`i64`].", + "type": "integer", + "format": "int64" + }, + { + "description": "Represents a [`f64`].", + "type": "number", + "format": "double" + } + ] + }, + "Permission": { + "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "commands": { + "description": "Allowed or denied commands when using this permission.", + "default": { + "allow": [], + "deny": [] + }, + "allOf": [ + { + "$ref": "#/definitions/Commands" + } + ] + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "scope": { + "description": "Allowed or denied scoped when using this permission.", + "default": { + "allow": null, + "deny": null + }, + "allOf": [ + { + "$ref": "#/definitions/Scopes" + } + ] + }, + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + } + } + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "allow-emit -> Enables the emit command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-emit" + ] + }, + { + "description": "deny-emit -> Denies the emit command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-emit" + ] + }, + { + "description": "allow-listen -> Enables the listen command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-listen" + ] + }, + { + "description": "deny-listen -> Denies the listen command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-listen" + ] + }, + { + "description": "allow-unlisten -> Enables the unlisten command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-unlisten" + ] + }, + { + "description": "deny-unlisten -> Denies the unlisten command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-unlisten" + ] + }, + { + "description": "default -> Default permissions for the plugin.", + "type": "string", + "enum": [ + "default" + ] + } + ] + }, + "PermissionSet": { + "description": "A set of direct permissions grouped together under a new name.", + "type": "object", + "required": [ + "description", + "identifier", + "permissions" + ], + "properties": { + "description": { + "description": "Human-readable description of what the permission does.", + "type": "string" + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionKind" + } + } + } + }, + "Scopes": { + "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "type": "object", + "properties": { + "allow": { + "description": "Data that defines what is allowed by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + }, + "deny": { + "description": "Data that defines what is denied by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + "Value": { + "description": "All supported ACL values.", + "anyOf": [ + { + "description": "Represents a [`bool`].", + "type": "boolean" + }, + { + "description": "Represents a valid ACL [`Number`].", + "allOf": [ + { + "$ref": "#/definitions/Number" + } + ] + }, + { + "description": "Represents a [`String`].", + "type": "string" + }, + { + "description": "Represents a list of other [`Value`]s.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + { + "description": "Represents a map of [`String`] keys to [`Value`]s.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Value" + } + } + ] + } + } +} \ No newline at end of file diff --git a/core/tauri/permissions/event/schemas/schema.json b/core/tauri/permissions/event/schemas/schema.json new file mode 100644 index 000000000..5114b6377 --- /dev/null +++ b/core/tauri/permissions/event/schemas/schema.json @@ -0,0 +1,301 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionFile", + "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", + "type": "object", + "properties": { + "default": { + "description": "The default permission set for the plugin", + "anyOf": [ + { + "$ref": "#/definitions/DefaultPermission" + }, + { + "type": "null" + } + ] + }, + "set": { + "description": "A list of permissions sets defined", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/PermissionSet" + } + }, + "permission": { + "description": "A list of inlined permissions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + } + }, + "definitions": { + "DefaultPermission": { + "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PermissionSet": { + "description": "A set of direct permissions grouped together under a new name.", + "type": "object", + "required": [ + "description", + "identifier", + "permissions" + ], + "properties": { + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": "string" + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionKind" + } + } + } + }, + "Permission": { + "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "commands": { + "description": "Allowed or denied commands when using this permission.", + "default": { + "allow": [], + "deny": [] + }, + "allOf": [ + { + "$ref": "#/definitions/Commands" + } + ] + }, + "scope": { + "description": "Allowed or denied scoped when using this permission.", + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/Scopes" + } + ] + } + } + }, + "Commands": { + "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", + "type": "object", + "properties": { + "allow": { + "description": "Allowed command.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Denied command, which takes priority.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Scopes": { + "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "type": "object", + "properties": { + "allow": { + "description": "Data that defines what is allowed by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + }, + "deny": { + "description": "Data that defines what is denied by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + "Value": { + "description": "All supported ACL values.", + "anyOf": [ + { + "description": "Represents a null JSON value.", + "type": "null" + }, + { + "description": "Represents a [`bool`].", + "type": "boolean" + }, + { + "description": "Represents a valid ACL [`Number`].", + "allOf": [ + { + "$ref": "#/definitions/Number" + } + ] + }, + { + "description": "Represents a [`String`].", + "type": "string" + }, + { + "description": "Represents a list of other [`Value`]s.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + { + "description": "Represents a map of [`String`] keys to [`Value`]s.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Value" + } + } + ] + }, + "Number": { + "description": "A valid ACL number.", + "anyOf": [ + { + "description": "Represents an [`i64`].", + "type": "integer", + "format": "int64" + }, + { + "description": "Represents a [`f64`].", + "type": "number", + "format": "double" + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "allow-emit -> Enables the emit command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-emit" + ] + }, + { + "description": "deny-emit -> Denies the emit command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-emit" + ] + }, + { + "description": "allow-listen -> Enables the listen command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-listen" + ] + }, + { + "description": "deny-listen -> Denies the listen command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-listen" + ] + }, + { + "description": "allow-unlisten -> Enables the unlisten command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-unlisten" + ] + }, + { + "description": "deny-unlisten -> Denies the unlisten command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-unlisten" + ] + }, + { + "description": "default -> Default permissions for the plugin.", + "type": "string", + "enum": [ + "default" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/core/tauri/permissions/menu/.schema.json b/core/tauri/permissions/menu/.schema.json new file mode 100644 index 000000000..dc3a04544 --- /dev/null +++ b/core/tauri/permissions/menu/.schema.json @@ -0,0 +1,577 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionFile", + "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", + "type": "object", + "properties": { + "default": { + "description": "The default permission set for the plugin", + "anyOf": [ + { + "$ref": "#/definitions/DefaultPermission" + }, + { + "type": "null" + } + ] + }, + "permission": { + "description": "A list of inlined permissions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + }, + "set": { + "description": "A list of permissions sets defined", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/PermissionSet" + } + }, + "test": { + "description": "Test something!!", + "anyOf": [ + { + "$ref": "#/definitions/PermissionSet" + }, + { + "type": "null" + } + ] + } + }, + "definitions": { + "Commands": { + "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", + "type": "object", + "properties": { + "allow": { + "description": "Allowed command.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Denied command, which takes priority.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "DefaultPermission": { + "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "type": "string" + } + }, + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + } + } + }, + "Number": { + "description": "A valid ACL number.", + "anyOf": [ + { + "description": "Represents an [`i64`].", + "type": "integer", + "format": "int64" + }, + { + "description": "Represents a [`f64`].", + "type": "number", + "format": "double" + } + ] + }, + "Permission": { + "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "commands": { + "description": "Allowed or denied commands when using this permission.", + "default": { + "allow": [], + "deny": [] + }, + "allOf": [ + { + "$ref": "#/definitions/Commands" + } + ] + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "scope": { + "description": "Allowed or denied scoped when using this permission.", + "default": { + "allow": null, + "deny": null + }, + "allOf": [ + { + "$ref": "#/definitions/Scopes" + } + ] + }, + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + } + } + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "allow-append -> Enables the append command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-append" + ] + }, + { + "description": "deny-append -> Denies the append command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-append" + ] + }, + { + "description": "allow-create-default -> Enables the create_default command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-create-default" + ] + }, + { + "description": "deny-create-default -> Denies the create_default command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-create-default" + ] + }, + { + "description": "allow-get -> Enables the get command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-get" + ] + }, + { + "description": "deny-get -> Denies the get command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-get" + ] + }, + { + "description": "allow-insert -> Enables the insert command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-insert" + ] + }, + { + "description": "deny-insert -> Denies the insert command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-insert" + ] + }, + { + "description": "allow-is-checked -> Enables the is_checked command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-checked" + ] + }, + { + "description": "deny-is-checked -> Denies the is_checked command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-checked" + ] + }, + { + "description": "allow-is-enabled -> Enables the is_enabled command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-enabled" + ] + }, + { + "description": "deny-is-enabled -> Denies the is_enabled command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-enabled" + ] + }, + { + "description": "allow-items -> Enables the items command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-items" + ] + }, + { + "description": "deny-items -> Denies the items command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-items" + ] + }, + { + "description": "allow-new -> Enables the new command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-new" + ] + }, + { + "description": "deny-new -> Denies the new command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-new" + ] + }, + { + "description": "allow-popup -> Enables the popup command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-popup" + ] + }, + { + "description": "deny-popup -> Denies the popup command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-popup" + ] + }, + { + "description": "allow-prepend -> Enables the prepend command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-prepend" + ] + }, + { + "description": "deny-prepend -> Denies the prepend command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-prepend" + ] + }, + { + "description": "allow-remove -> Enables the remove command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-remove" + ] + }, + { + "description": "deny-remove -> Denies the remove command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-remove" + ] + }, + { + "description": "allow-remove-at -> Enables the remove_at command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-remove-at" + ] + }, + { + "description": "deny-remove-at -> Denies the remove_at command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-remove-at" + ] + }, + { + "description": "allow-set-accelerator -> Enables the set_accelerator command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-accelerator" + ] + }, + { + "description": "deny-set-accelerator -> Denies the set_accelerator command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-accelerator" + ] + }, + { + "description": "allow-set-as-app-menu -> Enables the set_as_app_menu command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-as-app-menu" + ] + }, + { + "description": "deny-set-as-app-menu -> Denies the set_as_app_menu command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-as-app-menu" + ] + }, + { + "description": "allow-set-as-help-menu-for-nsapp -> Enables the set_as_help_menu_for_nsapp command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-as-help-menu-for-nsapp" + ] + }, + { + "description": "deny-set-as-help-menu-for-nsapp -> Denies the set_as_help_menu_for_nsapp command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-as-help-menu-for-nsapp" + ] + }, + { + "description": "allow-set-as-window-menu -> Enables the set_as_window_menu command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-as-window-menu" + ] + }, + { + "description": "deny-set-as-window-menu -> Denies the set_as_window_menu command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-as-window-menu" + ] + }, + { + "description": "allow-set-as-windows-menu-for-nsapp -> Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-as-windows-menu-for-nsapp" + ] + }, + { + "description": "deny-set-as-windows-menu-for-nsapp -> Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-as-windows-menu-for-nsapp" + ] + }, + { + "description": "allow-set-checked -> Enables the set_checked command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-checked" + ] + }, + { + "description": "deny-set-checked -> Denies the set_checked command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-checked" + ] + }, + { + "description": "allow-set-enabled -> Enables the set_enabled command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-enabled" + ] + }, + { + "description": "deny-set-enabled -> Denies the set_enabled command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-enabled" + ] + }, + { + "description": "allow-set-icon -> Enables the set_icon command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-icon" + ] + }, + { + "description": "deny-set-icon -> Denies the set_icon command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-icon" + ] + }, + { + "description": "allow-set-text -> Enables the set_text command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-text" + ] + }, + { + "description": "deny-set-text -> Denies the set_text command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-text" + ] + }, + { + "description": "allow-text -> Enables the text command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-text" + ] + }, + { + "description": "deny-text -> Denies the text command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-text" + ] + }, + { + "description": "default -> Default permissions for the plugin.", + "type": "string", + "enum": [ + "default" + ] + } + ] + }, + "PermissionSet": { + "description": "A set of direct permissions grouped together under a new name.", + "type": "object", + "required": [ + "description", + "identifier", + "permissions" + ], + "properties": { + "description": { + "description": "Human-readable description of what the permission does.", + "type": "string" + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionKind" + } + } + } + }, + "Scopes": { + "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "type": "object", + "properties": { + "allow": { + "description": "Data that defines what is allowed by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + }, + "deny": { + "description": "Data that defines what is denied by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + "Value": { + "description": "All supported ACL values.", + "anyOf": [ + { + "description": "Represents a [`bool`].", + "type": "boolean" + }, + { + "description": "Represents a valid ACL [`Number`].", + "allOf": [ + { + "$ref": "#/definitions/Number" + } + ] + }, + { + "description": "Represents a [`String`].", + "type": "string" + }, + { + "description": "Represents a list of other [`Value`]s.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + { + "description": "Represents a map of [`String`] keys to [`Value`]s.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Value" + } + } + ] + } + } +} \ No newline at end of file diff --git a/core/tauri/permissions/menu/schemas/schema.json b/core/tauri/permissions/menu/schemas/schema.json new file mode 100644 index 000000000..8ff323665 --- /dev/null +++ b/core/tauri/permissions/menu/schemas/schema.json @@ -0,0 +1,567 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionFile", + "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", + "type": "object", + "properties": { + "default": { + "description": "The default permission set for the plugin", + "anyOf": [ + { + "$ref": "#/definitions/DefaultPermission" + }, + { + "type": "null" + } + ] + }, + "set": { + "description": "A list of permissions sets defined", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/PermissionSet" + } + }, + "permission": { + "description": "A list of inlined permissions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + } + }, + "definitions": { + "DefaultPermission": { + "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PermissionSet": { + "description": "A set of direct permissions grouped together under a new name.", + "type": "object", + "required": [ + "description", + "identifier", + "permissions" + ], + "properties": { + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": "string" + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionKind" + } + } + } + }, + "Permission": { + "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "commands": { + "description": "Allowed or denied commands when using this permission.", + "default": { + "allow": [], + "deny": [] + }, + "allOf": [ + { + "$ref": "#/definitions/Commands" + } + ] + }, + "scope": { + "description": "Allowed or denied scoped when using this permission.", + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/Scopes" + } + ] + } + } + }, + "Commands": { + "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", + "type": "object", + "properties": { + "allow": { + "description": "Allowed command.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Denied command, which takes priority.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Scopes": { + "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "type": "object", + "properties": { + "allow": { + "description": "Data that defines what is allowed by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + }, + "deny": { + "description": "Data that defines what is denied by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + "Value": { + "description": "All supported ACL values.", + "anyOf": [ + { + "description": "Represents a null JSON value.", + "type": "null" + }, + { + "description": "Represents a [`bool`].", + "type": "boolean" + }, + { + "description": "Represents a valid ACL [`Number`].", + "allOf": [ + { + "$ref": "#/definitions/Number" + } + ] + }, + { + "description": "Represents a [`String`].", + "type": "string" + }, + { + "description": "Represents a list of other [`Value`]s.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + { + "description": "Represents a map of [`String`] keys to [`Value`]s.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Value" + } + } + ] + }, + "Number": { + "description": "A valid ACL number.", + "anyOf": [ + { + "description": "Represents an [`i64`].", + "type": "integer", + "format": "int64" + }, + { + "description": "Represents a [`f64`].", + "type": "number", + "format": "double" + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "allow-append -> Enables the append command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-append" + ] + }, + { + "description": "deny-append -> Denies the append command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-append" + ] + }, + { + "description": "allow-create-default -> Enables the create_default command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-create-default" + ] + }, + { + "description": "deny-create-default -> Denies the create_default command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-create-default" + ] + }, + { + "description": "allow-get -> Enables the get command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-get" + ] + }, + { + "description": "deny-get -> Denies the get command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-get" + ] + }, + { + "description": "allow-insert -> Enables the insert command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-insert" + ] + }, + { + "description": "deny-insert -> Denies the insert command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-insert" + ] + }, + { + "description": "allow-is-checked -> Enables the is_checked command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-checked" + ] + }, + { + "description": "deny-is-checked -> Denies the is_checked command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-checked" + ] + }, + { + "description": "allow-is-enabled -> Enables the is_enabled command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-enabled" + ] + }, + { + "description": "deny-is-enabled -> Denies the is_enabled command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-enabled" + ] + }, + { + "description": "allow-items -> Enables the items command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-items" + ] + }, + { + "description": "deny-items -> Denies the items command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-items" + ] + }, + { + "description": "allow-new -> Enables the new command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-new" + ] + }, + { + "description": "deny-new -> Denies the new command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-new" + ] + }, + { + "description": "allow-popup -> Enables the popup command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-popup" + ] + }, + { + "description": "deny-popup -> Denies the popup command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-popup" + ] + }, + { + "description": "allow-prepend -> Enables the prepend command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-prepend" + ] + }, + { + "description": "deny-prepend -> Denies the prepend command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-prepend" + ] + }, + { + "description": "allow-remove -> Enables the remove command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-remove" + ] + }, + { + "description": "deny-remove -> Denies the remove command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-remove" + ] + }, + { + "description": "allow-remove-at -> Enables the remove_at command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-remove-at" + ] + }, + { + "description": "deny-remove-at -> Denies the remove_at command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-remove-at" + ] + }, + { + "description": "allow-set-accelerator -> Enables the set_accelerator command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-accelerator" + ] + }, + { + "description": "deny-set-accelerator -> Denies the set_accelerator command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-accelerator" + ] + }, + { + "description": "allow-set-as-app-menu -> Enables the set_as_app_menu command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-as-app-menu" + ] + }, + { + "description": "deny-set-as-app-menu -> Denies the set_as_app_menu command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-as-app-menu" + ] + }, + { + "description": "allow-set-as-help-menu-for-nsapp -> Enables the set_as_help_menu_for_nsapp command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-as-help-menu-for-nsapp" + ] + }, + { + "description": "deny-set-as-help-menu-for-nsapp -> Denies the set_as_help_menu_for_nsapp command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-as-help-menu-for-nsapp" + ] + }, + { + "description": "allow-set-as-window-menu -> Enables the set_as_window_menu command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-as-window-menu" + ] + }, + { + "description": "deny-set-as-window-menu -> Denies the set_as_window_menu command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-as-window-menu" + ] + }, + { + "description": "allow-set-as-windows-menu-for-nsapp -> Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-as-windows-menu-for-nsapp" + ] + }, + { + "description": "deny-set-as-windows-menu-for-nsapp -> Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-as-windows-menu-for-nsapp" + ] + }, + { + "description": "allow-set-checked -> Enables the set_checked command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-checked" + ] + }, + { + "description": "deny-set-checked -> Denies the set_checked command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-checked" + ] + }, + { + "description": "allow-set-enabled -> Enables the set_enabled command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-enabled" + ] + }, + { + "description": "deny-set-enabled -> Denies the set_enabled command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-enabled" + ] + }, + { + "description": "allow-set-icon -> Enables the set_icon command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-icon" + ] + }, + { + "description": "deny-set-icon -> Denies the set_icon command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-icon" + ] + }, + { + "description": "allow-set-text -> Enables the set_text command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-text" + ] + }, + { + "description": "deny-set-text -> Denies the set_text command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-text" + ] + }, + { + "description": "allow-text -> Enables the text command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-text" + ] + }, + { + "description": "deny-text -> Denies the text command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-text" + ] + }, + { + "description": "default -> Default permissions for the plugin.", + "type": "string", + "enum": [ + "default" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/core/tauri/permissions/path/.schema.json b/core/tauri/permissions/path/.schema.json new file mode 100644 index 000000000..6b58359d6 --- /dev/null +++ b/core/tauri/permissions/path/.schema.json @@ -0,0 +1,381 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionFile", + "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", + "type": "object", + "properties": { + "default": { + "description": "The default permission set for the plugin", + "anyOf": [ + { + "$ref": "#/definitions/DefaultPermission" + }, + { + "type": "null" + } + ] + }, + "permission": { + "description": "A list of inlined permissions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + }, + "set": { + "description": "A list of permissions sets defined", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/PermissionSet" + } + }, + "test": { + "description": "Test something!!", + "anyOf": [ + { + "$ref": "#/definitions/PermissionSet" + }, + { + "type": "null" + } + ] + } + }, + "definitions": { + "Commands": { + "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", + "type": "object", + "properties": { + "allow": { + "description": "Allowed command.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Denied command, which takes priority.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "DefaultPermission": { + "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "type": "string" + } + }, + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + } + } + }, + "Number": { + "description": "A valid ACL number.", + "anyOf": [ + { + "description": "Represents an [`i64`].", + "type": "integer", + "format": "int64" + }, + { + "description": "Represents a [`f64`].", + "type": "number", + "format": "double" + } + ] + }, + "Permission": { + "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "commands": { + "description": "Allowed or denied commands when using this permission.", + "default": { + "allow": [], + "deny": [] + }, + "allOf": [ + { + "$ref": "#/definitions/Commands" + } + ] + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "scope": { + "description": "Allowed or denied scoped when using this permission.", + "default": { + "allow": null, + "deny": null + }, + "allOf": [ + { + "$ref": "#/definitions/Scopes" + } + ] + }, + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + } + } + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "allow-basename -> Enables the basename command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-basename" + ] + }, + { + "description": "deny-basename -> Denies the basename command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-basename" + ] + }, + { + "description": "allow-dirname -> Enables the dirname command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-dirname" + ] + }, + { + "description": "deny-dirname -> Denies the dirname command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-dirname" + ] + }, + { + "description": "allow-extname -> Enables the extname command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-extname" + ] + }, + { + "description": "deny-extname -> Denies the extname command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-extname" + ] + }, + { + "description": "allow-is-absolute -> Enables the is_absolute command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-absolute" + ] + }, + { + "description": "deny-is-absolute -> Denies the is_absolute command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-absolute" + ] + }, + { + "description": "allow-join -> Enables the join command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-join" + ] + }, + { + "description": "deny-join -> Denies the join command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-join" + ] + }, + { + "description": "allow-normalize -> Enables the normalize command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-normalize" + ] + }, + { + "description": "deny-normalize -> Denies the normalize command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-normalize" + ] + }, + { + "description": "allow-resolve -> Enables the resolve command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-resolve" + ] + }, + { + "description": "deny-resolve -> Denies the resolve command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-resolve" + ] + }, + { + "description": "allow-resolve-directory -> Enables the resolve_directory command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-resolve-directory" + ] + }, + { + "description": "deny-resolve-directory -> Denies the resolve_directory command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-resolve-directory" + ] + }, + { + "description": "default -> Default permissions for the plugin.", + "type": "string", + "enum": [ + "default" + ] + } + ] + }, + "PermissionSet": { + "description": "A set of direct permissions grouped together under a new name.", + "type": "object", + "required": [ + "description", + "identifier", + "permissions" + ], + "properties": { + "description": { + "description": "Human-readable description of what the permission does.", + "type": "string" + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionKind" + } + } + } + }, + "Scopes": { + "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "type": "object", + "properties": { + "allow": { + "description": "Data that defines what is allowed by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + }, + "deny": { + "description": "Data that defines what is denied by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + "Value": { + "description": "All supported ACL values.", + "anyOf": [ + { + "description": "Represents a [`bool`].", + "type": "boolean" + }, + { + "description": "Represents a valid ACL [`Number`].", + "allOf": [ + { + "$ref": "#/definitions/Number" + } + ] + }, + { + "description": "Represents a [`String`].", + "type": "string" + }, + { + "description": "Represents a list of other [`Value`]s.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + { + "description": "Represents a map of [`String`] keys to [`Value`]s.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Value" + } + } + ] + } + } +} \ No newline at end of file diff --git a/core/tauri/permissions/path/schemas/schema.json b/core/tauri/permissions/path/schemas/schema.json new file mode 100644 index 000000000..f38071e81 --- /dev/null +++ b/core/tauri/permissions/path/schemas/schema.json @@ -0,0 +1,371 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionFile", + "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", + "type": "object", + "properties": { + "default": { + "description": "The default permission set for the plugin", + "anyOf": [ + { + "$ref": "#/definitions/DefaultPermission" + }, + { + "type": "null" + } + ] + }, + "set": { + "description": "A list of permissions sets defined", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/PermissionSet" + } + }, + "permission": { + "description": "A list of inlined permissions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + } + }, + "definitions": { + "DefaultPermission": { + "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PermissionSet": { + "description": "A set of direct permissions grouped together under a new name.", + "type": "object", + "required": [ + "description", + "identifier", + "permissions" + ], + "properties": { + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": "string" + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionKind" + } + } + } + }, + "Permission": { + "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "commands": { + "description": "Allowed or denied commands when using this permission.", + "default": { + "allow": [], + "deny": [] + }, + "allOf": [ + { + "$ref": "#/definitions/Commands" + } + ] + }, + "scope": { + "description": "Allowed or denied scoped when using this permission.", + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/Scopes" + } + ] + } + } + }, + "Commands": { + "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", + "type": "object", + "properties": { + "allow": { + "description": "Allowed command.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Denied command, which takes priority.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Scopes": { + "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "type": "object", + "properties": { + "allow": { + "description": "Data that defines what is allowed by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + }, + "deny": { + "description": "Data that defines what is denied by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + "Value": { + "description": "All supported ACL values.", + "anyOf": [ + { + "description": "Represents a null JSON value.", + "type": "null" + }, + { + "description": "Represents a [`bool`].", + "type": "boolean" + }, + { + "description": "Represents a valid ACL [`Number`].", + "allOf": [ + { + "$ref": "#/definitions/Number" + } + ] + }, + { + "description": "Represents a [`String`].", + "type": "string" + }, + { + "description": "Represents a list of other [`Value`]s.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + { + "description": "Represents a map of [`String`] keys to [`Value`]s.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Value" + } + } + ] + }, + "Number": { + "description": "A valid ACL number.", + "anyOf": [ + { + "description": "Represents an [`i64`].", + "type": "integer", + "format": "int64" + }, + { + "description": "Represents a [`f64`].", + "type": "number", + "format": "double" + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "allow-basename -> Enables the basename command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-basename" + ] + }, + { + "description": "deny-basename -> Denies the basename command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-basename" + ] + }, + { + "description": "allow-dirname -> Enables the dirname command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-dirname" + ] + }, + { + "description": "deny-dirname -> Denies the dirname command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-dirname" + ] + }, + { + "description": "allow-extname -> Enables the extname command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-extname" + ] + }, + { + "description": "deny-extname -> Denies the extname command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-extname" + ] + }, + { + "description": "allow-is-absolute -> Enables the is_absolute command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-absolute" + ] + }, + { + "description": "deny-is-absolute -> Denies the is_absolute command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-absolute" + ] + }, + { + "description": "allow-join -> Enables the join command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-join" + ] + }, + { + "description": "deny-join -> Denies the join command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-join" + ] + }, + { + "description": "allow-normalize -> Enables the normalize command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-normalize" + ] + }, + { + "description": "deny-normalize -> Denies the normalize command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-normalize" + ] + }, + { + "description": "allow-resolve -> Enables the resolve command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-resolve" + ] + }, + { + "description": "deny-resolve -> Denies the resolve command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-resolve" + ] + }, + { + "description": "allow-resolve-directory -> Enables the resolve_directory command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-resolve-directory" + ] + }, + { + "description": "deny-resolve-directory -> Denies the resolve_directory command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-resolve-directory" + ] + }, + { + "description": "default -> Default permissions for the plugin.", + "type": "string", + "enum": [ + "default" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/core/tauri/permissions/resources/.schema.json b/core/tauri/permissions/resources/.schema.json new file mode 100644 index 000000000..42ed3743b --- /dev/null +++ b/core/tauri/permissions/resources/.schema.json @@ -0,0 +1,283 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionFile", + "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", + "type": "object", + "properties": { + "default": { + "description": "The default permission set for the plugin", + "anyOf": [ + { + "$ref": "#/definitions/DefaultPermission" + }, + { + "type": "null" + } + ] + }, + "permission": { + "description": "A list of inlined permissions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + }, + "set": { + "description": "A list of permissions sets defined", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/PermissionSet" + } + }, + "test": { + "description": "Test something!!", + "anyOf": [ + { + "$ref": "#/definitions/PermissionSet" + }, + { + "type": "null" + } + ] + } + }, + "definitions": { + "Commands": { + "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", + "type": "object", + "properties": { + "allow": { + "description": "Allowed command.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Denied command, which takes priority.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "DefaultPermission": { + "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "type": "string" + } + }, + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + } + } + }, + "Number": { + "description": "A valid ACL number.", + "anyOf": [ + { + "description": "Represents an [`i64`].", + "type": "integer", + "format": "int64" + }, + { + "description": "Represents a [`f64`].", + "type": "number", + "format": "double" + } + ] + }, + "Permission": { + "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "commands": { + "description": "Allowed or denied commands when using this permission.", + "default": { + "allow": [], + "deny": [] + }, + "allOf": [ + { + "$ref": "#/definitions/Commands" + } + ] + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "scope": { + "description": "Allowed or denied scoped when using this permission.", + "default": { + "allow": null, + "deny": null + }, + "allOf": [ + { + "$ref": "#/definitions/Scopes" + } + ] + }, + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + } + } + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "allow-close -> Enables the close command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-close" + ] + }, + { + "description": "deny-close -> Denies the close command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-close" + ] + }, + { + "description": "default -> Default permissions for the plugin.", + "type": "string", + "enum": [ + "default" + ] + } + ] + }, + "PermissionSet": { + "description": "A set of direct permissions grouped together under a new name.", + "type": "object", + "required": [ + "description", + "identifier", + "permissions" + ], + "properties": { + "description": { + "description": "Human-readable description of what the permission does.", + "type": "string" + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionKind" + } + } + } + }, + "Scopes": { + "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "type": "object", + "properties": { + "allow": { + "description": "Data that defines what is allowed by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + }, + "deny": { + "description": "Data that defines what is denied by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + "Value": { + "description": "All supported ACL values.", + "anyOf": [ + { + "description": "Represents a [`bool`].", + "type": "boolean" + }, + { + "description": "Represents a valid ACL [`Number`].", + "allOf": [ + { + "$ref": "#/definitions/Number" + } + ] + }, + { + "description": "Represents a [`String`].", + "type": "string" + }, + { + "description": "Represents a list of other [`Value`]s.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + { + "description": "Represents a map of [`String`] keys to [`Value`]s.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Value" + } + } + ] + } + } +} \ No newline at end of file diff --git a/core/tauri/permissions/resources/schemas/schema.json b/core/tauri/permissions/resources/schemas/schema.json new file mode 100644 index 000000000..31df6c016 --- /dev/null +++ b/core/tauri/permissions/resources/schemas/schema.json @@ -0,0 +1,273 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionFile", + "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", + "type": "object", + "properties": { + "default": { + "description": "The default permission set for the plugin", + "anyOf": [ + { + "$ref": "#/definitions/DefaultPermission" + }, + { + "type": "null" + } + ] + }, + "set": { + "description": "A list of permissions sets defined", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/PermissionSet" + } + }, + "permission": { + "description": "A list of inlined permissions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + } + }, + "definitions": { + "DefaultPermission": { + "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PermissionSet": { + "description": "A set of direct permissions grouped together under a new name.", + "type": "object", + "required": [ + "description", + "identifier", + "permissions" + ], + "properties": { + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": "string" + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionKind" + } + } + } + }, + "Permission": { + "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "commands": { + "description": "Allowed or denied commands when using this permission.", + "default": { + "allow": [], + "deny": [] + }, + "allOf": [ + { + "$ref": "#/definitions/Commands" + } + ] + }, + "scope": { + "description": "Allowed or denied scoped when using this permission.", + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/Scopes" + } + ] + } + } + }, + "Commands": { + "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", + "type": "object", + "properties": { + "allow": { + "description": "Allowed command.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Denied command, which takes priority.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Scopes": { + "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "type": "object", + "properties": { + "allow": { + "description": "Data that defines what is allowed by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + }, + "deny": { + "description": "Data that defines what is denied by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + "Value": { + "description": "All supported ACL values.", + "anyOf": [ + { + "description": "Represents a null JSON value.", + "type": "null" + }, + { + "description": "Represents a [`bool`].", + "type": "boolean" + }, + { + "description": "Represents a valid ACL [`Number`].", + "allOf": [ + { + "$ref": "#/definitions/Number" + } + ] + }, + { + "description": "Represents a [`String`].", + "type": "string" + }, + { + "description": "Represents a list of other [`Value`]s.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + { + "description": "Represents a map of [`String`] keys to [`Value`]s.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Value" + } + } + ] + }, + "Number": { + "description": "A valid ACL number.", + "anyOf": [ + { + "description": "Represents an [`i64`].", + "type": "integer", + "format": "int64" + }, + { + "description": "Represents a [`f64`].", + "type": "number", + "format": "double" + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "allow-close -> Enables the close command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-close" + ] + }, + { + "description": "deny-close -> Denies the close command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-close" + ] + }, + { + "description": "default -> Default permissions for the plugin.", + "type": "string", + "enum": [ + "default" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/core/tauri/permissions/tray/.schema.json b/core/tauri/permissions/tray/.schema.json new file mode 100644 index 000000000..d25757ffe --- /dev/null +++ b/core/tauri/permissions/tray/.schema.json @@ -0,0 +1,395 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionFile", + "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", + "type": "object", + "properties": { + "default": { + "description": "The default permission set for the plugin", + "anyOf": [ + { + "$ref": "#/definitions/DefaultPermission" + }, + { + "type": "null" + } + ] + }, + "permission": { + "description": "A list of inlined permissions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + }, + "set": { + "description": "A list of permissions sets defined", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/PermissionSet" + } + }, + "test": { + "description": "Test something!!", + "anyOf": [ + { + "$ref": "#/definitions/PermissionSet" + }, + { + "type": "null" + } + ] + } + }, + "definitions": { + "Commands": { + "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", + "type": "object", + "properties": { + "allow": { + "description": "Allowed command.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Denied command, which takes priority.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "DefaultPermission": { + "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "type": "string" + } + }, + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + } + } + }, + "Number": { + "description": "A valid ACL number.", + "anyOf": [ + { + "description": "Represents an [`i64`].", + "type": "integer", + "format": "int64" + }, + { + "description": "Represents a [`f64`].", + "type": "number", + "format": "double" + } + ] + }, + "Permission": { + "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "commands": { + "description": "Allowed or denied commands when using this permission.", + "default": { + "allow": [], + "deny": [] + }, + "allOf": [ + { + "$ref": "#/definitions/Commands" + } + ] + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "scope": { + "description": "Allowed or denied scoped when using this permission.", + "default": { + "allow": null, + "deny": null + }, + "allOf": [ + { + "$ref": "#/definitions/Scopes" + } + ] + }, + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + } + } + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "allow-new -> Enables the new command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-new" + ] + }, + { + "description": "deny-new -> Denies the new command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-new" + ] + }, + { + "description": "allow-set-icon -> Enables the set_icon command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-icon" + ] + }, + { + "description": "deny-set-icon -> Denies the set_icon command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-icon" + ] + }, + { + "description": "allow-set-icon-as-template -> Enables the set_icon_as_template command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-icon-as-template" + ] + }, + { + "description": "deny-set-icon-as-template -> Denies the set_icon_as_template command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-icon-as-template" + ] + }, + { + "description": "allow-set-menu -> Enables the set_menu command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-menu" + ] + }, + { + "description": "deny-set-menu -> Denies the set_menu command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-menu" + ] + }, + { + "description": "allow-set-show-menu-on-left-click -> Enables the set_show_menu_on_left_click command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-show-menu-on-left-click" + ] + }, + { + "description": "deny-set-show-menu-on-left-click -> Denies the set_show_menu_on_left_click command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-show-menu-on-left-click" + ] + }, + { + "description": "allow-set-temp-dir-path -> Enables the set_temp_dir_path command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-temp-dir-path" + ] + }, + { + "description": "deny-set-temp-dir-path -> Denies the set_temp_dir_path command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-temp-dir-path" + ] + }, + { + "description": "allow-set-title -> Enables the set_title command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-title" + ] + }, + { + "description": "deny-set-title -> Denies the set_title command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-title" + ] + }, + { + "description": "allow-set-tooltip -> Enables the set_tooltip command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-tooltip" + ] + }, + { + "description": "deny-set-tooltip -> Denies the set_tooltip command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-tooltip" + ] + }, + { + "description": "allow-set-visible -> Enables the set_visible command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-visible" + ] + }, + { + "description": "deny-set-visible -> Denies the set_visible command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-visible" + ] + }, + { + "description": "default -> Default permissions for the plugin.", + "type": "string", + "enum": [ + "default" + ] + } + ] + }, + "PermissionSet": { + "description": "A set of direct permissions grouped together under a new name.", + "type": "object", + "required": [ + "description", + "identifier", + "permissions" + ], + "properties": { + "description": { + "description": "Human-readable description of what the permission does.", + "type": "string" + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionKind" + } + } + } + }, + "Scopes": { + "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "type": "object", + "properties": { + "allow": { + "description": "Data that defines what is allowed by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + }, + "deny": { + "description": "Data that defines what is denied by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + "Value": { + "description": "All supported ACL values.", + "anyOf": [ + { + "description": "Represents a [`bool`].", + "type": "boolean" + }, + { + "description": "Represents a valid ACL [`Number`].", + "allOf": [ + { + "$ref": "#/definitions/Number" + } + ] + }, + { + "description": "Represents a [`String`].", + "type": "string" + }, + { + "description": "Represents a list of other [`Value`]s.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + { + "description": "Represents a map of [`String`] keys to [`Value`]s.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Value" + } + } + ] + } + } +} \ No newline at end of file diff --git a/core/tauri/permissions/tray/schemas/schema.json b/core/tauri/permissions/tray/schemas/schema.json new file mode 100644 index 000000000..9d2ff991e --- /dev/null +++ b/core/tauri/permissions/tray/schemas/schema.json @@ -0,0 +1,385 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionFile", + "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", + "type": "object", + "properties": { + "default": { + "description": "The default permission set for the plugin", + "anyOf": [ + { + "$ref": "#/definitions/DefaultPermission" + }, + { + "type": "null" + } + ] + }, + "set": { + "description": "A list of permissions sets defined", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/PermissionSet" + } + }, + "permission": { + "description": "A list of inlined permissions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + } + }, + "definitions": { + "DefaultPermission": { + "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PermissionSet": { + "description": "A set of direct permissions grouped together under a new name.", + "type": "object", + "required": [ + "description", + "identifier", + "permissions" + ], + "properties": { + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": "string" + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionKind" + } + } + } + }, + "Permission": { + "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "commands": { + "description": "Allowed or denied commands when using this permission.", + "default": { + "allow": [], + "deny": [] + }, + "allOf": [ + { + "$ref": "#/definitions/Commands" + } + ] + }, + "scope": { + "description": "Allowed or denied scoped when using this permission.", + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/Scopes" + } + ] + } + } + }, + "Commands": { + "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", + "type": "object", + "properties": { + "allow": { + "description": "Allowed command.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Denied command, which takes priority.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Scopes": { + "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "type": "object", + "properties": { + "allow": { + "description": "Data that defines what is allowed by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + }, + "deny": { + "description": "Data that defines what is denied by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + "Value": { + "description": "All supported ACL values.", + "anyOf": [ + { + "description": "Represents a null JSON value.", + "type": "null" + }, + { + "description": "Represents a [`bool`].", + "type": "boolean" + }, + { + "description": "Represents a valid ACL [`Number`].", + "allOf": [ + { + "$ref": "#/definitions/Number" + } + ] + }, + { + "description": "Represents a [`String`].", + "type": "string" + }, + { + "description": "Represents a list of other [`Value`]s.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + { + "description": "Represents a map of [`String`] keys to [`Value`]s.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Value" + } + } + ] + }, + "Number": { + "description": "A valid ACL number.", + "anyOf": [ + { + "description": "Represents an [`i64`].", + "type": "integer", + "format": "int64" + }, + { + "description": "Represents a [`f64`].", + "type": "number", + "format": "double" + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "allow-new -> Enables the new command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-new" + ] + }, + { + "description": "deny-new -> Denies the new command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-new" + ] + }, + { + "description": "allow-set-icon -> Enables the set_icon command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-icon" + ] + }, + { + "description": "deny-set-icon -> Denies the set_icon command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-icon" + ] + }, + { + "description": "allow-set-icon-as-template -> Enables the set_icon_as_template command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-icon-as-template" + ] + }, + { + "description": "deny-set-icon-as-template -> Denies the set_icon_as_template command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-icon-as-template" + ] + }, + { + "description": "allow-set-menu -> Enables the set_menu command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-menu" + ] + }, + { + "description": "deny-set-menu -> Denies the set_menu command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-menu" + ] + }, + { + "description": "allow-set-show-menu-on-left-click -> Enables the set_show_menu_on_left_click command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-show-menu-on-left-click" + ] + }, + { + "description": "deny-set-show-menu-on-left-click -> Denies the set_show_menu_on_left_click command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-show-menu-on-left-click" + ] + }, + { + "description": "allow-set-temp-dir-path -> Enables the set_temp_dir_path command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-temp-dir-path" + ] + }, + { + "description": "deny-set-temp-dir-path -> Denies the set_temp_dir_path command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-temp-dir-path" + ] + }, + { + "description": "allow-set-title -> Enables the set_title command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-title" + ] + }, + { + "description": "deny-set-title -> Denies the set_title command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-title" + ] + }, + { + "description": "allow-set-tooltip -> Enables the set_tooltip command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-tooltip" + ] + }, + { + "description": "deny-set-tooltip -> Denies the set_tooltip command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-tooltip" + ] + }, + { + "description": "allow-set-visible -> Enables the set_visible command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-visible" + ] + }, + { + "description": "deny-set-visible -> Denies the set_visible command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-visible" + ] + }, + { + "description": "default -> Default permissions for the plugin.", + "type": "string", + "enum": [ + "default" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/core/tauri/permissions/webview/.schema.json b/core/tauri/permissions/webview/.schema.json new file mode 100644 index 000000000..688de14a5 --- /dev/null +++ b/core/tauri/permissions/webview/.schema.json @@ -0,0 +1,409 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionFile", + "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", + "type": "object", + "properties": { + "default": { + "description": "The default permission set for the plugin", + "anyOf": [ + { + "$ref": "#/definitions/DefaultPermission" + }, + { + "type": "null" + } + ] + }, + "permission": { + "description": "A list of inlined permissions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + }, + "set": { + "description": "A list of permissions sets defined", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/PermissionSet" + } + }, + "test": { + "description": "Test something!!", + "anyOf": [ + { + "$ref": "#/definitions/PermissionSet" + }, + { + "type": "null" + } + ] + } + }, + "definitions": { + "Commands": { + "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", + "type": "object", + "properties": { + "allow": { + "description": "Allowed command.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Denied command, which takes priority.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "DefaultPermission": { + "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "type": "string" + } + }, + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + } + } + }, + "Number": { + "description": "A valid ACL number.", + "anyOf": [ + { + "description": "Represents an [`i64`].", + "type": "integer", + "format": "int64" + }, + { + "description": "Represents a [`f64`].", + "type": "number", + "format": "double" + } + ] + }, + "Permission": { + "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "commands": { + "description": "Allowed or denied commands when using this permission.", + "default": { + "allow": [], + "deny": [] + }, + "allOf": [ + { + "$ref": "#/definitions/Commands" + } + ] + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "scope": { + "description": "Allowed or denied scoped when using this permission.", + "default": { + "allow": null, + "deny": null + }, + "allOf": [ + { + "$ref": "#/definitions/Scopes" + } + ] + }, + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + } + } + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "allow-create-webview -> Enables the create_webview command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-create-webview" + ] + }, + { + "description": "deny-create-webview -> Denies the create_webview command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-create-webview" + ] + }, + { + "description": "allow-create-webview-window -> Enables the create_webview_window command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-create-webview-window" + ] + }, + { + "description": "deny-create-webview-window -> Denies the create_webview_window command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-create-webview-window" + ] + }, + { + "description": "allow-internal-toggle-devtools -> Enables the internal_toggle_devtools command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-internal-toggle-devtools" + ] + }, + { + "description": "deny-internal-toggle-devtools -> Denies the internal_toggle_devtools command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-internal-toggle-devtools" + ] + }, + { + "description": "allow-print -> Enables the print command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-print" + ] + }, + { + "description": "deny-print -> Denies the print command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-print" + ] + }, + { + "description": "allow-set-webview-focus -> Enables the set_webview_focus command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-webview-focus" + ] + }, + { + "description": "deny-set-webview-focus -> Denies the set_webview_focus command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-webview-focus" + ] + }, + { + "description": "allow-set-webview-position -> Enables the set_webview_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-webview-position" + ] + }, + { + "description": "deny-set-webview-position -> Denies the set_webview_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-webview-position" + ] + }, + { + "description": "allow-set-webview-size -> Enables the set_webview_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-webview-size" + ] + }, + { + "description": "deny-set-webview-size -> Denies the set_webview_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-webview-size" + ] + }, + { + "description": "allow-webview-close -> Enables the webview_close command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-webview-close" + ] + }, + { + "description": "deny-webview-close -> Denies the webview_close command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-webview-close" + ] + }, + { + "description": "allow-webview-position -> Enables the webview_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-webview-position" + ] + }, + { + "description": "deny-webview-position -> Denies the webview_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-webview-position" + ] + }, + { + "description": "allow-webview-size -> Enables the webview_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-webview-size" + ] + }, + { + "description": "deny-webview-size -> Denies the webview_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-webview-size" + ] + }, + { + "description": "default -> Default permissions for the plugin.", + "type": "string", + "enum": [ + "default" + ] + } + ] + }, + "PermissionSet": { + "description": "A set of direct permissions grouped together under a new name.", + "type": "object", + "required": [ + "description", + "identifier", + "permissions" + ], + "properties": { + "description": { + "description": "Human-readable description of what the permission does.", + "type": "string" + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionKind" + } + } + } + }, + "Scopes": { + "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "type": "object", + "properties": { + "allow": { + "description": "Data that defines what is allowed by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + }, + "deny": { + "description": "Data that defines what is denied by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + "Value": { + "description": "All supported ACL values.", + "anyOf": [ + { + "description": "Represents a [`bool`].", + "type": "boolean" + }, + { + "description": "Represents a valid ACL [`Number`].", + "allOf": [ + { + "$ref": "#/definitions/Number" + } + ] + }, + { + "description": "Represents a [`String`].", + "type": "string" + }, + { + "description": "Represents a list of other [`Value`]s.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + { + "description": "Represents a map of [`String`] keys to [`Value`]s.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Value" + } + } + ] + } + } +} \ No newline at end of file diff --git a/core/tauri/permissions/webview/schemas/schema.json b/core/tauri/permissions/webview/schemas/schema.json new file mode 100644 index 000000000..dd0a74532 --- /dev/null +++ b/core/tauri/permissions/webview/schemas/schema.json @@ -0,0 +1,399 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionFile", + "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", + "type": "object", + "properties": { + "default": { + "description": "The default permission set for the plugin", + "anyOf": [ + { + "$ref": "#/definitions/DefaultPermission" + }, + { + "type": "null" + } + ] + }, + "set": { + "description": "A list of permissions sets defined", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/PermissionSet" + } + }, + "permission": { + "description": "A list of inlined permissions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + } + }, + "definitions": { + "DefaultPermission": { + "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PermissionSet": { + "description": "A set of direct permissions grouped together under a new name.", + "type": "object", + "required": [ + "description", + "identifier", + "permissions" + ], + "properties": { + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": "string" + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionKind" + } + } + } + }, + "Permission": { + "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "commands": { + "description": "Allowed or denied commands when using this permission.", + "default": { + "allow": [], + "deny": [] + }, + "allOf": [ + { + "$ref": "#/definitions/Commands" + } + ] + }, + "scope": { + "description": "Allowed or denied scoped when using this permission.", + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/Scopes" + } + ] + } + } + }, + "Commands": { + "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", + "type": "object", + "properties": { + "allow": { + "description": "Allowed command.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Denied command, which takes priority.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Scopes": { + "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "type": "object", + "properties": { + "allow": { + "description": "Data that defines what is allowed by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + }, + "deny": { + "description": "Data that defines what is denied by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + "Value": { + "description": "All supported ACL values.", + "anyOf": [ + { + "description": "Represents a null JSON value.", + "type": "null" + }, + { + "description": "Represents a [`bool`].", + "type": "boolean" + }, + { + "description": "Represents a valid ACL [`Number`].", + "allOf": [ + { + "$ref": "#/definitions/Number" + } + ] + }, + { + "description": "Represents a [`String`].", + "type": "string" + }, + { + "description": "Represents a list of other [`Value`]s.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + { + "description": "Represents a map of [`String`] keys to [`Value`]s.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Value" + } + } + ] + }, + "Number": { + "description": "A valid ACL number.", + "anyOf": [ + { + "description": "Represents an [`i64`].", + "type": "integer", + "format": "int64" + }, + { + "description": "Represents a [`f64`].", + "type": "number", + "format": "double" + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "allow-create-webview -> Enables the create_webview command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-create-webview" + ] + }, + { + "description": "deny-create-webview -> Denies the create_webview command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-create-webview" + ] + }, + { + "description": "allow-create-webview-window -> Enables the create_webview_window command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-create-webview-window" + ] + }, + { + "description": "deny-create-webview-window -> Denies the create_webview_window command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-create-webview-window" + ] + }, + { + "description": "allow-internal-toggle-devtools -> Enables the internal_toggle_devtools command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-internal-toggle-devtools" + ] + }, + { + "description": "deny-internal-toggle-devtools -> Denies the internal_toggle_devtools command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-internal-toggle-devtools" + ] + }, + { + "description": "allow-print -> Enables the print command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-print" + ] + }, + { + "description": "deny-print -> Denies the print command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-print" + ] + }, + { + "description": "allow-set-webview-focus -> Enables the set_webview_focus command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-webview-focus" + ] + }, + { + "description": "deny-set-webview-focus -> Denies the set_webview_focus command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-webview-focus" + ] + }, + { + "description": "allow-set-webview-position -> Enables the set_webview_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-webview-position" + ] + }, + { + "description": "deny-set-webview-position -> Denies the set_webview_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-webview-position" + ] + }, + { + "description": "allow-set-webview-size -> Enables the set_webview_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-webview-size" + ] + }, + { + "description": "deny-set-webview-size -> Denies the set_webview_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-webview-size" + ] + }, + { + "description": "allow-webview-close -> Enables the webview_close command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-webview-close" + ] + }, + { + "description": "deny-webview-close -> Denies the webview_close command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-webview-close" + ] + }, + { + "description": "allow-webview-position -> Enables the webview_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-webview-position" + ] + }, + { + "description": "deny-webview-position -> Denies the webview_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-webview-position" + ] + }, + { + "description": "allow-webview-size -> Enables the webview_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-webview-size" + ] + }, + { + "description": "deny-webview-size -> Denies the webview_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-webview-size" + ] + }, + { + "description": "default -> Default permissions for the plugin.", + "type": "string", + "enum": [ + "default" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/core/tauri/permissions/window/.schema.json b/core/tauri/permissions/window/.schema.json new file mode 100644 index 000000000..3b2d603b8 --- /dev/null +++ b/core/tauri/permissions/window/.schema.json @@ -0,0 +1,1109 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionFile", + "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", + "type": "object", + "properties": { + "default": { + "description": "The default permission set for the plugin", + "anyOf": [ + { + "$ref": "#/definitions/DefaultPermission" + }, + { + "type": "null" + } + ] + }, + "permission": { + "description": "A list of inlined permissions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + }, + "set": { + "description": "A list of permissions sets defined", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/PermissionSet" + } + }, + "test": { + "description": "Test something!!", + "anyOf": [ + { + "$ref": "#/definitions/PermissionSet" + }, + { + "type": "null" + } + ] + } + }, + "definitions": { + "Commands": { + "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", + "type": "object", + "properties": { + "allow": { + "description": "Allowed command.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Denied command, which takes priority.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "DefaultPermission": { + "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "type": "string" + } + }, + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + } + } + }, + "Number": { + "description": "A valid ACL number.", + "anyOf": [ + { + "description": "Represents an [`i64`].", + "type": "integer", + "format": "int64" + }, + { + "description": "Represents a [`f64`].", + "type": "number", + "format": "double" + } + ] + }, + "Permission": { + "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "commands": { + "description": "Allowed or denied commands when using this permission.", + "default": { + "allow": [], + "deny": [] + }, + "allOf": [ + { + "$ref": "#/definitions/Commands" + } + ] + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "scope": { + "description": "Allowed or denied scoped when using this permission.", + "default": { + "allow": null, + "deny": null + }, + "allOf": [ + { + "$ref": "#/definitions/Scopes" + } + ] + }, + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + } + } + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "allow-available-monitors -> Enables the available_monitors command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-available-monitors" + ] + }, + { + "description": "deny-available-monitors -> Denies the available_monitors command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-available-monitors" + ] + }, + { + "description": "allow-center -> Enables the center command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-center" + ] + }, + { + "description": "deny-center -> Denies the center command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-center" + ] + }, + { + "description": "allow-close -> Enables the close command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-close" + ] + }, + { + "description": "deny-close -> Denies the close command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-close" + ] + }, + { + "description": "allow-create -> Enables the create command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-create" + ] + }, + { + "description": "deny-create -> Denies the create command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-create" + ] + }, + { + "description": "allow-current-monitor -> Enables the current_monitor command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-current-monitor" + ] + }, + { + "description": "deny-current-monitor -> Denies the current_monitor command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-current-monitor" + ] + }, + { + "description": "allow-hide -> Enables the hide command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-hide" + ] + }, + { + "description": "deny-hide -> Denies the hide command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-hide" + ] + }, + { + "description": "allow-inner-position -> Enables the inner_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-inner-position" + ] + }, + { + "description": "deny-inner-position -> Denies the inner_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-inner-position" + ] + }, + { + "description": "allow-inner-size -> Enables the inner_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-inner-size" + ] + }, + { + "description": "deny-inner-size -> Denies the inner_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-inner-size" + ] + }, + { + "description": "allow-internal-on-mousedown -> Enables the internal_on_mousedown command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-internal-on-mousedown" + ] + }, + { + "description": "deny-internal-on-mousedown -> Denies the internal_on_mousedown command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-internal-on-mousedown" + ] + }, + { + "description": "allow-internal-on-mousemove -> Enables the internal_on_mousemove command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-internal-on-mousemove" + ] + }, + { + "description": "deny-internal-on-mousemove -> Denies the internal_on_mousemove command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-internal-on-mousemove" + ] + }, + { + "description": "allow-internal-toggle-maximize -> Enables the internal_toggle_maximize command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-internal-toggle-maximize" + ] + }, + { + "description": "deny-internal-toggle-maximize -> Denies the internal_toggle_maximize command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-internal-toggle-maximize" + ] + }, + { + "description": "allow-is-closable -> Enables the is_closable command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-closable" + ] + }, + { + "description": "deny-is-closable -> Denies the is_closable command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-closable" + ] + }, + { + "description": "allow-is-decorated -> Enables the is_decorated command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-decorated" + ] + }, + { + "description": "deny-is-decorated -> Denies the is_decorated command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-decorated" + ] + }, + { + "description": "allow-is-focused -> Enables the is_focused command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-focused" + ] + }, + { + "description": "deny-is-focused -> Denies the is_focused command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-focused" + ] + }, + { + "description": "allow-is-fullscreen -> Enables the is_fullscreen command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-fullscreen" + ] + }, + { + "description": "deny-is-fullscreen -> Denies the is_fullscreen command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-fullscreen" + ] + }, + { + "description": "allow-is-maximizable -> Enables the is_maximizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-maximizable" + ] + }, + { + "description": "deny-is-maximizable -> Denies the is_maximizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-maximizable" + ] + }, + { + "description": "allow-is-maximized -> Enables the is_maximized command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-maximized" + ] + }, + { + "description": "deny-is-maximized -> Denies the is_maximized command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-maximized" + ] + }, + { + "description": "allow-is-minimizable -> Enables the is_minimizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-minimizable" + ] + }, + { + "description": "deny-is-minimizable -> Denies the is_minimizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-minimizable" + ] + }, + { + "description": "allow-is-minimized -> Enables the is_minimized command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-minimized" + ] + }, + { + "description": "deny-is-minimized -> Denies the is_minimized command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-minimized" + ] + }, + { + "description": "allow-is-resizable -> Enables the is_resizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-resizable" + ] + }, + { + "description": "deny-is-resizable -> Denies the is_resizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-resizable" + ] + }, + { + "description": "allow-is-visible -> Enables the is_visible command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-visible" + ] + }, + { + "description": "deny-is-visible -> Denies the is_visible command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-visible" + ] + }, + { + "description": "allow-maximize -> Enables the maximize command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-maximize" + ] + }, + { + "description": "deny-maximize -> Denies the maximize command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-maximize" + ] + }, + { + "description": "allow-minimize -> Enables the minimize command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-minimize" + ] + }, + { + "description": "deny-minimize -> Denies the minimize command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-minimize" + ] + }, + { + "description": "allow-outer-position -> Enables the outer_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-outer-position" + ] + }, + { + "description": "deny-outer-position -> Denies the outer_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-outer-position" + ] + }, + { + "description": "allow-outer-size -> Enables the outer_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-outer-size" + ] + }, + { + "description": "deny-outer-size -> Denies the outer_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-outer-size" + ] + }, + { + "description": "allow-primary-monitor -> Enables the primary_monitor command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-primary-monitor" + ] + }, + { + "description": "deny-primary-monitor -> Denies the primary_monitor command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-primary-monitor" + ] + }, + { + "description": "allow-request-user-attention -> Enables the request_user_attention command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-request-user-attention" + ] + }, + { + "description": "deny-request-user-attention -> Denies the request_user_attention command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-request-user-attention" + ] + }, + { + "description": "allow-scale-factor -> Enables the scale_factor command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-scale-factor" + ] + }, + { + "description": "deny-scale-factor -> Denies the scale_factor command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-scale-factor" + ] + }, + { + "description": "allow-set-always-on-bottom -> Enables the set_always_on_bottom command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-always-on-bottom" + ] + }, + { + "description": "deny-set-always-on-bottom -> Denies the set_always_on_bottom command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-always-on-bottom" + ] + }, + { + "description": "allow-set-always-on-top -> Enables the set_always_on_top command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-always-on-top" + ] + }, + { + "description": "deny-set-always-on-top -> Denies the set_always_on_top command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-always-on-top" + ] + }, + { + "description": "allow-set-closable -> Enables the set_closable command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-closable" + ] + }, + { + "description": "deny-set-closable -> Denies the set_closable command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-closable" + ] + }, + { + "description": "allow-set-content-protected -> Enables the set_content_protected command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-content-protected" + ] + }, + { + "description": "deny-set-content-protected -> Denies the set_content_protected command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-content-protected" + ] + }, + { + "description": "allow-set-cursor-grab -> Enables the set_cursor_grab command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-cursor-grab" + ] + }, + { + "description": "deny-set-cursor-grab -> Denies the set_cursor_grab command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-cursor-grab" + ] + }, + { + "description": "allow-set-cursor-icon -> Enables the set_cursor_icon command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-cursor-icon" + ] + }, + { + "description": "deny-set-cursor-icon -> Denies the set_cursor_icon command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-cursor-icon" + ] + }, + { + "description": "allow-set-cursor-position -> Enables the set_cursor_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-cursor-position" + ] + }, + { + "description": "deny-set-cursor-position -> Denies the set_cursor_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-cursor-position" + ] + }, + { + "description": "allow-set-cursor-visible -> Enables the set_cursor_visible command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-cursor-visible" + ] + }, + { + "description": "deny-set-cursor-visible -> Denies the set_cursor_visible command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-cursor-visible" + ] + }, + { + "description": "allow-set-decorations -> Enables the set_decorations command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-decorations" + ] + }, + { + "description": "deny-set-decorations -> Denies the set_decorations command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-decorations" + ] + }, + { + "description": "allow-set-effects -> Enables the set_effects command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-effects" + ] + }, + { + "description": "deny-set-effects -> Denies the set_effects command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-effects" + ] + }, + { + "description": "allow-set-focus -> Enables the set_focus command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-focus" + ] + }, + { + "description": "deny-set-focus -> Denies the set_focus command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-focus" + ] + }, + { + "description": "allow-set-fullscreen -> Enables the set_fullscreen command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-fullscreen" + ] + }, + { + "description": "deny-set-fullscreen -> Denies the set_fullscreen command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-fullscreen" + ] + }, + { + "description": "allow-set-icon -> Enables the set_icon command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-icon" + ] + }, + { + "description": "deny-set-icon -> Denies the set_icon command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-icon" + ] + }, + { + "description": "allow-set-ignore-cursor-events -> Enables the set_ignore_cursor_events command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-ignore-cursor-events" + ] + }, + { + "description": "deny-set-ignore-cursor-events -> Denies the set_ignore_cursor_events command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-ignore-cursor-events" + ] + }, + { + "description": "allow-set-max-size -> Enables the set_max_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-max-size" + ] + }, + { + "description": "deny-set-max-size -> Denies the set_max_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-max-size" + ] + }, + { + "description": "allow-set-maximizable -> Enables the set_maximizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-maximizable" + ] + }, + { + "description": "deny-set-maximizable -> Denies the set_maximizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-maximizable" + ] + }, + { + "description": "allow-set-min-size -> Enables the set_min_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-min-size" + ] + }, + { + "description": "deny-set-min-size -> Denies the set_min_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-min-size" + ] + }, + { + "description": "allow-set-minimizable -> Enables the set_minimizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-minimizable" + ] + }, + { + "description": "deny-set-minimizable -> Denies the set_minimizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-minimizable" + ] + }, + { + "description": "allow-set-position -> Enables the set_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-position" + ] + }, + { + "description": "deny-set-position -> Denies the set_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-position" + ] + }, + { + "description": "allow-set-progress-bar -> Enables the set_progress_bar command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-progress-bar" + ] + }, + { + "description": "deny-set-progress-bar -> Denies the set_progress_bar command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-progress-bar" + ] + }, + { + "description": "allow-set-resizable -> Enables the set_resizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-resizable" + ] + }, + { + "description": "deny-set-resizable -> Denies the set_resizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-resizable" + ] + }, + { + "description": "allow-set-shadow -> Enables the set_shadow command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-shadow" + ] + }, + { + "description": "deny-set-shadow -> Denies the set_shadow command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-shadow" + ] + }, + { + "description": "allow-set-size -> Enables the set_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-size" + ] + }, + { + "description": "deny-set-size -> Denies the set_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-size" + ] + }, + { + "description": "allow-set-skip-taskbar -> Enables the set_skip_taskbar command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-skip-taskbar" + ] + }, + { + "description": "deny-set-skip-taskbar -> Denies the set_skip_taskbar command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-skip-taskbar" + ] + }, + { + "description": "allow-set-title -> Enables the set_title command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-title" + ] + }, + { + "description": "deny-set-title -> Denies the set_title command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-title" + ] + }, + { + "description": "allow-show -> Enables the show command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-show" + ] + }, + { + "description": "deny-show -> Denies the show command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-show" + ] + }, + { + "description": "allow-start-dragging -> Enables the start_dragging command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-start-dragging" + ] + }, + { + "description": "deny-start-dragging -> Denies the start_dragging command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-start-dragging" + ] + }, + { + "description": "allow-theme -> Enables the theme command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-theme" + ] + }, + { + "description": "deny-theme -> Denies the theme command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-theme" + ] + }, + { + "description": "allow-title -> Enables the title command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-title" + ] + }, + { + "description": "deny-title -> Denies the title command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-title" + ] + }, + { + "description": "allow-toggle-maximize -> Enables the toggle_maximize command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-toggle-maximize" + ] + }, + { + "description": "deny-toggle-maximize -> Denies the toggle_maximize command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-toggle-maximize" + ] + }, + { + "description": "allow-unmaximize -> Enables the unmaximize command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-unmaximize" + ] + }, + { + "description": "deny-unmaximize -> Denies the unmaximize command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-unmaximize" + ] + }, + { + "description": "allow-unminimize -> Enables the unminimize command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-unminimize" + ] + }, + { + "description": "deny-unminimize -> Denies the unminimize command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-unminimize" + ] + }, + { + "description": "default -> Default permissions for the plugin.", + "type": "string", + "enum": [ + "default" + ] + } + ] + }, + "PermissionSet": { + "description": "A set of direct permissions grouped together under a new name.", + "type": "object", + "required": [ + "description", + "identifier", + "permissions" + ], + "properties": { + "description": { + "description": "Human-readable description of what the permission does.", + "type": "string" + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionKind" + } + } + } + }, + "Scopes": { + "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "type": "object", + "properties": { + "allow": { + "description": "Data that defines what is allowed by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + }, + "deny": { + "description": "Data that defines what is denied by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + "Value": { + "description": "All supported ACL values.", + "anyOf": [ + { + "description": "Represents a [`bool`].", + "type": "boolean" + }, + { + "description": "Represents a valid ACL [`Number`].", + "allOf": [ + { + "$ref": "#/definitions/Number" + } + ] + }, + { + "description": "Represents a [`String`].", + "type": "string" + }, + { + "description": "Represents a list of other [`Value`]s.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + { + "description": "Represents a map of [`String`] keys to [`Value`]s.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Value" + } + } + ] + } + } +} \ No newline at end of file diff --git a/core/tauri/permissions/window/schemas/schema.json b/core/tauri/permissions/window/schemas/schema.json new file mode 100644 index 000000000..09d8ab51e --- /dev/null +++ b/core/tauri/permissions/window/schemas/schema.json @@ -0,0 +1,1099 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionFile", + "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", + "type": "object", + "properties": { + "default": { + "description": "The default permission set for the plugin", + "anyOf": [ + { + "$ref": "#/definitions/DefaultPermission" + }, + { + "type": "null" + } + ] + }, + "set": { + "description": "A list of permissions sets defined", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/PermissionSet" + } + }, + "permission": { + "description": "A list of inlined permissions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + } + }, + "definitions": { + "DefaultPermission": { + "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PermissionSet": { + "description": "A set of direct permissions grouped together under a new name.", + "type": "object", + "required": [ + "description", + "identifier", + "permissions" + ], + "properties": { + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": "string" + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionKind" + } + } + } + }, + "Permission": { + "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "commands": { + "description": "Allowed or denied commands when using this permission.", + "default": { + "allow": [], + "deny": [] + }, + "allOf": [ + { + "$ref": "#/definitions/Commands" + } + ] + }, + "scope": { + "description": "Allowed or denied scoped when using this permission.", + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/Scopes" + } + ] + } + } + }, + "Commands": { + "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", + "type": "object", + "properties": { + "allow": { + "description": "Allowed command.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Denied command, which takes priority.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Scopes": { + "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "type": "object", + "properties": { + "allow": { + "description": "Data that defines what is allowed by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + }, + "deny": { + "description": "Data that defines what is denied by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + "Value": { + "description": "All supported ACL values.", + "anyOf": [ + { + "description": "Represents a null JSON value.", + "type": "null" + }, + { + "description": "Represents a [`bool`].", + "type": "boolean" + }, + { + "description": "Represents a valid ACL [`Number`].", + "allOf": [ + { + "$ref": "#/definitions/Number" + } + ] + }, + { + "description": "Represents a [`String`].", + "type": "string" + }, + { + "description": "Represents a list of other [`Value`]s.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + { + "description": "Represents a map of [`String`] keys to [`Value`]s.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Value" + } + } + ] + }, + "Number": { + "description": "A valid ACL number.", + "anyOf": [ + { + "description": "Represents an [`i64`].", + "type": "integer", + "format": "int64" + }, + { + "description": "Represents a [`f64`].", + "type": "number", + "format": "double" + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "allow-available-monitors -> Enables the available_monitors command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-available-monitors" + ] + }, + { + "description": "deny-available-monitors -> Denies the available_monitors command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-available-monitors" + ] + }, + { + "description": "allow-center -> Enables the center command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-center" + ] + }, + { + "description": "deny-center -> Denies the center command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-center" + ] + }, + { + "description": "allow-close -> Enables the close command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-close" + ] + }, + { + "description": "deny-close -> Denies the close command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-close" + ] + }, + { + "description": "allow-create -> Enables the create command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-create" + ] + }, + { + "description": "deny-create -> Denies the create command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-create" + ] + }, + { + "description": "allow-current-monitor -> Enables the current_monitor command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-current-monitor" + ] + }, + { + "description": "deny-current-monitor -> Denies the current_monitor command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-current-monitor" + ] + }, + { + "description": "allow-hide -> Enables the hide command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-hide" + ] + }, + { + "description": "deny-hide -> Denies the hide command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-hide" + ] + }, + { + "description": "allow-inner-position -> Enables the inner_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-inner-position" + ] + }, + { + "description": "deny-inner-position -> Denies the inner_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-inner-position" + ] + }, + { + "description": "allow-inner-size -> Enables the inner_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-inner-size" + ] + }, + { + "description": "deny-inner-size -> Denies the inner_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-inner-size" + ] + }, + { + "description": "allow-internal-on-mousedown -> Enables the internal_on_mousedown command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-internal-on-mousedown" + ] + }, + { + "description": "deny-internal-on-mousedown -> Denies the internal_on_mousedown command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-internal-on-mousedown" + ] + }, + { + "description": "allow-internal-on-mousemove -> Enables the internal_on_mousemove command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-internal-on-mousemove" + ] + }, + { + "description": "deny-internal-on-mousemove -> Denies the internal_on_mousemove command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-internal-on-mousemove" + ] + }, + { + "description": "allow-internal-toggle-maximize -> Enables the internal_toggle_maximize command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-internal-toggle-maximize" + ] + }, + { + "description": "deny-internal-toggle-maximize -> Denies the internal_toggle_maximize command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-internal-toggle-maximize" + ] + }, + { + "description": "allow-is-closable -> Enables the is_closable command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-closable" + ] + }, + { + "description": "deny-is-closable -> Denies the is_closable command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-closable" + ] + }, + { + "description": "allow-is-decorated -> Enables the is_decorated command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-decorated" + ] + }, + { + "description": "deny-is-decorated -> Denies the is_decorated command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-decorated" + ] + }, + { + "description": "allow-is-focused -> Enables the is_focused command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-focused" + ] + }, + { + "description": "deny-is-focused -> Denies the is_focused command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-focused" + ] + }, + { + "description": "allow-is-fullscreen -> Enables the is_fullscreen command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-fullscreen" + ] + }, + { + "description": "deny-is-fullscreen -> Denies the is_fullscreen command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-fullscreen" + ] + }, + { + "description": "allow-is-maximizable -> Enables the is_maximizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-maximizable" + ] + }, + { + "description": "deny-is-maximizable -> Denies the is_maximizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-maximizable" + ] + }, + { + "description": "allow-is-maximized -> Enables the is_maximized command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-maximized" + ] + }, + { + "description": "deny-is-maximized -> Denies the is_maximized command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-maximized" + ] + }, + { + "description": "allow-is-minimizable -> Enables the is_minimizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-minimizable" + ] + }, + { + "description": "deny-is-minimizable -> Denies the is_minimizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-minimizable" + ] + }, + { + "description": "allow-is-minimized -> Enables the is_minimized command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-minimized" + ] + }, + { + "description": "deny-is-minimized -> Denies the is_minimized command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-minimized" + ] + }, + { + "description": "allow-is-resizable -> Enables the is_resizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-resizable" + ] + }, + { + "description": "deny-is-resizable -> Denies the is_resizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-resizable" + ] + }, + { + "description": "allow-is-visible -> Enables the is_visible command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-is-visible" + ] + }, + { + "description": "deny-is-visible -> Denies the is_visible command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-is-visible" + ] + }, + { + "description": "allow-maximize -> Enables the maximize command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-maximize" + ] + }, + { + "description": "deny-maximize -> Denies the maximize command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-maximize" + ] + }, + { + "description": "allow-minimize -> Enables the minimize command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-minimize" + ] + }, + { + "description": "deny-minimize -> Denies the minimize command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-minimize" + ] + }, + { + "description": "allow-outer-position -> Enables the outer_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-outer-position" + ] + }, + { + "description": "deny-outer-position -> Denies the outer_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-outer-position" + ] + }, + { + "description": "allow-outer-size -> Enables the outer_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-outer-size" + ] + }, + { + "description": "deny-outer-size -> Denies the outer_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-outer-size" + ] + }, + { + "description": "allow-primary-monitor -> Enables the primary_monitor command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-primary-monitor" + ] + }, + { + "description": "deny-primary-monitor -> Denies the primary_monitor command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-primary-monitor" + ] + }, + { + "description": "allow-request-user-attention -> Enables the request_user_attention command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-request-user-attention" + ] + }, + { + "description": "deny-request-user-attention -> Denies the request_user_attention command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-request-user-attention" + ] + }, + { + "description": "allow-scale-factor -> Enables the scale_factor command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-scale-factor" + ] + }, + { + "description": "deny-scale-factor -> Denies the scale_factor command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-scale-factor" + ] + }, + { + "description": "allow-set-always-on-bottom -> Enables the set_always_on_bottom command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-always-on-bottom" + ] + }, + { + "description": "deny-set-always-on-bottom -> Denies the set_always_on_bottom command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-always-on-bottom" + ] + }, + { + "description": "allow-set-always-on-top -> Enables the set_always_on_top command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-always-on-top" + ] + }, + { + "description": "deny-set-always-on-top -> Denies the set_always_on_top command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-always-on-top" + ] + }, + { + "description": "allow-set-closable -> Enables the set_closable command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-closable" + ] + }, + { + "description": "deny-set-closable -> Denies the set_closable command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-closable" + ] + }, + { + "description": "allow-set-content-protected -> Enables the set_content_protected command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-content-protected" + ] + }, + { + "description": "deny-set-content-protected -> Denies the set_content_protected command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-content-protected" + ] + }, + { + "description": "allow-set-cursor-grab -> Enables the set_cursor_grab command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-cursor-grab" + ] + }, + { + "description": "deny-set-cursor-grab -> Denies the set_cursor_grab command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-cursor-grab" + ] + }, + { + "description": "allow-set-cursor-icon -> Enables the set_cursor_icon command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-cursor-icon" + ] + }, + { + "description": "deny-set-cursor-icon -> Denies the set_cursor_icon command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-cursor-icon" + ] + }, + { + "description": "allow-set-cursor-position -> Enables the set_cursor_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-cursor-position" + ] + }, + { + "description": "deny-set-cursor-position -> Denies the set_cursor_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-cursor-position" + ] + }, + { + "description": "allow-set-cursor-visible -> Enables the set_cursor_visible command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-cursor-visible" + ] + }, + { + "description": "deny-set-cursor-visible -> Denies the set_cursor_visible command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-cursor-visible" + ] + }, + { + "description": "allow-set-decorations -> Enables the set_decorations command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-decorations" + ] + }, + { + "description": "deny-set-decorations -> Denies the set_decorations command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-decorations" + ] + }, + { + "description": "allow-set-effects -> Enables the set_effects command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-effects" + ] + }, + { + "description": "deny-set-effects -> Denies the set_effects command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-effects" + ] + }, + { + "description": "allow-set-focus -> Enables the set_focus command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-focus" + ] + }, + { + "description": "deny-set-focus -> Denies the set_focus command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-focus" + ] + }, + { + "description": "allow-set-fullscreen -> Enables the set_fullscreen command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-fullscreen" + ] + }, + { + "description": "deny-set-fullscreen -> Denies the set_fullscreen command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-fullscreen" + ] + }, + { + "description": "allow-set-icon -> Enables the set_icon command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-icon" + ] + }, + { + "description": "deny-set-icon -> Denies the set_icon command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-icon" + ] + }, + { + "description": "allow-set-ignore-cursor-events -> Enables the set_ignore_cursor_events command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-ignore-cursor-events" + ] + }, + { + "description": "deny-set-ignore-cursor-events -> Denies the set_ignore_cursor_events command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-ignore-cursor-events" + ] + }, + { + "description": "allow-set-max-size -> Enables the set_max_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-max-size" + ] + }, + { + "description": "deny-set-max-size -> Denies the set_max_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-max-size" + ] + }, + { + "description": "allow-set-maximizable -> Enables the set_maximizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-maximizable" + ] + }, + { + "description": "deny-set-maximizable -> Denies the set_maximizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-maximizable" + ] + }, + { + "description": "allow-set-min-size -> Enables the set_min_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-min-size" + ] + }, + { + "description": "deny-set-min-size -> Denies the set_min_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-min-size" + ] + }, + { + "description": "allow-set-minimizable -> Enables the set_minimizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-minimizable" + ] + }, + { + "description": "deny-set-minimizable -> Denies the set_minimizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-minimizable" + ] + }, + { + "description": "allow-set-position -> Enables the set_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-position" + ] + }, + { + "description": "deny-set-position -> Denies the set_position command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-position" + ] + }, + { + "description": "allow-set-progress-bar -> Enables the set_progress_bar command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-progress-bar" + ] + }, + { + "description": "deny-set-progress-bar -> Denies the set_progress_bar command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-progress-bar" + ] + }, + { + "description": "allow-set-resizable -> Enables the set_resizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-resizable" + ] + }, + { + "description": "deny-set-resizable -> Denies the set_resizable command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-resizable" + ] + }, + { + "description": "allow-set-shadow -> Enables the set_shadow command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-shadow" + ] + }, + { + "description": "deny-set-shadow -> Denies the set_shadow command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-shadow" + ] + }, + { + "description": "allow-set-size -> Enables the set_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-size" + ] + }, + { + "description": "deny-set-size -> Denies the set_size command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-size" + ] + }, + { + "description": "allow-set-skip-taskbar -> Enables the set_skip_taskbar command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-skip-taskbar" + ] + }, + { + "description": "deny-set-skip-taskbar -> Denies the set_skip_taskbar command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-skip-taskbar" + ] + }, + { + "description": "allow-set-title -> Enables the set_title command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-set-title" + ] + }, + { + "description": "deny-set-title -> Denies the set_title command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-set-title" + ] + }, + { + "description": "allow-show -> Enables the show command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-show" + ] + }, + { + "description": "deny-show -> Denies the show command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-show" + ] + }, + { + "description": "allow-start-dragging -> Enables the start_dragging command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-start-dragging" + ] + }, + { + "description": "deny-start-dragging -> Denies the start_dragging command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-start-dragging" + ] + }, + { + "description": "allow-theme -> Enables the theme command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-theme" + ] + }, + { + "description": "deny-theme -> Denies the theme command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-theme" + ] + }, + { + "description": "allow-title -> Enables the title command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-title" + ] + }, + { + "description": "deny-title -> Denies the title command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-title" + ] + }, + { + "description": "allow-toggle-maximize -> Enables the toggle_maximize command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-toggle-maximize" + ] + }, + { + "description": "deny-toggle-maximize -> Denies the toggle_maximize command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-toggle-maximize" + ] + }, + { + "description": "allow-unmaximize -> Enables the unmaximize command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-unmaximize" + ] + }, + { + "description": "deny-unmaximize -> Denies the unmaximize command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-unmaximize" + ] + }, + { + "description": "allow-unminimize -> Enables the unminimize command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-unminimize" + ] + }, + { + "description": "deny-unminimize -> Denies the unminimize command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-unminimize" + ] + }, + { + "description": "default -> Default permissions for the plugin.", + "type": "string", + "enum": [ + "default" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/core/tauri/src/manager/mod.rs b/core/tauri/src/manager/mod.rs index 65dffb470..1cec341e3 100644 --- a/core/tauri/src/manager/mod.rs +++ b/core/tauri/src/manager/mod.rs @@ -299,13 +299,13 @@ impl AppManager { /// * In dev mode, this will be based on the `devPath` configuration value. /// * Otherwise, this will be based on the `distDir` configuration value. #[cfg(not(dev))] - fn base_path(&self) -> &AppUrl { - &self.config.build.dist_dir + fn base_path(&self) -> Option<&AppUrl> { + self.config.build.dist_dir.as_ref() } #[cfg(dev)] - fn base_path(&self) -> &AppUrl { - &self.config.build.dev_path + fn base_path(&self) -> Option<&AppUrl> { + self.config.build.dev_path.as_ref() } /// Get the base URL to use for webview requests. @@ -313,7 +313,9 @@ impl AppManager { /// In dev mode, this will be based on the `devPath` configuration value. pub(crate) fn get_url(&self) -> Cow<'_, Url> { match self.base_path() { - AppUrl::Url(WebviewUrl::External(url)) => Cow::Borrowed(url), + Some(AppUrl::Url(WebviewUrl::External(url) | WebviewUrl::CustomProtocol(url))) => { + Cow::Borrowed(url) + } _ => self.protocol_url(), } } diff --git a/core/tauri/src/manager/webview.rs b/core/tauri/src/manager/webview.rs index 765583ae8..7edd12b74 100644 --- a/core/tauri/src/manager/webview.rs +++ b/core/tauri/src/manager/webview.rs @@ -422,6 +422,8 @@ impl WebviewManager { } url } + + WebviewUrl::CustomProtocol(url) => url.clone(), _ => unimplemented!(), }; diff --git a/core/tauri/src/protocol/tauri.rs b/core/tauri/src/protocol/tauri.rs index e0c749c81..d7629d7c4 100644 --- a/core/tauri/src/protocol/tauri.rs +++ b/core/tauri/src/protocol/tauri.rs @@ -165,7 +165,7 @@ fn get_response( handler(request, &mut response); } // if it's an HTML file, we need to set the CSP meta tag on Linux - #[cfg(all(not(dev), target_os = "linux"))] + #[cfg(target_os = "linux")] if let Some(response_csp) = response.headers().get("Content-Security-Policy") { let response_csp = String::from_utf8_lossy(response_csp.as_bytes()); let html = String::from_utf8_lossy(response.body()); diff --git a/core/tauri/src/test/mock_runtime.rs b/core/tauri/src/test/mock_runtime.rs index e049c1688..c72f31121 100644 --- a/core/tauri/src/test/mock_runtime.rs +++ b/core/tauri/src/test/mock_runtime.rs @@ -391,7 +391,7 @@ impl WindowBuilder for MockWindowBuilder { } #[cfg(windows)] - fn drag_and_drop(mut self, enabled: bool) -> Self { + fn drag_and_drop(self, enabled: bool) -> Self { self } diff --git a/core/tauri/src/webview/mod.rs b/core/tauri/src/webview/mod.rs index d8d44ac47..66bd9d613 100644 --- a/core/tauri/src/webview/mod.rs +++ b/core/tauri/src/webview/mod.rs @@ -1044,17 +1044,44 @@ fn main() { } fn is_local_url(&self, current_url: &Url) -> bool { - self - .manager() - .get_url() - .make_relative(current_url) - .is_some() - || { - let protocol_url = self.manager().protocol_url(); - current_url.scheme() == protocol_url.scheme() - && current_url.domain() == protocol_url.domain() - } - || (cfg!(dev) && current_url.domain() == Some("tauri.localhost")) + // if from `tauri://` custom protocol + ({ + let protocol_url = self.manager().protocol_url(); + current_url.scheme() == protocol_url.scheme() + && current_url.domain() == protocol_url.domain() + }) || + + // or if relative to `distDir` or `devPath` + self + .manager() + .get_url() + .make_relative(current_url) + .is_some() + + // or from a custom protocol registered by the user + || ({ + let scheme = current_url.scheme(); + let protocols = self.manager().webview.uri_scheme_protocols.lock().unwrap(); + + #[cfg(all(not(windows), not(target_os = "android")))] + let local = protocols.contains_key(scheme); + + // on window and android, custom protocols are `http://.path/to/route` + // so we check using the first part of the domain + #[cfg(any(windows, target_os = "android"))] + let local = { + let protocol_url = self.manager().protocol_url(); + let maybe_protocol = current_url + .domain() + .and_then(|d| d .split_once('.')) + .unwrap_or_default() + .0; + + protocols.contains_key(maybe_protocol) && scheme == protocol_url.scheme() + }; + + local + }) } /// Handles this window receiving an [`InvokeRequest`]. diff --git a/core/tauri/src/webview/webview_window.rs b/core/tauri/src/webview/webview_window.rs index 55f613cdd..bffd926b5 100644 --- a/core/tauri/src/webview/webview_window.rs +++ b/core/tauri/src/webview/webview_window.rs @@ -34,7 +34,7 @@ use crate::{ webview::PageLoadPayload, webview::WebviewBuilder, window::WindowBuilder, - AppHandle, Event, EventId, Manager, Runtime, Webview, Window, WindowEvent, + AppHandle, Event, EventId, Manager, Runtime, Webview, WindowEvent, }; use tauri_macros::default_runtime; @@ -173,7 +173,7 @@ async fn reopen_window(app: tauri::AppHandle) { /// }); /// ``` #[cfg(desktop)] - pub fn on_menu_event, crate::menu::MenuEvent) + Send + Sync + 'static>( + pub fn on_menu_event, crate::menu::MenuEvent) + Send + Sync + 'static>( mut self, f: F, ) -> Self { @@ -902,7 +902,7 @@ tauri::Builder::default() ``` "#### )] - pub fn on_menu_event, crate::menu::MenuEvent) + Send + Sync + 'static>( + pub fn on_menu_event, crate::menu::MenuEvent) + Send + Sync + 'static>( &self, f: F, ) { diff --git a/core/tauri/src/window/mod.rs b/core/tauri/src/window/mod.rs index c5f21d91c..a61eb2b88 100644 --- a/core/tauri/src/window/mod.rs +++ b/core/tauri/src/window/mod.rs @@ -6,7 +6,6 @@ pub(crate) mod plugin; -use tauri_runtime::ResizeDirection; use tauri_runtime::{ webview::PendingWebview, window::dpi::{PhysicalPosition, PhysicalSize}, @@ -1819,7 +1818,10 @@ tauri::Builder::default() } /// Starts resize-dragging the window. - pub fn start_resize_dragging(&self, direction: ResizeDirection) -> crate::Result<()> { + pub fn start_resize_dragging( + &self, + direction: tauri_runtime::ResizeDirection, + ) -> crate::Result<()> { self .window .dispatcher diff --git a/core/tauri/src/window/scripts/undecorated-resizing.js b/core/tauri/src/window/scripts/undecorated-resizing.js index 894f6ca0b..f56f1ade3 100644 --- a/core/tauri/src/window/scripts/undecorated-resizing.js +++ b/core/tauri/src/window/scripts/undecorated-resizing.js @@ -4,7 +4,7 @@ ;(function () { const osName = __TEMPLATE_os_name__ - if (osName !== 'macos') { + if (osName !== 'macos' && osName !== 'ios' && osName !== 'android') { document.addEventListener('mousemove', (e) => { window.__TAURI_INTERNALS__.invoke('plugin:window|internal_on_mousemove', { x: e.clientX, diff --git a/examples/api/src-tauri/Cargo.lock b/examples/api/src-tauri/Cargo.lock index cb6d5ef6c..0e40ed9b4 100644 --- a/examples/api/src-tauri/Cargo.lock +++ b/examples/api/src-tauri/Cargo.lock @@ -93,9 +93,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" dependencies = [ "anstyle", "anstyle-parse", @@ -113,37 +113,37 @@ checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "api" @@ -157,7 +157,6 @@ dependencies = [ "tauri-plugin-cli", "tauri-plugin-sample", "tiny_http", - "window-shadows", ] [[package]] @@ -184,26 +183,28 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.9.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" dependencies = [ "concurrent-queue", - "event-listener 2.5.3", + "event-listener 4.0.3", + "event-listener-strategy", "futures-core", + "pin-project-lite", ] [[package]] name = "async-executor" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b0c4a4f319e45986f347ee47fef8bf5e81c9abc3f6f58dc2391439f30df65f0" +checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" dependencies = [ - "async-lock 2.8.0", + "async-lock 3.3.0", "async-task", "concurrent-queue", "fastrand 2.0.1", - "futures-lite 1.13.0", + "futures-lite 2.2.0", "slab", ] @@ -235,28 +236,27 @@ dependencies = [ "polling 2.8.0", "rustix 0.37.27", "slab", - "socket2 0.4.9", + "socket2 0.4.10", "waker-fn", ] [[package]] name = "async-io" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ed9d5715c2d329bf1b4da8d60455b99b187f27ba726df2883799af9af60997" +checksum = "fb41eb19024a91746eba0773aa5e16036045bbf45733766661099e182ea6a744" dependencies = [ - "async-lock 3.0.0", + "async-lock 3.3.0", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.0.1", + "futures-lite 2.2.0", "parking", - "polling 3.3.0", - "rustix 0.38.21", + "polling 3.3.2", + "rustix 0.38.30", "slab", "tracing", - "waker-fn", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -270,11 +270,11 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.0.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45e900cdcd39bb94a14487d3f7ef92ca222162e6c7c3fe7cb3550ea75fb486ed" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ - "event-listener 3.0.1", + "event-listener 4.0.3", "event-listener-strategy", "pin-project-lite", ] @@ -290,9 +290,9 @@ dependencies = [ "async-signal", "blocking", "cfg-if", - "event-listener 3.0.1", + "event-listener 3.1.0", "futures-lite 1.13.0", - "rustix 0.38.21", + "rustix 0.38.30", "windows-sys 0.48.0", ] @@ -313,13 +313,13 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" dependencies = [ - "async-io 2.2.0", + "async-io 2.3.0", "async-lock 2.8.0", "atomic-waker", "cfg-if", "futures-core", "futures-io", - "rustix 0.38.21", + "rustix 0.38.30", "signal-hook-registry", "slab", "windows-sys 0.48.0", @@ -327,15 +327,15 @@ dependencies = [ [[package]] name = "async-task" -version = "4.5.0" +version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4eb2cdb97421e01129ccb49169d8279ed21e829929144f4a22a6e54ac549ca1" +checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", @@ -394,9 +394,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.4" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "bitflags" @@ -406,9 +406,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" dependencies = [ "serde", ] @@ -430,16 +430,16 @@ dependencies = [ [[package]] name = "blocking" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c36a4d0d48574b3dd360b4b7d95cc651d2b6557b6402848a27d4b228a473e2a" +checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" dependencies = [ "async-channel", - "async-lock 2.8.0", + "async-lock 3.3.0", "async-task", "fastrand 2.0.1", "futures-io", - "futures-lite 1.13.0", + "futures-lite 2.2.0", "piper", "tracing", ] @@ -457,9 +457,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da74e2b81409b1b743f8f0c62cc6254afefb8b8e50bbfe3735550f7aeefa3448" +checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -508,11 +508,11 @@ dependencies = [ [[package]] name = "cairo-rs" -version = "0.18.2" +version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c0466dfa8c0ee78deef390c274ad756801e0a6dbb86c5ef0924a298c5761c4d" +checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cairo-sys-rs", "glib", "libc", @@ -565,9 +565,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.17.0" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ca592ad99e6a0fd4b95153406138b997cc26ccd3cd0aecdfd4fbdbf1519bd77" +checksum = "8a969e13a7589e9e3e4207e153bae624ade2b5622fb4684a4923b23ec3d57719" dependencies = [ "serde", "toml 0.8.2", @@ -601,9 +601,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.5" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" +checksum = "6100bc57b6209840798d95cb2775684849d332f7bd788db2a8c8caf7ef82a41a" dependencies = [ "smallvec", "target-lexicon", @@ -622,23 +622,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" [[package]] -name = "chrono" -version = "0.4.31" +name = "cfg_aliases" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "77e53693616d3075149f4ead59bdeecd204ac6b8192d8969757601b74bddf00f" + +[[package]] +name = "chrono" +version = "0.4.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41daef31d7a747c5c847246f36de49ced6f7403b4cdabc807a97b5cc184cda7a" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", "serde", - "windows-targets 0.48.5", + "windows-targets 0.52.0", ] [[package]] name = "chunked_transfer" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cca491388666e04d7248af3f60f0c40cfb0991c72205595d7c396e3510207d1a" +checksum = "6e4de3bc4ea267985becf712dc6d9eed8b04c953b3fcfb339ebc87acd9804901" [[package]] name = "cipher" @@ -652,18 +658,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.6" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.4.6" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" dependencies = [ "anstream", "anstyle", @@ -673,9 +679,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "cocoa" @@ -731,9 +737,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" dependencies = [ "crossbeam-utils", ] @@ -746,9 +752,9 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -756,9 +762,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "core-graphics" @@ -775,9 +781,9 @@ dependencies = [ [[package]] name = "core-graphics-types" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb142d41022986c1d8ff29103a1411c8a3dfad3552f87a4f8dc50d61d4f4e33" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -786,9 +792,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -804,22 +810,18 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crypto-common" @@ -861,9 +863,9 @@ dependencies = [ [[package]] name = "ctor" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e366bff8cd32dd8754b0991fb66b279dc48f598c3a18914852a6673deef583" +checksum = "30d2b3721e861707777e3195b0158f950ae6dc4a27e4d02ff9f67e3eb3de199e" dependencies = [ "quote", "syn 2.0.48", @@ -915,9 +917,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.9" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", "serde", @@ -990,7 +992,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.7.4", + "libloading 0.8.1", ] [[package]] @@ -1001,25 +1003,25 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "drm" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fb1b703ffbc7ebd216eba7900008049a56ace55580ecb2ee7fa801e8d8be87" +checksum = "a0f8a69e60d75ae7dab4ef26a59ca99f2a89d4c142089b537775ae0c198bdcde" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "bytemuck", "drm-ffi", "drm-fourcc", - "nix 0.27.1", + "rustix 0.38.30", ] [[package]] name = "drm-ffi" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba7d1c19c4b6270e89d59fb27dc6d02a317c658a8a54e54781e1db9b5947595d" +checksum = "41334f8405792483e32ad05fbb9c5680ff4e84491883d2947a4757dc54cb2ac6" dependencies = [ "drm-sys", - "nix 0.27.1", + "rustix 0.38.30", ] [[package]] @@ -1030,9 +1032,13 @@ checksum = "0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a042a662ca9fecd0b54dae6f4" [[package]] name = "drm-sys" -version = "0.5.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a4f1c0468062a56cd5705f1e3b5409eb286d5596a2028ec8e947595d7e715ae" +checksum = "2d09ff881f92f118b11105ba5e34ff8f4adf27b30dae8f12e28c193af1c83176" +dependencies = [ + "libc", + "linux-raw-sys 0.6.4", +] [[package]] name = "dtoa" @@ -1063,11 +1069,12 @@ checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" [[package]] name = "embed-resource" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f54cc3e827ee1c3812239a9a41dede7b4d7d5d5464faa32d71bd7cba28ce2cb2" +checksum = "3bde55e389bea6a966bd467ad1ad7da0ae14546a5bc794d16d1e55e7fca44881" dependencies = [ "cc", + "memchr", "rustc_version", "toml 0.8.2", "vswhom", @@ -1118,12 +1125,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.6" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c18ee0ed65a5f1f81cac6b1d213b69c35fa47d4252ad41f1486dbd8226fe36e" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1134,9 +1141,20 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "3.0.1" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cec0252c2afff729ee6f00e903d479fba81784c8e2bd77447673471fdfaea1" +checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" dependencies = [ "concurrent-queue", "parking", @@ -1145,11 +1163,11 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96b852f1345da36d551b9473fa1e2b1eb5c5195585c6c018118bc92a8d91160" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" dependencies = [ - "event-listener 3.0.1", + "event-listener 4.0.3", "pin-project-lite", ] @@ -1170,9 +1188,9 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "fdeflate" -version = "0.3.0" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d329bdeac514ee06249dabc27877490f17f5d371ec693360768b838e19f3ae10" +checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" dependencies = [ "simd-adler32", ] @@ -1232,9 +1250,9 @@ checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -1251,24 +1269,24 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -1277,9 +1295,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" @@ -1298,19 +1316,22 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.0.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3831c2651acb5177cbd83943f3d9c8912c5ad03c76afcc0e9511ba568ec5ebb" +checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" dependencies = [ + "fastrand 2.0.1", "futures-core", + "futures-io", + "parking", "pin-project-lite", ] [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", @@ -1319,21 +1340,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-core", "futures-io", @@ -1372,9 +1393,9 @@ dependencies = [ [[package]] name = "gdk-pixbuf" -version = "0.18.0" +version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbc9c2ed73a81d556b65d08879ba4ee58808a6b1927ce915262185d6d547c6f3" +checksum = "50e1f5f1b0bfb830d6ccc8066d18db35c487b1b2b1e8589b5dfe9f07e8defaec" dependencies = [ "gdk-pixbuf-sys", "gio", @@ -1479,12 +1500,12 @@ dependencies = [ [[package]] name = "gethostname" -version = "0.3.0" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb65d4ba3173c56a500b555b532f72c42e8d1fe64962b518897f8959fae2c177" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" dependencies = [ "libc", - "winapi", + "windows-targets 0.48.5", ] [[package]] @@ -1500,9 +1521,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", @@ -1521,15 +1542,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "gio" -version = "0.18.2" +version = "0.18.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57052f84e8e5999b258e8adf8f5f2af0ac69033864936b8b6838321db2f759b1" +checksum = "d4fc8f532f87b79cbc51a79748f16a6828fb784be93145a322fa14d06d354c73" dependencies = [ "futures-channel", "futures-core", @@ -1559,11 +1580,11 @@ dependencies = [ [[package]] name = "glib" -version = "0.18.2" +version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c316afb01ce8067c5eaab1fc4f2cd47dc21ce7b6296358605e2ffab23ccbd19" +checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "futures-channel", "futures-core", "futures-executor", @@ -1582,12 +1603,12 @@ dependencies = [ [[package]] name = "glib-macros" -version = "0.18.2" +version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8da903822b136d42360518653fcf154455defc437d3e7a81475bf9a95ff1e47" +checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" dependencies = [ "heck", - "proc-macro-crate", + "proc-macro-crate 2.0.1", "proc-macro-error", "proc-macro2", "quote", @@ -1666,7 +1687,7 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6063efb63db582968fb7df72e1ae68aa6360dcfb0a75143f34fc7d616bad75e" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro-error", "proc-macro2", "quote", @@ -1675,9 +1696,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ "bytes", "fnv", @@ -1685,7 +1706,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.3", + "indexmap 2.1.0", "slab", "tokio", "tokio-util", @@ -1700,9 +1721,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "heck" @@ -1712,9 +1733,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] name = "hex" @@ -1738,20 +1759,20 @@ dependencies = [ [[package]] name = "http" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", - "itoa 1.0.9", + "itoa 1.0.10", ] [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -1778,9 +1799,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", @@ -1791,9 +1812,9 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa 1.0.9", + "itoa 1.0.10", "pin-project-lite", - "socket2 0.4.9", + "socket2 0.5.5", "tokio", "tower-service", "tracing", @@ -1802,16 +1823,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core 0.51.1", + "windows-core", ] [[package]] @@ -1841,9 +1862,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1851,14 +1872,13 @@ dependencies = [ [[package]] name = "image" -version = "0.24.7" +version = "0.24.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711" +checksum = "034bbe799d1909622a74d1193aa50147769440040ff36cb2baa947609b0a4e23" dependencies = [ "bytemuck", "byteorder", "color_quant", - "num-rational", "num-traits", ] @@ -1875,12 +1895,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "serde", ] @@ -1924,9 +1944,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "itoa" @@ -1936,15 +1956,15 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "javascriptcore-rs" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e411dbc2288d2e66373abb4ebe35e198af770c1c61f795b8fa25a398c24006" +checksum = "ca5671e9ffce8ffba57afc24070e906da7fc4b1ba66f2cabebf61bf2ea257fcc" dependencies = [ "bitflags 1.3.2", "glib", @@ -1953,9 +1973,9 @@ dependencies = [ [[package]] name = "javascriptcore-rs-sys" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e2b173d4e1f4653dec2ffaf83c7d92842b04573bf04af0e75a086219e45298" +checksum = "af1be78d14ffa4b75b66df31840478fef72b51f8c2465d4ca7c194da9f7a5124" dependencies = [ "glib-sys", "gobject-sys", @@ -1987,9 +2007,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] @@ -2012,7 +2032,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "serde", "unicode-segmentation", ] @@ -2062,9 +2082,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.149" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libloading" @@ -2086,6 +2106,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "libredox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +dependencies = [ + "bitflags 2.4.2", + "libc", + "redox_syscall", +] + [[package]] name = "line-wrap" version = "0.1.1" @@ -2103,9 +2134,15 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.11" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "linux-raw-sys" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0b5399f6804fbab912acbd8878ed3532d506b7c951b8f9f164ef90fef39e3f4" [[package]] name = "lock_api" @@ -2184,9 +2221,9 @@ checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memmap2" @@ -2233,9 +2270,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi 0.11.0+wasi-snapshot-preview1", @@ -2244,9 +2281,9 @@ dependencies = [ [[package]] name = "muda" -version = "0.11.2" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b564d551449738387fb4541aef5fbfceaa81b2b732f2534c1c7c89dc7d673eaa" +checksum = "e406691fa7749604bbc7964bde28a300572d52621bb84540f6907c0f8fe08737" dependencies = [ "cocoa", "crossbeam-channel", @@ -2307,17 +2344,6 @@ dependencies = [ "memoffset 0.7.1", ] -[[package]] -name = "nix" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" -dependencies = [ - "bitflags 2.4.1", - "cfg-if", - "libc", -] - [[package]] name = "nodrop" version = "0.1.14" @@ -2334,27 +2360,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.17" @@ -2389,7 +2394,7 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -2425,18 +2430,18 @@ dependencies = [ [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" @@ -2462,9 +2467,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "pango" -version = "0.18.0" +version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06a9e54b831d033206160096b825f2070cf5fda7e35167b1c01e9e774f9202d1" +checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" dependencies = [ "gio", "glib", @@ -2509,16 +2514,16 @@ checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", + "redox_syscall", "smallvec", "windows-targets 0.48.5", ] [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "phf" @@ -2679,29 +2684,29 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "plist" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdc0001cfea3db57a2e24bc0d818e9e20e554b5f97fabb9bc231dc240269ae06" +checksum = "e5699cc8a63d1aa2b1ee8e12b9ad70ac790d65788cd36101fa37f87ea46c4cef" dependencies = [ "base64", - "indexmap 1.9.3", + "indexmap 2.1.0", "line-wrap", - "quick-xml 0.29.0", + "quick-xml 0.31.0", "serde", "time", ] [[package]] name = "png" -version = "0.17.10" +version = "0.17.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64" +checksum = "1f6c3c3e617595665b8ea2ff95a86066be38fb121ff920a9c0eb282abcd1da5a" dependencies = [ "bitflags 1.3.2", "crc32fast", @@ -2728,16 +2733,16 @@ dependencies = [ [[package]] name = "polling" -version = "3.3.0" +version = "3.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e53b6af1f60f36f8c2ac2aad5459d75a5a9b4be1e8cdd40264f315d78193e531" +checksum = "545c980a3880efd47b2e262f6a4bb6daad6555cf3367aa9c4e52895f69537a41" dependencies = [ "cfg-if", "concurrent-queue", "pin-project-lite", - "rustix 0.38.21", + "rustix 0.38.30", "tracing", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2780,6 +2785,16 @@ dependencies = [ "toml_edit 0.19.15", ] +[[package]] +name = "proc-macro-crate" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97dc5fea232fc28d2f597b37c4876b348a40e33f3b02cc975c8d006d78d94b1a" +dependencies = [ + "toml_datetime", + "toml_edit 0.20.2", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -2812,22 +2827,13 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.76" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] -[[package]] -name = "quick-xml" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b9228215d82c7b61490fec1de287136b5de6f5700f6e58ea9ad61a7964ca51" -dependencies = [ - "memchr", -] - [[package]] name = "quick-xml" version = "0.30.0" @@ -2837,6 +2843,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "quick-xml" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" +dependencies = [ + "memchr", +] + [[package]] name = "quote" version = "1.0.35" @@ -2906,7 +2921,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.12", ] [[package]] @@ -2939,15 +2954,6 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42a9830a0e1b9fb145ebb365b8bc4ccd75f290f98c0247deafbbe2c75cefb544" -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.4.1" @@ -2959,24 +2965,24 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ - "getrandom 0.2.10", - "redox_syscall 0.2.16", + "getrandom 0.2.12", + "libredox", "thiserror", ] [[package]] name = "regex" -version = "1.10.2" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.3", + "regex-automata 0.4.4", "regex-syntax 0.8.2", ] @@ -2991,9 +2997,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "3b7fa1134405e2ec9353fd416b17f8dacd46c473d7d3fd1cf202706a14eb792a" dependencies = [ "aho-corasick", "memchr", @@ -3014,9 +3020,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ "base64", "bytes", @@ -3080,15 +3086,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.21" +version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "errno", "libc", - "linux-raw-sys 0.4.11", - "windows-sys 0.48.0", + "linux-raw-sys 0.4.13", + "windows-sys 0.52.0", ] [[package]] @@ -3099,9 +3105,9 @@ checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "safemem" @@ -3177,9 +3183,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" dependencies = [ "serde", ] @@ -3217,20 +3223,20 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ - "itoa 1.0.9", + "itoa 1.0.10", "ryu", "serde", ] [[package]] name = "serde_repr" -version = "0.1.16" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" +checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", @@ -3239,9 +3245,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -3253,22 +3259,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.9", + "itoa 1.0.10", "ryu", "serde", ] [[package]] name = "serde_with" -version = "3.4.0" +version = "3.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" +checksum = "f5c9fdb6b00a489875b22efd4b78fe2b363b72265cc5f6eb2e2b9ee270e6140c" dependencies = [ "base64", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.0.2", + "indexmap 2.1.0", "serde", "serde_json", "serde_with_macros", @@ -3277,9 +3283,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.4.0" +version = "3.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93634eb5f75a2323b16de4748022ac4297f9e76b6dced2be287a099f41b5e788" +checksum = "dbff351eb4b33600a2e138dfa0b10b65a238ea8ff8fb2387c422c5022a3e8298" dependencies = [ "darling", "proc-macro2", @@ -3382,15 +3388,15 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -3398,9 +3404,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", "windows-sys 0.48.0", @@ -3408,13 +3414,13 @@ dependencies = [ [[package]] name = "softbuffer" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfa97594e034a52bfc0f7a2764f0445bd6dcf1c27136779b244473f9c24f9c5e" +checksum = "071916a85d1db274b4ed57af3a14afb66bd836ae7f82ebb6f1fd3455107830d9" dependencies = [ "as-raw-xcb-connection", "bytemuck", - "cfg_aliases", + "cfg_aliases 0.2.0", "cocoa", "core-graphics", "drm", @@ -3425,15 +3431,15 @@ dependencies = [ "memmap2", "objc", "raw-window-handle 0.6.0", - "redox_syscall 0.4.1", - "rustix 0.38.21", + "redox_syscall", + "rustix 0.38.30", "tiny-xlib", "wasm-bindgen", "wayland-backend", "wayland-client", "wayland-sys", "web-sys", - "windows-sys 0.48.0", + "windows-sys 0.52.0", "x11rb", ] @@ -3578,9 +3584,9 @@ dependencies = [ [[package]] name = "system-deps" -version = "6.1.2" +version = "6.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94af52f9402f94aac4948a2518b43359be8d9ce6cd9efc1c4de3b2f7b7e897d6" +checksum = "2a2d580ff6a20c55dfb86be5f9c238f67835d0e81cbdea8bf5680e0897320331" dependencies = [ "cfg-expr", "heck", @@ -3591,9 +3597,9 @@ dependencies = [ [[package]] name = "tao" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0dff18fed076d29cb5779e918ef4b8a5dbb756204e4a027794f0bce233d949" +checksum = "75d4a64cfac8e487c61d778fe4ab8480f162451e8af7f247aafadcb3b2560852" dependencies = [ "bitflags 1.3.2", "cc", @@ -3644,9 +3650,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.12" +version = "0.12.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" +checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" [[package]] name = "tauri" @@ -3658,7 +3664,7 @@ dependencies = [ "dirs-next", "embed_plist", "futures-util", - "getrandom 0.2.10", + "getrandom 0.2.12", "glob", "gtk", "heck", @@ -3774,8 +3780,8 @@ dependencies = [ [[package]] name = "tauri-plugin-cli" -version = "2.0.0-alpha.3" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#76cfdc32b4593acfdfed95bf3028cdba0d83fe61" +version = "2.0.0-alpha.6" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#61edbbec0acda4213ed8684f75a973e8be123a52" dependencies = [ "clap", "log", @@ -3842,7 +3848,7 @@ dependencies = [ "cargo_metadata", "ctor", "dunce", - "getrandom 0.2.10", + "getrandom 0.2.12", "glob", "heck", "html5ever", @@ -3878,15 +3884,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.8.1" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if", "fastrand 2.0.1", - "redox_syscall 0.4.1", - "rustix 0.38.21", - "windows-sys 0.48.0", + "redox_syscall", + "rustix 0.38.30", + "windows-sys 0.52.0", ] [[package]] @@ -3908,18 +3914,18 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", @@ -3938,12 +3944,12 @@ dependencies = [ [[package]] name = "time" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", - "itoa 1.0.9", + "itoa 1.0.10", "powerfmt", "serde", "time-core", @@ -3958,9 +3964,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ "time-core", ] @@ -4007,9 +4013,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.33.0" +version = "1.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" dependencies = [ "backtrace", "bytes", @@ -4017,15 +4023,15 @@ dependencies = [ "mio", "num_cpus", "pin-project-lite", - "socket2 0.5.4", + "socket2 0.5.5", "windows-sys 0.48.0", ] [[package]] name = "tokio-util" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -4074,7 +4080,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.2", + "indexmap 2.1.0", "serde", "serde_spanned", "toml_datetime", @@ -4087,7 +4093,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ - "indexmap 2.0.2", + "indexmap 2.1.0", "serde", "serde_spanned", "toml_datetime", @@ -4134,20 +4140,20 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "matchers", "nu-ansi-term", @@ -4163,9 +4169,9 @@ dependencies = [ [[package]] name = "tray-icon" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5375d350db4ccd3c783a4c683be535e70df5c62b07a824e7bcd6d43ef6d74181" +checksum = "fad962d06d2bfd9b2ab4f665fc73b175523b834b1466a294520201c5845145f8" dependencies = [ "cocoa", "core-graphics", @@ -4192,9 +4198,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" @@ -4204,19 +4210,20 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "uds_windows" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce65604324d3cce9b966701489fbd0cf318cb1f7bd9dd07ac9a4ee6fb791930d" +checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" dependencies = [ + "memoffset 0.9.0", "tempfile", "winapi", ] [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -4251,9 +4258,9 @@ dependencies = [ [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -4275,11 +4282,11 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.5.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.12", ] [[package]] @@ -4359,9 +4366,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -4369,9 +4376,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", @@ -4384,9 +4391,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" dependencies = [ "cfg-if", "js-sys", @@ -4396,9 +4403,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4406,9 +4413,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", @@ -4419,9 +4426,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "wasm-streams" @@ -4444,7 +4451,7 @@ checksum = "19152ddd73f45f024ed4534d9ca2594e0ef252c1847695255dae47f34df9fbe4" dependencies = [ "cc", "downcast-rs", - "nix 0.26.4", + "nix", "scoped-tls", "smallvec", "wayland-sys", @@ -4456,8 +4463,8 @@ version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ca7d52347346f5473bf2f56705f360e8440873052e575e55890c4fa57843ed3" dependencies = [ - "bitflags 2.4.1", - "nix 0.26.4", + "bitflags 2.4.2", + "nix", "wayland-backend", "wayland-scanner", ] @@ -4487,9 +4494,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", @@ -4548,7 +4555,7 @@ dependencies = [ "webview2-com-macros", "webview2-com-sys", "windows 0.52.0", - "windows-core 0.52.0", + "windows-core", "windows-implement", "windows-interface", ] @@ -4572,7 +4579,7 @@ checksum = "d6ad85fceee6c42fa3d61239eba5a11401bf38407a849ed5ea1b407df08cca72" dependencies = [ "thiserror", "windows 0.52.0", - "windows-core 0.52.0", + "windows-core", ] [[package]] @@ -4600,43 +4607,23 @@ dependencies = [ "winapi", ] -[[package]] -name = "winapi-wsapoll" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c17110f57155602a80dca10be03852116403c9ff3cd25b079d666f2aa3df6e" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "window-shadows" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ff424735b1ac21293b0492b069394b0a189c8a463fb015a16dea7c2e221c08" -dependencies = [ - "cocoa", - "objc", - "raw-window-handle 0.5.2", - "windows-sys 0.48.0", -] - [[package]] name = "window-vibrancy" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5931735e675b972fada30c7a402915d4d827aa5ef6c929c133d640c4b785e963" +checksum = "af6abc2b9c56bd95887825a1ce56cde49a2a97c07e28db465d541f5098a2656c" dependencies = [ "cocoa", "objc", "raw-window-handle 0.5.2", - "windows-sys 0.48.0", + "windows-sys 0.52.0", + "windows-version", ] [[package]] @@ -4654,21 +4641,12 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-core 0.52.0", + "windows-core", "windows-implement", "windows-interface", "windows-targets 0.52.0", ] -[[package]] -name = "windows-core" -version = "0.51.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-core" version = "0.52.0" @@ -4909,9 +4887,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.17" +version = "0.5.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3b801d0e0a6726477cc207f60162da452f3a95adb368399bef20a946e06f65c" +checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" dependencies = [ "memchr", ] @@ -4944,7 +4922,7 @@ checksum = "d3016c47c9b6f7029a9da7cd48af8352327226bba0e955f3c92e2966651365a9" dependencies = [ "base64", "block", - "cfg_aliases", + "cfg_aliases 0.1.1", "cocoa", "core-graphics", "crossbeam-channel", @@ -5004,29 +4982,24 @@ dependencies = [ [[package]] name = "x11rb" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1641b26d4dec61337c35a1b1aaf9e3cba8f46f0b43636c609ab0291a648040a" +checksum = "f8f25ead8c7e4cba123243a6367da5d3990e0d3affa708ea19dce96356bd9f1a" dependencies = [ "as-raw-xcb-connection", "gethostname", "libc", - "libloading 0.7.4", - "nix 0.26.4", + "libloading 0.8.1", "once_cell", - "winapi", - "winapi-wsapoll", + "rustix 0.38.30", "x11rb-protocol", ] [[package]] name = "x11rb-protocol" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82d6c3f9a0fb6701fab8f6cea9b0c0bd5d6876f1f89f7fada07e558077c344bc" -dependencies = [ - "nix 0.26.4", -] +checksum = "e63e71c4b8bd9ffec2c963173a4dc4cbde9ee96961d4fcb4429db9929b606c34" [[package]] name = "xdg-home" @@ -5034,7 +5007,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2769203cd13a0c6015d515be729c526d041e9cf2c0cc478d57faee85f40c6dcd" dependencies = [ - "nix 0.26.4", + "nix", "winapi", ] @@ -5062,7 +5035,7 @@ dependencies = [ "futures-sink", "futures-util", "hex", - "nix 0.26.4", + "nix", "once_cell", "ordered-stream", "rand 0.8.5", @@ -5085,7 +5058,7 @@ version = "3.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d1794a946878c0e807f55a397187c11fc7a038ba5d868e7db4f3bd7760bc9d" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "regex", @@ -5124,7 +5097,7 @@ version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "934d7a7dfc310d6ee06c87ffe88ef4eca7d3e37bb251dece2ef93da8f17d8ecd" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", diff --git a/examples/api/src-tauri/Cargo.toml b/examples/api/src-tauri/Cargo.toml index 050df8503..2a097b1aa 100644 --- a/examples/api/src-tauri/Cargo.toml +++ b/examples/api/src-tauri/Cargo.toml @@ -42,9 +42,6 @@ features = [ path = "../../../core/tauri" features = ["test"] -[target."cfg(target_os = \"windows\")".dependencies] -window-shadows = "0.2" - [features] custom-protocol = [ "tauri/custom-protocol" ] diff --git a/examples/api/src-tauri/tauri-plugin-sample/permissions/.schema.json b/examples/api/src-tauri/tauri-plugin-sample/permissions/.schema.json new file mode 100644 index 000000000..b8c21fa1e --- /dev/null +++ b/examples/api/src-tauri/tauri-plugin-sample/permissions/.schema.json @@ -0,0 +1,290 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionFile", + "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", + "type": "object", + "properties": { + "default": { + "description": "The default permission set for the plugin", + "anyOf": [ + { + "$ref": "#/definitions/DefaultPermission" + }, + { + "type": "null" + } + ] + }, + "permission": { + "description": "A list of inlined permissions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + }, + "set": { + "description": "A list of permissions sets defined", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/PermissionSet" + } + }, + "test": { + "description": "Test something!!", + "anyOf": [ + { + "$ref": "#/definitions/PermissionSet" + }, + { + "type": "null" + } + ] + } + }, + "definitions": { + "Commands": { + "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", + "type": "object", + "properties": { + "allow": { + "description": "Allowed command.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Denied command, which takes priority.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "DefaultPermission": { + "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "type": "string" + } + }, + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + } + } + }, + "Number": { + "description": "A valid ACL number.", + "anyOf": [ + { + "description": "Represents an [`i64`].", + "type": "integer", + "format": "int64" + }, + { + "description": "Represents a [`f64`].", + "type": "number", + "format": "double" + } + ] + }, + "Permission": { + "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "commands": { + "description": "Allowed or denied commands when using this permission.", + "default": { + "allow": [], + "deny": [] + }, + "allOf": [ + { + "$ref": "#/definitions/Commands" + } + ] + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "scope": { + "description": "Allowed or denied scoped when using this permission.", + "default": { + "allow": null, + "deny": null + }, + "allOf": [ + { + "$ref": "#/definitions/Scopes" + } + ] + }, + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + } + } + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "allow-ping -> Enables the ping command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-ping" + ] + }, + { + "description": "deny-ping -> Denies the ping command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-ping" + ] + }, + { + "description": "global-scope -> Sets a global scope.", + "type": "string", + "enum": [ + "global-scope" + ] + }, + { + "description": "allow-ping-scoped -> Enables the ping command with a test scope.", + "type": "string", + "enum": [ + "allow-ping-scoped" + ] + } + ] + }, + "PermissionSet": { + "description": "A set of direct permissions grouped together under a new name.", + "type": "object", + "required": [ + "description", + "identifier", + "permissions" + ], + "properties": { + "description": { + "description": "Human-readable description of what the permission does.", + "type": "string" + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionKind" + } + } + } + }, + "Scopes": { + "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "type": "object", + "properties": { + "allow": { + "description": "Data that defines what is allowed by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + }, + "deny": { + "description": "Data that defines what is denied by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + "Value": { + "description": "All supported ACL values.", + "anyOf": [ + { + "description": "Represents a [`bool`].", + "type": "boolean" + }, + { + "description": "Represents a valid ACL [`Number`].", + "allOf": [ + { + "$ref": "#/definitions/Number" + } + ] + }, + { + "description": "Represents a [`String`].", + "type": "string" + }, + { + "description": "Represents a list of other [`Value`]s.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + { + "description": "Represents a map of [`String`] keys to [`Value`]s.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Value" + } + } + ] + } + } +} \ No newline at end of file diff --git a/examples/api/src-tauri/tauri-plugin-sample/permissions/schemas/schema.json b/examples/api/src-tauri/tauri-plugin-sample/permissions/schemas/schema.json new file mode 100644 index 000000000..4b8173cad --- /dev/null +++ b/examples/api/src-tauri/tauri-plugin-sample/permissions/schemas/schema.json @@ -0,0 +1,280 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionFile", + "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", + "type": "object", + "properties": { + "default": { + "description": "The default permission set for the plugin", + "anyOf": [ + { + "$ref": "#/definitions/DefaultPermission" + }, + { + "type": "null" + } + ] + }, + "permission": { + "description": "A list of inlined permissions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + }, + "set": { + "description": "A list of permissions sets defined", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/PermissionSet" + } + } + }, + "definitions": { + "Commands": { + "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", + "type": "object", + "properties": { + "allow": { + "description": "Allowed command.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Denied command, which takes priority.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "DefaultPermission": { + "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "type": "string" + } + }, + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + } + } + }, + "Number": { + "description": "A valid ACL number.", + "anyOf": [ + { + "description": "Represents an [`i64`].", + "type": "integer", + "format": "int64" + }, + { + "description": "Represents a [`f64`].", + "type": "number", + "format": "double" + } + ] + }, + "Permission": { + "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "commands": { + "description": "Allowed or denied commands when using this permission.", + "default": { + "allow": [], + "deny": [] + }, + "allOf": [ + { + "$ref": "#/definitions/Commands" + } + ] + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": [ + "string", + "null" + ] + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "scope": { + "description": "Allowed or denied scoped when using this permission.", + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/Scopes" + } + ] + }, + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + } + } + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "allow-ping -> Enables the ping command without any pre-configured scope.", + "type": "string", + "enum": [ + "allow-ping" + ] + }, + { + "description": "deny-ping -> Denies the ping command without any pre-configured scope.", + "type": "string", + "enum": [ + "deny-ping" + ] + }, + { + "description": "global-scope -> Sets a global scope.", + "type": "string", + "enum": [ + "global-scope" + ] + }, + { + "description": "allow-ping-scoped -> Enables the ping command with a test scope.", + "type": "string", + "enum": [ + "allow-ping-scoped" + ] + } + ] + }, + "PermissionSet": { + "description": "A set of direct permissions grouped together under a new name.", + "type": "object", + "required": [ + "description", + "identifier", + "permissions" + ], + "properties": { + "description": { + "description": "Human-readable description of what the permission does.", + "type": "string" + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionKind" + } + } + } + }, + "Scopes": { + "description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.", + "type": "object", + "properties": { + "allow": { + "description": "Data that defines what is allowed by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + }, + "deny": { + "description": "Data that defines what is denied by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + "Value": { + "description": "All supported ACL values.", + "anyOf": [ + { + "description": "Represents a null JSON value.", + "type": "null" + }, + { + "description": "Represents a [`bool`].", + "type": "boolean" + }, + { + "description": "Represents a valid ACL [`Number`].", + "allOf": [ + { + "$ref": "#/definitions/Number" + } + ] + }, + { + "description": "Represents a [`String`].", + "type": "string" + }, + { + "description": "Represents a list of other [`Value`]s.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + { + "description": "Represents a map of [`String`] keys to [`Value`]s.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Value" + } + } + ] + } + } +} \ No newline at end of file diff --git a/examples/api/src/App.svelte b/examples/api/src/App.svelte index 5576fbc39..b0288f2b0 100644 --- a/examples/api/src/App.svelte +++ b/examples/api/src/App.svelte @@ -36,17 +36,17 @@ component: App, icon: 'i-codicon-hubot' }, - { + !isMobile && { label: 'Window', component: Window, icon: 'i-codicon-window' }, - { + !isMobile && { label: 'Menu', component: Menu, icon: 'i-ph-list' }, - { + !isMobile && { label: 'Tray', component: Tray, icon: 'i-ph-tray' diff --git a/tooling/cli/schema.json b/tooling/cli/schema.json index f36b85ecb..178924434 100644 --- a/tooling/cli/schema.json +++ b/tooling/cli/schema.json @@ -109,8 +109,6 @@ "build": { "description": "The build configuration.", "default": { - "devPath": "http://localhost:8080/", - "distDir": "../dist", "withGlobalTauri": false }, "allOf": [ @@ -575,13 +573,18 @@ "description": "An URL to open on a Tauri webview window.", "anyOf": [ { - "description": "An external URL.", + "description": "An external URL. Must use either the `http` or `https` schemes.", "type": "string", "format": "uri" }, { "description": "The path portion of an app URL. For instance, to load `tauri://localhost/users/john`, you can simply provide `users/john` in this configuration.", "type": "string" + }, + { + "description": "A custom protocol url, for example, `doom://index.html`", + "type": "string", + "format": "uri" } ] }, @@ -2408,19 +2411,23 @@ }, "devPath": { "description": "The path to the application assets or URL to load in development.\n\nThis is usually an URL to a dev server, which serves your application assets with live reloading. Most modern JavaScript bundlers provides a way to start a dev server by default.\n\nSee [vite](https://vitejs.dev/guide/), [Webpack DevServer](https://webpack.js.org/configuration/dev-server/) and [sirv](https://github.com/lukeed/sirv) for examples on how to set up a dev server.", - "default": "http://localhost:8080/", - "allOf": [ + "anyOf": [ { "$ref": "#/definitions/AppUrl" + }, + { + "type": "null" } ] }, "distDir": { "description": "The path to the application assets or URL to load in production.\n\nWhen a path relative to the configuration file is provided, it is read recursively and all files are embedded in the application binary. Tauri then looks for an `index.html` file unless you provide a custom window URL.\n\nYou can also provide a list of paths to be embedded, which allows granular control over what files are added to the binary. In this case, all files are added to the root and you must reference it that way in your HTML files.\n\nWhen an URL is provided, the application won't have bundled assets and the application will load that URL by default.", - "default": "../dist", - "allOf": [ + "anyOf": [ { "$ref": "#/definitions/AppUrl" + }, + { + "type": "null" } ] }, diff --git a/tooling/cli/src/build.rs b/tooling/cli/src/build.rs index c5e2fedc3..dc53f1e8b 100644 --- a/tooling/cli/src/build.rs +++ b/tooling/cli/src/build.rs @@ -280,7 +280,7 @@ pub fn setup(target: Target, options: &mut Options, mobile: bool) -> Result Result Result Result Result, tauri_dir: Option<&Path>) -> Vec
d == "localhost", Some(url::Host::Ipv4(i)) => {