From cd923ce03ff46bfaeedfda229bbaa5397df483f5 Mon Sep 17 00:00:00 2001 From: Alex Tourski <146070610+AlexTourski@users.noreply.github.com> Date: Sun, 26 Jul 2026 14:19:05 +0200 Subject: [PATCH 1/2] Add AccessGrant ontology schema --- services/ontology/schemas/accessGrant.json | 267 +++++++++++++++++++++ 1 file changed, 267 insertions(+) create mode 100644 services/ontology/schemas/accessGrant.json diff --git a/services/ontology/schemas/accessGrant.json b/services/ontology/schemas/accessGrant.json new file mode 100644 index 000000000..57cf53568 --- /dev/null +++ b/services/ontology/schemas/accessGrant.json @@ -0,0 +1,267 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "15d24c04-a4f3-4e45-a00e-0123926fbc87", + "title": "AccessGrant", + "type": "object", + "properties": { + "isReference": { + "type": "boolean" + }, + "grantId": { + "type": "string", + "minLength": 1 + }, + "grantorEName": { + "type": "string", + "minLength": 1 + }, + "granteeType": { + "type": "string", + "enum": [ + "ename", + "public" + ] + }, + "granteeEName": { + "type": [ + "string", + "null" + ], + "minLength": 1 + }, + "resourceType": { + "type": "string", + "pattern": "^[a-z][a-z0-9-]*$" + }, + "permissions": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^[a-z][a-z0-9-]*:[A-Za-z][A-Za-z0-9]*$" + } + }, + "status": { + "type": "string", + "enum": [ + "active", + "revoked" + ] + }, + "validFrom": { + "type": "string", + "format": "date-time" + }, + "validUntil": { + "type": [ + "string", + "null" + ], + "format": "date-time" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "revision": { + "type": "integer", + "minimum": 1 + }, + "revokedAt": { + "type": [ + "string", + "null" + ], + "format": "date-time" + }, + "delegationAllowed": { + "type": "boolean" + }, + "canonicalEnvelopeId": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "isReference", + "grantId", + "grantorEName", + "granteeType", + "createdAt" + ], + "oneOf": [ + { + "title": "CanonicalAccessGrant", + "properties": { + "isReference": { + "const": false + }, + "delegationAllowed": { + "const": false + } + }, + "required": [ + "isReference", + "grantId", + "grantorEName", + "granteeType", + "granteeEName", + "resourceType", + "permissions", + "status", + "validFrom", + "validUntil", + "createdAt", + "updatedAt", + "revision", + "revokedAt", + "delegationAllowed" + ], + "not": { + "required": [ + "canonicalEnvelopeId" + ] + } + }, + { + "title": "AccessGrantReference", + "properties": { + "isReference": { + "const": true + }, + "granteeType": { + "const": "ename" + } + }, + "required": [ + "isReference", + "grantId", + "grantorEName", + "granteeType", + "granteeEName", + "canonicalEnvelopeId", + "createdAt" + ], + "not": { + "anyOf": [ + { + "required": [ + "resourceType" + ] + }, + { + "required": [ + "permissions" + ] + }, + { + "required": [ + "status" + ] + }, + { + "required": [ + "validFrom" + ] + }, + { + "required": [ + "validUntil" + ] + }, + { + "required": [ + "updatedAt" + ] + }, + { + "required": [ + "revision" + ] + }, + { + "required": [ + "revokedAt" + ] + }, + { + "required": [ + "delegationAllowed" + ] + } + ] + } + } + ], + "allOf": [ + { + "if": { + "properties": { + "granteeType": { + "const": "ename" + } + }, + "required": [ + "granteeType" + ] + }, + "then": { + "properties": { + "granteeEName": { + "type": "string", + "minLength": 1 + } + } + } + }, + { + "if": { + "properties": { + "granteeType": { + "const": "public" + } + }, + "required": [ + "granteeType" + ] + }, + "then": { + "properties": { + "granteeEName": { + "type": "null" + } + } + } + }, + { + "if": { + "properties": { + "isReference": { + "const": false + }, + "status": { + "const": "revoked" + } + }, + "required": [ + "isReference", + "status" + ] + }, + "then": { + "properties": { + "revokedAt": { + "type": "string", + "format": "date-time" + } + } + } + } + ], + "additionalProperties": false +} From 181ced8a4b10a92672a167d6598c6b6c801f3ca2 Mon Sep 17 00:00:00 2001 From: Alex Tourski <146070610+AlexTourski@users.noreply.github.com> Date: Sun, 26 Jul 2026 14:19:11 +0200 Subject: [PATCH 2/2] Add CalendarAvailability ontology schema --- .../schemas/calendarAvailability.json | 174 ++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 services/ontology/schemas/calendarAvailability.json diff --git a/services/ontology/schemas/calendarAvailability.json b/services/ontology/schemas/calendarAvailability.json new file mode 100644 index 000000000..e2fdfbc7e --- /dev/null +++ b/services/ontology/schemas/calendarAvailability.json @@ -0,0 +1,174 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "a92c3675-dbc8-44f6-b24e-520eeadb8864", + "title": "CalendarAvailability", + "type": "object", + "properties": { + "availabilityId": { + "type": "string", + "minLength": 1 + }, + "ownerEName": { + "type": "string", + "minLength": 1 + }, + "startDate": { + "type": "string", + "format": "date-time" + }, + "endDate": { + "type": "string", + "format": "date-time" + }, + "timeZone": { + "type": "string", + "minLength": 1 + }, + "label": { + "type": [ + "string", + "null" + ], + "maxLength": 200 + }, + "bookingPolicy": { + "type": "string", + "enum": [ + "open", + "emailVerified", + "eNameRequired" + ] + }, + "verificationHoldMinutes": { + "type": [ + "integer", + "null" + ], + "minimum": 1, + "maximum": 1440 + }, + "maxBookingsPerEmailPerDay": { + "type": [ + "integer", + "null" + ], + "minimum": 1 + }, + "maxBookingsPerRequesterPerDay": { + "type": [ + "integer", + "null" + ], + "minimum": 1 + }, + "status": { + "type": "string", + "enum": [ + "active", + "cancelled" + ] + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "revision": { + "type": "integer", + "minimum": 1 + }, + "cancelledAt": { + "type": [ + "string", + "null" + ], + "format": "date-time" + } + }, + "required": [ + "availabilityId", + "ownerEName", + "startDate", + "endDate", + "timeZone", + "label", + "bookingPolicy", + "verificationHoldMinutes", + "maxBookingsPerEmailPerDay", + "maxBookingsPerRequesterPerDay", + "status", + "createdAt", + "updatedAt", + "revision", + "cancelledAt" + ], + "allOf": [ + { + "if": { + "properties": { + "bookingPolicy": { + "const": "emailVerified" + } + }, + "required": [ + "bookingPolicy" + ] + }, + "then": { + "properties": { + "verificationHoldMinutes": { + "type": "integer", + "minimum": 1, + "maximum": 1440 + } + } + } + }, + { + "if": { + "properties": { + "bookingPolicy": { + "enum": [ + "open", + "eNameRequired" + ] + } + }, + "required": [ + "bookingPolicy" + ] + }, + "then": { + "properties": { + "verificationHoldMinutes": { + "type": "null" + } + } + } + }, + { + "if": { + "properties": { + "status": { + "const": "cancelled" + } + }, + "required": [ + "status" + ] + }, + "then": { + "properties": { + "cancelledAt": { + "type": "string", + "format": "date-time" + } + } + } + } + ], + "additionalProperties": false +}