Welcome to mirror list, hosted at ThFree Co, Russian Federation.

json-schema-secure.json « refs « lib « ajv « node_modules - github.com/austingebauer/devise.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 66faf84f84b924fc5cb5b4787dcbc549587428d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/json-schema-secure.json#",
  "title": "Meta-schema for the security assessment of JSON Schemas",
  "description": "If a JSON Schema fails validation against this meta-schema, it may be unsafe to validate untrusted data",
  "definitions": {
    "schemaArray": {
      "type": "array",
      "minItems": 1,
      "items": {"$ref": "#"}
    }
  },
  "dependencies": {
    "patternProperties": {
      "description": "prevent slow validation of large property names",
      "required": ["propertyNames"],
      "properties": {
        "propertyNames": {
          "required": ["maxLength"]
        }
      }
    },
    "uniqueItems": {
      "description": "prevent slow validation of large non-scalar arrays",
      "if": {
        "properties": {
          "uniqueItems": {"const": true},
          "items": {
            "properties": {
              "type": {
                "anyOf": [
                  {
                    "enum": ["object", "array"]
                  },
                  {
                    "type": "array",
                    "contains": {"enum": ["object", "array"]}
                  }
                ]
              }
            }
          }
        }
      },
      "then": {
        "required": ["maxItems"]
      }
    },
    "pattern": {
      "description": "prevent slow pattern matching of large strings",
      "required": ["maxLength"]
    },
    "format": {
      "description": "prevent slow format validation of large strings",
      "required": ["maxLength"]
    }
  },
  "properties": {
    "additionalItems": {"$ref": "#"},
    "additionalProperties": {"$ref": "#"},
    "dependencies": {
      "additionalProperties": {
        "anyOf": [
          {"type": "array"},
          {"$ref": "#"}
        ]
      }
    },
    "items": {
      "anyOf": [
        {"$ref": "#"},
        {"$ref": "#/definitions/schemaArray"}
      ]
    },
    "definitions": {
      "additionalProperties": {"$ref": "#"}
    },
    "patternProperties": {
      "additionalProperties": {"$ref": "#"}
    },
    "properties": {
      "additionalProperties": {"$ref": "#"}
    },
    "if": {"$ref": "#"},
    "then": {"$ref": "#"},
    "else": {"$ref": "#"},
    "allOf": {"$ref": "#/definitions/schemaArray"},
    "anyOf": {"$ref": "#/definitions/schemaArray"},
    "oneOf": {"$ref": "#/definitions/schemaArray"},
    "not": {"$ref": "#"},
    "contains": {"$ref": "#"},
    "propertyNames": {"$ref": "#"}
  }
}