Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

20.1 KB
Raw Blame
{
  "$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 accept_next_key command without any pre-configured scope.",
          "type": "string",
          "const": "allow-accept-next-key",
          "markdownDescription": "Enables the accept_next_key command without any pre-configured scope."
        },
        {
          "description": "Denies the accept_next_key command without any pre-configured scope.",
          "type": "string",
          "const": "deny-accept-next-key",
          "markdownDescription": "Denies the accept_next_key command without any pre-configured scope."
        },
        {
          "description": "Enables the add_source command without any pre-configured scope.",
          "type": "string",
          "const": "allow-add-source",
          "markdownDescription": "Enables the add_source command without any pre-configured scope."
        },
        {
          "description": "Denies the add_source command without any pre-configured scope.",
          "type": "string",
          "const": "deny-add-source",
          "markdownDescription": "Denies the add_source command without any pre-configured scope."
        },
        {
          "description": "Enables the confirm_install command without any pre-configured scope.",
          "type": "string",
          "const": "allow-confirm-install",
          "markdownDescription": "Enables the confirm_install command without any pre-configured scope."
        },
        {
          "description": "Denies the confirm_install command without any pre-configured scope.",
          "type": "string",
          "const": "deny-confirm-install",
          "markdownDescription": "Denies the confirm_install command without any pre-configured scope."
        },
        {
          "description": "Enables the discard_stage command without any pre-configured scope.",
          "type": "string",
          "const": "allow-discard-stage",
          "markdownDescription": "Enables the discard_stage command without any pre-configured scope."
        },
        {
          "description": "Denies the discard_stage command without any pre-configured scope.",
          "type": "string",
          "const": "deny-discard-stage",
          "markdownDescription": "Denies the discard_stage command without any pre-configured scope."
        },
        {
          "description": "Enables the get_catalog command without any pre-configured scope.",
          "type": "string",
          "const": "allow-get-catalog",
          "markdownDescription": "Enables the get_catalog command without any pre-configured scope."
        },
        {
          "description": "Denies the get_catalog command without any pre-configured scope.",
          "type": "string",
          "const": "deny-get-catalog",
          "markdownDescription": "Denies the get_catalog command without any pre-configured scope."
        },
        {
          "description": "Enables the http_cancel command without any pre-configured scope.",
          "type": "string",
          "const": "allow-http-cancel",
          "markdownDescription": "Enables the http_cancel command without any pre-configured scope."
        },
        {
          "description": "Denies the http_cancel command without any pre-configured scope.",
          "type": "string",
          "const": "deny-http-cancel",
          "markdownDescription": "Denies the http_cancel command without any pre-configured scope."
        },
        {
          "description": "Enables the http_fetch command without any pre-configured scope.",
          "type": "string",
          "const": "allow-http-fetch",
          "markdownDescription": "Enables the http_fetch command without any pre-configured scope."
        },
        {
          "description": "Denies the http_fetch command without any pre-configured scope.",
          "type": "string",
          "const": "deny-http-fetch",
          "markdownDescription": "Denies the http_fetch command without any pre-configured scope."
        },
        {
          "description": "Enables the http_fetch_stream command without any pre-configured scope.",
          "type": "string",
          "const": "allow-http-fetch-stream",
          "markdownDescription": "Enables the http_fetch_stream command without any pre-configured scope."
        },
        {
          "description": "Denies the http_fetch_stream command without any pre-configured scope.",
          "type": "string",
          "const": "deny-http-fetch-stream",
          "markdownDescription": "Denies the http_fetch_stream command without any pre-configured scope."
        },
        {
          "description": "Enables the list command without any pre-configured scope.",
          "type": "string",
          "const": "allow-list",
          "markdownDescription": "Enables the list command without any pre-configured scope."
        },
        {
          "description": "Denies the list command without any pre-configured scope.",
          "type": "string",
          "const": "deny-list",
          "markdownDescription": "Denies the list command without any pre-configured scope."
        },
        {
          "description": "Enables the list_sources command without any pre-configured scope.",
          "type": "string",
          "const": "allow-list-sources",
          "markdownDescription": "Enables the list_sources command without any pre-configured scope."
        },
        {
          "description": "Denies the list_sources command without any pre-configured scope.",
          "type": "string",
          "const": "deny-list-sources",
          "markdownDescription": "Denies the list_sources command without any pre-configured scope."
        },
        {
          "description": "Enables the read_entry command without any pre-configured scope.",
          "type": "string",
          "const": "allow-read-entry",
          "markdownDescription": "Enables the read_entry command without any pre-configured scope."
        },
        {
          "description": "Denies the read_entry command without any pre-configured scope.",
          "type": "string",
          "const": "deny-read-entry",
          "markdownDescription": "Denies the read_entry command without any pre-configured scope."
        },
        {
          "description": "Enables the remove_source command without any pre-configured scope.",
          "type": "string",
          "const": "allow-remove-source",
          "markdownDescription": "Enables the remove_source command without any pre-configured scope."
        },
        {
          "description": "Denies the remove_source command without any pre-configured scope.",
          "type": "string",
          "const": "deny-remove-source",
          "markdownDescription": "Denies the remove_source command without any pre-configured scope."
        },
        {
          "description": "Enables the rollback command without any pre-configured scope.",
          "type": "string",
          "const": "allow-rollback",
          "markdownDescription": "Enables the rollback command without any pre-configured scope."
        },
        {
          "description": "Denies the rollback command without any pre-configured scope.",
          "type": "string",
          "const": "deny-rollback",
          "markdownDescription": "Denies the rollback command without any pre-configured scope."
        },
        {
          "description": "Enables the set_enabled command without any pre-configured scope.",
          "type": "string",
          "const": "allow-set-enabled",
          "markdownDescription": "Enables the set_enabled command without any pre-configured scope."
        },
        {
          "description": "Denies the set_enabled command without any pre-configured scope.",
          "type": "string",
          "const": "deny-set-enabled",
          "markdownDescription": "Denies the set_enabled command without any pre-configured scope."
        },
        {
          "description": "Enables the set_grants command without any pre-configured scope.",
          "type": "string",
          "const": "allow-set-grants",
          "markdownDescription": "Enables the set_grants command without any pre-configured scope."
        },
        {
          "description": "Denies the set_grants command without any pre-configured scope.",
          "type": "string",
          "const": "deny-set-grants",
          "markdownDescription": "Denies the set_grants command without any pre-configured scope."
        },
        {
          "description": "Enables the set_safe_mode command without any pre-configured scope.",
          "type": "string",
          "const": "allow-set-safe-mode",
          "markdownDescription": "Enables the set_safe_mode command without any pre-configured scope."
        },
        {
          "description": "Denies the set_safe_mode command without any pre-configured scope.",
          "type": "string",
          "const": "deny-set-safe-mode",
          "markdownDescription": "Denies the set_safe_mode command without any pre-configured scope."
        },
        {
          "description": "Enables the stage_bundle command without any pre-configured scope.",
          "type": "string",
          "const": "allow-stage-bundle",
          "markdownDescription": "Enables the stage_bundle command without any pre-configured scope."
        },
        {
          "description": "Denies the stage_bundle command without any pre-configured scope.",
          "type": "string",
          "const": "deny-stage-bundle",
          "markdownDescription": "Denies the stage_bundle command without any pre-configured scope."
        },
        {
          "description": "Enables the stage_from_index command without any pre-configured scope.",
          "type": "string",
          "const": "allow-stage-from-index",
          "markdownDescription": "Enables the stage_from_index command without any pre-configured scope."
        },
        {
          "description": "Denies the stage_from_index command without any pre-configured scope.",
          "type": "string",
          "const": "deny-stage-from-index",
          "markdownDescription": "Denies the stage_from_index command without any pre-configured scope."
        },
        {
          "description": "Enables the uninstall command without any pre-configured scope.",
          "type": "string",
          "const": "allow-uninstall",
          "markdownDescription": "Enables the uninstall command without any pre-configured scope."
        },
        {
          "description": "Denies the uninstall command without any pre-configured scope.",
          "type": "string",
          "const": "deny-uninstall",
          "markdownDescription": "Denies the uninstall command without any pre-configured scope."
        },
        {
          "description": "Default permissions for the extensions plugin: every command, for the main window only (see capabilities/extensions.json)\n#### This default permission set includes:\n\n- `allow-stage-bundle`\n- `allow-confirm-install`\n- `allow-discard-stage`\n- `allow-list`\n- `allow-set-enabled`\n- `allow-set-grants`\n- `allow-uninstall`\n- `allow-rollback`\n- `allow-read-entry`\n- `allow-set-safe-mode`\n- `allow-http-fetch`\n- `allow-http-fetch-stream`\n- `allow-http-cancel`\n- `allow-list-sources`\n- `allow-add-source`\n- `allow-remove-source`\n- `allow-get-catalog`\n- `allow-accept-next-key`\n- `allow-stage-from-index`",
          "type": "string",
          "const": "default",
          "markdownDescription": "Default permissions for the extensions plugin: every command, for the main window only (see capabilities/extensions.json)\n#### This default permission set includes:\n\n- `allow-stage-bundle`\n- `allow-confirm-install`\n- `allow-discard-stage`\n- `allow-list`\n- `allow-set-enabled`\n- `allow-set-grants`\n- `allow-uninstall`\n- `allow-rollback`\n- `allow-read-entry`\n- `allow-set-safe-mode`\n- `allow-http-fetch`\n- `allow-http-fetch-stream`\n- `allow-http-cancel`\n- `allow-list-sources`\n- `allow-add-source`\n- `allow-remove-source`\n- `allow-get-catalog`\n- `allow-accept-next-key`\n- `allow-stage-from-index`"
        }
      ]
    }
  }
}