mirror of
https://github.com/tauri-apps/tauri.git
synced 2025-01-07 03:44:07 +03:00
b2ff840e83
* Refactor Code Docs * updated schemas * cargo fmt whitespace fix * downgrade cargo-platform to 0.1.7 --------- Co-authored-by: Lucas Nogueira <118899497+lucasfernog-crabnebula@users.noreply.github.com>
84 lines
2.3 KiB
JSON
84 lines
2.3 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "Scopes",
|
|
"description": "An argument for fine grained behavior control of Tauri commands.\n\n It can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command.\n The configured scope is passed to the command and will be enforced by the command implementation.\n\n ## Example\n\n ```json\n {\n \"allow\": [{ \"path\": \"$HOME/**\" }],\n \"deny\": [{ \"path\": \"$HOME/secret.txt\" }]\n }\n ```",
|
|
"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"
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"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"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
} |