The storage plugin grew `pick_file` beside `pick_folder` and `pick_image`: the document sheet with the caller's own filter, answered with a path Rust can open. A document already on this phone hands its path over as it lies — the document sibling of the same volume:relative id the folder picker resolves, plus the Downloads provider's raw: — so a 300 MB pick copies nothing; one that has no path is copied into cacheDir/picked under its own name, and only as far as the caller allows, because a playlist is kilobytes and a DJ set is not. Those copies are swept at the start of every pick, which pick_image's never were. The import sheet has its fifth door, on round 24's screen, wait card and review, and the note that apologised for its absence says the one true thing about it instead. `playlist_import_probe` took a path and a name the way `playlist_import_folder` took a path, and the name is the load-bearing half: the parser picks its format off the extension and titles the draft from the stem, so a cache copy under an invented name would have read every playlist as plain text. The mock walk drives the door and both of the picker's refusals through round 31's fail door; the phone walk opens the real sheet and dismisses it with BACK, reading nothing and writing nothing. The brief asked for a second consumer — sending a file in a chat — and there is nothing behind it: `community_pick_file` is the persona layer's three native dialogs, `soulseek-client` has `say_room` and `message_user` and nothing that sends a file, and both frontends' thread composers are text only. Nothing was invented for it. The plugin command is general enough — a caller's own filter, a zero-copy path, a bounded copy — that the one reader still waiting, the local set listener the phone puts off by design, needs no further plugin change. Playlist export is not on that list and never was: writing a document out is the share plugin's errand, not a picker's. The Kotlin is unbuilt — nothing on this machine compiles it.
366 lines
12 KiB
JSON
366 lines
12 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 all_files_access command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-all-files-access",
|
|
"markdownDescription": "Enables the all_files_access command without any pre-configured scope."
|
|
},
|
|
{
|
|
"description": "Denies the all_files_access command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-all-files-access",
|
|
"markdownDescription": "Denies the all_files_access command without any pre-configured scope."
|
|
},
|
|
{
|
|
"description": "Enables the pick_file command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-pick-file",
|
|
"markdownDescription": "Enables the pick_file command without any pre-configured scope."
|
|
},
|
|
{
|
|
"description": "Denies the pick_file command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-pick-file",
|
|
"markdownDescription": "Denies the pick_file command without any pre-configured scope."
|
|
},
|
|
{
|
|
"description": "Enables the pick_folder command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-pick-folder",
|
|
"markdownDescription": "Enables the pick_folder command without any pre-configured scope."
|
|
},
|
|
{
|
|
"description": "Denies the pick_folder command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-pick-folder",
|
|
"markdownDescription": "Denies the pick_folder command without any pre-configured scope."
|
|
},
|
|
{
|
|
"description": "Enables the pick_image command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-pick-image",
|
|
"markdownDescription": "Enables the pick_image command without any pre-configured scope."
|
|
},
|
|
{
|
|
"description": "Denies the pick_image command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-pick-image",
|
|
"markdownDescription": "Denies the pick_image command without any pre-configured scope."
|
|
},
|
|
{
|
|
"description": "Enables the request_all_files_access command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "allow-request-all-files-access",
|
|
"markdownDescription": "Enables the request_all_files_access command without any pre-configured scope."
|
|
},
|
|
{
|
|
"description": "Denies the request_all_files_access command without any pre-configured scope.",
|
|
"type": "string",
|
|
"const": "deny-request-all-files-access",
|
|
"markdownDescription": "Denies the request_all_files_access command without any pre-configured scope."
|
|
},
|
|
{
|
|
"description": "The phone's storage: pick a library folder (a Storage Access Framework tree,\nresolved to a path when the volume allows), pick a photo or a file (the\ndocument picker, answered with a path — the document's own where this phone\nhas one, else a bounded copy in the app's cache), and Android's all-files\naccess — whether it is granted, and the system screen that grants it.\n\n#### This default permission set includes:\n\n- `allow-pick-folder`\n- `allow-all-files-access`\n- `allow-request-all-files-access`\n- `allow-pick-image`\n- `allow-pick-file`",
|
|
"type": "string",
|
|
"const": "default",
|
|
"markdownDescription": "The phone's storage: pick a library folder (a Storage Access Framework tree,\nresolved to a path when the volume allows), pick a photo or a file (the\ndocument picker, answered with a path — the document's own where this phone\nhas one, else a bounded copy in the app's cache), and Android's all-files\naccess — whether it is granted, and the system screen that grants it.\n\n#### This default permission set includes:\n\n- `allow-pick-folder`\n- `allow-all-files-access`\n- `allow-request-all-files-access`\n- `allow-pick-image`\n- `allow-pick-file`"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
} |