From 60b38453de42f1a7f302d680fc7ec43fd2ad8763 Mon Sep 17 00:00:00 2001 From: Andreas Huber <anh@fjd.de> Date: Wed, 5 Jan 2022 15:00:11 +0100 Subject: [PATCH] Schema dokumentiert --- .gitlab-ci.yml | 4 ++-- examples/accept-submission_1.json | 2 +- examples/accept-submission_2.json | 2 +- examples/create-submission_1.json | 2 +- examples/delete-submission_1.json | 2 +- examples/forward-submission_1.json | 2 +- examples/forward-submission_2.json | 2 +- examples/notify-submission_1.json | 2 +- examples/notify-submission_1a.json | 17 ----------------- examples/notify-submission_2.json | 2 +- examples/reject-submission_1.json | 2 +- examples/reject-submission_2.json | 2 +- examples/submit-submission_1.json | 2 +- spec/problems.schema.json | 4 ++++ spec/set-payload.schema.json | 18 +++++++++++++++++- 15 files changed, 34 insertions(+), 31 deletions(-) delete mode 100644 examples/notify-submission_1a.json diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ae87a79..46ccaf6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,7 +51,7 @@ upload:latest: before_script: - *pre-deploy-uber-space-setup script: - - sed -i "s,API_VERSION,latest,g" dist/set-payload.schema.json + - sed -i "s,SCHEMA_VERSION,latest,g" dist/set-payload.schema.json - rsync -Lvz -e "ssh -o CheckHostIP=no" ./dist/set-payload.schema.json fitko@dorado.uberspace.de:schema.fitko.de/fit-connect/set-payload/latest/ upload:release: @@ -62,5 +62,5 @@ upload:release: before_script: - *pre-deploy-uber-space-setup script: - - sed -i "s,API_VERSION,$CI_COMMIT_TAG,g" dist/set-payload.schema.json + - sed -i "s,SCHEMA_VERSION,$CI_COMMIT_TAG,g" dist/set-payload.schema.json - rsync -Lvz -e "ssh -o CheckHostIP=no" ./dist/set-payload.schema.json fitko@dorado.uberspace.de:schema.fitko.de/fit-connect/set-payload/$CI_COMMIT_TAG/ diff --git a/examples/accept-submission_1.json b/examples/accept-submission_1.json index d02d8f7..4166ba6 100644 --- a/examples/accept-submission_1.json +++ b/examples/accept-submission_1.json @@ -1,5 +1,5 @@ { - "$schema": "https://schema.fitko.de/fit-connect/set-payload/1.0.0/set-payload.schema.json", + "$schema": "https://schema.fitko.de/fit-connect/set-payload/SCHEMA_VERSION/set-payload.schema.json", "jti": "6872b19f-5ee2-47d7-a0e9-ebfe87ab2563", "iss": "40847c29-06aa-40e2-bf28-c29884c694c4", "iat": 1622796532, diff --git a/examples/accept-submission_2.json b/examples/accept-submission_2.json index a832ef7..0f27da2 100644 --- a/examples/accept-submission_2.json +++ b/examples/accept-submission_2.json @@ -1,5 +1,5 @@ { - "$schema": "https://schema.fitko.de/fit-connect/set-payload/1.0.0/set-payload.schema.json", + "$schema": "https://schema.fitko.de/fit-connect/set-payload/SCHEMA_VERSION/set-payload.schema.json", "jti": "8538165b-9ce3-4097-871d-5b9581a3b4d9", "iss": "40847c29-06aa-40e2-bf28-c29884c694c4", "iat": 1622796532, diff --git a/examples/create-submission_1.json b/examples/create-submission_1.json index b3931eb..7852528 100644 --- a/examples/create-submission_1.json +++ b/examples/create-submission_1.json @@ -1,5 +1,5 @@ { - "$schema": "https://schema.fitko.de/fit-connect/set-payload/1.0.0/set-payload.schema.json", + "$schema": "https://schema.fitko.de/fit-connect/set-payload/SCHEMA_VERSION/set-payload.schema.json", "jti": "ada1b5b4-1bd2-4fab-b236-c30ef88e8c72", "iss": "https://submission-api-dev.fit-connect.fitko.dev", "iat": 1622796532, diff --git a/examples/delete-submission_1.json b/examples/delete-submission_1.json index d43dbef..3f4d484 100644 --- a/examples/delete-submission_1.json +++ b/examples/delete-submission_1.json @@ -1,5 +1,5 @@ { - "$schema": "https://schema.fitko.de/fit-connect/set-payload/1.0.0/set-payload.schema.json", + "$schema": "https://schema.fitko.de/fit-connect/set-payload/SCHEMA_VERSION/set-payload.schema.json", "jti": "29d091aa-86ab-4806-beb5-fb462d18e2a1", "iss": "https://submission-api-dev.fit-connect.fitko.dev", "iat": 1622796532, diff --git a/examples/forward-submission_1.json b/examples/forward-submission_1.json index ddc58de..6e99b0d 100644 --- a/examples/forward-submission_1.json +++ b/examples/forward-submission_1.json @@ -1,5 +1,5 @@ { - "$schema": "https://schema.fitko.de/fit-connect/set-payload/1.0.0/set-payload.schema.json", + "$schema": "https://schema.fitko.de/fit-connect/set-payload/SCHEMA_VERSION/set-payload.schema.json", "jti": "c0cda2aa-bf79-4427-86f3-9f973bad2ecd", "iss": "40847c29-06aa-40e2-bf28-c29884c694c4", "iat": 1622796532, diff --git a/examples/forward-submission_2.json b/examples/forward-submission_2.json index fa98873..10bc143 100644 --- a/examples/forward-submission_2.json +++ b/examples/forward-submission_2.json @@ -1,5 +1,5 @@ { - "$schema": "https://schema.fitko.de/fit-connect/set-payload/1.0.0/set-payload.schema.json", + "$schema": "https://schema.fitko.de/fit-connect/set-payload/SCHEMA_VERSION/set-payload.schema.json", "jti": "dbf891c3-1e98-422a-b55a-d628133e5874", "iss": "40847c29-06aa-40e2-bf28-c29884c694c4", "iat": 1622796532, diff --git a/examples/notify-submission_1.json b/examples/notify-submission_1.json index a820b2a..df4fe0b 100644 --- a/examples/notify-submission_1.json +++ b/examples/notify-submission_1.json @@ -1,5 +1,5 @@ { - "$schema": "https://schema.fitko.de/fit-connect/set-payload/1.0.0/set-payload.schema.json", + "$schema": "https://schema.fitko.de/fit-connect/set-payload/SCHEMA_VERSION/set-payload.schema.json", "jti": "116c3c03-5f31-4d4c-9e65-d36e1e3895f7", "iss": "https://submission-api-dev.fit-connect.fitko.dev", "iat": 1622796532, diff --git a/examples/notify-submission_1a.json b/examples/notify-submission_1a.json deleted file mode 100644 index 53fc94d..0000000 --- a/examples/notify-submission_1a.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "https://schema.fitko.de/fit-connect/set-payload/1.0.0/set-payload.schema.json", - "jti": "b98af532-1f84-436e-8689-0596e91c7c66", - "iss": "https://submission-api-dev.fit-connect.fitko.dev", - "iat": 1622796532, - "sub": "submission:02bf1d9f-282d-4abf-810a-c4104baf0afe", - "txn": "case:452b5ee6-35df-441a-bd39-6141723cf914", - "events": { - "https://schema.fitko.de/fit-connect/events/notify-submission": { - "notifyType": "callback", - "callback": { - "url": "https://www.example.com/callback", - "status": 200 - } - } - } -} diff --git a/examples/notify-submission_2.json b/examples/notify-submission_2.json index a0891b4..cf58928 100644 --- a/examples/notify-submission_2.json +++ b/examples/notify-submission_2.json @@ -1,5 +1,5 @@ { - "$schema": "https://schema.fitko.de/fit-connect/set-payload/1.0.0/set-payload.schema.json", + "$schema": "https://schema.fitko.de/fit-connect/set-payload/SCHEMA_VERSION/set-payload.schema.json", "jti": "6127ff87-2786-4d0f-90fe-c531672f5de1", "iss": "https://submission-api-dev.fit-connect.fitko.dev", "iat": 1622796532, diff --git a/examples/reject-submission_1.json b/examples/reject-submission_1.json index e0f943f..4eb0b17 100644 --- a/examples/reject-submission_1.json +++ b/examples/reject-submission_1.json @@ -1,5 +1,5 @@ { - "$schema": "https://schema.fitko.de/fit-connect/set-payload/1.0.0/set-payload.schema.json", + "$schema": "https://schema.fitko.de/fit-connect/set-payload/SCHEMA_VERSION/set-payload.schema.json", "jti": "4ac47caa-bce1-435a-b04f-3322b224b32e", "iss": "40847c29-06aa-40e2-bf28-c29884c694c4", "iat": 1622796532, diff --git a/examples/reject-submission_2.json b/examples/reject-submission_2.json index 880c07d..7cb1f6a 100644 --- a/examples/reject-submission_2.json +++ b/examples/reject-submission_2.json @@ -1,5 +1,5 @@ { - "$schema": "https://schema.fitko.de/fit-connect/set-payload/1.0.0/set-payload.schema.json", + "$schema": "https://schema.fitko.de/fit-connect/set-payload/SCHEMA_VERSION/set-payload.schema.json", "jti": "959a274c-419f-4e87-a784-006dc404c415", "iss": "40847c29-06aa-40e2-bf28-c29884c694c4", "iat": 1622796532, diff --git a/examples/submit-submission_1.json b/examples/submit-submission_1.json index 8e99fba..922d703 100644 --- a/examples/submit-submission_1.json +++ b/examples/submit-submission_1.json @@ -1,5 +1,5 @@ { - "$schema": "https://schema.fitko.de/fit-connect/set-payload/1.0.0/set-payload.schema.json", + "$schema": "https://schema.fitko.de/fit-connect/set-payload/SCHEMA_VERSION/set-payload.schema.json", "jti": "25d2eb77-458d-4c9d-991c-6428c4651646", "iss": "https://submission-api-dev.fit-connect.fitko.dev", "iat": 1622796532, diff --git a/spec/problems.schema.json b/spec/problems.schema.json index aef0492..bbf887a 100644 --- a/spec/problems.schema.json +++ b/spec/problems.schema.json @@ -6,16 +6,20 @@ "type": "object", "properties": { "type": { + "description": "Fehlercode in Form einer URI.", "type": "string", "pattern": "^https:\\/\\/schema\\.fitko\\.de\\/fit-connect\\/events\\/problems\\/[-a-z]+$" }, "title": { + "description": "Für Menschen verständliche Fehlermeldung", "type": "string" }, "detail": { + "description": "Details zum Fehler, z.B. eine technische Fehlermeldung (optional)", "type": "string" }, "instance": { + "description": "Betroffener Teil der Übertragung. Mögliche Werte: `submission`, `metadata`, `data`, `attachment:` + UUID des Attachments oder `other`", "type": "string", "pattern": "^(submission|metadata|data|attachment:.+|other)$" } diff --git a/spec/set-payload.schema.json b/spec/set-payload.schema.json index cb75054..e87f23c 100644 --- a/spec/set-payload.schema.json +++ b/spec/set-payload.schema.json @@ -1,38 +1,49 @@ { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://schema.fitko.de/fit-connect/set-payload/SCHEMA_VERSION/set-payload.schema.json", "title": "Security Event Token (SET)", "description": "Security Event Token (SET) nach RFC 8417", "type": "object", "properties": { "$schema": { + "description": "URI des Schemas, dem dieser Security Event Token entspricht.", "type": "string", - "enum": [ "https://schema.fitko.de/fit-connect/set-payload/1.0.0/set-payload.schema.json" ] + "enum": [ "https://schema.fitko.de/fit-connect/set-payload/SCHEMA_VERSION/set-payload.schema.json" ] }, "jti": { + "description": "Die JWT ID (jti) ist eine eindeutige UUID für das SET.", "type": "string", "format": "uuid" }, "iss": { + "description": "Als Issuer ('iss') wird die UUID der Destination eingetragen. Bei vom Zustelldienst ausgestellten SETs steht dort die Basis-URL des Zustelldienstes.", "type": "string" }, "iat": { + "description": "The 'iat' (issued at) claim identifies the time at which the JWT was issued.", "type": "integer", "minimum": 1577833200 }, "sub": { + "description": "Das Subject ('sub') enthält 'submission:' und die UUID der Submission.", "type": "string", "pattern": "^submission:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$" }, "txn": { + "description": "Der Transaction Identifier ('txn') enthält 'case:' und die UUID des Cases.", "type": "string", "pattern": "^case:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$" }, "events": { + "description": "Enthält genau eines der spezifizierten Events als Unterobjekt.", "type": "object", "properties": { "https://schema.fitko.de/fit-connect/events/create-submission": { + "description": "Mit diesem Event dokumentiert der Zustelldienst, dass eine Einreichung angelegt wurde.", "type": "object" }, "https://schema.fitko.de/fit-connect/events/submit-submission": { + "description": "Mit diesem Event dokumentiert der Zustelldienst, dass die Einreichung abgesendet wurde.", "type": "object", "properties": { "authenticationTags": { @@ -44,6 +55,7 @@ ] }, "https://schema.fitko.de/fit-connect/events/notify-submission": { + "description": "Mit diesem Event dokumentiert der Zustelldienst, dass das empfangende System Kenntnis von der Einreichung erlangt hat. Wie dies erfolgt ist, wird mit dem Eintrag `notifyType` dokumentiert.", "type": "object", "properties": { "notifyType": { @@ -59,9 +71,11 @@ ] }, "https://schema.fitko.de/fit-connect/events/forward-submission": { + "description": "Mit diesem Event dokumentiert ein nachgelagertes System, dass es die Einreichung zur Weiterleitung übernommen hat.", "type": "object" }, "https://schema.fitko.de/fit-connect/events/reject-submission": { + "description": "Mit diesem Event dokumentiert das empfangende System, dass die Einreichung zurückgewiesen wird.", "type": "object", "properties": { "problems": { @@ -73,6 +87,7 @@ ] }, "https://schema.fitko.de/fit-connect/events/accept-submission": { + "description": "Mit diesem Event dokumentiert das empfangende System, dass die Einreichung akzeptiert wurde.", "type": "object", "properties": { "problems": { @@ -87,6 +102,7 @@ ] }, "https://schema.fitko.de/fit-connect/events/delete-submission": { + "description": "Mit diesem Event dokumentiert der Zustelldienst, dass die Einreichung gelöscht wurde.", "type": "object" } }, -- GitLab