From 91932417e35caae653bb733f3d2ca184397c8d88 Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Tue, 28 May 2024 13:28:09 +0200 Subject: [PATCH] Update schema for TIM-1307 --- .../permissionConfig.domain-exception.json | 6 +++ .../permissionConfig.user-exception.json | 6 +-- src/schema/permissionConfig.json | 45 +++++++------------ 3 files changed, 24 insertions(+), 33 deletions(-) create mode 100644 src/schema/examples/permissionConfig.domain-exception.json diff --git a/src/schema/examples/permissionConfig.domain-exception.json b/src/schema/examples/permissionConfig.domain-exception.json new file mode 100644 index 00000000..f267a3a2 --- /dev/null +++ b/src/schema/examples/permissionConfig.domain-exception.json @@ -0,0 +1,6 @@ +{ + "defaultSetting": "block all", + "domainExceptions": { + "hassel.hoff": {} + } +} diff --git a/src/schema/examples/permissionConfig.user-exception.json b/src/schema/examples/permissionConfig.user-exception.json index 4b8a9990..22e44f45 100644 --- a/src/schema/examples/permissionConfig.user-exception.json +++ b/src/schema/examples/permissionConfig.user-exception.json @@ -1,6 +1,6 @@ { "defaultSetting": "block all", - "userException": [{ - "mxid": "@david:hassel.hoff" - }] + "userExceptions": { + "@david:hassel.hoff": {} + } } diff --git a/src/schema/permissionConfig.json b/src/schema/permissionConfig.json index 0c98d4c1..3fdff325 100644 --- a/src/schema/permissionConfig.json +++ b/src/schema/permissionConfig.json @@ -11,38 +11,23 @@ "block all" ] }, - "groupException": { - "type": "array", - "uniqueItems": true, - "items": { - "groupName": { - "description": "The name of the group to be in-/excluded", - "type": "string", - "enum": [ - "myLocalContactList" - ] + "domainExceptions": { + "type": "object", + "description": "The map of servers to in-/exclude. This is a mapping of Matrix server name (https://spec.matrix.org/v1.3/appendices/#server-name) to empty object.", + "patternProperties": { + "^.*$": { + "type": "object", + "description": "An empty object for future enhancement" } - } - }, - "domainException": { - "type": "array", - "uniqueItems": true, - "items": { - "domain": { - "description": "The name of the domain to be in-/excluded", - "type": "string", - "pattern": "^((?!-)[A-Za-z0-9-]{1, 63}(?