diff --git a/spec/callbacks/new-events.yaml b/spec/callbacks/new-events.yaml new file mode 100644 index 0000000000000000000000000000000000000000..30d75adffa57d52a7f732969ce837015e77941cc --- /dev/null +++ b/spec/callbacks/new-events.yaml @@ -0,0 +1,14 @@ +'https://example.org/callback': + post: + summary: Callback für neue Events im Event Log + description: > + Bei neuen Events im Event Log wird ein Zustellpunkt mit Hilfe dieses Callbacks benachrichtigt. Voraussetzung ist die vorherige Konfiguration der [Callback-URL](https://docs.fitko.de/fit-connect/getting-started/receiving/query#callback). + requestBody: + required: true + content: + application/json: + schema: + $ref: '../schemas/callback-new-events.yaml' + responses: + '200': + description: OK diff --git a/spec/callbacks/new-submissions.yaml b/spec/callbacks/new-submissions.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a4e5943a6729f90a3db5252f3f05f5439a5453b0 --- /dev/null +++ b/spec/callbacks/new-submissions.yaml @@ -0,0 +1,14 @@ +'https://example.org/callback': + post: + summary: Callback für eine neue Einreichung + description: > + Bei neue eintreffenden Submissions wird ein Zustellpunkt mit Hilfe dieses Callbacks benachrichtigt. Voraussetzung ist die vorherige Konfiguration der [Callback-URL](https://docs.fitko.de/fit-connect/getting-started/receiving/query#callback). + requestBody: + required: true + content: + application/json: + schema: + $ref: '../schemas/callback-new-submissions.yaml' + responses: + '200': + description: OK diff --git a/spec/endpoints/destinations/index.yaml b/spec/endpoints/destinations/index.yaml index c6ac99598e4bd0ed428f493a162503b704cdc3da..0c5a270a6a28590d32796a260c00fa3d8a0ced0a 100644 --- a/spec/endpoints/destinations/index.yaml +++ b/spec/endpoints/destinations/index.yaml @@ -54,6 +54,9 @@ post: examples: Beispiel: $ref: '../../examples/create-destination.yaml' + callbacks: + NewSubmissions: + $ref: '../../callbacks/new-submissions.yaml' responses: '201': description: Created @@ -85,20 +88,3 @@ post: application/problem+json: schema: $ref: ../../schemas/error.yaml - callbacks: - SubmissionSubmitted: - '{$request.body#/callback}': - post: - summary: Callback für eine neue Einreichung - description: > - Wenn in einem Zustellpunkt ein Callback hinterlegt ist und für diesen Zustellpunkt eine neue Einreichung bereit - steht, dann wird er über den [hinterlegten Callback](https://docs.fitko.de/fit-connect/getting-started/receiving/query#callback) benachrichtigt. - requestBody: - required: true - content: - application/json: - schema: - $ref: '../../schemas/list-of-submission-ids.yaml' - responses: - '202': - description: Accepted diff --git a/spec/endpoints/destinations/uuid.yaml b/spec/endpoints/destinations/uuid.yaml index 3c4340a5e2fc152be56df6eba7712e0ff7e4c5d0..f3404a7296e3658bfc58123ad06608d7bc39b9e1 100644 --- a/spec/endpoints/destinations/uuid.yaml +++ b/spec/endpoints/destinations/uuid.yaml @@ -65,6 +65,9 @@ put: examples: Beispiel: $ref: '../../examples/update-destination.yaml' + callbacks: + NewSubmissions: + $ref: '../../callbacks/new-submissions.yaml' responses: '200': description: OK @@ -123,6 +126,9 @@ patch: examples: Beispiel: $ref: '../../examples/patch-destination.yaml' + callbacks: + NewSubmissions: + $ref: '../../callbacks/new-submissions.yaml' responses: '200': description: OK diff --git a/spec/endpoints/submissions/index.yaml b/spec/endpoints/submissions/index.yaml index a75097f0ff53aaa0bbf1b68a83bc68b23d6c0372..c7500275886e0e5248654930f4ad22366cba0dbd 100644 --- a/spec/endpoints/submissions/index.yaml +++ b/spec/endpoints/submissions/index.yaml @@ -53,6 +53,9 @@ post: examples: Beispiel: $ref: '../../examples/create-submission.yaml' + callbacks: + NewEvents: + $ref: '../../callbacks/new-events.yaml' responses: '201': description: Created diff --git a/spec/endpoints/submissions/uuid.yaml b/spec/endpoints/submissions/uuid.yaml index f31de2d280ba942780b59771f3d3cbb64c48c42e..6b1233ef0883f20380a8b3befe41bb8e4e9a5f9a 100644 --- a/spec/endpoints/submissions/uuid.yaml +++ b/spec/endpoints/submissions/uuid.yaml @@ -66,6 +66,9 @@ put: application/json: schema: $ref: '../../schemas/submit-submission.yaml' + callbacks: + NewEvents: + $ref: '../../callbacks/new-events.yaml' responses: '202': description: Accepted diff --git a/spec/examples/create-destination.yaml b/spec/examples/create-destination.yaml index 26236bd8a0ac506854da246ae6267672dc69dff2..766784b023b6f6fc876c4c9d64b0d05738545be8 100644 --- a/spec/examples/create-destination.yaml +++ b/spec/examples/create-destination.yaml @@ -13,7 +13,9 @@ value: regions: - "DE094750156156" - "DE09330411" - callback: 'https://127.0.0.1:4010/voluptas' + callback: + url: 'https://fachverfahren.beispielstadt.example.org/callbacks/fit-connect' + secret: insecure_unsafe_qHScgrg_kP-R31jHUwp3GkVkGJolvBchz65b74Lzue0 encryptionKid: c66e4423-e28d-4a1f-911d-818f9ab60221 encryptionPublicKey: $ref: './jwk-wrapKey.yaml' diff --git a/spec/examples/create-submission.yaml b/spec/examples/create-submission.yaml index 0e30b8a11995dc7eb3606ac534ba91237dcdae40..3b82dd1fbc2aaecbc427e549de09f8af710b8489 100644 --- a/spec/examples/create-submission.yaml +++ b/spec/examples/create-submission.yaml @@ -6,3 +6,6 @@ value: serviceType: name: Bauantrag identifier: "urn:de:fim:leika:leistung:99010003001006" + callback: + url: 'https://my-onlineservice.example.org/callbacks/fit-connect' + secret: insecure_unsafe_qHScgrg_kP-R31jHUwp3GkVkGJolvBchz65b74Lzue0 diff --git a/spec/examples/destination-any.yaml b/spec/examples/destination-any.yaml index 851e230000d16603cdceb875dcd58e7634d0696a..8436fc7943247cefebececb938f24354b3514626 100644 --- a/spec/examples/destination-any.yaml +++ b/spec/examples/destination-any.yaml @@ -15,4 +15,5 @@ value: phone: "+49170123456789" email: max@mustermann.not unit: Department XYZ - callback: 'https://127.0.0.1:4010/voluptas' + callback: + url: 'https://fachverfahren.beispielstadt.example.org/callbacks/fit-connect' diff --git a/spec/examples/destination-list.yaml b/spec/examples/destination-list.yaml index 3171c1f8a69e3f9931b59daa0961803817c10152..516f5feab717966c7908650712a1a8236352fff4 100644 --- a/spec/examples/destination-list.yaml +++ b/spec/examples/destination-list.yaml @@ -22,7 +22,8 @@ value: phone: "+49170123456789" email: max@mustermann.not unit: Department XYZ - callback: 'https://127.0.0.1:4010/voluptas' + callback: + url: 'https://fachverfahren.beispielstadt.example.org/callbacks/fit-connect' - destinationId: 2f59b8c6-3206-4734-aa21-a7b2a4d92f7a services: - identifier: "urn:de:fim:leika:leistung:99010003001006" @@ -38,4 +39,5 @@ value: phone: "+49170123456789" email: max@mustermann.not unit: Department XYZ - callback: 'https://127.0.0.1:4010/voluptas' + callback: + url: 'https://fachverfahren.beispielstadt.example.org/callbacks/fit-connect' diff --git a/spec/examples/destination-private.yaml b/spec/examples/destination-private.yaml index 851e230000d16603cdceb875dcd58e7634d0696a..8436fc7943247cefebececb938f24354b3514626 100644 --- a/spec/examples/destination-private.yaml +++ b/spec/examples/destination-private.yaml @@ -15,4 +15,5 @@ value: phone: "+49170123456789" email: max@mustermann.not unit: Department XYZ - callback: 'https://127.0.0.1:4010/voluptas' + callback: + url: 'https://fachverfahren.beispielstadt.example.org/callbacks/fit-connect' diff --git a/spec/examples/submission.yaml b/spec/examples/submission.yaml index 7418a81377a973ec48345beab740e259b3681ba4..7309f6073965ec9e1d71320358d45fed115fb0b5 100644 --- a/spec/examples/submission.yaml +++ b/spec/examples/submission.yaml @@ -10,3 +10,5 @@ value: serviceType: name: Bauantrag identifier: "urn:de:fim:leika:leistung:99010003001006" + callback: + url: 'https://my-onlineservice.example.org/callbacks/fit-connect' diff --git a/spec/examples/update-destination.yaml b/spec/examples/update-destination.yaml index bc93ee67aeaadfdddaad8e7d8905f835837f7fd1..07bc2a4504f17572e561868dd6c1171bb3024466 100644 --- a/spec/examples/update-destination.yaml +++ b/spec/examples/update-destination.yaml @@ -13,5 +13,7 @@ value: regions: - "DE094750156156" - "DE09330411" - callback: 'https://127.0.0.1:4010/voluptas' + callback: + url: 'https://fachverfahren.beispielstadt.example.org/callbacks/fit-connect' + secret: insecure_unsafe_qHScgrg_kP-R31jHUwp3GkVkGJolvBchz65b74Lzue0 encryptionKid: c66e4423-e28d-4a1f-911d-818f9ab60221 diff --git a/spec/schemas/callback-new-events.yaml b/spec/schemas/callback-new-events.yaml new file mode 100644 index 0000000000000000000000000000000000000000..76ed7f33aacb4a6030c8d21c09f0e0c17248ec44 --- /dev/null +++ b/spec/schemas/callback-new-events.yaml @@ -0,0 +1,20 @@ +title: Callback +description: Callback, der über neue Events im Event Log informiert. +type: object +properties: + type: + title: Art des Callbacks + description: Es liegen neue Events im Event Log vor + type: string + enum: + - https://schema.fitko.de/fit-connect/callbacks/new-events + submissionIds: + title: Liste der zugehörigen `submissionId`s + description: Liste der `submissionId`s, für die neue Events im Event Log bereitstehen. + type: array + minItems: 1 + items: + type: string + format: uuid + minLength: 32 + maxLength: 36 diff --git a/spec/schemas/callback-new-submissions.yaml b/spec/schemas/callback-new-submissions.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9903328ad0bcef515fda2f3b0192de37f49e9fac --- /dev/null +++ b/spec/schemas/callback-new-submissions.yaml @@ -0,0 +1,20 @@ +title: Callback +description: Callback, der über abholbereite Einreichungen informiert. +type: object +properties: + type: + title: Art des Callbacks + description: Es liegen neue Einreichungen vor + type: string + enum: + - https://schema.fitko.de/fit-connect/callbacks/new-submissions + submissionIds: + title: Liste abholbereiter Einreichungen + description: 'Liste von `submissionId`s aller Einreichungen, die zur Abholung bereitstehen' + type: array + minItems: 1 + items: + type: string + format: uuid + minLength: 32 + maxLength: 36 diff --git a/spec/schemas/callback-url.yaml b/spec/schemas/callback-url.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cdea7e8fa9e9e9a1a0766d72728145748e4b647d --- /dev/null +++ b/spec/schemas/callback-url.yaml @@ -0,0 +1,12 @@ +title: Konfiguration des eingerichteten Callbacks +type: object +required: + - url +properties: + url: + title: Callback-URL + description: 'Öffentlich erreichbare Callbackadresse, um Benachrichtigungen durch den Zustelldienst zu empfangen. Muss eine valide HTTPS-URL sein.' + type: string + minLength: 9 + format: uri + pattern: '^https://.+' diff --git a/spec/schemas/create-callback.yaml b/spec/schemas/create-callback.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d989c794ab32a5e618978411b29cf32bbc7a400a --- /dev/null +++ b/spec/schemas/create-callback.yaml @@ -0,0 +1,19 @@ +title: Objekt zur Konfiguration von Callbacks +type: object +required: + - url + - secret +properties: + url: + title: Callback-URL + description: 'Öffentlich erreichbare Callbackadresse, um Benachrichtigungen durch den Zustelldienst zu empfangen. Muss eine valide HTTPS-URL sein.' + type: string + minLength: 9 + format: uri + pattern: '^https://.+' + secret: + title: Callback-Secret + description: Callback-Secret zur Erzeugung des zur Absicherung eines Callback verwendeten HMACs. Das Callback-Secret kann über die API nur geschrieben, aber nicht abgerufen werden. + type: string + minLength: 32 + maxLength: 512 diff --git a/spec/schemas/create-destination.yaml b/spec/schemas/create-destination.yaml index 1d579457646674a7aa35dcfe760894995e9f8276..6cbafb4cc7f59be0b372a38359f6d7d934f11813 100644 --- a/spec/schemas/create-destination.yaml +++ b/spec/schemas/create-destination.yaml @@ -4,7 +4,6 @@ type: object required: - contactInformation - services - - callback - encryptionKid - encryptionPublicKey - signingPublicKey @@ -20,11 +19,7 @@ properties: items: $ref: './destination-service.yaml' callback: - type: string - minLength: 9 - format: uri - pattern: '^https://.+' - description: 'Öffentlich erreichbare Callbackadresse, um Benachrichtigungen beim Vorliegen neuer Einreichungen zu empfangen. Muss eine valide HTTPS URL sein.' + $ref: './create-callback.yaml' encryptionKid: type: string maxLength: 64 diff --git a/spec/schemas/create-submission.yaml b/spec/schemas/create-submission.yaml index 764f92e55d2cf2c5b9415322c09b578fe8412beb..99031e12873509137134aa256dca653133007150 100644 --- a/spec/schemas/create-submission.yaml +++ b/spec/schemas/create-submission.yaml @@ -29,3 +29,5 @@ properties: description: Optionale Vorgangsreferenz. Wird keine Vorgangsreferenz angegeben, wird ein neuer Vorgang eröffnet. Wird eine bestehende Vorgangsreferenz angegeben, so wird innerhalb eines bestehenden Vorgangs eine neue Einreichung erstellt (Reply). serviceType: $ref: './service-type.yaml' + callback: + $ref: './create-callback.yaml' diff --git a/spec/schemas/destination-private-parts.yaml b/spec/schemas/destination-private-parts.yaml index 04a55fed99f2a4bf789c7e138d0c467a0610ef27..cfa051f35a4c88679b3c2808fb2c2da384398208 100644 --- a/spec/schemas/destination-private-parts.yaml +++ b/spec/schemas/destination-private-parts.yaml @@ -1,13 +1,8 @@ type: object required: - contactInformation - - callback properties: contactInformation: $ref: './contact-information.yaml' callback: - type: string - minLength: 9 - format: uri - pattern: '^https://.+' - description: 'Öffentlich erreichbare Callbackadresse, um Benachrichtigungen beim Vorliegen neuer Einreichungen zu empfangen. Muss eine valide HTTPS URL sein.' + $ref: './callback-url.yaml' diff --git a/spec/schemas/list-of-submission-ids.yaml b/spec/schemas/list-of-submission-ids.yaml deleted file mode 100644 index ff74646aa034f45f176ce542c600ed37337bbc7e..0000000000000000000000000000000000000000 --- a/spec/schemas/list-of-submission-ids.yaml +++ /dev/null @@ -1,9 +0,0 @@ -title: Liste abholbereiter Einreichungen -description: 'Liste von `submissionId`s aller Einreichungen, die für den Zustellpunkt zur Abholung bereitstehen' -type: array -minItems: 1 -items: - type: string - format: uuid - minLength: 32 - maxLength: 36 diff --git a/spec/schemas/patch-destination.yaml b/spec/schemas/patch-destination.yaml index e88cfa7896a2fcd2044c229a329a0973a4994141..75fa00429b256440037dfc9367d84923da18d320 100644 --- a/spec/schemas/patch-destination.yaml +++ b/spec/schemas/patch-destination.yaml @@ -13,11 +13,7 @@ properties: items: $ref: './destination-service.yaml' callback: - type: string - minLength: 9 - format: uri - pattern: '^https://.+' - description: 'Öffentlich erreichbare Callbackadresse, um Benachrichtigungen beim Vorliegen neuer Einreichungen zu empfangen. Muss eine valide HTTPS URL sein.' + $ref: './create-callback.yaml' encryptionKid: type: string maxLength: 64 diff --git a/spec/schemas/submission-reduced.yaml b/spec/schemas/submission-reduced.yaml index 915b1aeb3c96cc131cfcfab085f52ae7ecb145d8..e443e786e81d2624f326c09bd1eb415cc86b10fd 100644 --- a/spec/schemas/submission-reduced.yaml +++ b/spec/schemas/submission-reduced.yaml @@ -36,3 +36,5 @@ properties: maxLength: 36 serviceType: $ref: './service-type.yaml' + callback: + $ref: './callback-url.yaml' diff --git a/spec/schemas/update-destination.yaml b/spec/schemas/update-destination.yaml index 8a4950108b4381b4ea0431e671144eb4b2089321..99b244ccbf61b7821b33ff47fdab887d3f2f55b0 100644 --- a/spec/schemas/update-destination.yaml +++ b/spec/schemas/update-destination.yaml @@ -4,7 +4,6 @@ type: object required: - contactInformation - services - - callback - encryptionKid properties: contactInformation: @@ -18,11 +17,7 @@ properties: items: $ref: './destination-service.yaml' callback: - type: string - minLength: 9 - format: uri - pattern: '^https://.+' - description: 'Öffentlich erreichbare Callbackadresse, um Benachrichtigungen beim Vorliegen neuer Einreichungen zu empfangen. Muss eine valide HTTPS URL sein.' + $ref: './create-callback.yaml' encryptionKid: type: string maxLength: 64 diff --git a/spec/submission-api.yaml b/spec/submission-api.yaml index 726f0a09045c7150af7b07bd2ac0ae7d113bcd63..c8f0e6924e719ec5f28c9dc5a1c0b5ad0a5e769f 100644 --- a/spec/submission-api.yaml +++ b/spec/submission-api.yaml @@ -113,8 +113,10 @@ components: $ref: './schemas/jwk.yaml' JWKS: $ref: './schemas/jwks.yaml' - ListOfSubmissionIds: - $ref: './schemas/list-of-submission-ids.yaml' + CallbackNewSubmissions: + $ref: './schemas/callback-new-submissions.yaml' + CallbackNewEvents: + $ref: './schemas/callback-new-events.yaml' PatchDestination: $ref: './schemas/patch-destination.yaml' ServiceRegion: @@ -135,6 +137,8 @@ components: $ref: './schemas/security-event-token.yaml' EventLog: $ref: './schemas/event-log.yaml' + Callback: + $ref: './schemas/callback-url.yaml' examples: Submission: @@ -163,3 +167,9 @@ components: $ref: './examples/jwk.yaml' JWKSVerify: $ref: './examples/jwks-verify.yaml' + + callbacks: + NewEvents: + $ref: './callbacks/new-events.yaml' + NewSubmissions: + $ref: './callbacks/new-submissions.yaml'