Bug 1739114 - Moved privileged WebExtensions permissions in their own JSONSchema type and added a new custom privileged keyword on each privileged manifest fields. r=robwu,mixedpuppy

This patch includes only the subset of D145687 changes related to the reworked JSONSchema data, plus some minor changes to Schemas.jsm to take the new
JSONSchema type ("PrivilegedPermissions") and the new custom JSONSchema keyword (the boolean "privileged" property used to identify manifest fields
only allowed in privileged extensions).

Besides the changes to the schema data, this patch is not expected to introduce any difference in behavior and so it could also land on its own
if needed (and the rest of the changes landed separately).

Differential Revision: https://phabricator.services.mozilla.com/D146800
This commit is contained in:
Luca Greco 2022-05-19 18:20:59 +00:00
Родитель f49dc4f09a
Коммит b928b2d0a8
10 изменённых файлов: 25 добавлений и 10 удалений

Просмотреть файл

@ -2,7 +2,7 @@
{
"namespace": "manifest",
"types": [{
"$extend": "PermissionNoPrompt",
"$extend": "PermissionPrivileged",
"choices": [{
"type": "string",
"enum": [

Просмотреть файл

@ -7,7 +7,7 @@
"namespace": "manifest",
"types": [
{
"$extend": "PermissionNoPrompt",
"$extend": "PermissionPrivileged",
"choices": [
{
"type": "string",

Просмотреть файл

@ -3,7 +3,7 @@
"namespace": "manifest",
"types": [
{
"$extend": "PermissionNoPrompt",
"$extend": "PermissionPrivileged",
"choices": [{
"type": "string",
"enum": [

Просмотреть файл

@ -1372,6 +1372,7 @@ class Type extends Entry {
"deprecated",
"preprocess",
"postprocess",
"privileged",
"allowedContexts",
"min_manifest_version",
"max_manifest_version",
@ -3764,6 +3765,7 @@ this.Schemas = {
"OptionalPermission",
"PermissionNoPrompt",
"OptionalPermissionNoPrompt",
"PermissionPrivileged",
]
) {
const ns = this.getNamespace("manifest");

Просмотреть файл

@ -2,7 +2,7 @@
{
"namespace": "manifest",
"types": [{
"$extend": "PermissionNoPrompt",
"$extend": "PermissionPrivileged",
"choices": [{
"type": "string",
"enum": [

Просмотреть файл

@ -17,7 +17,8 @@
"experiment_apis": {
"type": "object",
"additionalProperties": {"$ref": "experiments.ExperimentAPI"},
"optional": true
"optional": true,
"privileged": true
}
}
}

Просмотреть файл

@ -18,7 +18,8 @@
"items": {
"type": "string"
},
"optional": true
"optional": true,
"privileged": true
}
}
}

Просмотреть файл

@ -493,15 +493,26 @@
{ "$ref": "MatchPattern" }
]
},
{
"id": "PermissionPrivileged",
"choices": [
{
"type": "string",
"enum": [
"mozillaAddons"
]
}
]
},
{
"id": "PermissionNoPrompt",
"choices": [
{ "$ref": "OptionalPermission" },
{ "$ref": "OptionalPermissionNoPrompt" },
{ "$ref": "PermissionPrivileged" },
{
"type": "string",
"enum": [
"alarms",
"mozillaAddons",
"storage",
"unlimitedStorage"
]

Просмотреть файл

@ -3,7 +3,7 @@
"namespace": "manifest",
"types": [
{
"$extend": "PermissionNoPrompt",
"$extend": "PermissionPrivileged",
"choices": [{
"type": "string",
"enum": [

Просмотреть файл

@ -57,7 +57,7 @@
}
}
},{
"$extend": "PermissionNoPrompt",
"$extend": "PermissionPrivileged",
"choices": [{
"type": "string",
"enum": [