scope-schema.json 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema#",
  3. "title": "Scopes",
  4. "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 ```",
  5. "type": "object",
  6. "properties": {
  7. "allow": {
  8. "description": "Data that defines what is allowed by the scope.",
  9. "type": [
  10. "array",
  11. "null"
  12. ],
  13. "items": {
  14. "$ref": "#/definitions/Value"
  15. }
  16. },
  17. "deny": {
  18. "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.",
  19. "type": [
  20. "array",
  21. "null"
  22. ],
  23. "items": {
  24. "$ref": "#/definitions/Value"
  25. }
  26. }
  27. },
  28. "definitions": {
  29. "Value": {
  30. "description": "All supported ACL values.",
  31. "anyOf": [
  32. {
  33. "description": "Represents a null JSON value.",
  34. "type": "null"
  35. },
  36. {
  37. "description": "Represents a [`bool`].",
  38. "type": "boolean"
  39. },
  40. {
  41. "description": "Represents a valid ACL [`Number`].",
  42. "allOf": [
  43. {
  44. "$ref": "#/definitions/Number"
  45. }
  46. ]
  47. },
  48. {
  49. "description": "Represents a [`String`].",
  50. "type": "string"
  51. },
  52. {
  53. "description": "Represents a list of other [`Value`]s.",
  54. "type": "array",
  55. "items": {
  56. "$ref": "#/definitions/Value"
  57. }
  58. },
  59. {
  60. "description": "Represents a map of [`String`] keys to [`Value`]s.",
  61. "type": "object",
  62. "additionalProperties": {
  63. "$ref": "#/definitions/Value"
  64. }
  65. }
  66. ]
  67. },
  68. "Number": {
  69. "description": "A valid ACL number.",
  70. "anyOf": [
  71. {
  72. "description": "Represents an [`i64`].",
  73. "type": "integer",
  74. "format": "int64"
  75. },
  76. {
  77. "description": "Represents a [`f64`].",
  78. "type": "number",
  79. "format": "double"
  80. }
  81. ]
  82. }
  83. }
  84. }