mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-26 03:11:12 +01:00
525 lines
16 KiB
JSON
525 lines
16 KiB
JSON
{
|
|
"$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",
|
|
"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. Tauri convention is to use <h4> headings in markdown content for Tauri documentation generation purposes.",
|
|
"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. Tauri internal convention is to use <h4> headings in markdown content for Tauri documentation generation purposes.",
|
|
"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.",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Scopes"
|
|
}
|
|
]
|
|
},
|
|
"platforms": {
|
|
"description": "Target platforms this permission applies. By default all platforms are affected by this permission.",
|
|
"type": [
|
|
"array",
|
|
"null"
|
|
],
|
|
"items": {
|
|
"$ref": "#/definitions/Target"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"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": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```",
|
|
"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. This should be prioritized by validation logic.",
|
|
"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"
|
|
}
|
|
]
|
|
},
|
|
"Target": {
|
|
"description": "Platform target.",
|
|
"oneOf": [
|
|
{
|
|
"description": "MacOS.",
|
|
"type": "string",
|
|
"enum": [
|
|
"macOS"
|
|
]
|
|
},
|
|
{
|
|
"description": "Windows.",
|
|
"type": "string",
|
|
"enum": [
|
|
"windows"
|
|
]
|
|
},
|
|
{
|
|
"description": "Linux.",
|
|
"type": "string",
|
|
"enum": [
|
|
"linux"
|
|
]
|
|
},
|
|
{
|
|
"description": "Android.",
|
|
"type": "string",
|
|
"enum": [
|
|
"android"
|
|
]
|
|
},
|
|
{
|
|
"description": "iOS.",
|
|
"type": "string",
|
|
"enum": [
|
|
"iOS"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"PermissionKind": {
|
|
"type": "string",
|
|
"oneOf": [
|
|
{
|
|
"description": "Enables the activate command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-activate"
|
|
},
|
|
{
|
|
"description": "Denies the activate command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-activate"
|
|
},
|
|
{
|
|
"description": "Enables the add command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-add"
|
|
},
|
|
{
|
|
"description": "Denies the add command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-add"
|
|
},
|
|
{
|
|
"description": "Enables the apply command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-apply"
|
|
},
|
|
{
|
|
"description": "Denies the apply command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-apply"
|
|
},
|
|
{
|
|
"description": "Enables the calculate command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-calculate"
|
|
},
|
|
{
|
|
"description": "Denies the calculate command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-calculate"
|
|
},
|
|
{
|
|
"description": "Enables the check command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-check"
|
|
},
|
|
{
|
|
"description": "Denies the check command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-check"
|
|
},
|
|
{
|
|
"description": "Enables the checkout command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-checkout"
|
|
},
|
|
{
|
|
"description": "Denies the checkout command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-checkout"
|
|
},
|
|
{
|
|
"description": "Enables the cmd_add command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-cmd-add"
|
|
},
|
|
{
|
|
"description": "Denies the cmd_add command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-cmd-add"
|
|
},
|
|
{
|
|
"description": "Enables the cmd_checkout command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-cmd-checkout"
|
|
},
|
|
{
|
|
"description": "Denies the cmd_checkout command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-cmd-checkout"
|
|
},
|
|
{
|
|
"description": "Enables the cmd_commit command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-cmd-commit"
|
|
},
|
|
{
|
|
"description": "Denies the cmd_commit command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-cmd-commit"
|
|
},
|
|
{
|
|
"description": "Enables the cmd_init command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-cmd-init"
|
|
},
|
|
{
|
|
"description": "Denies the cmd_init command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-cmd-init"
|
|
},
|
|
{
|
|
"description": "Enables the cmd_log command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-cmd-log"
|
|
},
|
|
{
|
|
"description": "Denies the cmd_log command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-cmd-log"
|
|
},
|
|
{
|
|
"description": "Enables the cmd_status command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-cmd-status"
|
|
},
|
|
{
|
|
"description": "Denies the cmd_status command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-cmd-status"
|
|
},
|
|
{
|
|
"description": "Enables the commit command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-commit"
|
|
},
|
|
{
|
|
"description": "Denies the commit command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-commit"
|
|
},
|
|
{
|
|
"description": "Enables the init command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-init"
|
|
},
|
|
{
|
|
"description": "Denies the init command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-init"
|
|
},
|
|
{
|
|
"description": "Enables the init_repo command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-init-repo"
|
|
},
|
|
{
|
|
"description": "Denies the init_repo command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-init-repo"
|
|
},
|
|
{
|
|
"description": "Enables the initialize command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-initialize"
|
|
},
|
|
{
|
|
"description": "Denies the initialize command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-initialize"
|
|
},
|
|
{
|
|
"description": "Enables the log command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-log"
|
|
},
|
|
{
|
|
"description": "Denies the log command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-log"
|
|
},
|
|
{
|
|
"description": "Enables the status command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-status"
|
|
},
|
|
{
|
|
"description": "Denies the status command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-status"
|
|
},
|
|
{
|
|
"description": "Enables the sync command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-sync"
|
|
},
|
|
{
|
|
"description": "Denies the sync command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-sync"
|
|
},
|
|
{
|
|
"description": "Enables the sync_fs command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-sync-fs"
|
|
},
|
|
{
|
|
"description": "Denies the sync_fs command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-sync-fs"
|
|
},
|
|
{
|
|
"description": "Enables the unstage command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-unstage"
|
|
},
|
|
{
|
|
"description": "Denies the unstage command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-unstage"
|
|
},
|
|
{
|
|
"description": "Enables the watch command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-watch"
|
|
},
|
|
{
|
|
"description": "Denies the watch command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-watch"
|
|
},
|
|
{
|
|
"description": "Default permissions for the plugin",
|
|
"type": "string",
|
|
"const": "default"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
} |