summaryrefslogtreecommitdiff
path: root/app/validators/json_schemas
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-12-17 11:59:07 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-12-17 11:59:07 +0000
commit8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch)
tree544930fb309b30317ae9797a9683768705d664c4 /app/validators/json_schemas
parent4b1de649d0168371549608993deac953eb692019 (diff)
downloadgitlab-ce-8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca.tar.gz
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'app/validators/json_schemas')
-rw-r--r--app/validators/json_schemas/codeclimate.json34
-rw-r--r--app/validators/json_schemas/http_integration_payload_attribute_mapping.json14
-rw-r--r--app/validators/json_schemas/vulnerability_finding_details.json182
3 files changed, 230 insertions, 0 deletions
diff --git a/app/validators/json_schemas/codeclimate.json b/app/validators/json_schemas/codeclimate.json
new file mode 100644
index 00000000000..56056c62c4e
--- /dev/null
+++ b/app/validators/json_schemas/codeclimate.json
@@ -0,0 +1,34 @@
+{
+ "description": "Codequality used by codeclimate parser",
+ "type": "object",
+ "required": ["description", "fingerprint", "severity", "location"],
+ "properties": {
+ "description": { "type": "string" },
+ "fingerprint": { "type": "string" },
+ "severity": { "type": "string" },
+ "location": {
+ "type": "object",
+ "properties": {
+ "path": { "type": "string" },
+ "lines": {
+ "type": "object",
+ "properties": {
+ "begin": { "type": "integer" }
+ }
+ },
+ "positions": {
+ "type": "object",
+ "properties": {
+ "begin": {
+ "type": "object",
+ "properties": {
+ "line": { "type": "integer" }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "additionalProperties": true
+}
diff --git a/app/validators/json_schemas/http_integration_payload_attribute_mapping.json b/app/validators/json_schemas/http_integration_payload_attribute_mapping.json
new file mode 100644
index 00000000000..e457b8a292b
--- /dev/null
+++ b/app/validators/json_schemas/http_integration_payload_attribute_mapping.json
@@ -0,0 +1,14 @@
+{
+ "type": "object",
+ "patternProperties": {
+ ".*": {
+ "type": "object",
+ "required": ["path", "type"],
+ "properties": {
+ "path": { "type": "array" },
+ "type": { "type": "string" }
+ },
+ "additionalProperties": false
+ }
+ }
+}
diff --git a/app/validators/json_schemas/vulnerability_finding_details.json b/app/validators/json_schemas/vulnerability_finding_details.json
new file mode 100644
index 00000000000..f2940866f4b
--- /dev/null
+++ b/app/validators/json_schemas/vulnerability_finding_details.json
@@ -0,0 +1,182 @@
+{
+ "type": "object",
+ "description": "The schema for vulnerability finding details",
+ "additionalProperties": false,
+ "patternProperties": {
+ "^.*$": {
+ "allOf": [
+ { "$ref": "#/definitions/named_field" },
+ { "$ref": "#/definitions/type_list" }
+ ]
+ }
+ },
+ "definitions": {
+ "type_list": {
+ "oneOf": [
+ { "$ref": "#/definitions/named_list" },
+ { "$ref": "#/definitions/list" },
+ { "$ref": "#/definitions/table" },
+
+ { "$ref": "#/definitions/text" },
+ { "$ref": "#/definitions/url" },
+ { "$ref": "#/definitions/code" },
+ { "$ref": "#/definitions/int" },
+
+ { "$ref": "#/definitions/commit" },
+ { "$ref": "#/definitions/file_location" },
+ { "$ref": "#/definitions/module_location" }
+ ]
+ },
+ "lang_text": {
+ "type": "object",
+ "required": [ "value", "lang" ],
+ "properties": {
+ "lang": { "type": "string" },
+ "value": { "type": "string" }
+ }
+ },
+ "lang_text_list": {
+ "type": "array",
+ "items": { "$ref": "#/definitions/lang_text" }
+ },
+ "named_field": {
+ "type": "object",
+ "required": [ "name" ],
+ "properties": {
+ "name": { "$ref": "#/definitions/lang_text_list" },
+ "description": { "$ref": "#/definitions/lang_text_list" }
+ }
+ },
+ "named_list": {
+ "type": "object",
+ "description": "An object with named and typed fields",
+ "required": [ "type", "items" ],
+ "properties": {
+ "type": { "const": "named-list" },
+ "items": {
+ "type": "object",
+ "patternProperties": {
+ "^.*$": {
+ "allOf": [
+ { "$ref": "#/definitions/named_field" },
+ { "$ref": "#/definitions/type_list" }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "list": {
+ "type": "object",
+ "description": "A list of typed fields",
+ "required": [ "type", "items" ],
+ "properties": {
+ "type": { "const": "list" },
+ "items": {
+ "type": "array",
+ "items": { "$ref": "#/definitions/type_list" }
+ }
+ }
+ },
+ "table": {
+ "type": "object",
+ "description": "A table of typed fields",
+ "required": [],
+ "properties": {
+ "type": { "const": "table" },
+ "items": {
+ "type": "object",
+ "properties": {
+ "header": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/type_list"
+ }
+ },
+ "rows": {
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/type_list"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "text": {
+ "type": "object",
+ "description": "Raw text",
+ "required": [ "type", "value" ],
+ "properties": {
+ "type": { "const": "text" },
+ "value": { "$ref": "#/definitions/lang_text_list" }
+ }
+ },
+ "url": {
+ "type": "object",
+ "description": "A single URL",
+ "required": [ "type", "href" ],
+ "properties": {
+ "type": { "const": "url" },
+ "text": { "$ref": "#/definitions/lang_text_list" },
+ "href": { "type": "string" }
+ }
+ },
+ "code": {
+ "type": "object",
+ "description": "A codeblock",
+ "required": [ "type", "value" ],
+ "properties": {
+ "type": { "const": "code" },
+ "value": { "type": "string" },
+ "lang": { "type": "string" }
+ }
+ },
+ "int": {
+ "type": "object",
+ "description": "An integer",
+ "required": [ "type", "value" ],
+ "properties": {
+ "type": { "const": "int" },
+ "value": { "type": "integer" },
+ "format": {
+ "type": "string",
+ "enum": [ "default", "hex" ]
+ }
+ }
+ },
+ "commit": {
+ "type": "object",
+ "description": "A specific commit within the project",
+ "required": [ "type", "value" ],
+ "properties": {
+ "type": { "const": "commit" },
+ "value": { "type": "string", "description": "The commit SHA" }
+ }
+ },
+ "file_location": {
+ "type": "object",
+ "description": "A location within a file in the project",
+ "required": [ "type", "file_name", "line_start" ],
+ "properties": {
+ "type": { "const": "file-location" },
+ "file_name": { "type": "string" },
+ "line_start": { "type": "integer" },
+ "line_end": { "type": "integer" }
+ }
+ },
+ "module_location": {
+ "type": "object",
+ "description": "A location within a binary module of the form module+relative_offset",
+ "required": [ "type", "module_name", "offset" ],
+ "properties": {
+ "type": { "const": "module-location" },
+ "module_name": { "type": "string" },
+ "offset": { "type": "integer" }
+ }
+ }
+ }
+}