升级插件安全策略、包管理和运行时能力
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://ymhut.local/schemas/ymhut.plugin.v3.json",
|
||||
"title": "YMhut Box Plugin Manifest v3",
|
||||
"type": "object",
|
||||
"required": [ "manifestVersion", "apiVersion", "id", "name", "version", "author", "description", "entry", "runtime", "permissions", "permissionReasons", "security", "surfaces", "resources" ],
|
||||
"properties": {
|
||||
"manifestVersion": { "const": 3 },
|
||||
"apiVersion": { "const": "2" },
|
||||
"id": { "type": "string", "pattern": "^[A-Za-z0-9._-]{1,64}$" },
|
||||
"name": { "type": "string", "minLength": 1 },
|
||||
"version": { "type": "string", "minLength": 1 },
|
||||
"author": { "type": "string" },
|
||||
"description": { "type": "string" },
|
||||
"entry": { "$ref": "#/$defs/relativePath" },
|
||||
"runtime": { "enum": [ "WebView", "Tauri", "Shell", "Script" ] },
|
||||
"builtIn": { "type": "boolean", "default": false },
|
||||
"permissions": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/permission" } },
|
||||
"permissionReasons": { "type": "object", "additionalProperties": { "type": "string", "minLength": 1 } },
|
||||
"security": { "type": "object", "required": [ "requiredPermissions" ], "properties": { "requiredPermissions": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/permission" } } } },
|
||||
"requirements": { "type": "object", "properties": { "minimumClientVersion": { "type": "string" }, "minimumWindowsBuild": { "type": "integer", "minimum": 0 }, "architectures": { "type": "array", "uniqueItems": true, "items": { "enum": [ "X64", "X86", "Arm64" ] } } } },
|
||||
"network": { "type": "object", "properties": { "allowedOrigins": { "type": "array", "uniqueItems": true, "items": { "type": "string", "pattern": "^(https|wss)://[^/?#*]+$" } }, "openExternalOrigins": { "type": "array", "uniqueItems": true, "items": { "type": "string", "pattern": "^https://[^/?#*]+$" } }, "runToolIds": { "type": "array", "uniqueItems": true, "items": { "type": "string", "pattern": "^[A-Za-z0-9._-]{1,64}$" } } } },
|
||||
"surfaces": { "type": "array", "minItems": 1, "items": { "type": "object", "required": [ "kind", "id", "name", "description" ], "properties": { "kind": { "enum": [ "ToolboxTool", "NavPage" ] }, "id": { "type": "string", "pattern": "^[A-Za-z0-9._-]{1,64}$" }, "name": { "type": "string", "minLength": 1 }, "description": { "type": "string" }, "entry": { "$ref": "#/$defs/relativePath" }, "category": { "type": "string" }, "keywords": { "type": "array", "items": { "type": "string" } }, "iconGlyph": { "type": "string" } } } },
|
||||
"resources": { "type": "array", "items": { "$ref": "#/$defs/relativePath" } }
|
||||
},
|
||||
"$defs": {
|
||||
"relativePath": { "type": "string", "minLength": 1, "not": { "pattern": "(^[\\/]|(^|[\\/])\\.\\.([\\/]|$)|:)" } },
|
||||
"permission": { "enum": [ "Input", "Output", "Log", "Storage", "Http", "Clipboard", "FilePicker", "RunTool", "OpenExternal", "OpenSystemBrowser", "ExternalRuntime", "NetworkDiagnostics" ] }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user