mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-08-03 18:08:36 +02:00
revert to draft07 schema
This commit is contained in:
@@ -68,6 +68,9 @@ fn _f() {
|
||||
fn main() {
|
||||
tauri_plugin::Builder::new(COMMANDS)
|
||||
.global_api_script_path("./api-iife.js")
|
||||
.global_scope_schema(schemars::schema_for!(HttpScopeEntry))
|
||||
.global_scope_schema(
|
||||
schemars::SchemaGenerator::new(schemars::generate::SchemaSettings::draft07())
|
||||
.into_root_schema_for::<HttpScopeEntry>(),
|
||||
)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$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",
|
||||
@@ -8,7 +8,7 @@
|
||||
"description": "The default permission set for the plugin",
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/DefaultPermission"
|
||||
"$ref": "#/definitions/DefaultPermission"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
@@ -19,19 +19,19 @@
|
||||
"description": "A list of permissions sets defined",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/$defs/PermissionSet"
|
||||
"$ref": "#/definitions/PermissionSet"
|
||||
}
|
||||
},
|
||||
"permission": {
|
||||
"description": "A list of inlined permissions",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/$defs/Permission"
|
||||
"$ref": "#/definitions/Permission"
|
||||
},
|
||||
"default": []
|
||||
}
|
||||
},
|
||||
"$defs": {
|
||||
"definitions": {
|
||||
"DefaultPermission": {
|
||||
"description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
|
||||
"type": "object",
|
||||
@@ -80,7 +80,7 @@
|
||||
"description": "All permissions this set contains.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/$defs/PermissionKind"
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -116,15 +116,23 @@
|
||||
},
|
||||
"commands": {
|
||||
"description": "Allowed or denied commands when using this permission.",
|
||||
"$ref": "#/$defs/Commands",
|
||||
"default": {
|
||||
"allow": [],
|
||||
"deny": []
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/Commands"
|
||||
}
|
||||
]
|
||||
},
|
||||
"scope": {
|
||||
"description": "Allowed or denied scoped when using this permission.",
|
||||
"$ref": "#/$defs/Scopes"
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/Scopes"
|
||||
}
|
||||
]
|
||||
},
|
||||
"platforms": {
|
||||
"description": "Target platforms this permission applies. By default all platforms are affected by this permission.",
|
||||
@@ -133,7 +141,7 @@
|
||||
"null"
|
||||
],
|
||||
"items": {
|
||||
"$ref": "#/$defs/Target"
|
||||
"$ref": "#/definitions/Target"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -174,7 +182,7 @@
|
||||
"null"
|
||||
],
|
||||
"items": {
|
||||
"$ref": "#/$defs/Value"
|
||||
"$ref": "#/definitions/Value"
|
||||
}
|
||||
},
|
||||
"deny": {
|
||||
@@ -184,7 +192,7 @@
|
||||
"null"
|
||||
],
|
||||
"items": {
|
||||
"$ref": "#/$defs/Value"
|
||||
"$ref": "#/definitions/Value"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -202,7 +210,11 @@
|
||||
},
|
||||
{
|
||||
"description": "Represents a valid ACL [`Number`].",
|
||||
"$ref": "#/$defs/Number"
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/Number"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "Represents a [`String`].",
|
||||
@@ -212,14 +224,14 @@
|
||||
"description": "Represents a list of other [`Value`]s.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/$defs/Value"
|
||||
"$ref": "#/definitions/Value"
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "Represents a map of [`String`] keys to [`Value`]s.",
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"$ref": "#/$defs/Value"
|
||||
"$ref": "#/definitions/Value"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -268,77 +280,6 @@
|
||||
"const": "iOS"
|
||||
}
|
||||
]
|
||||
},
|
||||
"PermissionKind": {
|
||||
"type": "string",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "Enables the fetch command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "allow-fetch",
|
||||
"markdownDescription": "Enables the fetch command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the fetch command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "deny-fetch",
|
||||
"markdownDescription": "Denies the fetch command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the fetch_cancel command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "allow-fetch-cancel",
|
||||
"markdownDescription": "Enables the fetch_cancel command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the fetch_cancel command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "deny-fetch-cancel",
|
||||
"markdownDescription": "Denies the fetch_cancel command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the fetch_cancel_body command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "allow-fetch-cancel-body",
|
||||
"markdownDescription": "Enables the fetch_cancel_body command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the fetch_cancel_body command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "deny-fetch-cancel-body",
|
||||
"markdownDescription": "Denies the fetch_cancel_body command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the fetch_read_body command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "allow-fetch-read-body",
|
||||
"markdownDescription": "Enables the fetch_read_body command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the fetch_read_body command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "deny-fetch-read-body",
|
||||
"markdownDescription": "Denies the fetch_read_body command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the fetch_send command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "allow-fetch-send",
|
||||
"markdownDescription": "Enables the fetch_send command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the fetch_send command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "deny-fetch-send",
|
||||
"markdownDescription": "Denies the fetch_send command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "This permission set configures what kind of\nfetch operations are available from the http plugin.\n\nThis enables all fetch operations but does not\nallow explicitly any origins to be fetched. This needs to\nbe manually configured before usage.\n\n#### Granted Permissions\n\nAll fetch operations are enabled.\n\n\n#### This default permission set includes:\n\n- `allow-fetch`\n- `allow-fetch-cancel`\n- `allow-fetch-send`\n- `allow-fetch-read-body`\n- `allow-fetch-cancel-body`",
|
||||
"type": "string",
|
||||
"const": "default",
|
||||
"markdownDescription": "This permission set configures what kind of\nfetch operations are available from the http plugin.\n\nThis enables all fetch operations but does not\nallow explicitly any origins to be fetched. This needs to\nbe manually configured before usage.\n\n#### Granted Permissions\n\nAll fetch operations are enabled.\n\n\n#### This default permission set includes:\n\n- `allow-fetch`\n- `allow-fetch-cancel`\n- `allow-fetch-send`\n- `allow-fetch-read-body`\n- `allow-fetch-cancel-body`"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user