From 9514d6a2bf7466d68f8e9621357cfccf3c6b5880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 24 Sep 2023 16:07:03 +0200 Subject: [PATCH 1/4] schemas: permissions additional_urls are of the same type as url. --- schemas/manifest.v2.schema.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/schemas/manifest.v2.schema.json b/schemas/manifest.v2.schema.json index 4831e0a0..e4f10ab3 100644 --- a/schemas/manifest.v2.schema.json +++ b/schemas/manifest.v2.schema.json @@ -294,9 +294,10 @@ }, "additional_urls": { "type": "array", - "items": { - "type": "string" - } + "items": {"$ref": "#/$defs/path_absolute"} + }, + "label": { + "type": "string" } } } From 03504079dae98dde1487fc55ec9da954b5afa7a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 24 Sep 2023 16:08:03 +0200 Subject: [PATCH 2/4] schemas: Fix regexes: name_and_permission to allow __KEY__ and non-complete rwx syntax ; path_absolute to allow __KEY__ --- schemas/manifest.v2.schema.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schemas/manifest.v2.schema.json b/schemas/manifest.v2.schema.json index e4f10ab3..7c41313b 100644 --- a/schemas/manifest.v2.schema.json +++ b/schemas/manifest.v2.schema.json @@ -26,11 +26,11 @@ }, "path_absolute": { "type": "string", - "pattern": "^/.*$" + "pattern": "^(__[A-Z_]*__)?/.*$" }, "name_and_permission": { "type": "string", - "pattern": "^([a-z_][a-z0-9_-]{0,30})(:[rwx-]{3})?$" + "pattern": "^(([a-z_][a-z0-9_-]{0,30})|([_A-Z]*))(:[rwx-]{1,3})?$" }, "sha256sum": { "type": "string", From 19f3eb02cf75de4bd9ca272ea0fcd936019e1ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 24 Sep 2023 16:08:50 +0200 Subject: [PATCH 3/4] schemas: Allow translated_string to be a simple string, the underlying code supports it. --- schemas/manifest.v2.schema.json | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/schemas/manifest.v2.schema.json b/schemas/manifest.v2.schema.json index 7c41313b..deaab194 100644 --- a/schemas/manifest.v2.schema.json +++ b/schemas/manifest.v2.schema.json @@ -7,14 +7,21 @@ "type": "object", "$defs": { "translated_string": { - "type": "object", - "required": ["en"], - "additionalProperties": false, - "patternProperties": { - "^[a-z]{2}$": { + "anyOf": [ + { + "type": "object", + "required": ["en"], + "additionalProperties": false, + "patternProperties": { + "^[a-z]{2}$": { + "type": "string" + } + } + }, + { "type": "string" } - } + ] }, "byte_size": { "type": "string", From bd6a08d9cbe65bb517d4b5fdbea3a71c641bad41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 24 Sep 2023 16:09:47 +0200 Subject: [PATCH 4/4] schemas: Add support install.*.pattern.{regex,error} --- schemas/manifest.v2.schema.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/schemas/manifest.v2.schema.json b/schemas/manifest.v2.schema.json index deaab194..698affa9 100644 --- a/schemas/manifest.v2.schema.json +++ b/schemas/manifest.v2.schema.json @@ -199,6 +199,20 @@ } } ] + }, + "pattern": { + "type": "object", + "required": [], + "additionalProperties": false, + "properties": { + "regexp": { + "type": "string", + "format": "regex" + }, + "error": { + "type": "string" + } + } } } }